:root {
  --bg: #140a22;
  --panel: rgba(22, 10, 36, 0.76);
  --line: rgba(255, 255, 255, 0.12);
  --text: #f8f4ff;
  --muted: #d6c8ee;
  --gold: #ffcf68;
  --gold-deep: #ff9f3c;
  --green: #1dd095;
  --green-deep: #0d715e;
  --pink: #ff6f94;
  --back-blue: #244f97;
  --back-blue-deep: #162d61;
  --back-crimson: #8b264a;
  --back-night: #1a234a;
  --back-gold: #f8d574;
  --shadow: 0 24px 60px rgba(2, 0, 10, 0.45);
  --viewport-w: 100vw;
  --viewport-h: 100vh;
  --landscape-w: 100vh;
  --landscape-h: 100vw;
  --table-lower-offset: 12px;
}

html.native-app {
  --table-lower-offset: 10px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  width: 100%;
  min-height: var(--viewport-h);
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(8, 5, 20, 0.18), rgba(8, 5, 20, 0.5)),
    url("../images/objects/background-only.jpg") center / cover fixed no-repeat,
    #080414;
  overflow-x: hidden;
}

html.native-app,
body.native-app {
  width: 100%;
  height: 100%;
  min-height: 100%;
  max-height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: manipulation;
}

html.force-landscape-ui,
body.force-landscape-ui {
  width: var(--viewport-w);
  height: var(--viewport-h);
  min-height: var(--viewport-h);
  max-height: var(--viewport-h);
  overflow: hidden;
  overscroll-behavior: none;
}

#table-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: none;
  opacity: 0;
  z-index: 0;
}

#app {
  position: relative;
  z-index: 1;
}

body.force-landscape-ui {
  position: fixed;
  inset: 0;
}

body.force-landscape-ui #table-bg,
body.force-landscape-ui #app {
  position: fixed;
  top: 50%;
  left: 50%;
  width: calc(var(--landscape-w) - 1px);
  height: calc(var(--landscape-h) - 1px);
  transform: translate(-50%, -50%) rotate(90deg);
  transform-origin: center center;
}

body.force-landscape-ui #table-bg {
  z-index: 0;
}

body.force-landscape-ui #app {
  z-index: 1;
  overflow: hidden;
}

body.force-landscape-ui .screen {
  width: 100%;
  max-width: none;
  min-height: 100%;
  height: 100%;
}

@media (orientation: landscape) {
  html.native-app .screen {
    min-height: var(--viewport-h);
    height: var(--viewport-h);
    max-height: var(--viewport-h);
    display: grid;
    grid-template-rows: auto minmax(0, 1.45fr) minmax(160px, 0.85fr) auto;
    overflow: hidden;
  }

  html.native-app .topbar {
    gap: 6px;
    padding: 6px 10px;
  }

  html.native-app .brand-title {
    max-width: 30vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 1rem;
  }

  html.native-app .toolbar {
    justify-content: flex-end;
    gap: 6px;
  }

  html.native-app .setting-group {
    gap: 4px;
  }

  html.native-app .chip-label {
    gap: 4px;
    padding: 4px 8px;
    font-size: 0.74rem;
  }

  html.native-app .chip-label input[type="number"] {
    padding: 2px 4px;
    font-size: 0.74rem;
  }

  html.native-app .action-btn {
    padding: 6px 12px;
    font-size: 0.76rem;
  }

  html.native-app .table-area {
    height: auto;
    min-height: 226px;
  }

  html.native-app .oval-table {
    top: calc(-8px + var(--table-lower-offset));
    width: min(92vw, 820px);
    height: auto;
    border-width: 0;
  }

  html.native-app .oval-table::after {
    content: none;
  }

  html.native-app .seat {
    width: 98px;
  }

  html.native-app .seat-card {
    padding: 4px 2px;
    border-radius: 13px;
  }

  html.native-app .avatar-wrap,
  html.native-app .avatar-emoji {
    width: 36px;
    height: 36px;
  }

  html.native-app .avatar-emoji {
    font-size: 1.12rem;
  }

  html.native-app .seat-name {
    font-size: 0.68rem;
  }

  html.native-app .seat-note,
  html.native-app .seat-timer,
  html.native-app .card-count,
  html.native-app .seat-pts {
    font-size: 0.58rem;
  }

  html.native-app .player-money {
    min-width: 44px;
    padding: 1px 4px;
    font-size: 0.54rem;
  }

  html.native-app .money-coin-icon {
    width: 12px;
    height: 12px;
  }

  html.native-app .mini-fan {
    width: 58px;
    height: 32px;
    margin-top: 4px;
  }

  html.native-app .mini-fan.winner-reveal {
    width: 100%;
    min-height: 42px;
    height: auto;
    gap: 2px;
    padding: 0 1px 2px;
  }

  html.native-app .mini-card {
    width: 21px;
    height: 30px;
    font-size: 0.54rem;
  }

  html.native-app .mini-fan.winner-reveal .mini-card {
    width: 15px;
    height: 22px;
    font-size: 0.4rem;
  }

  html.native-app .mini-fan.compact {
    width: 48px;
    height: 34px;
    gap: 4px;
  }

  html.native-app .mini-card.back.single {
    width: 24px;
    height: 34px;
  }

  html.native-app .revealed-strip {
    gap: 1px;
    margin: 3px auto 1px;
    max-width: 118px;
  }

  html.native-app .revealed-strip.winner-reveal {
    flex-direction: column;
    gap: 3px;
    max-width: 100%;
  }

  html.native-app .revealed-meld.compact {
    gap: 0;
    padding: 1px 2px;
  }

  html.native-app .revealed-meld.full-reveal {
    gap: 1px;
    padding: 2px 3px;
  }

  html.native-app .rev-back {
    width: 14px;
    height: 20px;
  }

  html.native-app .full-card.mini-rev.mini-seat-rev {
    width: 18px;
    height: 26px;
  }

  html.native-app .full-card.mini-rev.mini-seat-rev .center {
    font-size: 0.58rem;
  }

  html.native-app .full-card.mini-rev.mini-seat-rev .corner,
  html.native-app .full-card.mini-rev.mini-seat-rev .joker-corner {
    font-size: 0.28rem;
  }

  html.native-app .rev-taken {
    min-width: 18px;
    height: 20px;
    padding: 0 3px;
    font-size: 0.62rem;
  }

  html.native-app .rev-count {
    font-size: 0.62rem;
  }

  html.native-app .pot-won-badge {
    top: -20px;
    padding: 2px 7px;
    font-size: 0.56rem;
  }

  html.native-app .human-seat-col .pot-won-badge {
    top: -28px;
  }

  html.native-app .lock-badge {
    top: -8px;
    right: -4px;
    font-size: 0.56rem;
    padding: 2px 5px;
  }

  html.native-app .human-seat-col .lock-badge {
    top: 2px;
    right: -16px;
  }

  html.native-app .center-zone {
    top: calc(50% + 38px);
    transform: translate(-50%, -50%) scale(0.8);
    gap: 3px;
    padding: 3px 5px;
    border-radius: 12px;
  }

  html.native-app .turn-row {
    gap: 6px;
  }

  html.native-app .turn-pill,
  html.native-app .pot-pill {
    padding: 4px 8px;
    font-size: 0.68rem;
  }

  html.native-app .table-timer {
    width: 30px;
    height: 30px;
    font-size: 0.82rem;
  }

  html.native-app .pile-row {
    gap: 7px;
  }

  html.native-app .pile-wrap {
    gap: 3px;
  }

  html.native-app .center-zone .pile,
  html.native-app .center-zone .flip-pile,
  html.native-app .center-zone .empty-pile,
  html.native-app .center-zone .pile .full-card {
    width: 28px;
    height: 40px;
  }

  html.native-app .center-zone .full-card {
    border-radius: 8px;
  }

  html.native-app .center-zone .full-card .corner {
    font-size: 0.36rem;
  }

  html.native-app .center-zone .full-card .center {
    font-size: 0.76rem;
  }

  html.native-app .center-coin-pot {
    width: 92px;
    height: 26px;
    transform: scale(0.78);
    transform-origin: top center;
    margin-top: -3px;
  }

  html.native-app .stack-card,
  html.native-app .flip-back {
    border-radius: 7px;
    --back-frame-inset: 3px;
    --back-emblem-size: 13px;
  }

  html.native-app .deck-count {
    width: 15px;
    height: 15px;
    right: -4px;
    bottom: -4px;
    font-size: 0.48rem;
  }

  html.native-app .info-bar {
    gap: 8px;
    margin-top: 0;
    padding: 3px 8px;
    font-size: 0.68rem;
  }

  html.native-app .info-chip {
    gap: 4px;
    padding: 3px 8px;
  }

  html.native-app .timer-chip {
    min-width: 38px;
  }

  html.native-app .timer-chip strong {
    font-size: 0.8rem;
  }

  html.native-app .status-chip {
    flex: 1 1 240px;
  }

  html.native-app .hand-area {
    margin-top: 0;
    min-height: 140px;
    padding: 2px 8px 4px 72px;
    display: grid;
    grid-template-rows: auto 1fr;
    overflow: visible;
  }

  html.native-app .hand-area .seat.seat-human {
    width: 70px;
  }

  html.native-app .human-seat-col {
    width: 60px;
    height: 60px;
    left: 10px;
    top: auto;
    bottom: 2px;
    display: flex;
  }

  html.native-app .human-seat-col .seat.seat-human {
    position: static;
    width: 60px;
  }

  html.native-app .human-seat-col .avatar-wrap,
  html.native-app .human-seat-col .avatar-emoji {
    width: 46px;
    height: 46px;
  }

  html.native-app .human-seat-col .seat-name {
    font-size: 0.68rem;
  }

  html.native-app .human-point-meter {
    gap: 2px;
    margin-top: 0;
    font-size: 0.56rem;
  }

  html.native-app .human-point-star {
    font-size: 0.62rem;
  }

  html.native-app .human-seat-col .seat-pts,
  html.native-app .human-seat-col .seat-note {
    font-size: 0.58rem;
  }

  html.native-app .human-discards {
    left: 32%;
    bottom: 118px;
  }

  html.native-app .human-discard-item {
    margin-left: -18px;
    position: relative;
  }

  html.native-app .human-discard-item.top {
    z-index: 3;
  }

  html.native-app .human-discards .seat-discard-card,
  html.native-app .human-discards .my-discard-card {
    width: 34px !important;
    height: 48px !important;
  }

  html.native-app .human-discards .seat-discard-card .center,
  html.native-app .human-discards .my-discard-card .center {
    font-size: 0.88rem !important;
  }

  html.native-app .human-discards .seat-discard-card .corner,
  html.native-app .human-discards .my-discard-card .corner {
    font-size: 0.42rem !important;
  }

  html.native-app .hand-top {
    justify-content: flex-end;
    gap: 4px;
    margin-bottom: 2px;
    min-height: 0;
  }

  html.native-app .inline-hand-top {
    right: 10px;
    bottom: 96px;
    padding: 0;
    transform: none;
  }

  html.native-app .floating-hand-top {
    right: 8px;
    left: auto;
    top: 50%;
    transform: translateY(-50%);
  }

  html.native-app .hand-actions {
    gap: 4px;
    margin-left: auto;
  }

  html.native-app .floating-actions .mini-btn {
    padding: 5px 10px;
    font-size: 0.64rem;
  }

  html.native-app .my-last-discard {
    padding: 3px 6px;
    min-width: 52px;
    border-radius: 10px;
  }

  html.native-app .my-last-discard-head {
    font-size: 0.52rem;
  }

  html.native-app .my-last-discard-card {
    width: 36px !important;
    height: 50px !important;
  }

  html.native-app .my-last-discard-card .center {
    font-size: 0.96rem !important;
  }

  html.native-app .my-last-discard-card .corner,
  html.native-app .my-last-discard-card .joker-corner {
    font-size: 0.42rem !important;
  }

  html.native-app .mini-btn {
    padding: 4px 10px;
    font-size: 0.68rem;
  }

  html.native-app .inline-actions .image-action-btn {
    width: 76px;
    height: 23px;
    padding: 0;
  }

  html.native-app .hand-stage {
    grid-row: 1 / -1;
    align-self: end;
    width: 100%;
    gap: 6px;
    min-height: 100px;
    align-items: flex-end;
    padding-top: 6px;
    overflow: visible;
  }

  html.native-app .human-revealed {
    gap: 6px;
    padding: 4px 8px;
    margin-bottom: 3px;
  }

  html.native-app .hum-revealed-meld {
    gap: 2px;
    padding: 3px 4px;
  }

  html.native-app .full-card.mini-rev {
    width: 30px;
    height: 42px;
  }

  html.native-app .full-card.mini-rev .center {
    font-size: 0.82rem;
  }

  html.native-app .full-card.mini-rev .corner,
  html.native-app .full-card.mini-rev .joker-corner {
    font-size: 0.4rem;
  }

  html.native-app .full-card.mini-rev .joker-art-wrap {
    inset: 5px 4px;
  }

  html.native-app .hand-fan {
    min-height: 84px;
  }

  html.native-app .hand-card {
    width: 66px;
    height: 94px;
    border-radius: 12px;
  }

  html.native-app .hand-card .full-card {
    width: 66px;
    height: 94px;
  }

  html.native-app .hand-card .full-card .corner {
    font-size: 0.68rem;
  }

  html.native-app .hand-card .full-card .center {
    font-size: 1.5rem;
  }

  html.native-app .hand-card:hover {
    bottom: 6px;
  }

  html.native-app .hold-slot {
    width: 58px;
    min-height: 72px;
    padding: 3px;
    border-radius: 14px;
  }

  html.native-app .hold-slot.dual {
    width: 108px;
  }

  html.native-app .hold-slot.empty {
    width: 26px;
    border-color: transparent;
    padding: 0;
  }

  html.native-app .hold-slot strong {
    display: none;
  }

  html.native-app .hold-slot .rule-note {
    display: none;
  }

  html.native-app .hold-card {
    margin-top: 4px;
  }

  html.native-app .hold-card .full-card {
    width: 48px;
    height: 68px;
  }

  html.native-app .hold-pair {
    gap: 5px;
  }

  html.native-app .hand-fan {
    min-height: 72px;
    margin-top: 4px;
  }

  html.native-app .pot-won-tag,
  html.native-app .lock-tag {
    padding: 2px 6px;
    margin-bottom: 3px;
    font-size: 0.56rem;
  }

  html.native-app .my-discard {
    margin-top: 4px;
  }

  html.native-app .my-discard-label {
    display: none;
  }

  html.native-app .seat-discard-card,
  html.native-app .my-discard-card {
    width: 34px !important;
    height: 48px !important;
  }

  html.native-app .human-discards .seat-discard-card,
  html.native-app .human-discards .my-discard-card {
    width: 34px !important;
    height: 48px !important;
  }

  html.native-app .human-discards .seat-discard-card .center,
  html.native-app .human-discards .my-discard-card .center { font-size: 0.88rem !important; }
  html.native-app .human-discards .seat-discard-card .corner,
  html.native-app .human-discards .my-discard-card .corner { font-size: 0.42rem !important; }

  html.native-app .seat-discard-card .center,
  html.native-app .my-discard-card .center {
    font-size: 0.88rem !important;
  }

  html.native-app .seat-discard-card .corner,
  html.native-app .my-discard-card .corner {
    font-size: 0.42rem !important;
  }

  html.native-app .seat-discard-stack-item {
    margin-left: -14px;
  }

  html.native-app .seat.seat-right .seat-discard-row .seat-discard-stack-item {
    margin-right: -14px;
  }
}

/* ── Layout: stacked vertically ── */
.screen {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  min-height: var(--viewport-h);
}

/* ── Top Bar ── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 6px;
  padding: 3px 10px;
  background: linear-gradient(180deg, rgba(40, 14, 56, 0.9), rgba(17, 15, 40, 0.85));
  border-bottom: 1px solid var(--line);
  min-height: 32px;
}

.brand-title {
  margin: 0;
  font-family: "Cinzel", serif;
  font-size: 0.92rem;
  white-space: nowrap;
}

.brand-copy, .rule-note, .seat-note, .meta-text {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.4;
  font-size: 0.82rem;
}

.toolbar {
  display: flex;
  flex-wrap: nowrap;
  gap: 5px;
  align-items: center;
}

.chip-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.7rem;
  line-height: 1.2;
}

.chip-label input[type="number"] {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 5px;
  color: var(--text);
  padding: 1px 3px;
  font: inherit;
  font-size: 0.7rem;
}

.setting-group {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
}

.topbar .action-btn {
  padding: 3px 10px;
  font-size: 0.72rem;
  line-height: 1.2;
}

.action-btn {
  padding: 8px 16px;
  border-radius: 999px;
  border: 0;
  outline: 0;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text);
  cursor: pointer;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.action-btn.primary {
  color: #271203;
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
}

.action-btn.success {
  color: #04231c;
  background: linear-gradient(135deg, #7dffbc, #27cf8b);
}

.action-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ── Table Area: fixed height, holds oval + seats + center ── */
.table-area {
  position: relative;
  width: 100%;
  height: 472px;
  flex-shrink: 0;
  overflow: visible;
  isolation: isolate;
  background: transparent;
  box-shadow: none;
}

.oval-table {
  display: block;
  position: absolute;
  top: calc(-8px + var(--table-lower-offset));
  left: 50%;
  transform: translateX(-50%);
  width: min(1040px, 96vw);
  aspect-ratio: 13 / 6;
  height: auto;
  border-radius: 0;
  background: url("../images/objects/table.png") center / contain no-repeat;
  border: 0;
  box-shadow: none;
  pointer-events: none;
}

.oval-table::after {
  content: none;
  position: absolute;
  inset: 14%;
  border-radius: 999px;
  border: 3px solid rgba(116, 255, 214, 0.14);
}

/* ── Seats around table ── */
.seat {
  position: absolute;
  width: 130px;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 2;
}

.seat-card {
  position: relative;
  padding: 6px 8px;
  border-radius: 16px;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.seat.active .seat-card {
  box-shadow: none;
}

.avatar {
  width: 42px;
  height: 42px;
  margin: 0 auto 4px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.9rem;
  color: #23140a;
  background: linear-gradient(135deg, #ffe49d, #ff9e5e);
  border: 2px solid rgba(255, 255, 255, 0.8);
}

.avatar-wrap {
  position: relative;
  width: 48px;
  height: 48px;
  margin: 0 auto 4px;
}

.timer-ring {
  position: absolute;
  inset: -8px;
  width: calc(100% + 16px);
  height: calc(100% + 16px);
  z-index: 4;
  pointer-events: none;
  transform: rotate(-90deg);
}

.timer-ring-bg {
  fill: none;
  stroke: rgba(0, 0, 0, 0.35);
  stroke-width: 4;
}

.timer-ring-progress {
  fill: none;
  stroke: #22c55e;
  stroke-width: 4;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.9s linear;
  filter: drop-shadow(0 0 4px rgba(34, 197, 94, 0.7));
}

.timer-ring.warn .timer-ring-progress {
  stroke: #ef4444;
  filter: drop-shadow(0 0 6px rgba(239, 68, 68, 0.8));
  animation: timer-ring-warn 0.7s ease-in-out infinite;
}

.timer-ring-text {
  fill: #fff;
  font-size: 20px;
  font-weight: 800;
  text-anchor: middle;
  transform: rotate(90deg);
  transform-origin: 32px 32px;
  paint-order: stroke;
  stroke: rgba(0, 0, 0, 0.6);
  stroke-width: 3px;
}

@keyframes timer-ring-warn {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

.avatar-emoji {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  background: linear-gradient(135deg, #ffe49d, #ff9e5e);
  border: 2px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.avatar-emoji img {
  width: 72%;
  height: 72%;
  object-fit: contain;
  display: block;
  margin-top: 14%;
}

.banker-badge {
  position: absolute;
  bottom: -2px;
  right: -4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff9e5e, #c63357);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 900;
  display: grid;
  place-items: center;
  border: 2px solid #fff;
}

.banker-chip strong { color: var(--gold); }

.revealed-strip {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 3px;
  margin: 4px auto 2px;
  max-width: 132px;
}

.revealed-strip.winner-reveal {
  flex-direction: column;
  gap: 4px;
  max-width: 100%;
}

.revealed-meld {
  display: flex;
  gap: 2px;
  justify-content: center;
  padding: 2px 4px;
  border-radius: 6px;
  background: rgba(255, 207, 104, 0.12);
  border: 1px solid rgba(255, 207, 104, 0.3);
}

.revealed-meld.serial { border-color: rgba(125, 255, 188, 0.5); background: rgba(125, 255, 188, 0.12); }

.rev-card {
  display: inline-block;
  padding: 1px 4px;
  background: #fff;
  color: #182234;
  border-radius: 3px;
  font-size: 0.6rem;
  font-weight: 800;
}

.rev-card.red { color: #cb3158; }

.revealed-meld.compact {
  padding: 1px 2px;
  gap: 0;
  display: inline-flex;
  align-items: center;
}

.revealed-meld.full-reveal {
  gap: 2px;
  padding: 3px 4px;
  flex-wrap: wrap;
}

.rev-back {
  display: inline-block;
  width: 16px;
  height: 22px;
  border-radius: 4px;
  --back-border: 1px;
  --back-frame-inset: 2px;
  --back-emblem-size: 8px;
}

.rev-count {
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--gold);
}

.rev-taken {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 24px;
  padding: 0 4px;
  border-radius: 5px;
  background: #f8f6fb;
  color: #0e1220;
  font-weight: 800;
  font-size: 0.72rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.rev-taken.red { color: #cb3158; }

.rev-taken-locked {
  position: relative;
  padding-right: 12px;
}

.rev-lock-badge {
  position: absolute;
  right: -5px;
  top: -5px;
  width: 13px;
  height: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: #111;
  box-shadow: none;
  pointer-events: none;
}

.rev-lock-badge svg {
  width: 9px;
  height: 9px;
  display: block;
}

.human-revealed {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: center;
  padding: 2px 6px;
  margin-bottom: 2px;
}

.hum-revealed-meld {
  display: flex;
  gap: 1px;
  padding: 2px 3px;
  border-radius: 6px;
  background: rgba(255, 207, 104, 0.15);
  border: 1px solid rgba(255, 207, 104, 0.4);
}

.revealed-card-anchor {
  display: flex;
}

.revealed-card-anchor.pullable {
  cursor: pointer;
  transition: transform 0.15s ease;
}
.revealed-card-anchor.pullable:hover {
  transform: translateY(-4px);
}
.revealed-card-anchor.pullable:active {
  transform: translateY(-1px);
}

.hum-revealed-meld.serial {
  background: rgba(125, 255, 188, 0.15);
  border-color: rgba(125, 255, 188, 0.5);
}

.hum-revealed-meld.extend-selectable {
  cursor: pointer;
  animation: extend-pulse 1.2s ease-in-out infinite;
}

.hum-revealed-meld.extend-selected {
  background: rgba(255, 207, 104, 0.35) !important;
  border-color: var(--gold) !important;
  box-shadow: 0 0 0 2px var(--gold);
}

@keyframes extend-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 207, 104, 0.5); }
  50% { box-shadow: 0 0 0 4px rgba(255, 207, 104, 0.15); }
}

.full-card.mini-rev {
  width: 40px;
  height: 56px;
  font-size: 0.55rem;
}

.full-card.mini-rev .center { font-size: 0.95rem; }
.full-card.mini-rev .corner { font-size: 0.55rem; }

.full-card.mini-rev.mini-seat-rev {
  width: 22px;
  height: 32px;
  border-radius: 6px;
}

.full-card.mini-rev.mini-seat-rev .center {
  font-size: 0.72rem;
}

.full-card.mini-rev.mini-seat-rev .corner,
.full-card.mini-rev.mini-seat-rev .joker-corner {
  font-size: 0.34rem;
}

.pot-pill {
  padding: 4px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffe28a, #ff9d4b);
  color: #2d1000;
  font-size: 0.72rem;
  font-weight: 900;
}

.flip-pile {
  width: 60px;
  height: 84px;
  border-radius: 12px;
  overflow: visible;
}

.flip-card {
  box-shadow: 0 0 0 2px rgba(255, 207, 104, 0.9), 0 8px 16px rgba(0, 0, 0, 0.4) !important;
  animation: flip-glow 2.2s ease-in-out infinite;
}

.full-card.flip-card,
.full-card.point-card-visual {
  background:
    linear-gradient(180deg, #fff6c2 0%, #ffd76b 48%, #e89a1d 100%) !important;
  border: 1px solid rgba(149, 95, 0, 0.5);
}

.center-zone.center-cards-pending .flip-card,
.center-zone.center-cards-pending .point-card-visual,
.hand-stage.deal-pending .hand-card,
.mini-fan.deal-pending .mini-card {
  opacity: 0;
}

.full-card.flip-card.red,
.full-card.point-card-visual.red {
  color: #8a1e33;
}

.full-card.flip-card.black,
.full-card.point-card-visual.black {
  color: #3a2608;
}

.flip-back {
  position: relative;
  inset: auto;
  width: 60px;
  height: 84px;
  animation: flip-glow 2.2s ease-in-out infinite;
}

@keyframes flip-glow {
  0%, 100% { box-shadow: 0 0 0 2px rgba(255, 207, 104, 0.9), 0 8px 16px rgba(0, 0, 0, 0.4); }
  50% { box-shadow: 0 0 0 3px rgba(255, 207, 104, 1), 0 0 22px rgba(255, 207, 104, 0.6); }
}

.results-flip {
  text-align: center;
  padding: 6px 10px;
  margin: 4px 0 10px;
  background: rgba(255, 207, 104, 0.1);
  border-radius: 8px;
  font-size: 0.85rem;
}

.results-flip strong.red { color: #ff6f94; }
.results-flip strong.black { color: var(--gold); }

.seat-name {
  font-size: 0.8rem;
  font-weight: 800;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
}

.seat-pts {
  color: var(--gold);
  font-size: 0.75rem;
  font-weight: 700;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
}

.point-star {
  color: #ffdf6e;
  margin-right: 2px;
}

.player-money {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 54px;
  margin: 1px auto 0;
  padding: 1px 5px;
  border-radius: 999px;
  background: rgba(20, 8, 4, 0.58);
  color: #ffe58b;
  font-size: 0.66rem;
  font-weight: 900;
  line-height: 1.2;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.75);
  box-shadow: inset 0 0 0 1px rgba(255, 217, 112, 0.26), 0 3px 8px rgba(0, 0, 0, 0.22);
}

.money-coin-icon {
  width: 15px;
  height: 15px;
  display: block;
  flex: 0 0 auto;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.42));
}

.mini-fan {
  position: relative;
  width: 72px;
  height: 38px;
  margin: 6px auto 0;
}

.mini-card {
  position: absolute;
  top: 0;
  left: 50%;
  width: 26px;
  height: 36px;
  border-radius: 6px;
  transform-origin: bottom center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.28);
  font-size: 0.65rem;
}

.mini-card.back {
  --back-border: 2px;
  --back-frame-inset: 3px;
  --back-emblem-size: 12px;
}

.mini-card.face {
  background: #f8f6fb;
  color: #0e1220;
  display: grid;
  place-items: center;
  font-weight: 800;
}

.mini-card.face.red { color: #cb3158; }

.mini-card.joker {
  background: linear-gradient(135deg, #ffe88a, #ff6fc8) !important;
  color: #2d1050 !important;
}

.mini-fan.winner-reveal {
  width: 100%;
  min-height: 54px;
  height: auto;
  margin-top: 6px;
  padding: 0 2px 2px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 3px;
}

.mini-fan.winner-reveal .mini-card {
  position: relative;
  top: auto;
  left: auto;
  width: 18px;
  height: 26px;
  transform: none !important;
  font-size: 0.46rem;
  flex: 0 0 auto;
}

.mini-fan.compact {
  width: 52px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  position: relative;
}

.mini-card.back.single {
  position: relative;
  top: auto;
  left: auto;
  transform: none;
  width: 30px;
  height: 42px;
  flex: 0 0 auto;
}

.card-count {
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--gold);
  background: rgba(0, 0, 0, 0.4);
  padding: 1px 6px;
  border-radius: 10px;
}

.card-lock-badge {
  position: absolute;
  left: 50%;
  top: 58%;
  transform: translate(-50%, -50%);
  z-index: 6;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: transparent;
  box-shadow: none;
  color: #111;
  pointer-events: none;
}

.card-lock-badge svg {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 1px 1px rgba(255, 255, 255, 0.7));
}

.seat-timer {
  font-size: 0.65rem;
  color: var(--gold);
  font-weight: 700;
  animation: timer-pulse 0.8s ease-in-out infinite;
}

.seat-note {
  font-size: 0.7rem;
  margin: 2px 0 0;
  min-height: 16px;
  color: var(--muted);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
}

/* ── Center Zone (deck + discard inside table) ── */
.center-zone {
  position: absolute;
  left: 50%;
  top: calc(50% + 48px);
  transform: translate(-50%, -50%) scale(0.88);
  transform-origin: center center;
  margin-top: var(--table-lower-offset);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 2px 4px;
  border-radius: 10px;
  background: transparent;
}

.center-zone .pile,
.center-zone .flip-pile,
.center-zone .empty-pile,
.center-zone .pile .full-card {
  width: 29px;
  height: 40px;
}

.center-zone .deck-pile {
  width: 29px;
  height: 40px;
  border-radius: 6px;
}

.center-zone .deck-pile .stack-card {
  border-radius: 6px;
  --back-emblem-size: 12px;
  --back-frame-inset: 2px;
}

.center-zone .full-card {
  border-radius: 8px;
}

.center-zone .full-card .corner,
.center-zone .full-card .joker-corner {
  font-size: 0.38rem;
}

.center-zone .full-card .center {
  font-size: 0.78rem;
}

.point-card-pile .full-card,
.flip-pile .full-card {
  box-shadow: 0 0 0 2px rgba(255, 207, 104, 0.82), 0 10px 22px rgba(0, 0, 0, 0.34);
}

.center-status {
  margin: 0;
  padding: 6px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  color: #182234;
  font-weight: 700;
  font-size: 0.8rem;
  white-space: nowrap;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pile-row {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
}

.center-coin-pot {
  position: relative;
  width: 118px;
  height: 36px;
  margin-top: -1px;
  pointer-events: none;
  filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.44));
}

.pot-coin-scatter {
  position: absolute;
  inset: 0;
}

.pot-coin,
.pot-coin-stack {
  position: absolute;
  display: block;
  user-select: none;
}

.pot-coin {
  width: 22px;
  height: 22px;
}

.pot-coin-stack {
  width: 23px;
  height: 29px;
  left: 76px;
  top: 3px;
  z-index: 9;
}

.pot-coin-0 { left: 34px; top: 8px; transform: rotate(-16deg); z-index: 3; }
.pot-coin-1 { left: 48px; top: 10px; transform: rotate(9deg); z-index: 4; }
.pot-coin-2 { left: 60px; top: 7px; transform: rotate(-4deg); z-index: 5; }
.pot-coin-3 { left: 42px; top: 2px; transform: rotate(18deg); z-index: 6; }
.pot-coin-4 { left: 56px; top: 0; transform: rotate(-22deg); z-index: 7; }
.pot-coin-5 { left: 70px; top: 9px; transform: rotate(13deg); z-index: 4; }
.pot-coin-6 { left: 27px; top: 14px; transform: rotate(5deg); z-index: 2; }
.pot-coin-7 { left: 83px; top: 13px; transform: rotate(-9deg); z-index: 3; }

.pot-amount {
  position: absolute;
  left: 10px;
  top: 10px;
  z-index: 10;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(25, 11, 5, 0.64);
  color: #ffe08a;
  font-size: 0.58rem;
  font-weight: 900;
  line-height: 1.25;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.75);
  box-shadow: inset 0 0 0 1px rgba(255, 220, 120, 0.28);
}

.pile-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.pile-label {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.56rem;
  font-weight: 700;
}

.pile {
  position: relative;
  width: 60px;
  height: 84px;
  border-radius: 12px;
  cursor: pointer;
}

.pile.disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.stack-card {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  --back-border: 2px;
  --back-frame-inset: 5px;
  --back-emblem-size: 24px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.28);
}

.rev-back,
.mini-card.back,
.flip-back {
  position: relative;
  display: block;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 236, 177, 0.28), transparent 18%),
    repeating-linear-gradient(45deg, rgba(255, 223, 145, 0.18) 0 2px, transparent 2px 10px),
    repeating-linear-gradient(-45deg, rgba(255, 223, 145, 0.14) 0 2px, transparent 2px 10px),
    linear-gradient(145deg, #356dc6 0%, var(--back-blue) 25%, var(--back-blue-deep) 47%, var(--back-crimson) 76%, var(--back-night) 100%);
  border: var(--back-border, 2px) solid rgba(255, 245, 214, 0.82);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    inset 0 0 30px rgba(5, 9, 28, 0.18),
    0 8px 16px rgba(0, 0, 0, 0.28);
}

.stack-card {
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 236, 177, 0.28), transparent 18%),
    repeating-linear-gradient(45deg, rgba(255, 223, 145, 0.18) 0 2px, transparent 2px 10px),
    repeating-linear-gradient(-45deg, rgba(255, 223, 145, 0.14) 0 2px, transparent 2px 10px),
    linear-gradient(145deg, #356dc6 0%, var(--back-blue) 25%, var(--back-blue-deep) 47%, var(--back-crimson) 76%, var(--back-night) 100%);
  border: var(--back-border, 2px) solid rgba(255, 245, 214, 0.82);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    inset 0 0 30px rgba(5, 9, 28, 0.18),
    0 8px 16px rgba(0, 0, 0, 0.28);
}

.rev-back::before,
.mini-card.back::before,
.stack-card::before,
.flip-back::before {
  content: "";
  position: absolute;
  inset: var(--back-frame-inset, 4px);
  border-radius: inherit;
  border: 1px solid rgba(255, 223, 145, 0.82);
  background:
    radial-gradient(circle at center, rgba(255, 234, 169, 0.18) 0 22%, transparent 23%),
    linear-gradient(90deg, transparent 0 9%, rgba(255, 225, 157, 0.26) 9% 11%, transparent 11% 89%, rgba(255, 225, 157, 0.26) 89% 91%, transparent 91%),
    linear-gradient(0deg, transparent 0 10%, rgba(255, 225, 157, 0.22) 10% 12%, transparent 12% 88%, rgba(255, 225, 157, 0.22) 88% 90%, transparent 90%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0) 0 11px, rgba(255, 224, 148, 0.15) 11px 12px),
    repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0) 0 11px, rgba(255, 224, 148, 0.13) 11px 12px),
    linear-gradient(180deg, rgba(12, 18, 47, 0.05), rgba(12, 18, 47, 0.24));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    inset 0 0 18px rgba(255, 214, 119, 0.18);
}

.rev-back::after,
.mini-card.back::after,
.stack-card::after,
.flip-back::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--back-emblem-size, 18px);
  height: var(--back-emblem-size, 18px);
  transform: translate(-50%, -50%) rotate(45deg);
  border-radius: 4px;
  background:
    radial-gradient(circle at center, rgba(255, 247, 224, 0.98) 0 14%, transparent 15%),
    radial-gradient(circle at center, rgba(255, 217, 120, 0.98) 0 42%, rgba(185, 111, 45, 0.96) 43% 66%, rgba(31, 18, 50, 0.96) 67% 100%);
  border: 1px solid rgba(255, 244, 218, 0.45);
  box-shadow:
    0 0 18px rgba(255, 207, 104, 0.18),
    inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.mini-card.back {
  box-shadow:
    0 5px 12px rgba(0, 0, 0, 0.34),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.stack-card:nth-child(1) {
  z-index: 3;
}

.stack-card:nth-child(2) {
  z-index: 2;
  transform: translate(4px, -4px) rotate(3deg);
  opacity: 0.88;
}

.stack-card:nth-child(3) {
  z-index: 1;
  transform: translate(8px, -8px) rotate(6deg);
  opacity: 0.78;
}

.deck-count {
  position: absolute;
  right: -4px;
  bottom: -4px;
  z-index: 4;
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffe28a, #ff9d4b);
  color: #351a00;
  font-weight: 800;
  font-size: 0.5rem;
}

.turn-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.turn-pill {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.4);
  color: var(--gold);
  font-size: 0.62rem;
  font-weight: 800;
}

.table-timer {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 1rem;
  color: #fff;
  background: rgba(29, 208, 149, 0.3);
  border: 2px solid var(--green);
  animation: none;
}

.table-timer.timer-warn {
  background: rgba(255, 111, 148, 0.3);
  border-color: var(--pink);
  color: var(--pink);
  animation: timer-pulse 0.5s ease-in-out infinite;
}

/* Full card (in discard pile center + hand) */
.full-card {
  position: relative;
  width: 60px;
  height: 84px;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(241, 241, 248, 0.96));
  color: #141a2c;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.28);
}

.full-card.red { color: #c63357; }

.full-card.image-card {
  background: #ffffff;
  border: none;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.28);
  padding: 0;
}

.card-face-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
  display: block;
  border-radius: inherit;
}

.full-card .corner {
  position: absolute;
  display: grid;
  gap: 1px;
  line-height: 1;
  font-weight: 800;
  font-size: 0.65rem;
}

.full-card .corner.top { top: 4px; left: 4px; }
.full-card .corner.bottom { right: 4px; bottom: 4px; transform: rotate(180deg); }

.full-card .center {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  font-weight: 800;
}

/* ── Money Card (gold face) ── */
.full-card.money-card-face {
  background:
    linear-gradient(180deg, #fff3b8 0%, #ffd76b 45%, #f0a72a 100%);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
  border: none;
}

.full-card.money-card-face.red { color: #8a1e33; }
.full-card.money-card-face.black { color: #3a2608; }

.full-card.money-card-face .center {
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.55);
}

/* ── Joker Card (image) ── */
.full-card.joker-card {
  background: #ffffff;
  color: #3a2608;
  border: none;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.32);
  overflow: hidden;
  padding: 0;
}

.joker-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
  display: block;
  border-radius: inherit;
}

.full-card.joker-card.red {
  color: #8a1e33;
}

.full-card.joker-card.black {
  color: #3a2608;
}

.joker-art-wrap {
  position: absolute;
  inset: 10px 8px;
  display: grid;
  place-items: center;
}

.joker-art {
  width: 92%;
  height: 92%;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.12));
}

.joker-corner {
  position: absolute;
  display: grid;
  gap: 1px;
  line-height: 1;
  font-weight: 900;
  font-size: 0.62rem;
  z-index: 1;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
}

.joker-corner.top {
  top: 4px;
  left: 4px;
}

.joker-corner.bottom {
  right: 4px;
  bottom: 4px;
  transform: rotate(180deg);
}

.full-card.mini-rev .joker-art-wrap {
  inset: 6px 5px;
}

.full-card.mini-rev .joker-corner {
  font-size: 0.42rem;
}

/* ── Money Card Badge ── */
.money-badge {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffe28a, #ff9d4b);
  color: #351a00;
  font-weight: 800;
  font-size: 0.55rem;
  display: grid;
  place-items: center;
}

.empty-pile {
  width: 60px;
  height: 84px;
  border-radius: 12px;
  border: 2px dashed rgba(255, 255, 255, 0.25);
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.65rem;
}

/* ── Timer ── */
.timer-chip {
  background: rgba(29, 208, 149, 0.15);
  border: 1px solid rgba(29, 208, 149, 0.3);
  min-width: 44px;
  justify-content: center;
}

.timer-chip strong {
  color: var(--green) !important;
  font-size: 0.95rem;
}

.timer-chip.timer-warn {
  background: rgba(255, 111, 148, 0.2);
  border-color: rgba(255, 111, 148, 0.4);
  animation: timer-pulse 0.6s ease-in-out infinite;
}

.timer-chip.timer-warn strong {
  color: var(--pink) !important;
}

@keyframes timer-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

/* ── Arrange Button ── */
.arrange-active {
  background: rgba(29, 208, 149, 0.2) !important;
  border: 1px solid rgba(29, 208, 149, 0.3);
  color: var(--green) !important;
}

/* ── Meld Group Colors ── */
.hand-card.meld-green { box-shadow: 0 -3px 0 0 #1dd095, 0 8px 16px rgba(0,0,0,0.2); }
.hand-card.meld-red { box-shadow: 0 -3px 0 0 #ff4d6d, 0 8px 16px rgba(0,0,0,0.2); }

.hand-card.revealed-locked {
  cursor: not-allowed;
  opacity: 0.92;
  pointer-events: none;
}
.hand-card.revealed-locked.extend-selectable {
  pointer-events: auto;
  cursor: pointer;
}
.hand-card.revealed-locked.revealed-pullback {
  pointer-events: auto;
  cursor: pointer;
}
.hand-card.revealed-locked.extend-selected {
  box-shadow: 0 -3px 0 0 #ffcf68, 0 0 0 3px rgba(255, 207, 104, 0.6), 0 8px 16px rgba(0,0,0,0.3);
}
.hand-card.revealed-locked .full-card {
  filter: brightness(0.95);
}
.hand-card.revealed-locked::after {
  content: "";
  position: absolute;
  top: 6px;
  right: 6px;
  width: 14px;
  height: 14px;
  background: rgba(29, 208, 149, 0.95);
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.7);
  z-index: 4;
}

.hand-card.meld-green.money-card { box-shadow: 0 -3px 0 0 #1dd095, 0 8px 16px rgba(0,0,0,0.2); }
.hand-card.meld-red.money-card { box-shadow: 0 -3px 0 0 #ff4d6d, 0 8px 16px rgba(0,0,0,0.2); }

/* ── Player Hand Area (bottom) ── */
.hand-area {
  flex: 0 0 auto;
  position: relative;
  display: flex;
  flex-direction: column;
  margin-top: -14px;
  padding: 6px 12px 8px 98px;
  background: transparent;
  min-height: 220px;
  overflow: visible;
}

.hand-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 0;
}

.simple-hand-top {
  justify-content: flex-end;
}

.floating-hand-top {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 8;
  align-items: center;
  pointer-events: none;
}

.floating-hand-top > * {
  pointer-events: auto;
}

.inline-hand-top {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  right: 16px;
  bottom: 132px;
  padding: 0;
  width: auto;
  z-index: 12;
  transform: none;
}


.my-last-discard {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 6px 10px;
  border-radius: 12px;
  background: rgba(14, 8, 28, 0.78);
  border: 1px solid rgba(255, 207, 104, 0.35);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28);
  min-width: 68px;
}

.my-last-discard-row {
  display: flex;
  align-items: center;
}

.my-last-discard-item {
  margin-left: -20px;
}

.my-last-discard-item:first-child {
  margin-left: 0;
}

.my-last-discard.empty {
  opacity: 0.7;
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.18);
}

.my-last-discard-head {
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: rgba(255, 207, 104, 0.9);
  white-space: nowrap;
}

.my-last-discard-card {
  width: 48px !important;
  height: 68px !important;
  border-radius: 10px !important;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3) !important;
}

.my-last-discard-card .center {
  font-size: 1.18rem !important;
}

.my-last-discard-card .corner,
.my-last-discard-card .joker-corner {
  font-size: 0.54rem !important;
}

.my-last-discard-empty {
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.55);
  padding: 8px 0;
}

.inline-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  margin-right: 0;
}

.inline-actions .mini-btn {
  padding: 11px 20px;
  font-size: 0.95rem;
  font-weight: 800;
  background: rgba(16, 10, 31, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  border-radius: 14px;
}

.inline-actions .simple-discard-btn:not(.disabled) {
  background: linear-gradient(180deg, #f97316, #c2410c);
  color: #fff;
  border-color: rgba(255, 207, 104, 0.65);
  box-shadow: 0 0 0 2px rgba(255, 207, 104, 0.45), 0 6px 14px rgba(249, 115, 22, 0.45);
  animation: pulse-discard 1.3s ease-in-out infinite;
}

.inline-actions .image-action-btn {
  position: relative;
  width: 98px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background-color: transparent;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  box-shadow: 0 7px 14px rgba(0, 0, 0, 0.28);
  overflow: hidden;
}

.image-action-btn span {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.image-action-btn.group-image-btn {
  background-image: url("../images/objects/group-button.png");
}

.image-action-btn.meld-image-btn {
  background-image: url("../images/objects/meld-button.png");
}

.image-action-btn.discard-image-btn {
  background-image: url("../images/objects/discard-button.png");
}

.image-action-btn.arrange-active {
  background-color: transparent !important;
  border-color: transparent;
  color: transparent !important;
  filter: brightness(1.15) drop-shadow(0 0 8px rgba(29, 208, 149, 0.45));
}

.inline-actions .image-action-btn.disabled {
  filter: grayscale(0.7);
  opacity: 0.48;
}

@keyframes pulse-discard {
  0%, 100% { box-shadow: 0 0 0 2px rgba(255, 207, 104, 0.45), 0 6px 14px rgba(249, 115, 22, 0.45); }
  50% { box-shadow: 0 0 0 4px rgba(255, 207, 104, 0.75), 0 8px 20px rgba(249, 115, 22, 0.65); }
}

.hand-top h2 {
  margin: 0;
  font-family: "Cinzel", serif;
  font-size: 1.1rem;
}

.hand-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.floating-actions {
  margin-left: auto;
  align-items: center;
}

.floating-actions .mini-btn {
  padding: 7px 14px;
  background: rgba(16, 10, 31, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.24);
}

.hand-side-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 0 0 auto;
  align-self: stretch;
  justify-content: flex-end;
  padding-bottom: 4px;
  position: relative;
  z-index: 8;
  pointer-events: auto;
}

.hand-side-actions .mini-btn {
  padding: 6px 10px;
  font-size: 0.72rem;
  white-space: nowrap;
  position: relative;
  z-index: 9;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.mini-btn {
  padding: 6px 12px;
  border-radius: 999px;
  border: 0;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
}

.mini-btn.disabled {
  opacity: 0.45;
  cursor: default;
  pointer-events: none;
}

.hand-stage {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  min-height: 150px;
  padding-top: 8px;
  position: relative;
}

.hand-stage .human-revealed {
  display: none;
}

.hand-fan {
  position: relative;
  flex: 1;
  min-height: 138px;
  margin-top: -12px;
  z-index: 1;
}

.hand-card {
  position: absolute;
  bottom: 0;
  width: 86px;
  height: 120px;
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  transform-origin: bottom center;
  transition: transform 0.18s ease, bottom 0.18s ease, box-shadow 0.18s ease;
}

/* Scale up full-card inside hand */
.hand-card .full-card {
  width: 86px;
  height: 120px;
}

.hand-card .full-card .corner {
  font-size: 0.84rem;
}

.hand-card .full-card .corner.top { top: 6px; left: 6px; }
.hand-card .full-card .corner.bottom { right: 6px; bottom: 6px; }

.hand-card .full-card .center {
  font-size: 1.9rem;
}

.hand-card:hover {
  bottom: 12px;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.34);
  z-index: 10;
}

.hand-card.disabled { cursor: default; }

.hand-card.money-card {
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.28);
}

.hand-card.point-owned .full-card {
  background:
    radial-gradient(circle at 48% 16%, rgba(255, 210, 84, 0.52) 0 16%, rgba(255, 210, 84, 0) 34%),
    linear-gradient(155deg, #ffd65a 0%, #ffc73a 28%, #f4ab1d 58%, #e18d10 100%);
  border: 1px solid rgba(255, 201, 79, 0.98);
  box-shadow:
    0 0 0 2px rgba(255, 191, 45, 0.98),
    0 10px 24px rgba(255, 161, 24, 0.42),
    0 14px 24px rgba(0, 0, 0, 0.26),
    inset 0 1px 0 rgba(255, 220, 118, 0.32),
    inset 0 -10px 18px rgba(179, 96, 8, 0.16);
  filter: saturate(1.12) brightness(1.01);
}

.hand-card.selected {
  bottom: 20px;
  z-index: 24;
}

.hand-card.dragging-source {
  opacity: 0.25;
  filter: grayscale(0.3);
}

.hand-card.drop-target-left {
  transform: translateX(22px) rotate(0deg) !important;
  transition: transform 0.15s ease;
}

.hand-card.drop-target-right {
  transform: translateX(-22px) rotate(0deg) !important;
  transition: transform 0.15s ease;
}

.drag-ghost {
  border-radius: 14px;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.55), 0 0 0 3px rgba(255, 207, 104, 0.9);
  transition: transform 0.1s ease;
  touch-action: none;
  user-select: none;
}

.hand-card {
  touch-action: none;
  user-select: none;
}

.hand-card.selected .full-card,
.hold-card.selected .full-card {
  box-shadow: 0 0 0 3px rgba(255, 207, 104, 0.95), 0 16px 28px rgba(0, 0, 0, 0.34);
}

.hand-card.locked .full-card,
.hold-card.locked .full-card {
  box-shadow: 0 0 0 2px rgba(255, 207, 104, 0.6), 0 8px 16px rgba(0, 0, 0, 0.28);
}

.hold-slot {
  width: 90px;
  flex-shrink: 0;
  min-height: 130px;
  padding: 8px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed rgba(255, 255, 255, 0.18);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-end;
}

.hold-slot.dual {
  width: 140px;
}

.hold-slot.empty {
  background: transparent;
  border-color: transparent;
  width: 48px;
  padding: 0;
}

.hold-pair {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 8px;
  width: 100%;
}

.hold-slot strong {
  font-size: 0.78rem;
}

.hold-slot .rule-note {
  font-size: 0.7rem;
}

.hold-card {
  position: relative;
  margin-top: 6px;
  flex: 0 0 auto;
}

.hold-card .full-card {
  width: 72px;
  height: 100px;
  margin: 0 auto;
}

.draw-flyer {
  position: fixed;
  z-index: 220;
  pointer-events: none;
  transform-origin: center center;
  will-change: transform;
}

.draw-flyer .full-card {
  width: 100% !important;
  height: 100% !important;
  margin: 0;
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.34);
}

.deal-card-flyer {
  filter: drop-shadow(0 9px 12px rgba(0, 0, 0, 0.42));
}

.deal-card-flyer .draw-flyer-back {
  border-radius: 4px;
}

.deal-card-flyer .draw-flyer-back::before {
  border-radius: 3px;
}

.coin-flyer {
  position: fixed;
  z-index: 240;
  width: 26px;
  height: 26px;
  pointer-events: none;
  display: grid;
  place-items: center;
  transform-origin: center center;
  will-change: transform, opacity;
}

.coin-flyer img {
  width: 26px;
  height: 26px;
  display: block;
  filter: drop-shadow(0 5px 8px rgba(0, 0, 0, 0.52));
}

.coin-flyer span {
  position: absolute;
  left: 50%;
  top: -11px;
  transform: translateX(-50%);
  padding: 1px 5px;
  border-radius: 999px;
  background: rgba(24, 10, 4, 0.78);
  color: #ffe58b;
  font-size: 0.56rem;
  font-weight: 900;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
}

.draw-flyer-back {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 12px;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 236, 177, 0.28), transparent 18%),
    repeating-linear-gradient(45deg, rgba(255, 223, 145, 0.18) 0 2px, transparent 2px 10px),
    repeating-linear-gradient(-45deg, rgba(255, 223, 145, 0.14) 0 2px, transparent 2px 10px),
    linear-gradient(145deg, #356dc6 0%, var(--back-blue) 25%, var(--back-blue-deep) 47%, var(--back-crimson) 76%, var(--back-night) 100%);
  border: 2px solid rgba(255, 245, 214, 0.82);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    inset 0 0 30px rgba(5, 9, 28, 0.18),
    0 16px 30px rgba(0, 0, 0, 0.34);
}

.draw-flyer-back::before {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: inherit;
  border: 1px solid rgba(255, 223, 145, 0.82);
  background:
    radial-gradient(circle at center, rgba(255, 234, 169, 0.18) 0 22%, transparent 23%),
    linear-gradient(90deg, transparent 0 9%, rgba(255, 225, 157, 0.26) 9% 11%, transparent 11% 89%, rgba(255, 225, 157, 0.26) 89% 91%, transparent 91%),
    linear-gradient(0deg, transparent 0 10%, rgba(255, 225, 157, 0.22) 10% 12%, transparent 12% 88%, rgba(255, 225, 157, 0.22) 88% 90%, transparent 90%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0) 0 11px, rgba(255, 224, 148, 0.15) 11px 12px),
    repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0) 0 11px, rgba(255, 224, 148, 0.13) 11px 12px),
    linear-gradient(180deg, rgba(12, 18, 47, 0.05), rgba(12, 18, 47, 0.24));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    inset 0 0 18px rgba(255, 214, 119, 0.18);
}

.draw-flyer-back::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 24px;
  height: 24px;
  transform: translate(-50%, -50%) rotate(45deg);
  border-radius: 4px;
  background:
    radial-gradient(circle at center, rgba(255, 247, 224, 0.98) 0 14%, transparent 15%),
    radial-gradient(circle at center, rgba(255, 217, 120, 0.98) 0 42%, rgba(185, 111, 45, 0.96) 43% 66%, rgba(31, 18, 50, 0.96) 67% 100%);
  border: 1px solid rgba(255, 244, 218, 0.45);
  box-shadow:
    0 0 18px rgba(255, 207, 104, 0.18),
    inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

/* ── Results Overlay ── */
.winner-banner {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  pointer-events: none;
  animation: winner-banner-in 0.55s cubic-bezier(0.17, 0.89, 0.32, 1.28);
}

.winner-banner-inner {
  padding: 18px 28px 22px;
  background: linear-gradient(180deg, #fff6c2 0%, #ffd76b 48%, #e89a1d 100%);
  color: #3a2608;
  border-radius: 28px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55), 0 0 0 4px rgba(255, 255, 255, 0.25), 0 0 80px rgba(255, 207, 104, 0.65);
  text-align: center;
  max-width: min(96vw, 900px);
  max-height: 92vh;
  overflow-y: auto;
  animation: winner-banner-pulse 1.6s ease-in-out infinite;
  pointer-events: auto;
  position: relative;
}

.winner-banner-close {
  position: absolute;
  top: 6px;
  right: 10px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.18);
  color: #3a2608;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
}
.winner-banner-close:hover { background: rgba(0, 0, 0, 0.28); }

.winner-banner.winner-banner-compact {
  place-items: start center;
  padding-top: 60px;
  animation: none;
}
.winner-banner.winner-banner-compact .winner-banner-inner {
  animation: none;
  padding: 12px 18px 14px;
  transform: scale(0.88);
  transform-origin: top center;
}

.winner-banner-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin-bottom: 14px;
}

.winner-banner-crown {
  font-size: 2.4rem;
  line-height: 1;
}

.winner-hand-showcase {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 16px;
}

.winner-meld-group {
  display: flex;
  gap: 3px;
  padding: 6px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.32);
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.winner-showcase-card {
  width: 54px !important;
  height: 76px !important;
  border-radius: 10px !important;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3) !important;
}

.winner-showcase-card .center {
  font-size: 1.4rem !important;
}

.winner-showcase-card .corner,
.winner-showcase-card .joker-corner {
  font-size: 0.62rem !important;
}

@media (max-width: 600px) {
  .winner-showcase-card {
    width: 40px !important;
    height: 58px !important;
  }
  .winner-showcase-card .center { font-size: 1.05rem !important; }
  .winner-showcase-card .corner,
  .winner-showcase-card .joker-corner { font-size: 0.48rem !important; }
  .winner-hand-showcase { gap: 6px; padding: 6px; }
  .winner-meld-group { gap: 2px; padding: 4px; }
}

.winner-banner-name {
  font-family: "Cinzel", serif;
  font-weight: 700;
  font-size: 2rem;
  letter-spacing: 0.04em;
}

.winner-banner-text {
  font-weight: 900;
  font-size: 1.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #6a2c0a;
  margin-top: 4px;
}

@keyframes winner-banner-in {
  0% { opacity: 0; transform: scale(0.6); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes winner-banner-pulse {
  0%, 100% { box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55), 0 0 0 4px rgba(255, 255, 255, 0.25), 0 0 80px rgba(255, 207, 104, 0.65); }
  50% { box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55), 0 0 0 4px rgba(255, 255, 255, 0.4), 0 0 120px rgba(255, 207, 104, 0.9); }
}

.results-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  padding: 20px;
}

.results-modal {
  width: min(520px, 95vw);
  max-height: 85vh;
  overflow-y: auto;
  padding: 24px 20px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(40, 14, 56, 0.96), rgba(12, 15, 36, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.5);
}

.results-title {
  margin: 0 0 16px;
  font-family: "Cinzel", serif;
  font-size: 1.6rem;
  text-align: center;
  color: var(--gold);
}

.results-section {
  margin-bottom: 14px;
}

.results-section h3 {
  margin: 0 0 8px;
  font-size: 0.9rem;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  padding-bottom: 4px;
}

.results-grid { display: grid; gap: 6px; }

.result-player {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.88rem;
}

.result-player.winner {
  background: rgba(255, 207, 104, 0.12);
  border: 1px solid rgba(255, 207, 104, 0.25);
}

.net { font-weight: 800; }
.net.positive { color: var(--green); }
.net.negative { color: var(--pink); }

.flow-list {
  display: grid;
  gap: 4px;
  max-height: 180px;
  overflow-y: auto;
}

.flow-item {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.8rem;
}

.flow-from { color: var(--pink); font-weight: 700; }
.flow-arrow { color: var(--muted); }
.flow-to { color: var(--green); font-weight: 700; }
.flow-reason { color: var(--muted); font-size: 0.72rem; margin-left: auto; }

.net-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 6px;
}

.net-item {
  padding: 8px 10px;
  border-radius: 12px;
  text-align: center;
  font-size: 0.85rem;
}

.net-item.positive { background: rgba(29, 208, 149, 0.12); color: var(--green); }
.net-item.negative { background: rgba(255, 111, 148, 0.12); color: var(--pink); }

/* ── Responsive ── */
@media (max-width: 820px) {
  :root {
    --table-lower-offset: 10px;
  }

  .topbar {
    padding: 6px 10px;
  }

  .brand-title { font-size: 1rem; }

  .table-area { height: 382px; }

  .oval-table {
    width: min(92vw, 760px);
    height: auto;
    top: calc(-8px + var(--table-lower-offset));
    border-width: 0;
  }

  .seat { width: 100px; }
  .avatar { width: 32px; height: 32px; font-size: 0.75rem; }
  .seat-name { font-size: 0.7rem; }
  .player-money {
    min-width: 42px;
    padding: 1px 4px;
    font-size: 0.52rem;
  }
  .money-coin-icon {
    width: 12px;
    height: 12px;
  }
  .mini-fan { width: 56px; height: 30px; }
  .mini-card { width: 20px; height: 28px; font-size: 0.55rem; }

  .pile { width: 48px; height: 68px; }
  .full-card { width: 48px; height: 68px; }
  .full-card .corner { font-size: 0.55rem; }
  .full-card .center { font-size: 1.2rem; }
  .stack-card { border-radius: 10px; }
  .deck-count { width: 16px; height: 16px; font-size: 0.5rem; }
  .empty-pile { width: 48px; height: 68px; }

  .hand-card { width: 60px; height: 84px; }
  .hand-card .full-card { width: 60px; height: 84px; }
  .hand-card .full-card .center { font-size: 1.3rem; }

  .hold-slot { width: 76px; }
  .hold-card .full-card { width: 60px; height: 84px; }
}

/* ── Human seat column (avatar + own discard) at left of hand ── */
.human-seat-col {
  position: absolute;
  left: 14px;
  bottom: 8px;
  width: 76px;
  height: 76px;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  z-index: 5;
}

.human-seat-col .seat.seat-human {
  position: static;
  transform: none;
  width: 76px;
}

.human-seat-col .pot-won-badge {
  top: -34px;
}

.human-seat-col .lock-badge {
  top: 4px;
  right: -18px;
}

.human-seat-col .seat-card {
  padding: 2px 2px 0;
}

.human-seat-col .avatar-wrap,
.human-seat-col .avatar-emoji {
  width: 58px;
  height: 58px;
}

.human-seat-col .avatar-emoji {
  font-size: 1.36rem;
}

.human-seat-col .seat-name {
  font-size: 0.78rem;
}

.human-point-meter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  margin-top: 1px;
  color: #ffcf68;
  font-size: 0.66rem;
  font-weight: 800;
  line-height: 1;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.75);
  white-space: nowrap;
}

.human-point-star {
  color: #ffdf6e;
  font-size: 0.74rem;
  line-height: 1;
}

.human-seat-col .seat-pts,
.human-seat-col .seat-note {
  font-size: 0.66rem;
}

.human-discards {
  position: absolute;
  left: 32%;
  bottom: 148px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  pointer-events: none;
  z-index: 5;
}

.human-discard-item {
  margin-left: -28px;
  position: relative;
}

.human-discard-item:first-child {
  margin-left: 0;
}

.human-discard-item.top {
  z-index: 3;
}

.human-discards .seat-discard-card,
.human-discards .my-discard-card {
  width: 42px !important;
  height: 60px !important;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.28);
}

.human-discards .seat-discard-card .center,
.human-discards .my-discard-card .center {
  font-size: 1.1rem !important;
}

.human-discards .seat-discard-card .corner,
.human-discards .my-discard-card .corner {
  font-size: 0.52rem !important;
}

/* ── Seat-side discard (per-player discard pile) ── */
.seat-discard-row {
  position: absolute;
  top: 34px;
  transform: none;
  z-index: 9;
  pointer-events: none;
  display: flex;
  align-items: center;
}

.seat.seat-left .seat-discard-row {
  left: calc(50% + 25px);
  margin-left: 0;
}

.seat.seat-right .seat-discard-row {
  right: calc(50% + 25px);
  left: auto;
  margin-right: 0;
  flex-direction: row-reverse;
}

.seat-discard-stack-item {
  margin-left: -16px;
  position: relative;
}

.seat-discard-stack-item:first-child {
  margin-left: 0;
}

.seat.seat-right .seat-discard-row .seat-discard-stack-item {
  margin-left: 0;
  margin-right: -16px;
}

.seat.seat-right .seat-discard-row .seat-discard-stack-item:first-child {
  margin-right: 0;
}

.seat-discard-stack-item.front {
  z-index: 1;
}

.seat-discard-stack-item.latest {
  z-index: 7;
}

.seat-discard-card {
  width: 42px !important;
  height: 60px !important;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.28);
}

.seat-discard-card .center { font-size: 1.1rem !important; }
.seat-discard-card .corner { font-size: 0.52rem !important; }

.seat-discard-row.takeable {
  pointer-events: auto;
  cursor: pointer;
  z-index: 10;
}

.seat-discard-row.takeable .seat-discard-stack-item.latest .seat-discard-card {
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.55), 0 0 0 3px var(--gold);
  animation: discard-glow 1s ease-in-out infinite;
}

@keyframes discard-glow {
  0%, 100% { filter: drop-shadow(0 0 0 rgba(255, 207, 104, 0.4)); }
  50% { filter: drop-shadow(0 0 8px rgba(255, 207, 104, 0.9)); }
}

/* ── Pot Winner & Lock Badges ── */
.pot-won-badge {
  position: absolute;
  top: -26px;
  left: 50%;
  transform: translateX(-50%);
  padding: 3px 8px;
  background: linear-gradient(135deg, #ff5a6e, #c81e2e);
  color: #fff;
  font-weight: 800;
  font-size: 0.62rem;
  border-radius: 10px;
  text-align: center;
  line-height: 1.1;
  box-shadow: 0 4px 10px rgba(200, 30, 46, 0.5);
  z-index: 5;
  white-space: nowrap;
}

.lock-badge {
  position: absolute;
  top: -10px;
  right: -6px;
  background: linear-gradient(135deg, #ffcf68, #ff9f3c);
  color: #2d1a00;
  font-weight: 800;
  font-size: 0.68rem;
  padding: 2px 6px;
  border-radius: 8px;
  z-index: 5;
  white-space: nowrap;
}

.pot-won-tag {
  display: inline-block;
  padding: 3px 8px;
  margin-bottom: 4px;
  background: linear-gradient(135deg, #ff5a6e, #c81e2e);
  color: #fff;
  font-weight: 800;
  font-size: 0.7rem;
  border-radius: 8px;
}

.lock-tag {
  display: inline-block;
  padding: 3px 8px;
  margin-bottom: 4px;
  background: linear-gradient(135deg, #ffcf68, #ff9f3c);
  color: #2d1a00;
  font-weight: 800;
  font-size: 0.7rem;
  border-radius: 8px;
}

/* Human's own last discard */
.my-discard {
  margin-top: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  flex: 0 0 auto;
}

.my-discard-label {
  display: none;
}

.my-discard-card {
  width: 48px !important;
  height: 68px !important;
}

.my-discard-card .center { font-size: 1.1rem !important; }
.my-discard-card .corner { font-size: 0.55rem !important; }

@media (max-width: 980px) and (max-height: 560px) and (orientation: landscape),
       (max-width: 560px) and (max-height: 980px) and (orientation: portrait) {
  :root {
    --table-lower-offset: 10px;
  }

  html,
  body,
  .screen {
    min-height: var(--viewport-h);
    height: var(--viewport-h);
    max-height: var(--viewport-h);
    overflow: hidden;
  }

  .screen {
    display: grid;
    grid-template-rows: auto minmax(0, 1.45fr) minmax(160px, 0.85fr) auto;
  }

  .topbar {
    gap: 6px;
    padding: 6px 10px;
  }

  .brand-title {
    flex: 0 1 auto;
    max-width: 34vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.94rem;
  }

  .toolbar {
    flex: 1 1 0;
    justify-content: flex-end;
    gap: 6px;
  }

  .setting-group {
    gap: 4px;
  }

  .chip-label {
    gap: 4px;
    padding: 4px 8px;
    font-size: 0.72rem;
  }

  .chip-label input[type="number"] {
    width: 52px !important;
    padding: 2px 4px;
    font-size: 0.72rem;
  }

  .action-btn {
    padding: 6px 12px;
    font-size: 0.74rem;
  }

  .table-area {
    height: auto;
    min-height: 226px;
  }

  .oval-table {
    top: calc(-8px + var(--table-lower-offset));
    width: min(92vw, 820px);
    height: auto;
    border-width: 0;
  }

  .oval-table::after {
    content: none;
  }

  .seat {
    width: 94px;
  }

  .seat-card {
    padding: 4px 2px;
    border-radius: 13px;
  }

  .avatar-wrap,
  .avatar-emoji {
    width: 36px;
    height: 36px;
  }

  .avatar-emoji {
    font-size: 1.08rem;
  }

  .banker-badge {
    width: 16px;
    height: 16px;
    font-size: 0.56rem;
  }

  .seat-name {
    font-size: 0.68rem;
  }

  .seat-pts,
  .seat-note,
  .seat-timer,
  .card-count {
    font-size: 0.58rem;
  }

  .mini-fan {
    width: 58px;
    height: 32px;
    margin-top: 4px;
  }

  .mini-fan.winner-reveal {
    width: 100%;
    min-height: 42px;
    height: auto;
    gap: 2px;
    padding: 0 1px 2px;
  }

  .mini-card {
    width: 21px;
    height: 30px;
    font-size: 0.54rem;
  }

  .mini-fan.winner-reveal .mini-card {
    width: 15px;
    height: 22px;
    font-size: 0.4rem;
  }

  .mini-fan.compact {
    width: 48px;
    height: 34px;
    gap: 4px;
  }

  .mini-card.back.single {
    width: 25px;
    height: 36px;
  }

  .revealed-strip {
    gap: 1px;
    margin: 3px auto 1px;
    max-width: 118px;
  }

  .revealed-strip.winner-reveal {
    flex-direction: column;
    gap: 3px;
    max-width: 100%;
  }

  .revealed-meld.compact {
    gap: 0;
    padding: 1px 2px;
  }

  .revealed-meld.full-reveal {
    gap: 1px;
    padding: 2px 3px;
  }

  .rev-back {
    width: 14px;
    height: 20px;
  }

  .full-card.mini-rev.mini-seat-rev {
    width: 18px;
    height: 26px;
  }

  .full-card.mini-rev.mini-seat-rev .center {
    font-size: 0.58rem;
  }

  .full-card.mini-rev.mini-seat-rev .corner,
  .full-card.mini-rev.mini-seat-rev .joker-corner {
    font-size: 0.28rem;
  }

  .rev-taken {
    min-width: 18px;
    height: 20px;
    padding: 0 3px;
    font-size: 0.62rem;
  }

  .rev-count {
    font-size: 0.62rem;
  }

  .pot-won-badge {
    top: -20px;
    padding: 2px 7px;
    font-size: 0.55rem;
  }

  .human-seat-col .pot-won-badge {
    top: -28px;
  }

  .lock-badge {
    top: -8px;
    right: -4px;
    font-size: 0.56rem;
    padding: 2px 5px;
  }

  .human-seat-col .lock-badge {
    top: 2px;
    right: -16px;
  }

  .center-zone {
    top: calc(50% + 38px);
    transform: translate(-50%, -50%) scale(0.8);
    gap: 3px;
    padding: 3px 5px;
    border-radius: 12px;
  }

  .turn-row {
    gap: 6px;
  }

  .turn-pill,
  .pot-pill {
    padding: 4px 8px;
    font-size: 0.68rem;
  }

  .table-timer {
    width: 30px;
    height: 30px;
    font-size: 0.82rem;
  }

  .pile-row {
    gap: 7px;
  }

  .pile-wrap {
    gap: 3px;
  }

  .pile-label {
    font-size: 0.58rem;
  }

  .center-zone .pile,
  .center-zone .flip-pile,
  .center-zone .empty-pile,
  .center-zone .pile .full-card {
    width: 28px;
    height: 40px;
  }

  .center-zone .full-card {
    border-radius: 8px;
  }

  .center-zone .full-card .corner {
    font-size: 0.36rem;
  }

  .center-zone .full-card .corner.top {
    top: 2px;
    left: 2px;
  }

  .center-zone .full-card .center {
    font-size: 0.76rem;
  }

  .center-coin-pot {
    width: 88px;
    height: 24px;
    transform: scale(0.76);
    transform-origin: top center;
    margin-top: -4px;
  }

  .full-card .corner.bottom {
    right: 3px;
    bottom: 3px;
  }

  .full-card .center {
    font-size: 0.94rem;
  }

  .stack-card,
  .flip-back {
    border-radius: 7px;
    --back-frame-inset: 3px;
    --back-emblem-size: 13px;
  }

  .deck-count {
    width: 15px;
    height: 15px;
    right: -4px;
    bottom: -4px;
    font-size: 0.48rem;
  }

  .info-bar {
    gap: 8px;
    margin-top: 0;
    padding: 3px 8px;
    font-size: 0.68rem;
  }

  .info-chip {
    gap: 4px;
    padding: 3px 8px;
  }

  .timer-chip {
    min-width: 38px;
  }

  .timer-chip strong {
    font-size: 0.8rem;
  }

  .status-chip {
    flex: 1 1 240px;
  }

  .hand-area {
    margin-top: 0;
    min-height: 140px;
    padding: 2px 8px 4px 72px;
    display: grid;
    grid-template-rows: auto 1fr;
    overflow: visible;
  }

  .hand-area .seat.seat-human {
    width: 70px;
  }

  .human-seat-col {
    width: 60px;
    height: 60px;
    left: 10px;
    top: auto;
    bottom: 2px;
    display: flex;
  }

  .human-seat-col .seat.seat-human {
    position: static;
    width: 60px;
  }

  .human-seat-col .avatar-wrap,
  .human-seat-col .avatar-emoji {
    width: 46px;
    height: 46px;
  }

  .human-seat-col .seat-name {
    font-size: 0.68rem;
  }

  .human-point-meter {
    gap: 2px;
    margin-top: 0;
    font-size: 0.56rem;
  }

  .human-point-star {
    font-size: 0.62rem;
  }

  .human-seat-col .seat-pts,
  .human-seat-col .seat-note {
    font-size: 0.58rem;
  }

  .human-discards {
    left: 32%;
    bottom: 118px;
  }

  .human-discard-item {
    margin-left: -18px;
    position: relative;
  }

  .human-discard-item.top {
    z-index: 3;
  }

  .human-discards .seat-discard-card,
  .human-discards .my-discard-card {
    width: 32px !important;
    height: 46px !important;
  }

  .human-discards .seat-discard-card .center,
  .human-discards .my-discard-card .center {
    font-size: 0.86rem !important;
  }

  .human-discards .seat-discard-card .corner,
  .human-discards .my-discard-card .corner {
    font-size: 0.4rem !important;
  }

  .hand-top {
    justify-content: flex-end;
    gap: 4px;
    margin-bottom: 2px;
    min-height: 0;
  }

  .floating-hand-top {
    right: 8px;
    left: auto;
    top: 50%;
    transform: translateY(-50%);
  }

  .inline-hand-top {
    gap: 6px;
    right: 8px;
    bottom: 92px;
    padding: 0;
    transform: none;
  }

  .inline-actions {
    gap: 4px;
  }

  .inline-actions .mini-btn {
    padding: 5px 10px;
    font-size: 0.66rem;
  }

  .inline-actions .image-action-btn {
    width: 74px;
    height: 23px;
    padding: 0;
  }

  .hand-actions {
    gap: 4px;
    margin-left: auto;
  }

  .floating-actions .mini-btn {
    padding: 5px 10px;
    font-size: 0.64rem;
  }

  .my-last-discard {
    padding: 3px 6px;
    min-width: 52px;
    border-radius: 10px;
  }

  .my-last-discard-head {
    font-size: 0.52rem;
  }

  .my-last-discard-card {
    width: 36px !important;
    height: 50px !important;
  }

  .my-last-discard-card .center {
    font-size: 0.92rem !important;
  }

  .my-last-discard-card .corner,
  .my-last-discard-card .joker-corner {
    font-size: 0.4rem !important;
  }

  .mini-btn {
    padding: 4px 10px;
    font-size: 0.68rem;
  }

  .hand-stage {
    grid-row: 1 / -1;
    align-self: end;
    width: 100%;
    gap: 6px;
    min-height: 100px;
    align-items: flex-end;
    padding-top: 6px;
    overflow: visible;
  }

  .hand-side-actions {
    gap: 4px;
    padding-bottom: 2px;
  }

  .hand-side-actions .mini-btn {
    padding: 4px 8px;
    font-size: 0.62rem;
  }

  .human-revealed {
    gap: 6px;
    padding: 4px 8px;
    margin-bottom: 3px;
  }

  .hum-revealed-meld {
    gap: 2px;
    padding: 3px 4px;
  }

  .full-card.mini-rev {
    width: 28px;
    height: 40px;
  }

  .full-card.mini-rev .center {
    font-size: 0.82rem;
  }

  .full-card.mini-rev .corner,
  .full-card.mini-rev .joker-corner {
    font-size: 0.4rem;
  }

  .full-card.mini-rev .joker-art-wrap {
    inset: 5px 4px;
  }

  .hand-fan {
    min-height: 72px;
    margin-top: 4px;
  }

  .hand-card {
    width: 66px;
    height: 94px;
    border-radius: 12px;
  }

  .hand-card .full-card {
    width: 66px;
    height: 94px;
  }

  .hand-card .full-card .corner {
    font-size: 0.66rem;
  }

  .hand-card .full-card .center {
    font-size: 1.45rem;
  }

  .hand-card:hover {
    bottom: 6px;
  }

  .hold-slot {
    width: 58px;
    min-height: 72px;
    padding: 3px;
    border-radius: 14px;
  }

  .hold-slot.dual {
    width: 108px;
  }

  .hold-slot.empty {
    width: 26px;
    border-color: transparent;
    padding: 0;
  }

  .hold-slot strong {
    display: none;
  }

  .hold-slot .rule-note {
    display: none;
  }

  .hold-card {
    margin-top: 4px;
  }

  .hold-card .full-card {
    width: 46px;
    height: 66px;
  }

  .hold-pair {
    gap: 5px;
  }

  .pot-won-tag,
  .lock-tag {
    padding: 2px 6px;
    margin-bottom: 3px;
    font-size: 0.56rem;
  }

  .my-discard {
    margin-top: 4px;
  }

  .my-discard-label {
    display: none;
  }

  .seat-discard-card,
  .my-discard-card {
    width: 32px !important;
    height: 46px !important;
  }

  .human-discards .seat-discard-card,
  .human-discards .my-discard-card {
    width: 32px !important;
    height: 46px !important;
  }

  .human-discards .seat-discard-card .center,
  .human-discards .my-discard-card .center { font-size: 0.86rem !important; }
  .human-discards .seat-discard-card .corner,
  .human-discards .my-discard-card .corner { font-size: 0.4rem !important; }

  .seat-discard-card .center,
  .my-discard-card .center {
    font-size: 0.86rem !important;
  }

  .seat-discard-card .corner,
  .my-discard-card .corner {
    font-size: 0.4rem !important;
  }

  .seat-discard-stack-item {
    margin-left: -12px;
  }

  .seat.seat-right .seat-discard-row .seat-discard-stack-item {
    margin-right: -12px;
  }

  .results-overlay {
    padding: 10px;
  }

  .results-modal {
    max-height: 90svh;
    padding: 18px 14px;
    border-radius: 18px;
  }
}

/* Opponent taken cards sit beside their face-down hand card. */
.seat-card-row {
  position: absolute;
  top: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  max-width: 138px;
  margin: 0;
  overflow: visible;
  z-index: 5;
}

.seat.seat-left .seat-card-row {
  left: calc(50% + 25px);
}

.seat.seat-right .seat-card-row {
  right: calc(50% + 25px);
  flex-direction: row-reverse;
}

.seat-card-row .mini-fan.compact {
  margin: 0;
  flex: 0 0 auto;
  z-index: 3;
}

.seat-card-row .revealed-strip.compact-reveals {
  margin: 0 0 0 -16px;
  max-width: none;
  flex: 0 1 auto;
  overflow: visible;
  gap: 0;
  position: relative;
  z-index: 4;
}

.seat.seat-right .seat-card-row .revealed-strip.compact-reveals {
  margin: 0 -16px 0 0;
}

.seat-card-row .revealed-meld.compact {
  padding: 0;
  border: 0;
  background: transparent;
}

.rev-taken-card {
  position: relative;
  display: inline-flex;
  width: 32px;
  height: 46px;
  flex: 0 0 32px;
}

.rev-taken-card + .rev-taken-card {
  margin-left: -16px;
}

.seat-card-row .revealed-meld.compact + .revealed-meld.compact {
  margin-left: -16px;
}

.rev-taken-card .compact-taken-card {
  width: 32px !important;
  height: 46px !important;
  border-radius: 7px;
}

.rev-taken-card .compact-taken-card .corner,
.rev-taken-card .compact-taken-card .joker-corner {
  font-size: 0.4rem !important;
}

.rev-taken-card .compact-taken-card .center {
  font-size: 0.86rem !important;
}

.rev-taken-card .card-lock-badge {
  left: 50%;
  top: 55%;
  width: 16px;
  height: 16px;
  z-index: 9;
  color: #111;
  filter: drop-shadow(0 1px 2px rgba(255, 255, 255, 0.8)) drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35));
}

.seat-card-row .mini-card.back.single {
  width: 32px;
  height: 46px;
}

html.native-app .seat-card-row,
.screen-force-landscape .seat-card-row {
  gap: 0;
  max-width: 132px;
}

html.native-app .seat-card-row.has-reveals .revealed-strip.compact-reveals,
.screen-force-landscape .seat-card-row.has-reveals .revealed-strip.compact-reveals {
  margin-left: -14px;
}

html.native-app .seat.seat-right .seat-card-row.has-reveals .revealed-strip.compact-reveals,
.screen-force-landscape .seat.seat-right .seat-card-row.has-reveals .revealed-strip.compact-reveals {
  margin-left: 0;
  margin-right: -14px;
}

html.native-app .rev-taken-card,
.screen-force-landscape .rev-taken-card {
  width: 30px;
  height: 42px;
  flex-basis: 30px;
}

html.native-app .rev-taken-card .compact-taken-card,
.screen-force-landscape .rev-taken-card .compact-taken-card {
  width: 30px !important;
  height: 42px !important;
}

html.native-app .seat-card-row .mini-card.back.single,
.screen-force-landscape .seat-card-row .mini-card.back.single {
  width: 30px;
  height: 42px;
}

/* ── Room Select ── */
.room-screen {
  position: relative;
  width: 100%;
  min-height: var(--viewport-h, 100vh);
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(38, 0, 0, 0.22), rgba(25, 0, 0, 0.02)),
    url("../images/rooms/room-background.jpg") center / cover no-repeat;
  color: #fff;
  font-family: "Inter", system-ui, sans-serif;
}

.room-profile {
  position: absolute;
  top: clamp(8px, 2.1vh, 20px);
  right: clamp(14px, 4vw, 72px);
  width: clamp(190px, 24vw, 360px);
  height: clamp(56px, 11vh, 120px);
  display: grid;
  grid-template-columns: 1fr clamp(50px, 7vw, 94px);
  align-items: center;
  gap: clamp(6px, 1vw, 12px);
  padding: 6px;
  padding-left: clamp(22px, 4vw, 58px);
  border-radius: 0 10px 10px 0;
  background: linear-gradient(105deg, #c21b1b 0 28%, rgba(121, 0, 0, 0.92) 29% 100%);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.36);
}

.room-profile-info {
  min-width: 0;
  display: grid;
  gap: 2px;
  justify-items: end;
  text-align: right;
}

.room-profile-info strong {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: clamp(0.88rem, 1.65vw, 1.65rem);
  line-height: 1;
  text-shadow: 0 2px 2px rgba(0, 0, 0, 0.4);
}

.room-profile-money,
.room-league {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  max-width: 100%;
  border-radius: 8px;
  background: rgba(35, 0, 0, 0.72);
  font-weight: 900;
}

.room-profile-money {
  gap: 5px;
  padding: 2px 7px;
  color: #ffe871;
  font-size: clamp(0.78rem, 1.45vw, 1.35rem);
  font-style: italic;
}

.room-profile-money img {
  width: clamp(16px, 2.3vw, 30px);
  height: clamp(16px, 2.3vw, 30px);
}

.room-league {
  padding: 2px 8px;
  color: rgba(255, 255, 255, 0.9);
  font-size: clamp(0.54rem, 1.02vw, 1rem);
}

.room-avatar {
  width: 100%;
  aspect-ratio: 1;
  border: 2px solid rgba(255, 237, 151, 0.9);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.28);
}

.room-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.room-country-list {
  position: absolute;
  left: clamp(12px, 4vw, 92px);
  top: clamp(54px, 16.5vh, 226px);
  width: clamp(190px, 23vw, 480px);
  display: grid;
  gap: clamp(6px, 2vh, 24px);
}

.room-country-btn {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  opacity: 0.74;
  filter: grayscale(0.25) brightness(0.86);
  transition: transform 0.16s ease, filter 0.16s ease, opacity 0.16s ease;
}

.room-country-btn img {
  width: 100%;
  aspect-ratio: 518 / 107;
  display: block;
  object-fit: contain;
  pointer-events: none;
}

.room-country-btn.active,
.room-country-btn:hover {
  opacity: 1;
  filter: none;
  transform: translateX(6px);
}

.room-country-btn.active {
  box-shadow: 0 0 20px rgba(255, 0, 0, 0.42);
}

.room-panel {
  position: absolute;
  left: clamp(235px, 28vw, 800px);
  right: clamp(74px, 20vw, 620px);
  top: clamp(52px, 13vh, 190px);
  bottom: clamp(52px, 12vh, 170px);
  min-width: 390px;
  display: grid;
  grid-template-columns: minmax(190px, 0.95fr) minmax(230px, 1fr);
  border: clamp(2px, 0.35vw, 6px) solid rgba(219, 187, 127, 0.95);
  border-radius: clamp(16px, 2vw, 34px);
  background: rgba(30, 0, 0, 0.72);
  box-shadow: inset 0 0 0 1px rgba(255, 244, 190, 0.16), 0 18px 34px rgba(0, 0, 0, 0.45);
}

.room-country-preview {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border-radius: clamp(12px, 1.5vw, 26px) 0 0 clamp(12px, 1.5vw, 26px);
  border-right: 2px solid rgba(255, 244, 190, 0.9);
}

.room-country-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.room-country-caption {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: min(72%, 340px);
  transform: translateX(-50%);
  padding: clamp(4px, 1.3vh, 14px) 10px clamp(6px, 1.5vh, 18px);
  clip-path: polygon(14% 0, 86% 0, 100% 100%, 0% 100%);
  background: linear-gradient(180deg, #d1bd7e, #8f7144);
  color: rgba(255, 255, 255, 0.94);
  text-align: center;
  font-size: clamp(1rem, 2.3vw, 2.8rem);
  line-height: 1;
  text-shadow: 0 2px 2px rgba(0, 0, 0, 0.35);
}

.room-rate-panel {
  position: relative;
  display: grid;
  align-content: center;
  gap: clamp(10px, 2.5vh, 28px);
  padding: clamp(36px, 8vh, 96px) clamp(22px, 4vw, 86px) clamp(20px, 4vh, 58px);
}

.room-rate-title {
  position: absolute;
  top: 0;
  left: 50%;
  width: clamp(180px, 24vw, 430px);
  transform: translate(-50%, -2px);
  display: block;
  pointer-events: none;
}

.room-rate-list {
  display: grid;
  gap: clamp(9px, 3vh, 36px);
}

.room-rate-btn {
  display: grid;
  grid-template-columns: clamp(34px, 4.6vw, 78px) 1fr;
  align-items: center;
  min-height: clamp(48px, 9.4vh, 124px);
  padding: 0 clamp(20px, 4vw, 62px);
  border: 2px solid rgba(255, 255, 255, 0.68);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.76);
  background: linear-gradient(180deg, #e2e2e2, #8e8e8e);
  box-shadow:
    inset 0 3px 3px rgba(255, 255, 255, 0.65),
    inset 0 -7px 12px rgba(0, 0, 0, 0.2),
    0 7px 14px rgba(0, 0, 0, 0.32);
  cursor: pointer;
  filter: saturate(0.4);
}

.room-rate-btn.active,
.room-rate-btn:hover {
  color: #ffe066;
  border-color: rgba(255, 237, 151, 0.95);
  background: linear-gradient(180deg, #fff6c5, #cc9d36);
  filter: none;
}

.room-rate-btn img {
  width: clamp(34px, 4.6vw, 78px);
  height: clamp(34px, 4.6vw, 78px);
  filter: drop-shadow(0 3px 2px rgba(0, 0, 0, 0.34));
}

.room-rate-btn span {
  min-width: 0;
  overflow: hidden;
  text-align: center;
  white-space: nowrap;
  font-size: clamp(1.15rem, 3.4vw, 4.1rem);
  font-weight: 900;
  font-style: italic;
  line-height: 1;
  text-shadow:
    0 2px 0 rgba(255, 255, 255, 0.28),
    0 4px 5px rgba(0, 0, 0, 0.34);
}

.room-online-panel {
  display: grid;
  gap: clamp(6px, 1.3vh, 12px);
  padding: clamp(8px, 1.5vh, 14px);
  border: 1px solid rgba(255, 229, 149, 0.5);
  border-radius: 8px;
  background: rgba(20, 0, 0, 0.58);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 8px 16px rgba(0, 0, 0, 0.22);
}

.room-online-head,
.room-online-actions,
.room-join-row,
.room-player-list,
.room-online-log {
  display: flex;
  align-items: center;
}

.room-online-head {
  justify-content: space-between;
  gap: 10px;
  color: #fff;
  font-size: clamp(0.7rem, 1vw, 0.95rem);
  font-weight: 900;
  letter-spacing: 0;
}

.room-online-head em {
  max-width: 48%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #d6d6d6;
  font-size: 0.72em;
  font-style: normal;
  text-transform: uppercase;
}

.room-online-head em.status-connected {
  color: #62ff9a;
}

.room-online-head em.status-connecting {
  color: #ffe066;
}

.room-online-head em.status-error {
  color: #ff7676;
}

.room-online-actions,
.room-join-row {
  gap: 7px;
}

.room-online-btn,
.room-join-row input {
  min-height: clamp(28px, 4.5vh, 40px);
  border-radius: 7px;
  font-weight: 900;
  font-size: clamp(0.68rem, 0.95vw, 0.95rem);
}

.room-online-btn {
  flex: 1 1 0;
  border: 1px solid rgba(255, 236, 168, 0.52);
  color: #fff;
  background: linear-gradient(180deg, #575757, #171717);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.18), 0 5px 10px rgba(0, 0, 0, 0.25);
  cursor: pointer;
}

.room-online-btn.primary {
  color: #2b1600;
  background: linear-gradient(180deg, #fff9ba, #d99620);
}

.room-join-row input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0 10px;
  border: 1px solid rgba(255, 236, 168, 0.46);
  color: #fff;
  background: rgba(0, 0, 0, 0.38);
  letter-spacing: 0;
  text-transform: uppercase;
  outline: none;
}

.room-join-row input::placeholder {
  color: rgba(255, 255, 255, 0.56);
}

.room-player-list,
.room-online-log {
  gap: 5px;
  flex-wrap: wrap;
}

.room-player-pill,
.room-online-log span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.36);
}

.room-player-pill {
  padding: 3px 7px;
  color: #fff4bf;
  font-size: clamp(0.62rem, 0.82vw, 0.8rem);
  font-weight: 800;
}

.room-player-pill.self {
  background: rgba(255, 194, 61, 0.24);
  color: #ffe066;
}

.room-online-log span {
  padding: 2px 6px;
  color: rgba(255, 255, 255, 0.7);
  font-size: clamp(0.56rem, 0.74vw, 0.72rem);
}

.room-back-btn {
  position: absolute;
  left: clamp(18px, 3.7vw, 88px);
  bottom: clamp(14px, 3.2vh, 54px);
  width: clamp(120px, 14vw, 310px);
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.room-back-btn img {
  width: 100%;
  display: block;
  pointer-events: none;
}

@media (max-width: 980px) and (orientation: landscape) {
  .room-country-list {
    left: 10px;
    top: 58px;
    width: 188px;
    gap: 7px;
  }

  .room-profile {
    top: 6px;
    right: 10px;
    width: 184px;
    height: 54px;
    grid-template-columns: 1fr 48px;
    padding-left: 18px;
  }

  .room-panel {
    left: 218px;
    right: 24px;
    top: 56px;
    bottom: 34px;
    min-width: 0;
    grid-template-columns: minmax(170px, 0.9fr) minmax(224px, 1fr);
  }

  .room-rate-panel {
    gap: 9px;
    padding: 40px 22px 18px;
  }

  .room-rate-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .room-rate-btn {
    min-height: 42px;
    padding: 0 9px;
    grid-template-columns: 26px 1fr;
  }

  .room-rate-btn img {
    width: 26px;
    height: 26px;
  }

  .room-rate-btn span {
    font-size: 0.94rem;
  }

  .room-rate-title {
    width: 190px;
  }

  .room-online-panel {
    gap: 5px;
    padding: 7px;
  }

  .room-online-btn,
  .room-join-row input {
    min-height: 28px;
    font-size: 0.62rem;
  }

  .room-country-caption {
    font-size: 1rem;
  }

  .room-back-btn {
    width: 116px;
    left: 18px;
    bottom: 10px;
  }
}
