/* ── Table grid ────────────────────────────────────── */
.table-area {
  display: grid;
  grid-template-columns: 1fr 280px 1fr;
  grid-template-rows: auto 1fr auto;
  gap: 6px;
  flex: 1;
  min-height: 0;
  max-width: 1500px;
  width: 100%;
  margin: 0 auto;
  padding: 4px 12px 8px;
  align-items: center;
}

/* ── Zones ─────────────────────────────────────────── */
.zone { display: flex; justify-content: center; }

.zone-n {
  grid-column: 1 / -1;
  grid-row: 1;
}
.zone-w {
  grid-column: 1;
  grid-row: 2;
  justify-self: end;
}
.zone-e {
  grid-column: 3;
  grid-row: 2;
  justify-self: start;
}
.zone-s {
  grid-column: 1 / -1;
  grid-row: 3;
}

/* ── Center field ──────────────────────────────────── */
.center-field {
  grid-column: 2;
  grid-row: 2;
  justify-self: center;
  align-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  flex-shrink: 0;
}
.center-field.compass-mode {
  width: 80px;
  height: 80px;
  background: rgba(0,0,0,.22);
  border: 1.5px solid rgba(255,215,0,.15);
  border-radius: 50%;
}
.compass {
  font-size: .6rem;
  font-weight: 700;
  color: rgba(255,215,0,.55);
  text-align: center;
  line-height: 1.8;
  letter-spacing: .08em;
  user-select: none;
}
.compass span { display: block; }

/* ── Trick mode center ─────────────────────────────── */
.center-field.trick-mode {
  width: 260px;
  height: 260px;
  background: rgba(0,0,0,.15);
  border: 1.5px solid rgba(255,215,0,.1);
  border-radius: 12px;
  position: relative;
}
.trick-area {
  width: 100%;
  height: 100%;
  position: relative;
}
.trick-n, .trick-s, .trick-w, .trick-e {
  position: absolute;
  display: flex;
  justify-content: center;
  align-items: center;
}
.trick-n { top: 8px; left: 50%; transform: translateX(-50%); }
.trick-s { bottom: 8px; left: 50%; transform: translateX(-50%); }
.trick-w { left: 12px; top: 50%; transform: translateY(-50%); }
.trick-e { right: 12px; top: 50%; transform: translateY(-50%); }

.trick-placeholder {
  width: 44px;
  height: 62px;
  border: 1.5px dashed rgba(255,255,255,.08);
  border-radius: 5px;
}
.trick-score {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: .55rem;
  font-weight: 700;
  color: rgba(255,215,0,.4);
  white-space: nowrap;
  text-align: center;
  line-height: 1.5;
}
.trick-winner {
  font-size: .78rem;
  font-weight: 700;
  color: #6ff5a9;
  text-align: center;
  margin-top: 4px;
  animation: trickWinPulse .6s ease;
}
@keyframes trickWinPulse {
  0%   { opacity: 0; transform: scale(.8); }
  50%  { opacity: 1; transform: scale(1.15); }
  100% { opacity: 1; transform: scale(1); }
}

/* Trick cards fly-to-winner animation (direction class set by JS) */
.trick-area .card.trick-card {
  transition: transform .45s cubic-bezier(.4,0,.2,1), opacity .45s ease;
}
.trick-area.clearing-to-N .card.trick-card { transform: translate(0, -80px) scale(.45); opacity: 0; }
.trick-area.clearing-to-S .card.trick-card { transform: translate(0, 80px) scale(.45); opacity: 0; }
.trick-area.clearing-to-W .card.trick-card { transform: translate(-80px, 0) scale(.45); opacity: 0; }
.trick-area.clearing-to-E .card.trick-card { transform: translate(80px, 0) scale(.45); opacity: 0; }

/* ── Buttons inside center field ───────────────────── */
.center-btns {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 6px;
  flex-wrap: wrap;
}
.center-btns .btn-action {
  font-size: .68rem;
  padding: 3px 10px;
}

/* ── Responsive ────────────────────────────────────── */
@media (max-width: 1100px) {
  .table-area {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto auto auto;
    gap: 6px;
  }
  .zone-n { grid-column: 1; grid-row: 1; }
  .zone-w { grid-column: 1; grid-row: 2; justify-self: center; }
  .center-field { grid-column: 1; grid-row: 3; justify-self: center; }
  .zone-e { grid-column: 1; grid-row: 4; justify-self: center; }
  .zone-s { grid-column: 1; grid-row: 5; }
}

@media (max-width: 768px) {
  .table-area {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto auto auto;
    gap: 4px;
    padding: 2px 6px 6px;
  }
  .zone { justify-content: center; }
  .zone-n, .zone-s { justify-self: stretch; }
  .zone-w, .zone-e { justify-self: stretch; }
  .zone-n { grid-column: 1; grid-row: 1; }
  .zone-w { grid-column: 1; grid-row: 2; }
  .center-field { grid-column: 1; grid-row: 3; justify-self: center; }
  .zone-e { grid-column: 1; grid-row: 4; }
  .zone-s { grid-column: 1; grid-row: 5; }

  /* Compass */
  .center-field.compass-mode { width: 60px; height: 60px; }
  .compass { font-size: .5rem; }

  /* Trick mode */
  .center-field.trick-mode {
    width: 200px;
    height: 200px;
  }
  .trick-n { top: 4px; }
  .trick-s { bottom: 4px; }
  .trick-w { left: 6px; }
  .trick-e { right: 6px; }
  .trick-score { font-size: .5rem; }
  .trick-winner { font-size: .7rem; }

  .center-btns { gap: 4px; margin-top: 4px; }
  .center-btns .btn-action { font-size: .62rem; padding: 2px 8px; }
}
