:root {
  --felt-1: #126044;
  --felt-2: #0a4934;
  --felt-edge: #052b20;
  --gold: #d9ad5b;
  --gold-soft: #f3d494;
  --card-bg: #fffdf7;
  --ink: #151915;
  --muted: #a8bbb3;
  --danger: #c3423f;
  --shadow: 0 18px 55px rgba(0, 0, 0, 0.38);
  --radius: 12px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #f3f3f3;
  background:
    radial-gradient(circle at 50% -10%, #21805c 0%, transparent 46%),
    linear-gradient(145deg, var(--felt-2), var(--felt-edge));
  -webkit-font-smoothing: antialiased;
  user-select: none;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .16;
  background-image: repeating-linear-gradient(115deg, transparent 0 3px, #fff 3px 4px);
  mix-blend-mode: soft-light;
}

.screen { display: none; height: 100%; }
.screen.active { display: flex; }

button {
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
  border: none;
  border-radius: var(--radius);
  padding: 10px 16px;
  background: #ffffff14;
  color: inherit;
  transition: transform 0.08s ease, background 0.15s ease, box-shadow 0.15s ease;
}
button:hover { background: #ffffff26; }
button:focus-visible { outline: 3px solid var(--gold-soft); outline-offset: 3px; }
button:active { transform: translateY(1px); }
button.primary {
  background: linear-gradient(180deg, var(--gold-soft), var(--gold));
  color: #3a2b00;
  font-weight: 600;
  box-shadow: var(--shadow);
}
button.primary:hover { filter: brightness(1.05); }
button.ghost { background: transparent; border: 1px solid #ffffff33; }
button.small { padding: 6px 10px; font-size: 0.85rem; }
button.wide { width: 100%; margin-top: 10px; }
button:disabled { opacity: 0.4; cursor: default; }

.hidden { display: none !important; }
.muted { color: var(--muted); }
.language-toggle {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 100;
  min-width: 43px;
  padding: 7px 10px;
  border: 1px solid #d9ad5b55;
  border-radius: 999px;
  background: #071b15e8;
  color: #efd595;
  box-shadow: 0 6px 18px #0007;
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .1em;
}

/* ===================== LANDING ===================== */
#screen-landing {
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  overflow-y: auto;
}
.landing-card {
  width: 100%;
  max-width: 560px;
  background: linear-gradient(145deg, #ffffff12, #ffffff07);
  border: 1px solid #ffffff20;
  border-radius: 26px;
  padding: 38px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  position: relative;
  overflow: hidden;
}
.landing-card::after {
  content: "";
  position: absolute;
  width: 180px; height: 180px;
  border: 1px solid #d9ad5b24;
  border-radius: 50%;
  right: -86px; top: -86px;
  box-shadow: 0 0 0 22px #d9ad5b0a, 0 0 0 48px #d9ad5b08;
  pointer-events: none;
}
.landing-card h1 {
  margin: 0 0 10px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3rem, 11vw, 5rem);
  line-height: .9;
  letter-spacing: -4px;
  font-weight: 500;
}
.brand-mark { display: flex; gap: 5px; color: var(--gold-soft); margin-bottom: 20px; }
.brand-mark span:nth-child(2), .brand-mark span:nth-child(3) { color: #ef8277; }
.eyebrow {
  margin: 0 0 8px;
  color: var(--gold-soft);
  font-size: .72rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  font-weight: 700;
}
.tagline { color: #d2ddd8; margin: 0 0 30px; font-size: 1rem; line-height: 1.5; }

.mode-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.mode-btn {
  display: grid;
  grid-template-columns: 34px 1fr;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 10px;
  padding: 18px;
  text-align: left;
  background: #ffffff14;
  border: 1px solid #ffffff1f;
  min-height: 104px;
}
.mode-btn.primary { box-shadow: 0 12px 30px #0004; }
.mode-icon {
  grid-row: 1 / 3;
  width: 34px; height: 46px;
  border-radius: 6px;
  display: grid; place-items: center;
  color: #3a2b00;
  background: #fff8e8;
  border: 1px solid #9f7a37;
  box-shadow: 2px 3px 0 #7d612f;
  font-size: 1.15rem;
}
.mode-title { font-weight: 700; align-self: end; }
.mode-sub { font-size: 0.78rem; color: var(--muted); line-height: 1.35; align-self: start; }
button.primary .mode-sub { color: #614d21; }

.online-form, .vs-form {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid #ffffff1a;
  animation: fade 0.2s ease;
}
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; } }

.form-row label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 12px;
}
input[type="text"] {
  width: 100%;
  margin-top: 4px;
  padding: 10px 12px;
  font-size: 1rem;
  background: #00000033;
  border: 1px solid #ffffff26;
  border-radius: var(--radius);
  color: inherit;
}
input:focus { outline: 2px solid var(--gold); }
input::placeholder { color: #9fb0a9; }

.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.join-row { display: flex; gap: 6px; margin-left: auto; }
.code-input {
  width: 90px;
  text-transform: uppercase;
  letter-spacing: 2px;
  text-align: center;
}

.capacity-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  font-size: 0.9rem;
  color: var(--muted);
}
.seg {
  display: inline-flex;
  background: #00000033;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid #ffffff26;
}
.seg button {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 8px 14px;
  min-width: 44px;
}
.seg button.active {
  background: var(--gold);
  color: #3a2b00;
  font-weight: 600;
}

.rules {
  margin-top: 22px;
  font-size: 0.88rem;
  color: var(--muted);
}
.rules summary { cursor: pointer; color: var(--gold-soft); }
.rules ol { margin: 10px 0 0; padding-left: 20px; line-height: 1.6; }
.rules li { margin-bottom: 4px; }
.edition-note {
  margin: 20px 0 0;
  text-align: center;
  font-size: .68rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #829a90;
}

/* ===================== LOBBY ===================== */
#screen-lobby {
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.lobby-card {
  width: 100%;
  max-width: 420px;
  background: #ffffff0d;
  border: 1px solid #ffffff1a;
  border-radius: 18px;
  padding: 28px;
  text-align: center;
  box-shadow: var(--shadow);
}
.lobby-card h2 { margin: 0 0 4px; }
.code-pill {
  display: inline-block;
  background: var(--gold);
  color: #3a2b00;
  font-weight: 700;
  letter-spacing: 3px;
  padding: 4px 12px;
  border-radius: 8px;
  margin-left: 6px;
}
.hint { color: var(--muted); margin: 0 0 18px; font-size: 0.9rem; }
.seat-list {
  list-style: none;
  padding: 0;
  margin: 0 0 18px;
  text-align: left;
}
.seat-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #00000022;
  border-radius: var(--radius);
  margin-bottom: 6px;
}
.seat-list .seat-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--muted);
}
.seat-list .seat-dot.human { background: var(--gold); }
.seat-list .seat-dot.bot { background: #5fa8ff; }
.seat-list .seat-name { flex: 1; }
.seat-list .seat-tag { font-size: 0.75rem; color: var(--muted); }

.lobby-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ===================== GAME ===================== */
#screen-game {
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.game-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: linear-gradient(180deg, #071d17e8, #061611b8);
  border-bottom: 1px solid #d9ad5b28;
  box-shadow: 0 8px 28px #0005;
  gap: 8px;
  flex-wrap: wrap;
}
.topbar-left, .topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}
.topbar-right { justify-content: flex-end; }
.turn-banner {
  font-weight: 600;
  font-size: 0.95rem;
  padding: 6px 14px;
  background: #00000033;
  border-radius: 999px;
  border: 1px solid #ffffff1a;
  white-space: nowrap;
}
.turn-banner.your-turn {
  background: var(--gold);
  color: #3a2b00;
  border-color: transparent;
}
.info-pill {
  background: linear-gradient(180deg, #18372eaa, #061611bb);
  padding: 6px 11px;
  border: 1px solid #ffffff13;
  border-radius: 999px;
  box-shadow: inset 0 1px #ffffff0d;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: .03em;
}
.trump-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #d9c8a8;
  font-weight: 700;
}
.trump-symbol {
  width: 27px;
  height: 27px;
  display: inline-grid;
  place-items: center;
  border-radius: 7px;
  background: linear-gradient(145deg, #fff, #e9dfcf);
  border: 1px solid #b9a88e;
  box-shadow: 0 3px 8px #0007, inset 0 0 0 1px #fff;
  font-family: Georgia, serif;
  font-size: 1.35rem;
  line-height: 1;
}
.trump-symbol.red { color: #c81f2d; }
.trump-symbol.black { color: #101411; }

.opponents {
  display: flex;
  justify-content: center;
  gap: 24px;
  padding: 18px 14px 10px;
  flex-wrap: wrap;
}
.opp {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 11px 16px 10px;
  background: linear-gradient(180deg, #102d25d9, #081b16d9);
  border: 1px solid #d9ad5b24;
  border-radius: 16px;
  min-width: 158px;
  box-shadow: 0 12px 30px #0005, inset 0 1px #ffffff0d;
  transition: all 0.15s;
}
.opp.active {
  border-color: var(--gold);
  background: linear-gradient(180deg, #493b1cdd, #1f2419e8);
  box-shadow: 0 0 0 2px #d9ad5b30, 0 14px 38px #0007, inset 0 1px #fff2;
}
.opp.finished { opacity: 0.4; }
.opp .opp-name {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 600;
  font-size: .95rem;
  color: #f7ead0;
  letter-spacing: .01em;
  text-shadow: 0 2px 5px #000;
}
.opp .opp-cards {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 51px;
  min-width: 122px;
  padding-right: 15px;
  position: relative;
}
.opp .mini-back {
  width: 31px;
  height: 44px;
  border-radius: 5px;
  margin-right: -17px;
  background:
    linear-gradient(135deg, transparent 44%, #d6ad6f55 45% 51%, transparent 52%),
    linear-gradient(45deg, transparent 44%, #d6ad6f44 45% 51%, transparent 52%),
    #3a1220;
  background-size: 9px 9px;
  border: 2px solid #efe4ce;
  outline: 1px solid #a77d4a;
  box-shadow: 3px 6px 11px #0009, inset 0 0 0 2px #6f3341;
  position: relative;
  transform: translateY(var(--fan-lift)) rotate(var(--fan-angle));
  transform-origin: 50% 110%;
}
.opp .mini-back::before {
  content: "D";
  position: absolute;
  inset: 5px;
  display: grid;
  place-items: center;
  border: 1px solid #d6ad6f99;
  border-radius: 50% / 35%;
  color: #d9ad5bbb;
  font-family: Georgia, serif;
  font-size: .72rem;
  text-shadow: 0 1px #000;
}
.opp .opp-count {
  position: absolute;
  right: -2px;
  bottom: -4px;
  min-width: 25px;
  height: 25px;
  padding: 0 6px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #f4e6ca;
  color: #261b0e;
  border: 2px solid #a97e43;
  box-shadow: 0 3px 9px #0008;
  font-size: .72rem;
  font-weight: 800;
}
.opp .role-tag {
  font-size: 0.62rem;
  padding: 3px 9px;
  border-radius: 999px;
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-weight: 800;
}
.opp .role-tag.attack { background: #7b2530; color: #ffe7e4; border: 1px solid #d66b71; }
.opp .role-tag.defend { background: #163e57; color: #e0f3ff; border: 1px solid #4f8aae; }
.opp .role-tag.durak { background: var(--gold); color: #3a2b00; font-weight: 700; }

.table-area {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 10px;
  min-height: 140px;
  margin: 0 16px;
  border: 1px solid #d9ad5b22;
  border-radius: 30px;
  background:
    radial-gradient(ellipse at center, #18755366, #062c22cc 68%),
    linear-gradient(90deg, #fff0, #fff1, #fff0);
  box-shadow:
    inset 0 0 70px #0006,
    inset 0 1px #ffffff14,
    0 18px 60px #0004;
}
.table-emblem {
  position: absolute;
  font-family: Georgia, serif;
  font-size: clamp(7rem, 18vw, 13rem);
  color: #d9ad5b0b;
  border: 2px solid #d9ad5b0a;
  width: 1em; height: 1em;
  border-radius: 50%;
  display: grid; place-items: center;
  transform: rotate(-8deg);
}
.table {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 14px;
  max-width: 90%;
  z-index: 1;
}
.table > .muted {
  padding: 9px 15px;
  border: 1px solid #d9ad5b22;
  border-radius: 999px;
  background: #061c16a8;
  color: #b7c9c1;
  box-shadow: inset 0 1px #ffffff0b, 0 7px 20px #0004;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* Visible stock and revealed trump */
.stock {
  position: absolute;
  left: clamp(18px, 5vw, 72px);
  top: 50%;
  width: 112px;
  height: 136px;
  transform: translateY(-50%);
  z-index: 3;
  transition: opacity .2s ease;
}
.stock-pile {
  position: absolute;
  left: 28px;
  top: 0;
  width: 68px;
  height: 98px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: #d9ad5b;
  background:
    linear-gradient(135deg, transparent 44%, #d6ad6f55 45% 51%, transparent 52%),
    linear-gradient(45deg, transparent 44%, #d6ad6f44 45% 51%, transparent 52%),
    #35111e;
  background-size: 12px 12px;
  border: 3px solid #f1e6d1;
  outline: 1px solid #9e733e;
  box-shadow:
    4px -4px 0 -1px #481827,
    7px -7px 0 -1px #eadfc9,
    10px -10px 0 -1px #481827,
    0 14px 24px #0009,
    inset 0 0 0 3px #6e3040;
  z-index: 3;
}
.stock-monogram {
  width: 35px;
  height: 50px;
  border: 1px solid #d9ad5b99;
  border-radius: 50% / 35%;
  display: grid;
  place-items: center;
  font-family: Georgia, serif;
  font-size: 1.25rem;
  text-shadow: 0 2px #000;
}
.stock-trump-slot {
  position: absolute;
  left: -6px;
  top: 0;
  width: 68px;
  height: 98px;
  z-index: 1;
}
.stock-trump-card {
  margin: 0;
  transform: none;
}
.stock-trump-card .corner-br {
  top: -12px;
}
.stock-count {
  position: absolute;
  right: 2px;
  top: 82px;
  min-width: 32px;
  height: 32px;
  padding: 0 7px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #f4e6ca;
  color: #24180b;
  border: 2px solid #a97e43;
  box-shadow: 0 5px 12px #0009;
  font-weight: 900;
  font-size: .78rem;
  z-index: 5;
}
.stock-label {
  position: absolute;
  left: 30px;
  bottom: -4px;
  color: #d9c8a8;
  font-size: .6rem;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
  text-shadow: 0 2px 4px #000;
  z-index: 5;
}
.stock.empty .stock-pile,
.stock.empty .stock-trump-slot { opacity: 0; }
.stock.empty .stock-count {
  right: 35px;
  top: 42px;
  background: #173b30;
  color: #a8bbb3;
  border-color: #ffffff24;
}
.stock.empty .stock-label::after { content: " empty"; }
.bout {
  position: relative;
  display: flex;
  align-items: center;
}
.bout .defense {
  position: absolute;
  left: 18px;
  top: -10px;
  transform: rotate(12deg);
}

/* Cards */
.card {
  width: 68px;
  height: 98px;
  border-radius: 9px;
  background:
    linear-gradient(135deg, #ffffff 0%, #fffdf7 62%, #eee7d9 100%);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 8px 8px 11px;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 800;
  box-shadow:
    0 13px 22px #0008,
    0 2px 4px #0008,
    inset 0 0 0 2px #ffffff,
    inset 0 0 0 3px #d8cdb8;
  position: relative;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  line-height: 1;
  border: 1px solid #9f927d;
}
.card::after {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px solid #b8aa922e;
  border-radius: 5px;
  pointer-events: none;
}
.card.red { color: #a81924; }
.card:not(.red) { color: #111713; }
.card .rank { font-size: 1.18rem; letter-spacing: -.04em; }
.card .suit-big {
  font-size: 2rem;
  text-align: center;
  margin: -4px 0;
}
.card .corner-tl { text-align: left; }
.card .corner-br {
  text-align: right;
  transform: rotate(180deg);
  position: relative;
  top: -12px;
}
.card.back {
  background: repeating-linear-gradient(45deg, #b23, #b23 5px, #811 5px, #811 10px);
  color: transparent;
  border: 2px solid #5a0e0e;
}

.hand .card {
  cursor: pointer;
  margin: 0 -9px;
  transition: transform 0.12s ease, margin 0.12s ease;
}
.hand .card:hover {
  transform: translateY(-18px) rotate(-1deg);
  z-index: 5;
}
.hand .card.playable {
  touch-action: none;
  box-shadow:
    0 0 0 3px #efd48a,
    0 0 24px #d9ad5b88,
    0 16px 28px #0009,
    inset 0 0 0 2px #fff;
}
.hand .card.dragging {
  opacity: .25;
}
.drag-ghost {
  position: fixed !important;
  left: 0;
  top: 0;
  z-index: 1000 !important;
  margin: 0 !important;
  pointer-events: none;
  opacity: .96;
  transform: translate3d(-999px, -999px, 0);
  transition: none !important;
  filter: drop-shadow(0 18px 18px #000a);
}
.table-area.drag-drop-ready {
  border-color: #f0d28499;
  box-shadow:
    inset 0 0 70px #0006,
    inset 0 0 0 3px #d9ad5b24,
    0 0 28px #d9ad5b32;
}
.card.drag-drop-target {
  box-shadow:
    0 0 0 4px #f1d58d,
    0 0 28px #d9ad5baa,
    0 13px 22px #0008;
}
.hand .card.selected {
  transform: translateY(-22px);
  box-shadow: 0 0 0 3px var(--gold-soft), var(--shadow);
  z-index: 6;
}
.hand .card.dim {
  opacity: .62;
  filter: saturate(.65) brightness(.82);
}

.hand-area {
  padding: 5px 14px calc(22px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  background: linear-gradient(180deg, transparent, #03150f88);
  border-top: 1px solid #ffffff08;
}
.hand-meta {
  width: min(640px, calc(100% - 20px));
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 8px;
  color: #a9bdb4;
}
.hand-label {
  display: block;
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.hand-hint {
  display: block;
  margin-top: 3px;
  color: #829c91;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .01em;
}
.hand-count {
  padding: 3px 8px;
  border: 1px solid #d9ad5b2e;
  border-radius: 999px;
  background: #081f18cc;
  color: #e3c98d;
  font-size: .68rem;
  font-weight: 800;
}
.hand {
  display: flex;
  justify-content: center;
  flex-wrap: nowrap;
  overflow-x: auto;
  max-width: 100%;
  /* Keep enough space inside the scroll container for lifted cards and
     their glow; otherwise overflow-x causes the top edge to be clipped. */
  padding: 38px 18px 7px;
  margin-top: -21px;
  filter: drop-shadow(0 14px 16px #0008);
  position: relative;
  z-index: 3;
}

.action-bar {
  display: flex;
  justify-content: center;
  gap: 10px;
  min-height: 42px;
  padding: 5px 14px 7px;
  position: relative;
  z-index: 10;
}
.action-btn {
  min-height: 48px;
  padding: 10px 24px;
  font-weight: 600;
  background: linear-gradient(180deg, #ffffff19, #ffffff09);
  border: 1px solid #d9ad5b33;
  box-shadow: 0 8px 20px #0004, inset 0 1px #ffffff12;
}
.action-btn:disabled { display: none; }

/* Game over overlay */
.game-over {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #00000099;
  backdrop-filter: blur(4px);
  z-index: 20;
}
.go-card {
  background: #ffffff0d;
  border: 1px solid #ffffff1a;
  border-radius: 18px;
  padding: 32px 40px;
  text-align: center;
  box-shadow: var(--shadow);
}
.go-card h2 { margin: 0 0 8px; font-size: 1.8rem; }
.go-card p { margin: 0 0 18px; color: var(--muted); }
.go-card button { margin: 0 6px; }

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #000000dd;
  border: 1px solid #ffffff26;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.9rem;
  z-index: 50;
  animation: fade 0.2s ease;
}
.toast.error { border-color: var(--danger); color: #ffb4b4; }

/* Responsive: shrink cards on small screens */
@media (max-width: 600px) {
  .card { width: 56px; height: 81px; padding: 6px 6px 9px; }
  .card .rank { font-size: 1rem; }
  .card .suit-big { font-size: 1.45rem; }
  .landing-card { padding: 28px 22px; border-radius: 20px; }
  .landing-card h1 { letter-spacing: -2px; }
  .mode-grid { grid-template-columns: 1fr; }
  .mode-btn { min-height: 84px; }
  .turn-banner { font-size: 0.8rem; padding: 5px 10px; }
  .game-topbar {
    display: grid;
    grid-template-columns: 1fr auto;
    padding: 7px 10px 8px;
  }
  .topbar-left {
    min-width: 0;
    justify-content: flex-start;
  }
  .turn-banner {
    grid-column: 2;
    font-size: .72rem;
  }
  .topbar-right {
    grid-column: 1 / -1;
    justify-content: center;
  }
  .table-area { margin: 0 6px; border-radius: 22px; }
  .opponents { gap: 8px; padding: 9px 6px 4px; }
  .opp { min-width: 106px; padding: 8px 10px; }
  .opp .mini-back { width: 20px; height: 29px; margin-right: -12px; }
  .opp .opp-name { font-size: .8rem; }
  .hand .card { margin: 0 -8px; }
  .hand-area { padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px)); }
  .hand-meta { align-items: flex-end; }
  .hand-hint { max-width: 210px; font-size: .62rem; }
  .stock {
    left: 8px;
    width: 72px;
    height: 92px;
    transform: translateY(-50%) scale(.72);
    transform-origin: left center;
  }
  .table { max-width: 76%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
