/* İhale UI. Visual language from the Pubzi template: near-black ground,
   neon lime accent, Days One display type, Chakra Petch body, cut corners. */
:root {
  --bg: #0B0E13;
  --bg-2: #1C1D20;
  --panel: #13161C;
  --panel-2: #191C23;
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.22);
  --text: #ABABAB;
  --white: #FFFFFF;
  --theme: #CBFE1C;
  --theme-deep: #5A7501;
  --theme-soft: rgba(203, 254, 28, 0.12);
  --danger: #FF5468;
  --warn: #FFB547;
  --card-face: #F6F7F1;
  --card-ink: #12151B;
  --card-red: #D7263D;
  --display: "Days One", "Exo 2", sans-serif;
  --body: "Chakra Petch", "Exo 2", system-ui, sans-serif;
  --cut: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 0 100%);
  --cut-sm: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%);
  --radius: 14px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
h1, h2, h3, h4 { font-family: var(--display); color: var(--white); font-weight: 400; margin: 0; text-wrap: balance; line-height: 1.15; }
h1 { font-size: clamp(34px, 9vw, 56px); text-transform: uppercase; }
h2 { font-size: 24px; text-transform: uppercase; }
h3 { font-size: 18px; }
p { margin: 0; }
a { color: var(--theme); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--theme); outline-offset: 2px; }
[hidden] { display: none !important; }
.muted { color: var(--text); font-size: 14px; }
.small { font-size: 13px; }
.accent { color: var(--theme); }
.num { font-variant-numeric: tabular-nums; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 12px; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.center { text-align: center; }
.eyebrow { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--theme); font-weight: 600; }

/* ---------- Buttons ---------- */
.btn {
  position: relative; overflow: hidden; z-index: 0;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 28px; border: 1px solid var(--theme); border-radius: 100px;
  background: var(--theme); color: var(--bg); font-weight: 700; font-size: 16px; text-decoration: none;
  transition: color 0.3s, background 0.3s, transform 0.1s;
}
.btn::after {
  content: ""; position: absolute; inset: 0; background: var(--white); z-index: -1; border-radius: inherit;
  transform: translate3d(0, 101%, 0); transition: transform 0.35s cubic-bezier(0.1, 0, 0.3, 1);
}
@media (hover: hover) { .btn:hover::after { transform: none; } }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn:disabled::after { display: none; }
.btn.block { width: 100%; }
.btn.ghost { background: transparent; color: var(--white); border-color: var(--line-strong); }
.btn.ghost::after { background: var(--theme-soft); }
.btn.danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn.danger::after { background: rgba(255, 84, 104, 0.12); }
.btn.slab {
  border-radius: 0; clip-path: var(--cut-sm);
  background: linear-gradient(90deg, var(--theme) 0%, var(--theme-deep) 100%); border: 0;
}
.btn.slab::after { border-radius: 0; }
.btn.sm { min-height: 40px; padding: 0 18px; font-size: 14px; }
.icon-btn {
  width: 44px; height: 44px; display: inline-grid; place-items: center; flex: none;
  border-radius: 50%; border: 1px solid var(--line); background: var(--panel); color: var(--white); font-size: 17px;
}
.icon-btn:hover { border-color: var(--theme); color: var(--theme); }
.link-btn { background: none; border: 0; color: var(--theme); padding: 8px 0; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Panels ---------- */
.panel {
  background: var(--panel); border: 1px solid var(--line); clip-path: var(--cut);
  padding: 20px; position: relative;
}
.panel.glow { background: radial-gradient(120% 100% at 100% 0%, rgba(203, 254, 28, 0.14), transparent 55%), var(--panel); }
.panel h2 { font-size: 20px; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.list-row:first-child { border-top: 0; }

/* ---------- Forms ---------- */
label.field { display: flex; flex-direction: column; gap: 8px; color: var(--white); font-weight: 600; font-size: 14px; }
.input {
  height: 52px; padding: 0 18px; border-radius: 100px; border: 1px solid var(--line-strong);
  background: var(--bg); color: var(--white); font-size: 16px; width: 100%; min-width: 0;
}
.input:focus { border-color: var(--theme); outline: none; }
.input.code { text-transform: uppercase; letter-spacing: 0.3em; font-family: var(--display); text-align: center; }
.check { display: flex; gap: 12px; align-items: flex-start; color: var(--white); font-size: 15px; }
.check input { width: 22px; height: 22px; accent-color: var(--theme); flex: none; margin: 1px 0 0; }
.error-text { color: var(--danger); font-size: 14px; min-height: 1em; }

/* Segmented control */
.seg { display: flex; padding: 4px; border: 1px solid var(--line); border-radius: 100px; background: var(--bg); gap: 4px; }
.seg button {
  flex: 1; min-height: 40px; border: 0; border-radius: 100px; background: transparent; color: var(--text);
  font-weight: 600; font-size: 14px; padding: 0 10px; white-space: nowrap;
}
.seg button[aria-pressed="true"] { background: var(--theme); color: var(--bg); }
.seg button:disabled { opacity: 0.35; }

/* Toggle switch */
.switch-row { display: flex; align-items: center; gap: 14px; padding: 10px 0; }
.switch-row .txt { flex: 1; min-width: 0; }
.switch-row .txt b { color: var(--white); display: block; font-weight: 600; }
.switch { position: relative; width: 52px; height: 30px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 30px; background: var(--bg-2); border: 1px solid var(--line-strong); transition: 0.2s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--text); transition: 0.2s; }
.switch input:checked + span { background: var(--theme-soft); border-color: var(--theme); }
.switch input:checked + span::after { transform: translateX(22px); background: var(--theme); }
.switch input:focus-visible + span { outline: 2px solid var(--theme); outline-offset: 2px; }

/* ---------- App shell ---------- */
#app { min-height: 100%; }
.screen { max-width: 560px; margin: 0 auto; padding: 16px 16px 40px; display: flex; flex-direction: column; gap: 18px; }
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  display: flex; align-items: center; gap: 10px; padding: 12px 16px;
  background: rgba(11, 14, 19, 0.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.topbar .title { font-family: var(--display); color: var(--white); font-size: 18px; text-transform: uppercase; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logo { font-family: var(--display); color: var(--white); font-size: 26px; letter-spacing: 0.02em; display: inline-flex; align-items: center; gap: 8px; line-height: 1; }
.logo .mark {
  width: 34px; height: 34px; display: grid; place-items: center; background: var(--theme); color: var(--bg);
  clip-path: var(--cut-sm); font-size: 18px;
}
.logo small { display: block; font-family: var(--body); font-size: 10px; letter-spacing: 0.42em; color: var(--theme); margin-top: 4px; font-weight: 600; }
.coin-chip {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px 0 6px; border-radius: 100px;
  background: var(--panel); border: 1px solid var(--line); color: var(--white); font-weight: 700; font-variant-numeric: tabular-nums;
}
.coin { width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--theme); color: var(--bg); font-family: var(--display); font-size: 13px; flex: none; }
.coin.sm { width: 20px; height: 20px; font-size: 10px; }

/* Hero (welcome) */
.hero {
  position: relative; padding: 40px 0 8px; overflow: hidden;
}
.hero::before {
  content: ""; position: absolute; inset: -40% -30% auto auto; width: 120%; height: 140%;
  background: radial-gradient(closest-side, rgba(203, 254, 28, 0.28), transparent 70%); pointer-events: none; z-index: -1;
}
.hero h1 span { color: var(--theme); display: block; }
.hero-fan { position: relative; height: 120px; margin: 8px 0 4px; }
.hero-fan .card { position: absolute; left: 50%; bottom: 0; transform-origin: 50% 120%; }

/* Lobby */
.mode-card { display: flex; flex-direction: column; gap: 14px; }
.mode-card .head { display: flex; gap: 14px; align-items: flex-start; }
.mode-icon { width: 48px; height: 48px; display: grid; place-items: center; flex: none; background: var(--theme-soft); color: var(--theme); font-size: 22px; clip-path: var(--cut-sm); }
.tiers { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.tier {
  border: 1px solid var(--line); background: var(--bg); color: var(--white); padding: 10px 4px; display: flex; flex-direction: column; align-items: center; gap: 4px;
  font-weight: 700; font-variant-numeric: tabular-nums; font-size: 15px; clip-path: var(--cut-sm);
}
.tier small { font-weight: 500; color: var(--text); font-size: 11px; }
.tier[aria-pressed="true"] { border-color: var(--theme); background: var(--theme-soft); color: var(--theme); }
.tier:disabled { opacity: 0.35; }
.bonus-strip { display: flex; align-items: center; gap: 14px; }
.streak { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.streak div { height: 44px; border: 1px solid var(--line); display: grid; place-items: center; font-size: 11px; text-align: center; line-height: 1.2; clip-path: var(--cut-sm); font-variant-numeric: tabular-nums; }
.streak div b { color: var(--white); display: block; font-size: 12px; }
.streak .done { background: var(--theme-soft); border-color: var(--theme-deep); }
.streak .today { border-color: var(--theme); box-shadow: inset 0 0 0 1px var(--theme); }

/* Avatars */
.avatar {
  --av: #CBFE1C; width: 44px; height: 44px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: color-mix(in srgb, var(--av) 18%, var(--bg)); color: var(--av); border: 2px solid color-mix(in srgb, var(--av) 55%, transparent);
  font-size: 18px; position: relative;
}
.avatar.lg { width: 72px; height: 72px; font-size: 30px; }
.avatar-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.avatar-grid button { padding: 0; border: 0; background: none; display: grid; place-items: center; border-radius: 50%; aspect-ratio: 1; }
.avatar-grid button .avatar { width: 100%; height: auto; aspect-ratio: 1; font-size: clamp(16px, 5vw, 22px); }
.avatar-grid button[aria-pressed="true"] .avatar { border-color: var(--white); box-shadow: 0 0 0 3px var(--theme); }

/* Room */
.seat-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.seat-box { border: 1px solid var(--line); padding: 14px; display: flex; flex-direction: column; gap: 10px; min-width: 0; clip-path: var(--cut-sm); background: var(--bg); }
.seat-box.team-a { border-color: rgba(203, 254, 28, 0.4); }
.seat-box.team-b { border-color: rgba(120, 180, 255, 0.4); }
.seat-box .who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.seat-box .who .nm { color: var(--white); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seat-box .acts { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 100px; border: 1px solid var(--line); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; white-space: nowrap; }
.tag.lime { border-color: var(--theme); color: var(--theme); }
.tag.warn { border-color: var(--warn); color: var(--warn); }
.tag.bad { border-color: var(--danger); color: var(--danger); }
.code-big { font-family: var(--display); font-size: 40px; color: var(--theme); letter-spacing: 0.18em; }

/* Matchmaking */
.radar { width: 180px; height: 180px; margin: 10px auto; border-radius: 50%; position: relative; border: 1px solid var(--line); display: grid; place-items: center; }
.radar::before, .radar::after { content: ""; position: absolute; inset: 22%; border-radius: 50%; border: 1px solid var(--line); }
.radar::after { inset: 0; border: 0; background: conic-gradient(from 0deg, rgba(203, 254, 28, 0.35), transparent 30%); animation: spin 2.4s linear infinite; }
.radar b { font-family: var(--display); font-size: 40px; color: var(--white); z-index: 1; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Cards ---------- */
.card {
  --w: 62px; width: var(--w); height: calc(var(--w) * 1.42); border-radius: calc(var(--w) * 0.1);
  background: var(--card-face); color: var(--card-ink); position: relative; flex: none; user-select: none;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.25), 0 8px 18px rgba(0, 0, 0, 0.35); font-family: var(--display);
}
.card.red { color: var(--card-red); }
.card .ix { position: absolute; top: 5%; left: 8%; display: flex; flex-direction: column; align-items: center; line-height: 1; font-size: calc(var(--w) * 0.27); }
.card .ix i { font-style: normal; font-family: system-ui, sans-serif; font-size: calc(var(--w) * 0.24); margin-top: 1px; }
.card .pip { position: absolute; right: 8%; bottom: 4%; font-size: calc(var(--w) * 0.5); line-height: 1; font-family: system-ui, sans-serif; }
.card.back {
  background:
    repeating-linear-gradient(45deg, rgba(203, 254, 28, 0.16) 0 2px, transparent 2px 9px),
    linear-gradient(160deg, #1d2410, #0d1006);
  border: 2px solid var(--theme-deep);
}
.card.back::after { content: "İ"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--theme); font-size: calc(var(--w) * 0.42); }
.card.trumpc::before { content: ""; position: absolute; inset: -1px; border-radius: inherit; box-shadow: inset 0 0 0 2px rgba(203, 254, 28, 0.85); pointer-events: none; }

/* ---------- Game table ---------- */
.game { position: fixed; inset: 0; display: flex; flex-direction: column; overflow: hidden; background: var(--bg);
  padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
.game-top { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--panel); flex: none; }
.game-top .info { flex: 1; min-width: 0; display: flex; gap: 6px; align-items: center; overflow-x: auto; scrollbar-width: none; }
.game-top .info::-webkit-scrollbar { display: none; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: 100px; border: 1px solid var(--line); color: var(--white); font-size: 13px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pill .k { color: var(--text); font-weight: 500; }
.pill.trump { border-color: var(--theme); }
.pill.trump .s { font-size: 18px; line-height: 1; }
.game-top .icon-btn { width: 38px; height: 38px; font-size: 15px; }

.felt {
  flex: 1; position: relative; min-height: 0;
  background:
    radial-gradient(60% 45% at 50% 46%, rgba(203, 254, 28, 0.13), transparent 70%),
    radial-gradient(100% 70% at 50% 50%, #151a12 0%, var(--bg) 75%);
}
.felt::before { content: ""; position: absolute; left: 50%; top: 46%; width: min(70vw, 340px); aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; border: 1px dashed rgba(203, 254, 28, 0.18); }

.opp { position: absolute; display: flex; flex-direction: column; align-items: center; gap: 4px; width: 96px; text-align: center; z-index: 2; }
.opp.top { top: 10px; left: 50%; transform: translateX(-50%); }
.opp.left { left: 6px; top: 34%; }
.opp.right { right: 6px; top: 34%; }
.opp .nm { color: var(--white); font-size: 13px; font-weight: 600; max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opp .sub { display: flex; gap: 4px; justify-content: center; flex-wrap: wrap; }
.mini { display: inline-flex; align-items: center; gap: 3px; height: 20px; padding: 0 7px; border-radius: 100px; font-size: 11px; font-weight: 700; background: var(--panel-2); border: 1px solid var(--line); color: var(--white); font-variant-numeric: tabular-nums; white-space: nowrap; }
.mini.bid { border-color: var(--theme); color: var(--theme); }
.mini.pass { color: var(--text); }
.mini.dealer { background: var(--white); color: var(--bg); border-color: var(--white); }
.mini.state { border-color: var(--warn); color: var(--warn); }
.mini.botc { color: var(--text); }
.seat-av { position: relative; }
.seat-av .ring { position: absolute; inset: -6px; width: calc(100% + 12px); height: calc(100% + 12px); transform: rotate(-90deg); pointer-events: none; }
.seat-av .ring circle { fill: none; stroke-width: 3; }
.seat-av .ring .bgc { stroke: rgba(255, 255, 255, 0.08); }
.seat-av .ring .fg { stroke: var(--theme); stroke-linecap: round; }
.seat-av.active .avatar { box-shadow: 0 0 0 3px var(--theme), 0 0 24px rgba(203, 254, 28, 0.55); }
.seat-av.low .ring .fg { stroke: var(--danger); }
.opp .fan { display: flex; justify-content: center; height: 18px; }
.opp .fan .card { --w: 14px; margin-left: -9px; box-shadow: none; border-width: 1px; }
.opp .fan .card::after { display: none; }

.trick-area { position: absolute; left: 50%; top: 46%; width: 0; height: 0; z-index: 3; }
.trick-area .card { --w: clamp(54px, 15vw, 70px); position: absolute; left: calc(var(--w) / -2); top: calc(var(--w) * -0.71); transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.45s; }
.trick-area .card.p0 { transform: translate(0, 46%); }
.trick-area .card.p1 { transform: translate(62%, 0) rotate(8deg); }
.trick-area .card.p2 { transform: translate(0, -46%); }
.trick-area .card.p3 { transform: translate(-62%, 0) rotate(-8deg); }
.trick-area .card.win { box-shadow: 0 0 0 3px var(--theme), 0 0 30px rgba(203, 254, 28, 0.6); z-index: 5; }
.trick-area .card.from0 { animation: from0 0.35s ease-out; }
.trick-area .card.from1 { animation: from1 0.35s ease-out; }
.trick-area .card.from2 { animation: from2 0.35s ease-out; }
.trick-area .card.from3 { animation: from3 0.35s ease-out; }
@keyframes from0 { from { translate: 0 60vh; } }
@keyframes from1 { from { translate: 50vw 0; } }
@keyframes from2 { from { translate: 0 -40vh; } }
@keyframes from3 { from { translate: -50vw 0; } }
.trick-area.collect .card { opacity: 0; }
.trick-area.collect.to0 .card { transform: translate(0, 300%) scale(0.5); }
.trick-area.collect.to1 .card { transform: translate(300%, 0) scale(0.5); }
.trick-area.collect.to2 .card { transform: translate(0, -300%) scale(0.5); }
.trick-area.collect.to3 .card { transform: translate(-300%, 0) scale(0.5); }

.status-line { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); z-index: 4; max-width: calc(100% - 32px); text-align: center; }
.status-line .msg { display: inline-block; padding: 6px 14px; border-radius: 100px; background: rgba(11, 14, 19, 0.85); border: 1px solid var(--line); color: var(--white); font-size: 14px; font-weight: 600; }
.status-line .msg.go { border-color: var(--theme); color: var(--theme); }

.me-bar { position: relative; display: flex; align-items: center; gap: 10px; padding: 10px 12px 8px; flex: none; border-top: 1px solid var(--line); background: var(--panel); }
.me-bar .nm { color: var(--white); font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-bar .icon-btn { width: 38px; height: 38px; font-size: 15px; }
.me-bar .icon-btn:disabled { opacity: 0.35; }
.me-bar .timer { position: absolute; left: 0; right: 0; top: -1px; height: 3px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.me-bar .timer i { display: block; height: 100%; background: var(--theme); width: 0; }
.me-bar .timer.low i { background: var(--danger); }

.hand { position: relative; height: calc(var(--cw) * 1.42 + 28px); flex: none; --cw: clamp(58px, 17vw, 84px); touch-action: none; }
.hand .card { --w: var(--cw); position: absolute; bottom: 10px; transition: transform 0.18s, filter 0.18s, left 0.25s; cursor: pointer; }
.hand .card.illegal { filter: brightness(0.45) saturate(0.6); cursor: not-allowed; }
.hand .card.legal { box-shadow: 0 0 0 2px var(--theme), 0 8px 18px rgba(0, 0, 0, 0.35); }
.hand .card.sel { transform: translateY(-22px); box-shadow: 0 0 0 3px var(--theme), 0 0 26px rgba(203, 254, 28, 0.55); }
.hand.waiting .card.legal { box-shadow: 0 2px 0 rgba(0, 0, 0, 0.25), 0 8px 18px rgba(0, 0, 0, 0.35); }

/* Bottom sheets and modals */
.sheet-wrap { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; background: rgba(5, 7, 10, 0.55); }
.sheet-wrap.clear { background: transparent; pointer-events: none; }
.sheet-wrap.clear .sheet { pointer-events: auto; }
.sheet-wrap.mid { align-items: center; padding: 16px; }
.sheet {
  width: 100%; max-width: 560px; max-height: 88%; overflow: auto; background: var(--panel); border: 1px solid var(--line-strong);
  border-bottom: 0; padding: 20px 16px calc(20px + env(safe-area-inset-bottom, 0px)); clip-path: var(--cut);
  display: flex; flex-direction: column; gap: 14px; animation: rise 0.25s ease-out;
}
.sheet-wrap.mid .sheet { border-bottom: 1px solid var(--line-strong); padding-bottom: 20px; }
@keyframes rise { from { transform: translateY(30px); opacity: 0; } }
.sheet .head { display: flex; align-items: center; gap: 10px; }
.sheet .head h2 { flex: 1; font-size: 20px; }
.bid-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.bid-grid button {
  height: 52px; border: 1px solid var(--theme-deep); background: var(--bg); color: var(--white); font-family: var(--display); font-size: 20px; clip-path: var(--cut-sm);
}
.bid-grid button:hover { border-color: var(--theme); color: var(--theme); }
.bid-grid button:disabled { opacity: 0.2; }
.suit-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.suit-grid button {
  aspect-ratio: 0.8; border: 1px solid var(--line-strong); background: var(--card-face); color: var(--card-ink); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border-radius: 10px; font-size: 13px; font-weight: 700; font-family: var(--body);
}
.suit-grid button .s { font-size: 40px; line-height: 1; font-family: system-ui, sans-serif; }
.suit-grid button.red { color: var(--card-red); }
.suit-grid button .cnt { font-size: 11px; color: #555; font-weight: 600; }
.suit-grid button:hover:not(:disabled) { box-shadow: 0 0 0 3px var(--theme); }
.suit-grid button:disabled { opacity: 0.3; cursor: not-allowed; }

.result-hero { text-align: center; display: flex; flex-direction: column; gap: 6px; align-items: center; }
.result-hero .big { font-family: var(--display); font-size: 30px; color: var(--white); text-transform: uppercase; }
.result-hero .big.win { color: var(--theme); }
.result-hero .big.bad { color: var(--danger); }
table.scores { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 14px; }
table.scores th, table.scores td { padding: 8px 6px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.scores th:first-child, table.scores td:first-child { text-align: left; }
table.scores th { color: var(--text); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; }
table.scores td { color: var(--white); }
table.scores tr.me td { color: var(--theme); }
table.scores td.neg { color: var(--danger); }
table.scores tfoot td { font-weight: 700; border-bottom: 0; border-top: 2px solid var(--line-strong); }
.table-scroll { overflow-x: auto; }

/* Chat */
.chat-list { display: flex; flex-direction: column; gap: 8px; max-height: 46vh; overflow-y: auto; padding-right: 4px; }
.chat-msg { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; }
.chat-msg .top { display: flex; gap: 8px; align-items: center; font-size: 12px; }
.chat-msg .top b { color: var(--theme); }
.chat-msg .top .acts { margin-left: auto; display: flex; gap: 2px; }
.chat-msg .top .acts button { background: none; border: 0; color: var(--text); font-size: 12px; padding: 4px 6px; }
.chat-msg .top .acts button:hover { color: var(--white); }
.chat-msg .txt { color: var(--white); font-size: 15px; overflow-wrap: anywhere; }
.chat-msg.sys { background: transparent; border-style: dashed; }
.chat-msg.sys .txt { color: var(--text); font-size: 13px; }
.chat-form { display: flex; gap: 8px; }
.badge-dot { position: absolute; top: 4px; right: 4px; width: 9px; height: 9px; border-radius: 50%; background: var(--theme); }
.toast-bubble { position: absolute; z-index: 6; max-width: 150px; padding: 6px 10px; background: var(--white); color: var(--bg); border-radius: 12px; font-size: 12px; font-weight: 600; animation: rise 0.2s; overflow-wrap: anywhere; }

/* Tutorial coach (FR-97) */
.coach {
  flex: none; position: relative; z-index: 9; margin: 8px 10px 0; padding: 12px 14px 14px;
  background: radial-gradient(120% 120% at 100% 0%, rgba(203, 254, 28, 0.14), transparent 60%), var(--panel-2);
  border: 1px solid var(--theme); clip-path: var(--cut-sm); display: flex; flex-direction: column; gap: 6px;
  animation: rise 0.25s ease-out;
}
.coach h3 { font-size: 16px; color: var(--theme); text-transform: uppercase; }
.coach p { color: #e3e6dc; font-size: 14.5px; line-height: 1.45; max-width: 65ch; }
.coach .btn { align-self: flex-start; margin-top: 4px; }
.coach .link-btn { padding: 2px 0; color: var(--text); font-weight: 500; }
.coach-bar { height: 3px; background: rgba(255, 255, 255, 0.08); }
.coach-bar i { display: block; height: 100%; background: var(--theme); transition: width 0.3s; }
.coach.float {
  position: fixed; z-index: 60; left: 10px; right: 10px; top: calc(62px + env(safe-area-inset-top, 0px));
  margin: 0 auto; max-width: 540px;
}
.coach-hl { outline: 2px solid var(--theme); outline-offset: 5px; border-radius: 6px; animation: hl 1.2s ease-in-out infinite; }
@keyframes hl { 50% { outline-color: rgba(203, 254, 28, 0.25); } }
.game.tutorial .hand:not(.waiting) .card.legal:not(.sel) { animation: nudge 1.2s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateY(-10px); } }
.game.tutorial .sheet-wrap.clear .sheet { max-height: 100%; }
.tut-score .sheet-wrap.mid { align-items: flex-end; }
.tut-score .sheet-wrap.mid .sheet { max-height: 55%; }

/* Toasts */
.toasts { position: fixed; left: 50%; top: calc(12px + env(safe-area-inset-top, 0px)); transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
.toast { padding: 12px 16px; background: var(--white); color: var(--bg); font-weight: 600; font-size: 14px; clip-path: var(--cut-sm); animation: rise 0.25s; }
.toast.bad { background: var(--danger); color: var(--white); }
.toast.good { background: var(--theme); color: var(--bg); }

/* Ads */
.ad-box { aspect-ratio: 16 / 10; border: 1px dashed var(--line-strong); display: grid; place-items: center; text-align: center; padding: 20px; color: var(--text); background: repeating-linear-gradient(135deg, transparent 0 12px, rgba(255, 255, 255, 0.03) 12px 24px); }

/* Rules text */
.rules h3 { margin-top: 18px; color: var(--theme); font-size: 16px; text-transform: uppercase; }
.rules p { margin-top: 6px; color: #cfd2c8; max-width: 65ch; }
.rules b { color: var(--white); }

.ledger-row { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.ledger-row .amt { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; }
.ledger-row .amt.pos { color: var(--theme); }
.ledger-row .amt.neg { color: var(--danger); }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { border: 1px solid var(--line); padding: 12px; text-align: center; clip-path: var(--cut-sm); }
.stat b { display: block; font-family: var(--display); color: var(--white); font-size: 22px; font-weight: 400; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12px; }

.loading { min-height: 100vh; display: grid; place-items: center; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--theme); animation: spin 0.8s linear infinite; }
.conn-banner { position: fixed; left: 0; right: 0; top: 0; z-index: 90; background: var(--warn); color: var(--bg); text-align: center; font-weight: 700; font-size: 13px; padding: calc(4px + env(safe-area-inset-top, 0px)) 8px 4px; }

@media (min-width: 720px) {
  .opp.left { left: 24px; }
  .opp.right { right: 24px; }
  .hand { --cw: 84px; }
}
@media (max-height: 640px) {
  .hand { --cw: clamp(48px, 13vw, 64px); }
  .opp.left, .opp.right { top: 26%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
