/* ==========================================================================
   页面布局：开始页 / 牌桌 / 结算页
   ========================================================================== */

/* 开始页 ------------------------------------------------------------------ */

.setup {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(28px, 6vw, 72px) clamp(16px, 4vw, 40px);
}

.setup__frame {
  position: relative;
  width: min(760px, 100%);
  padding: clamp(28px, 4.5vw, 56px);
  border: 1px solid var(--gold-line);
  background: linear-gradient(180deg, rgba(13, 24, 48, 0.78), rgba(6, 11, 24, 0.92));
  box-shadow: var(--shadow-panel);
  backdrop-filter: blur(8px);
  animation: rise 0.6s var(--ease) both;
}

.setup__frame::before {
  content: "";
  position: absolute;
  inset: 9px;
  border: 1px solid rgba(201, 162, 74, 0.18);
  pointer-events: none;
}

.setup__kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.42em;
  color: var(--gold);
  text-align: center;
  text-transform: uppercase;
}

.setup__dice {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 26px 0 18px;
}

.setup__title {
  text-align: center;
  font-size: clamp(44px, 9vw, 84px);
  letter-spacing: 0.14em;
  text-indent: 0.14em;
  color: #f6ecd8;
  text-shadow: 0 0 34px rgba(201, 162, 74, 0.3);
}

.setup__en {
  margin-top: 6px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.62em;
  color: var(--muted);
  text-transform: uppercase;
}

.setup__tagline {
  margin: 18px auto 0;
  max-width: 30em;
  text-align: center;
  color: var(--cream-dim);
  font-family: var(--font-serif);
  font-size: 15px;
  letter-spacing: 0.08em;
}

.setup__panel {
  margin-top: 34px;
  padding-top: 26px;
  border-top: 1px solid rgba(201, 162, 74, 0.22);
  display: grid;
  gap: 20px;
}

.setup__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.setup__label {
  font-size: 13px;
  letter-spacing: 0.12em;
  color: var(--cream-dim);
}

.setup__names {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 14px;
}

.setup__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.setup__note {
  font-size: 12px;
  color: var(--muted-2);
  line-height: 1.65;
}

.setup__links {
  margin-top: 22px;
  display: flex;
  justify-content: center;
  gap: 22px;
  font-size: 12px;
  letter-spacing: 0.06em;
}

/* 牌桌 -------------------------------------------------------------------- */

.board-screen {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px clamp(16px, 2.4vw, 30px);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(9, 16, 33, 0.94), rgba(9, 16, 33, 0.7));
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 30;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-width: 0;
}

.brand__title {
  font-family: var(--font-serif);
  font-size: 20px;
  letter-spacing: 0.16em;
  color: var(--cream);
  white-space: nowrap;
}

.brand__en {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.34em;
  color: var(--muted-2);
  white-space: nowrap;
}

.topbar__stats {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  min-width: 0;
}

.topbar__actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.board {
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr) 296px;
  gap: 14px;
  padding: 14px clamp(12px, 2vw, 26px) 18px;
  min-height: 0;
  align-items: stretch;
}

.seats {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}

.felt {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
}

.feed {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: linear-gradient(180deg, rgba(13, 24, 48, 0.72), rgba(8, 14, 30, 0.82));
  overflow: hidden;
}

.feed__title {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  letter-spacing: 0.2em;
  color: var(--gold);
  font-family: var(--font-sans);
  font-weight: 600;
}

.feed__list {
  flex: 1;
  overflow: auto;
  padding: 6px 0;
}

/* 手牌区 ------------------------------------------------------------------ */

.hand {
  position: sticky;
  bottom: 0;
  z-index: 25;
  padding: 12px clamp(16px, 2.4vw, 30px) 18px;
  border-top: 1px solid var(--line-strong);
  background: linear-gradient(180deg, rgba(8, 14, 28, 0.82), rgba(5, 9, 18, 0.97));
  backdrop-filter: blur(14px);
}

.hand__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.hand__who {
  font-family: var(--font-serif);
  font-size: 14px;
  letter-spacing: 0.08em;
  color: var(--cream);
}

.hand__hint {
  font-size: 12px;
  color: var(--muted);
}

.hand__cards {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  min-height: calc(var(--card-w) * 1.4 + 14px);
  align-items: flex-end;
}

.hand__cards--ai {
  align-items: center;
  justify-content: center;
  padding: 10px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-s);
  background: rgba(9, 16, 32, 0.45);
}

/* 结算页 ------------------------------------------------------------------ */

.result {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(28px, 6vw, 72px) 20px;
}

.result__frame {
  width: min(680px, 100%);
  padding: clamp(26px, 4vw, 48px);
  border: 1px solid var(--gold-line);
  background: linear-gradient(180deg, rgba(13, 24, 48, 0.82), rgba(6, 11, 24, 0.94));
  box-shadow: var(--shadow-panel);
  animation: rise 0.5s var(--ease) both;
}

.result__kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.42em;
  color: var(--gold);
  text-align: center;
}

.result__title {
  margin-top: 12px;
  text-align: center;
  font-size: clamp(32px, 6vw, 48px);
  letter-spacing: 0.16em;
  text-indent: 0.16em;
}

.result__note {
  margin: 14px auto 0;
  max-width: 34em;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.7;
}

.result__actions {
  margin-top: 30px;
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* 响应式 ------------------------------------------------------------------ */

@media (max-width: 1180px) {
  .board-screen {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .board {
    grid-template-columns: 232px minmax(0, 1fr);
  }

  .feed {
    grid-column: 1 / -1;
    max-height: 240px;
  }

  .seats {
    max-height: 60vh;
  }
}

@media (max-width: 860px) {
  .topbar {
    flex-wrap: wrap;
    gap: 10px;
  }

  .topbar__stats {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 2px;
  }

  .board {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .seats {
    flex-direction: row;
    overflow-x: auto;
    max-height: none;
    padding-bottom: 4px;
  }

  .seats > * {
    flex: 0 0 190px;
  }

  .felt {
    justify-content: flex-start;
  }

  .setup__names {
    grid-template-columns: 1fr;
  }

  .hand {
    position: static;
    padding: 10px 12px 14px;
  }

  .card--lg {
    --card-w: 112px;
  }

  .slot {
    width: 112px;
    height: 157px;
  }

  :root {
    --card-w: 78px;
  }
}

@media (max-width: 520px) {
  .brand__en {
    display: none;
  }

  .hand__cards {
    gap: 7px;
  }

  :root {
    --card-w: 66px;
  }
}

@media (max-height: 820px) {
  .felt {
    justify-content: flex-start;
  }

  .table-center {
    max-height: none;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
