:root {
  --bg: #06060a;
  --panel: rgba(16, 16, 24, 0.86);
  --panel-2: rgba(28, 28, 40, 0.92);
  --line: rgba(255, 216, 107, 0.22);
  --line-strong: rgba(255, 216, 107, 0.5);
  --gold: #ffd86b;
  --gold-2: #c9a02e;
  --text: #f4f1e8;
  --muted: #9b98a8;
  --red: #ff5f5f;
  --red-2: #b32b2b;
  --blue: #6bd5ff;
  --green: #61ff9f;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.55);
  --radius: 16px;
  --bull-mask: url("bull-v2.svg");
  --bear-mask: url("bear-v2.svg");
}

body.icons-v1 { --bull-mask: url("bull.svg"); --bear-mask: url("bear.svg"); }
body.icons-v3 { --bull-mask: url("bull-v3.svg"); --bear-mask: url("bear-v3.svg"); }

* { box-sizing: border-box; }
html, body {
  margin: 0; width: 100%; height: 100%;
  background: var(--bg); color: var(--text);
  font-family: 'Orbitron', Arial, sans-serif;
  overflow: hidden; -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; }
img { -webkit-user-drag: none; user-select: none; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 11px; }

.bg-layer {
  position: fixed; inset: 0; z-index: 0;
  background: #06060a center/cover no-repeat;
  filter: brightness(.62) saturate(1.05);
  transform: scale(1.04);
}
.bg-layer::after {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(circle at 50% 45%, rgba(255,216,107,.05), transparent 42%),
    linear-gradient(180deg, rgba(3,3,7,.26), rgba(4,4,9,.72));
}

#app { position: relative; z-index: 1; width: 100%; height: 100dvh; }
.screen { position: absolute; inset: 0; display: flex; flex-direction: column; }

/* ================= LOBBY ================= */
.lobby-screen { overflow-y: auto; padding: 16px clamp(14px, 3vw, 40px) 28px; scrollbar-width: thin; }
.topbar { width: min(1180px, 100%); margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; color: #171204; font-weight: 900; font-size: 15px; background: linear-gradient(135deg, #fff2b8, var(--gold), var(--gold-2)); box-shadow: 0 0 24px rgba(255,216,107,.25); }
.brand-title { font-weight: 900; letter-spacing: 2px; font-size: 15px; }
.brand-sub { color: var(--gold); font-size: 10px; letter-spacing: 4px; margin-top: 2px; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.wallet { display: flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: rgba(0,0,0,.45); padding: 8px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; }
.wallet-label { color: var(--muted); font-size: 9px; letter-spacing: 1.5px; }
.gxc-coin { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; color: #221a06; font-size: 11px; font-weight: 900; background: radial-gradient(circle at 32% 28%, #fff6c9, var(--gold) 40%, var(--gold-2) 78%, #6d5210); box-shadow: inset 0 0 4px rgba(255,255,255,.5), 0 0 10px rgba(255,216,107,.25); }
.gxc-coin.small { width: 18px; height: 18px; font-size: 9px; }
.league-badge { border-radius: 999px; padding: 7px 11px; font-size: 10px; font-weight: 800; letter-spacing: 1px; border: 1px solid rgba(255,255,255,.14); white-space: nowrap; }
.league-badge.tiny { padding: 3px 7px; font-size: 8px; margin-left: 6px; }
.league-badge.bronze { color: #ffbf8a; background: rgba(140,82,35,.28); border-color: rgba(255,170,100,.3); }
.league-badge.silver { color: #d9e4f0; background: rgba(120,145,170,.22); border-color: rgba(200,225,255,.25); }
.league-badge.gold { color: #ffe9a1; background: rgba(180,140,35,.24); border-color: rgba(255,216,107,.35); }

.lobby-main { width: min(1180px, 100%); margin: 0 auto; padding-top: clamp(24px, 6vh, 60px); }
.hero-kicker { color: var(--gold); letter-spacing: 4px; font-size: 10px; margin-bottom: 12px; }
.hero h1 { margin: 0; font-size: clamp(38px, 7vw, 84px); line-height: .95; letter-spacing: 1px; font-weight: 900; text-shadow: 0 0 40px rgba(255,216,107,.12); }
.hero h1 span { background: linear-gradient(135deg, #fff6cd 0%, var(--gold) 38%, #a47c18 72%, #ffe9a1 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.hero-text { max-width: 650px; color: #c9c5d4; line-height: 1.65; font-size: clamp(11px, 1.4vw, 14px); margin: 18px 0 24px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.btn { border: 0; cursor: pointer; border-radius: 12px; padding: 14px 18px; display: inline-flex; align-items: center; gap: 12px; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease; }
.btn:active { transform: translateY(1px) scale(.99); }
.btn-icon { font-size: 22px; }
.btn strong { display: block; font-size: 13px; letter-spacing: 1.5px; }
.btn small { display: block; font-size: 9px; opacity: .72; margin-top: 4px; letter-spacing: .6px; }
.btn-primary { color: #1b1404; background: linear-gradient(135deg, #fff0b0, var(--gold) 45%, #d6ab3c); box-shadow: 0 10px 30px rgba(255,216,107,.18); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 38px rgba(255,216,107,.25); }
.btn-primary:disabled { opacity: .38; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-ghost { color: var(--text); background: rgba(255,255,255,.035); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: var(--line-strong); background: rgba(255,216,107,.06); }
.btn-small { padding: 10px 12px; font-size: 10px; letter-spacing: 1px; justify-content: center; }
.link-btn { margin-top: 16px; background: transparent; border: 0; color: var(--muted); font-size: 10px; letter-spacing: 1px; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }
.link-btn:hover { color: var(--gold); }

.lobby-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: clamp(26px, 5vh, 54px); }
.panel { background: var(--panel); border: 1px solid rgba(255,255,255,.07); border-radius: var(--radius); padding: 16px; backdrop-filter: blur(14px); box-shadow: var(--shadow); }
.panel-head { display: flex; justify-content: space-between; gap: 10px; color: var(--gold); font-size: 10px; letter-spacing: 2px; font-weight: 800; margin-bottom: 12px; }
.panel-head .muted { color: var(--muted); letter-spacing: .5px; }
.rules-mini { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 10px; color: #d4d0dd; }
.rules-mini b { color: var(--gold); }
.market-preview { display: flex; align-items: center; justify-content: center; gap: 34px; padding: 6px 0 4px; }
.market-glyph { width: clamp(44px, 6vw, 68px); height: clamp(44px, 6vw, 68px); }
.market-glyph.bull { filter: drop-shadow(0 0 18px rgba(255,216,107,.3)); }
.market-glyph.bear { filter: drop-shadow(0 0 18px rgba(255,95,95,.32)); }

/* Shared silhouette masks */
.trend-glyph, .market-glyph, .explosion-glyph, .trend-watermark {
  display: block;
  background: currentColor;
  -webkit-mask-position: center;
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-position: center;
  mask-size: contain;
  mask-repeat: no-repeat;
}
.trend-glyph.bull, .market-glyph.bull, .explosion-glyph.bull, .trend-watermark.bull {
  -webkit-mask-image: var(--bull-mask);
  mask-image: var(--bull-mask);
  color: var(--gold);
}
.trend-glyph.bear, .market-glyph.bear, .explosion-glyph.bear, .trend-watermark.bear {
  -webkit-mask-image: var(--bear-mask);
  mask-image: var(--bear-mask);
  color: #ff7b7b;
}
.trend-glyph { width: 24px; height: 24px; }
.trend-question { display: none; font-size: 20px; color: var(--muted); line-height: 1; }
.hidden-trend .trend-question { display: block; }
.hidden-trend .trend-glyph { display: none; }
.market-note { font-size: 9px; line-height: 1.55; margin-top: 8px; }
.collection-summary { display: flex; gap: 12px; align-items: center; }
.collection-thumb { width: 66px; height: 84px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); flex: 0 0 auto; }
.collection-thumb img { width: 100%; height: 100%; object-fit: cover; }
.collection-info { flex: 1; font-size: 11px; line-height: 1.6; }
.mini-progress { height: 4px; background: rgba(255,255,255,.06); border-radius: 99px; margin-top: 7px; overflow: hidden; }
.mini-progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--gold-2), var(--gold)); }
.quick-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.quick-btn { background: rgba(255,255,255,.035); border: 1px solid rgba(255,255,255,.07); color: var(--text); border-radius: 10px; padding: 12px 6px; display: grid; gap: 6px; justify-items: center; font-size: 18px; cursor: pointer; transition: .18s ease; }
.quick-btn span { font-size: 8px; letter-spacing: 1px; color: var(--muted); }
.quick-btn:hover { border-color: var(--line-strong); background: rgba(255,216,107,.06); }
.next-event { font-size: 9px; color: var(--muted); margin-top: 12px; letter-spacing: .5px; }
.next-event b { color: var(--gold); }
.lobby-footer { margin-top: 22px; color: #5d596d; font-size: 8px; letter-spacing: 1px; text-align: center; }

/* ================= SELECTION ================= */
.selection-screen { padding: 10px clamp(8px, 2vw, 22px) max(10px, env(safe-area-inset-bottom)); gap: 8px; }
.selection-title { min-width: 0; }
.selection-title .match-mode { font-size: 9px; letter-spacing: 2px; color: var(--gold); font-weight: 800; }
.selection-title .match-collection { font-size: 10px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-box { margin-left: auto; display: flex; align-items: center; gap: 10px; background: rgba(0,0,0,.42); border: 1px solid var(--line); border-radius: 999px; padding: 7px 12px; font-size: 9px; letter-spacing: .5px; color: var(--muted); white-space: nowrap; }
.search-box b { color: var(--gold); font-size: 11px; }
.selection-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.selection-tabs { display: flex; gap: 6px; }
.sel-tab { border: 1px solid rgba(255,255,255,.08); background: rgba(0,0,0,.35); color: var(--muted); border-radius: 999px; padding: 8px 13px; font-size: 9px; letter-spacing: 1px; cursor: pointer; font-weight: 700; }
.sel-tab b { color: inherit; margin-left: 5px; }
.sel-tab.active { color: #1d1605; background: var(--gold); border-color: var(--gold); }
.selection-hint { font-size: 9px; color: var(--muted); line-height: 1.4; }
.selection-filters { display: flex; gap: 5px; flex-wrap: wrap; }
.sel-filter { border: 1px solid rgba(255,255,255,.08); background: rgba(0,0,0,.32); color: var(--muted); border-radius: 999px; padding: 5px 9px; font-size: 8px; letter-spacing: .5px; cursor: pointer; }
.sel-filter.active { color: #1d1605; background: var(--gold); border-color: var(--gold); font-weight: 800; }
.selection-grid { flex: 1; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 7px; padding: 3px 2px 10px; scrollbar-width: thin; }
.selection-card { position: relative; border-radius: 8px; overflow: hidden; border: 1px solid rgba(255,255,255,.1); background: #15151c; aspect-ratio: 2 / 2.9; cursor: pointer; transition: transform .15s ease, border-color .15s ease, opacity .15s ease; }
.selection-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.selection-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 45%, rgba(0,0,0,.88)); pointer-events: none; }
.selection-card .sc-cost { position: absolute; top: 4px; left: 4px; z-index: 3; font-size: 10px; font-weight: 900; background: var(--gold); color: #211a06; border-radius: 4px; padding: 1px 5px; }
.selection-card .sc-name { position: absolute; left: 4px; right: 4px; bottom: 4px; z-index: 3; font-size: 6px; color: #fff; text-shadow: 0 1px 3px #000; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.selection-card .sc-badge { position: absolute; top: 4px; right: 4px; z-index: 4; font-size: 7px; font-weight: 900; letter-spacing: .5px; border-radius: 4px; padding: 2px 4px; background: var(--green); color: #05220f; display: none; }
.selection-card.selected-main { border-color: var(--green); box-shadow: 0 0 0 1px rgba(97,255,159,.35), 0 0 16px rgba(97,255,159,.2); }
.selection-card.selected-main .sc-badge { display: block; background: var(--green); }
.selection-card.selected-tb { border-color: var(--red); box-shadow: 0 0 0 1px rgba(255,95,95,.4), 0 0 16px rgba(255,95,95,.22); }
.selection-card.selected-tb .sc-badge { display: block; background: var(--red); color: #fff; }
.selection-card:hover { transform: translateY(-3px); }
.selection-footer { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; padding-top: 4px; }
.selection-footer .btn { flex: 0 1 auto; min-width: 120px; }

/* ================= MATCH ================= */
.match-screen { padding: 8px clamp(8px, 2vw, 22px) max(8px, env(safe-area-inset-bottom)); gap: 6px; background: linear-gradient(180deg, rgba(4,4,8,.24), rgba(8,8,14,.72)); }
.match-top { display: flex; align-items: center; gap: 10px; min-height: 40px; }
.icon-btn { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line); background: rgba(0,0,0,.4); color: var(--gold); font-size: 16px; cursor: pointer; flex: 0 0 auto; }
.icon-btn:hover { background: rgba(255,216,107,.08); }
.match-title { min-width: 0; }
.match-mode { font-size: 9px; letter-spacing: 2px; color: var(--gold); font-weight: 800; }
.match-collection { font-size: 10px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.match-round { margin-left: auto; text-align: right; font-size: 9px; color: var(--muted); letter-spacing: 1px; }
.round-pips { display: flex; gap: 2px; justify-content: flex-end; margin-top: 4px; max-width: 150px; flex-wrap: wrap; }
.round-pips i { width: 5px; height: 3px; border-radius: 9px; background: rgba(255,255,255,.1); }
.round-pips i.done { background: var(--gold-2); }
.round-pips i.now { background: var(--gold); box-shadow: 0 0 8px rgba(255,216,107,.6); }
.match-wallet { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; color: var(--gold); border: 1px solid var(--line); border-radius: 999px; padding: 6px 10px; background: rgba(0,0,0,.35); }
.timer-strip { position: relative; height: 5px; border-radius: 99px; background: rgba(255,255,255,.06); overflow: hidden; flex: 0 0 auto; }
.timer-fill { height: 100%; width: 100%; background: linear-gradient(90deg, var(--green), var(--gold), var(--red)); transition: width .4s linear; }
.timer-badge { display: inline-block; margin-left: 7px; padding: 1px 6px; border-radius: 999px; background: rgba(0,0,0,.42); border: 1px solid var(--line); color: var(--gold); font-size: 8px; letter-spacing: 1px; vertical-align: 1px; }

/* trend bar */
.trend-bar { display: flex; align-items: center; gap: 10px; padding: 7px 11px; border-radius: 12px; border: 1px solid var(--line); background: linear-gradient(90deg, rgba(255,216,107,.09), rgba(0,0,0,.4)); flex: 0 0 auto; transition: border-color .25s ease, background .25s ease; }
.trend-bar.bull { border-color: rgba(255,216,107,.55); box-shadow: 0 0 22px rgba(255,216,107,.12) inset; }
.trend-bar.bear { border-color: rgba(255,95,95,.55); background: linear-gradient(90deg, rgba(255,95,95,.1), rgba(0,0,0,.4)); box-shadow: 0 0 22px rgba(255,95,95,.12) inset; }
.trend-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-size: 23px; background: rgba(0,0,0,.4); border: 1px solid rgba(255,255,255,.08); flex: 0 0 auto; }
.trend-copy { display: grid; gap: 2px; min-width: 0; }
.trend-copy strong { font-size: 10px; letter-spacing: 1.5px; color: var(--gold); }
.trend-bar.bear .trend-copy strong { color: #ff9b9b; }
.trend-copy span { font-size: 8px; color: var(--muted); letter-spacing: .5px; }
.trend-side { margin-left: auto; text-align: right; display: grid; gap: 2px; }
.trend-side span { font-size: 10px; font-weight: 800; color: var(--text); }
.trend-side small { font-size: 6px; color: var(--muted); letter-spacing: 1px; }
.hidden-trend { border-color: rgba(255,255,255,.12); background: rgba(0,0,0,.45); }
.hidden-trend .trend-icon { color: var(--muted); }

.opponent-zone { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 10px; border: 1px solid rgba(255,255,255,.055); background: rgba(255,255,255,.018); border-radius: 12px; flex: 0 0 auto; }
.opponent-info { display: flex; align-items: center; gap: 9px; min-width: 0; }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08); flex: 0 0 auto; }
.avatar.bot { background: rgba(255,95,95,.09); border-color: rgba(255,95,95,.2); }
.avatar.you { background: rgba(107,213,255,.09); border-color: rgba(107,213,255,.2); }
.opponent-name, .player-name { font-size: 10px; font-weight: 800; letter-spacing: 1px; white-space: nowrap; }
.opponent-sub { font-size: 8px; color: var(--muted); margin-top: 3px; letter-spacing: .5px; }
.bot-hand { display: flex; gap: 3px; align-items: center; flex-wrap: nowrap; overflow: hidden; }
.card-back { width: 24px; height: 34px; border-radius: 5px; border: 1px solid rgba(255,216,107,.28); background: url("https://ik.imagekit.io/r5wb3cgeg/cardbacks/anime_heroes_back.jpg?tr=w-80,h-112,fo-auto,q-60") center/cover; box-shadow: 0 2px 8px rgba(0,0,0,.4); flex: 0 0 auto; }

.table-zone { flex: 1; min-height: 0; border: 1px solid rgba(255,216,107,.1); border-radius: 18px; background: radial-gradient(ellipse at 50% 45%, rgba(255,216,107,.06), transparent 60%), linear-gradient(180deg, rgba(12,12,18,.72), rgba(7,7,11,.86)); display: flex; flex-direction: column; justify-content: center; gap: 6px; padding: 8px 12px; position: relative; overflow: hidden; }
.debt-row { display: flex; align-items: center; gap: 8px; position: relative; z-index: 3; }
.debt-label { font-size: 7px; letter-spacing: 1.5px; color: var(--muted); width: 82px; flex: 0 0 auto; }
.debt-track { height: 6px; border-radius: 99px; background: rgba(255,255,255,.07); overflow: hidden; flex: 1; }
.debt-fill { display: block; height: 100%; width: 0%; background: linear-gradient(90deg, var(--gold-2), var(--red)); transition: width .6s ease; }
.debt-fill.bot { background: linear-gradient(90deg, #4e6dff, var(--blue)); }
.debt-value { width: 42px; text-align: right; font-size: 11px; font-weight: 800; color: var(--gold); flex: 0 0 auto; }
.debt-row:last-of-type .debt-value { color: var(--blue); }
.table-center { display: flex; align-items: center; justify-content: center; gap: clamp(10px, 4vw, 34px); position: relative; min-height: 130px; z-index: 3; }
.slot { width: clamp(82px, 10vw, 108px); height: clamp(116px, 14vw, 150px); border-radius: 10px; border: 1px dashed rgba(255,255,255,.12); display: grid; place-items: center; position: relative; background: rgba(255,255,255,.015); }
.slot-placeholder { font-size: 7px; letter-spacing: 1px; color: rgba(255,255,255,.18); text-align: center; padding: 6px; }
.vs { font-size: 11px; font-weight: 900; color: var(--gold-2); letter-spacing: 1px; opacity: .7; }
.round-result { position: absolute; left: 50%; top: -4px; transform: translate(-50%, -100%); padding: 5px 12px; border-radius: 999px; background: rgba(0,0,0,.72); border: 1px solid var(--line); color: var(--gold); font-size: 9px; letter-spacing: 2px; white-space: nowrap; z-index: 8; }
.round-result.lose { color: var(--red); border-color: rgba(255,95,95,.4); }
.round-result.draw { color: var(--muted); }
.trend-watermark { position: absolute; left: -1%; top: 18%; width: clamp(140px, 22vw, 240px); height: clamp(140px, 22vw, 240px); opacity: .08; pointer-events: none; z-index: 1; transition: opacity .4s; }
.trend-watermark.bull { opacity: .1; }
.trend-watermark.bear { opacity: .11; }

.player-zone { padding: 7px 10px 4px; border: 1px solid rgba(255,255,255,.055); background: rgba(255,255,255,.018); border-radius: 12px; flex: 0 0 auto; }
.player-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.player-info { display: flex; align-items: center; gap: 9px; min-width: 0; }
.player-actions { display: flex; gap: 6px; align-items: center; }
.btn-allin { border: 1px solid rgba(255,95,95,.45); background: linear-gradient(180deg, rgba(255,95,95,.18), rgba(120,20,20,.2)); color: #ffb3b3; border-radius: 8px; padding: 8px 10px; font-size: 8px; font-weight: 900; letter-spacing: 1.5px; cursor: pointer; transition: .18s ease; white-space: nowrap; }
.btn-allin:hover { box-shadow: 0 0 18px rgba(255,95,95,.35); transform: translateY(-1px); }
.btn-allin.active { background: linear-gradient(180deg, #ff6b6b, #a31e1e); color: #fff; animation: pulse 1s infinite; }
.btn-allin:disabled { opacity: .25; cursor: not-allowed; box-shadow: none; transform: none; animation: none; }
.btn-collection { border: 1px solid var(--line); background: rgba(0,0,0,.3); color: var(--gold); border-radius: 8px; padding: 8px 10px; font-size: 8px; font-weight: 800; letter-spacing: 1px; cursor: pointer; white-space: nowrap; }
.btn-collection:hover { background: rgba(255,216,107,.08); }

.selected-bar { margin: 6px 0 0; padding: 6px 9px; border-radius: 8px; border: 1px solid rgba(97,255,159,.3); background: rgba(97,255,159,.06); color: var(--green); font-size: 9px; letter-spacing: .5px; display: flex; justify-content: space-between; gap: 8px; }
.selected-bar b { color: #fff; }
.hand { display: flex; justify-content: center; gap: clamp(4px, .8vw, 9px); padding: 8px 0 4px; overflow-x: auto; scrollbar-width: none; min-height: 104px; align-items: flex-end; }
.hand::-webkit-scrollbar { display: none; }
.hand-controls { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.hand-hint { font-size: 8px; color: var(--muted); letter-spacing: .5px; line-height: 1.4; }
#selected-bar, #play-btn { display: none !important; }
.turn-label { display: inline-block; margin-left: 5px; padding: 2px 6px; border-radius: 999px; background: rgba(97,255,159,.1); border: 1px solid rgba(97,255,159,.3); color: var(--green); font-size: 7px; letter-spacing: 1px; vertical-align: 1px; }
.turn-label.bot { background: rgba(255,95,95,.1); border-color: rgba(255,95,95,.3); color: #ff9b9b; }
.btn-play { padding: 10px 16px; font-size: 10px; letter-spacing: 1.5px; border-radius: 9px; }
.btn-play:disabled { cursor: not-allowed; }
.btn-play.ready { animation: playPulse 1.1s infinite; }
@keyframes playPulse { 0%,100% { box-shadow: 0 0 0 0 rgba(255,216,107,.38); } 50% { box-shadow: 0 0 0 9px rgba(255,216,107,0); } }

/* cards */
.card { position: relative; width: 84px; height: 120px; border-radius: 9px; overflow: hidden; border: 1px solid rgba(255,255,255,.16); background: #15151c; flex: 0 0 auto; cursor: pointer; transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease; box-shadow: 0 8px 18px rgba(0,0,0,.4); touch-action: manipulation; }
.card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.05) 0%, transparent 45%, rgba(0,0,0,.82) 100%); pointer-events: none; }
.card-cost { position: absolute; top: 5px; left: 5px; z-index: 3; min-width: 24px; height: 24px; padding: 0 5px; border-radius: 7px; display: grid; place-items: center; background: linear-gradient(135deg, #fff0b0, var(--gold), #b78b1f); color: #221a06; font-size: 12px; font-weight: 900; box-shadow: 0 2px 8px rgba(0,0,0,.45); }
.card-name { position: absolute; left: 5px; right: 5px; bottom: 5px; z-index: 3; font-size: 7px; font-weight: 700; letter-spacing: .4px; color: #fff; text-shadow: 0 1px 3px #000; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card:hover { transform: translateY(-5px); border-color: rgba(255,216,107,.45); }
.card.selected { transform: translateY(-12px) scale(1.04); border-color: var(--gold); box-shadow: 0 0 0 1px rgba(255,216,107,.35), 0 18px 34px rgba(0,0,0,.55), 0 0 22px rgba(255,216,107,.28); }
.card.selected::before { content: "✓"; position: absolute; top: 5px; right: 5px; z-index: 4; width: 19px; height: 19px; border-radius: 50%; display: grid; place-items: center; background: var(--green); color: #05220f; font-size: 11px; font-weight: 900; box-shadow: 0 2px 8px rgba(0,0,0,.45); }
.card.blocked { opacity: .3; filter: grayscale(.8); cursor: not-allowed; }
.card.blocked:hover { transform: none; border-color: rgba(255,255,255,.16); }
.card.blocked::before { content: "✕"; position: absolute; top: 5px; right: 5px; z-index: 4; width: 19px; height: 19px; border-radius: 50%; display: grid; place-items: center; background: var(--red); color: #fff; font-size: 11px; font-weight: 900; box-shadow: 0 2px 8px rgba(0,0,0,.45); }
.collection-card.blocked { opacity: .3; filter: grayscale(1); cursor: not-allowed; border-color: rgba(255,95,95,.35); }
.collection-card.blocked:hover { transform: none; border-color: rgba(255,95,95,.35); }
.table-card { width: 100%; height: 100%; border-radius: 10px; animation: reveal .42s cubic-bezier(.2,.9,.25,1.2) both; }
.table-card.win { border-color: var(--green); box-shadow: 0 0 26px rgba(97,255,159,.28); }
.table-card.lose { border-color: var(--red); box-shadow: 0 0 26px rgba(255,95,95,.28); filter: saturate(.7) brightness(.75); }
.table-card .card-name { font-size: 8px; }

/* drawer */
.drawer-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.62); backdrop-filter: blur(3px); z-index: 40; }
.drawer { position: fixed; top: 0; right: 0; height: 100dvh; width: min(440px, 94vw); background: linear-gradient(180deg, rgba(20,20,28,.98), rgba(9,9,14,.99)); border-left: 1px solid var(--line); z-index: 50; transform: translateX(102%); transition: transform .28s cubic-bezier(.2,.8,.2,1); display: flex; flex-direction: column; padding: 16px 14px 12px; box-shadow: -20px 0 60px rgba(0,0,0,.55); }
.drawer.open { transform: translateX(0); }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.drawer-title { font-size: 12px; font-weight: 900; letter-spacing: 2px; color: var(--gold); }
.drawer-sub { font-size: 9px; margin-top: 4px; }
.drawer-note { margin-top: 10px; padding: 8px 9px; border-radius: 8px; border: 1px solid rgba(255,216,107,.13); background: rgba(255,216,107,.045); color: #918d9f; font-size: 8px; line-height: 1.55; }
.drawer-filters { display: flex; gap: 6px; margin: 12px 0 10px; flex-wrap: wrap; }
.filter { border: 1px solid rgba(255,255,255,.08); background: rgba(255,255,255,.03); color: var(--muted); border-radius: 999px; padding: 6px 10px; font-size: 8px; letter-spacing: 1px; cursor: pointer; }
.filter.active { color: #1d1605; background: var(--gold); border-color: var(--gold); font-weight: 800; }
.collection-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(66px, 1fr)); gap: 7px; overflow-y: auto; padding: 2px 2px 10px; scrollbar-width: thin; flex: 1; }
.collection-card { position: relative; border-radius: 7px; overflow: hidden; border: 1px solid rgba(255,255,255,.1); background: #15151c; aspect-ratio: 2 / 2.9; cursor: pointer; }
.collection-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.collection-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 45%, rgba(0,0,0,.88)); }
.collection-card .cc-cost { position: absolute; top: 3px; left: 3px; z-index: 3; font-size: 9px; font-weight: 900; background: var(--gold); color: #211a06; border-radius: 4px; padding: 1px 4px; }
.collection-card .cc-status { position: absolute; left: 3px; right: 3px; bottom: 3px; z-index: 3; font-size: 6px; letter-spacing: .4px; color: #fff; text-align: center; }
.collection-card.hand { border-color: var(--green); box-shadow: 0 0 12px rgba(97,255,159,.25); }
.collection-card.played { opacity: .35; filter: grayscale(1); cursor: not-allowed; }
.collection-card.panel { opacity: .85; }
.collection-card:hover { border-color: rgba(255,216,107,.45); }
.drawer-legend { display: flex; gap: 12px; justify-content: center; padding-top: 8px; font-size: 7px; color: var(--muted); border-top: 1px solid rgba(255,255,255,.06); }
.drawer-legend span { display: inline-flex; align-items: center; gap: 4px; }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.dot.hand { background: var(--green); }
.dot.deck { background: #8e8a9c; }
.dot.played { background: #4a4757; }

/* trend explosion */
.trend-explosion { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; align-content: center; gap: 6px; pointer-events: none; background: radial-gradient(circle at 50% 50%, rgba(0,0,0,.15), rgba(0,0,0,.55)); animation: explosionFade 1.5s ease forwards; }
.trend-explosion.hidden { display: none; }
.explosion-rays { position: absolute; width: 30vmin; height: 30vmin; border-radius: 50%; background: repeating-conic-gradient(from 0deg, rgba(255,216,107,.45) 0deg 8deg, transparent 8deg 24deg); filter: blur(1px); animation: rays 1.2s ease-out forwards; }
.trend-explosion.bear .explosion-rays { background: repeating-conic-gradient(from 0deg, rgba(255,95,95,.45) 0deg 8deg, transparent 8deg 24deg); }
.explosion-animal { width: min(30vmin, 260px); height: min(30vmin, 260px); line-height: 1; animation: animalPop .7s cubic-bezier(.2,1.4,.3,1) both; position: relative; z-index: 2; }
.explosion-glyph { width: 100%; height: 100%; background: linear-gradient(135deg, #fff2b8, var(--gold) 45%, #a47c18); filter: drop-shadow(0 0 38px rgba(255,216,107,.55)); }
.trend-explosion.bear .explosion-glyph { background: linear-gradient(135deg, #ffd0d0, #ff5f5f 45%, #7a1c1c); filter: drop-shadow(0 0 38px rgba(255,95,95,.6)); }
.explosion-title { font-size: clamp(18px, 4vw, 34px); font-weight: 900; letter-spacing: 5px; color: var(--gold); text-shadow: 0 0 30px rgba(255,216,107,.5); position: relative; z-index: 2; }
.trend-explosion.bear .explosion-title { color: #ff9b9b; text-shadow: 0 0 30px rgba(255,95,95,.5); }
.explosion-sub { font-size: 10px; letter-spacing: 2px; color: var(--muted); position: relative; z-index: 2; }
@keyframes explosionFade { 0% { opacity: 0; } 12% { opacity: 1; } 78% { opacity: 1; } 100% { opacity: 0; } }
@keyframes animalPop { 0% { transform: scale(.3) rotate(-8deg); opacity: 0; } 60% { transform: scale(1.08) rotate(2deg); opacity: 1; } 100% { transform: scale(1) rotate(0); } }
@keyframes rays { 0% { transform: scale(.2) rotate(0); opacity: 0; } 30% { opacity: 1; } 100% { transform: scale(2.2) rotate(30deg); opacity: 0; } }

/* modal */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 18px; background: rgba(0,0,0,.72); backdrop-filter: blur(5px); }
.modal-box { width: min(440px, 100%); background: linear-gradient(180deg, rgba(28,28,38,.98), rgba(10,10,16,.99)); border: 1px solid var(--line-strong); border-radius: 18px; padding: 22px; text-align: center; box-shadow: 0 30px 80px rgba(0,0,0,.6), 0 0 40px rgba(255,216,107,.08); animation: modalIn .28s ease both; }
.modal-box h2 { margin: 0 0 8px; font-size: clamp(20px, 5vw, 30px); letter-spacing: 1px; }
.modal-box h2.win { color: var(--gold); }
.modal-box h2.lose { color: var(--red); }
.modal-box p { color: var(--muted); font-size: 10px; line-height: 1.65; margin: 0 0 16px; }
.modal-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0 18px; }
.modal-stat { background: rgba(255,255,255,.035); border: 1px solid rgba(255,255,255,.06); border-radius: 10px; padding: 10px 6px; }
.modal-stat b { display: block; font-size: 16px; color: var(--gold); }
.modal-stat span { display: block; font-size: 7px; color: var(--muted); letter-spacing: 1px; margin-top: 4px; }
.modal-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.modal-actions .btn { flex: 1 1 120px; justify-content: center; }
.rules-list { text-align: left; display: grid; gap: 8px; margin: 12px 0 18px; }
.rules-list div { font-size: 10px; line-height: 1.55; color: #d6d2df; background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.06); border-radius: 9px; padding: 10px; }
.rules-list b { color: var(--gold); }

/* tiebreaker */
.tb-box { width: min(620px, 100%); }
.tb-trend { display: inline-flex; align-items: center; gap: 8px; margin: 4px 0 12px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: rgba(0,0,0,.3); font-size: 10px; letter-spacing: 1px; }
.tb-trend.bear { border-color: rgba(255,95,95,.4); color: #ffb3b3; }
.tb-cards { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin: 14px 0; }
.tb-card { width: 92px; height: 132px; border-radius: 9px; overflow: hidden; position: relative; border: 1px solid rgba(255,255,255,.16); cursor: pointer; background: #15151c; transition: transform .16s ease, border-color .16s ease; }
.tb-card:hover { transform: translateY(-5px); border-color: var(--gold); }
.tb-card img { width: 100%; height: 100%; object-fit: cover; }
.tb-card .card-cost { position: absolute; top: 4px; left: 4px; z-index: 3; min-width: 22px; height: 22px; display: grid; place-items: center; border-radius: 6px; background: var(--gold); color: #211a06; font-size: 11px; font-weight: 900; }
.tb-card .card-name { position: absolute; left: 4px; right: 4px; bottom: 4px; z-index: 3; font-size: 7px; color: #fff; text-shadow: 0 1px 3px #000; }
.tb-result { margin: 12px 0; padding: 10px; border-radius: 10px; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.07); font-size: 10px; line-height: 1.5; color: #d6d2df; }
.tb-result b { color: var(--gold); }
.preview-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; max-height: 58vh; overflow: auto; padding: 4px; margin-top: 10px; scrollbar-width: thin; }
.preview-card { position: relative; border-radius: 5px; overflow: hidden; border: 1px solid rgba(255,255,255,.1); aspect-ratio: 2 / 2.9; background: #15151c; }
.preview-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.preview-card span { position: absolute; top: 2px; left: 2px; background: var(--gold); color: #211a06; font-size: 8px; font-weight: 900; border-radius: 3px; padding: 0 3px; }
.tb-vs { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 10px 0; }
.tb-vs .tb-mini { width: 60px; height: 86px; border-radius: 7px; overflow: hidden; border: 1px solid rgba(255,255,255,.16); position: relative; }
.tb-vs .tb-mini img { width: 100%; height: 100%; object-fit: cover; }
.tb-vs .tb-mini .card-cost { position: absolute; top: 3px; left: 3px; font-size: 9px; padding: 1px 4px; border-radius: 4px; background: var(--gold); color: #211a06; font-weight: 900; }

/* toast */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 120; background: rgba(10,10,16,.95); border: 1px solid var(--line); color: var(--gold); border-radius: 999px; padding: 9px 16px; font-size: 9px; letter-spacing: 1px; box-shadow: var(--shadow); animation: toastIn .22s ease both; }
.emote-bar { display: none; }
.emote-bar:hover { opacity: 1; }
.emote-bar button { width: 28px; height: 28px; border-radius: 50%; border: 1px solid rgba(255,255,255,.1); background: rgba(0,0,0,.5); font-size: 13px; cursor: pointer; padding: 0; }
.emote-bar button:hover { border-color: var(--line-strong); }
.bubble { position: fixed; right: 24px; bottom: 50px; z-index: 35; background: #fff; color: #111; padding: 8px 12px; border-radius: 14px 14px 2px 14px; font-size: 20px; box-shadow: 0 10px 24px rgba(0,0,0,.4); animation: bubbleIn .25s ease both; }

@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes reveal { from { opacity: 0; transform: translateY(20px) rotate(-4deg) scale(.85); } to { opacity: 1; transform: none; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes bubbleIn { from { opacity: 0; transform: translateY(8px) scale(.9); } to { opacity: 1; transform: none; } }
@keyframes shake { 0%,100% { transform: translateX(0); } 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(4px); } }
.shake { animation: shake .38s ease; }

/* responsive */
@media (max-width: 820px) {
  .lobby-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: clamp(34px, 9vw, 58px); }
  .card { width: 74px; height: 106px; }
  .table-zone { min-height: 210px; }
}
@media (max-width: 620px) {
  .lobby-screen { padding: 10px 10px 22px; }
  .brand-title { font-size: 12px; } .brand-sub { font-size: 8px; letter-spacing: 2px; }
  .brand-mark { width: 36px; height: 36px; font-size: 12px; }
  .wallet { padding: 6px 9px; font-size: 11px; } .league-badge { padding: 6px 8px; font-size: 8px; }
  .hero-text { font-size: 11px; margin: 14px 0 18px; }
  .hero-actions { display: grid; grid-template-columns: 1fr 1fr; }
  #quick-btn { grid-column: 1 / -1; }
  .btn { padding: 12px 10px; gap: 8px; } .btn strong { font-size: 10px; letter-spacing: 1px; } .btn small { font-size: 7px; } .btn-icon { font-size: 17px; }
  .selection-screen { padding: 5px 5px max(5px, env(safe-area-inset-bottom)); gap: 5px; }
  .search-box { font-size: 7px; padding: 5px 8px; } .search-box b { font-size: 9px; }
  .selection-grid { grid-template-columns: repeat(4, 1fr); gap: 5px; }
  .selection-card .sc-name { font-size: 5px; }
  .selection-footer .btn { min-width: 0; flex: 1; padding: 9px 6px; font-size: 8px; }
  .match-screen { padding: 5px 5px max(5px, env(safe-area-inset-bottom)); gap: 4px; }
  .match-top { gap: 6px; min-height: 34px; }
  .match-mode { font-size: 7px; letter-spacing: 1px; } .match-collection { font-size: 8px; } .match-round { font-size: 7px; } .match-wallet { font-size: 10px; padding: 5px 8px; }
  .timer-badge { font-size: 7px; padding: 1px 4px; margin-left: 4px; }
  .icon-btn { width: 30px; height: 30px; font-size: 14px; }
  .trend-bar { padding: 5px 7px; gap: 7px; }
  .trend-icon { width: 30px; height: 30px; font-size: 19px; }
  .trend-glyph { width: 20px; height: 20px; }
  .trend-copy strong { font-size: 8px; } .trend-copy span { font-size: 7px; } .trend-side span { font-size: 8px; }
  .opponent-zone { padding: 5px 7px; border-radius: 9px; }
  .avatar { width: 26px; height: 26px; font-size: 12px; }
  .opponent-name, .player-name { font-size: 8px; } .opponent-sub { font-size: 7px; }
  .card-back { width: 20px; height: 29px; } .bot-hand { gap: 2px; }
  .table-zone { min-height: 0; flex: 1; padding: 6px; border-radius: 12px; gap: 4px; }
  .debt-label { width: 64px; font-size: 6px; } .debt-value { width: 32px; font-size: 9px; }
  .table-center { min-height: 104px; gap: 12px; } .slot { width: 76px; height: 108px; } .slot-placeholder { font-size: 6px; } .vs { font-size: 9px; }
  .round-result { font-size: 7px; padding: 4px 8px; letter-spacing: 1px; }
  .trend-watermark { width: 110px; height: 110px; top: 12%; }
  .player-zone { padding: 5px 6px 3px; border-radius: 9px; }
  .player-actions { gap: 4px; } .btn-allin, .btn-collection { padding: 6px 7px; font-size: 7px; letter-spacing: .5px; }
  .turn-label { font-size: 6px; padding: 1px 4px; margin-left: 3px; }
  .hand { justify-content: flex-start; min-height: 92px; padding: 6px 2px 2px; scroll-snap-type: x mandatory; }
  .card { width: 68px; height: 98px; scroll-snap-align: center; }
  .card-cost { min-width: 19px; height: 19px; font-size: 10px; } .card-name { font-size: 6px; }
  .hand-controls { gap: 6px; } .hand-hint { font-size: 7px; max-width: 55%; } .btn-play { padding: 8px 10px; font-size: 8px; letter-spacing: 1px; }
  .emote-bar { display: none; }
  .drawer { top: auto; bottom: 0; left: 0; right: 0; width: 100%; height: 82dvh; border-left: 0; border-top: 1px solid var(--line); border-radius: 18px 18px 0 0; transform: translateY(102%); padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  .drawer.open { transform: translateY(0); }
  .collection-grid { grid-template-columns: repeat(4, 1fr); }
  .tb-card { width: 78px; height: 112px; }
  .explosion-animal { width: 38vmin; height: 38vmin; }
  .explosion-title { font-size: 20px; letter-spacing: 2px; }
  .preview-grid { grid-template-columns: repeat(5, 1fr); max-height: 52vh; }
  .modal-actions { flex-direction: column; }
  .modal-actions .btn { flex: 1 1 auto; width: 100%; }
}
@media (max-width: 390px) {
  .hero-actions { grid-template-columns: 1fr; }
  .card { width: 62px; height: 90px; } .slot { width: 70px; height: 100px; }
  .btn-allin, .btn-collection { font-size: 6px; padding: 5px 6px; }
  .tb-card { width: 70px; height: 100px; }
}
@media (max-height: 700px) and (min-width: 621px) {
  .match-screen { gap: 4px; } .table-center { min-height: 112px; } .card { width: 72px; height: 102px; } .hand { min-height: 88px; padding-top: 4px; } .player-zone { padding: 5px 8px 2px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ============================================================
   CLASSIC POT
   ============================================================ */

.classic-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr);
  gap: 12px;
  margin-top: clamp(20px, 4vh, 40px);
}

.classic-collections-panel,
.classic-selected-panel {
  min-height: 0;
}

.lobby-collections {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  max-height: 510px;
  overflow-y: auto;
  padding: 2px 3px 4px 2px;
  scrollbar-width: thin;
}

.lobby-collection {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.1);
  background: #15151c;
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.lobby-collection img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lobby-collection::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 38%, rgba(0,0,0,.9)); pointer-events: none; }
.lobby-collection:hover { transform: translateY(-3px); border-color: rgba(255,216,107,.45); }
.lobby-collection.owned { border-color: rgba(97,255,159,.25); }
.lobby-collection.selected { border-color: var(--gold); box-shadow: 0 0 0 1px rgba(255,216,107,.4), 0 0 22px rgba(255,216,107,.16); }
.lobby-collection.locked { opacity: .38; cursor: not-allowed; }
.lobby-collection.locked:hover { transform: none; border-color: rgba(255,255,255,.1); }
.lc-name { position: absolute; left: 4px; right: 4px; bottom: 18px; z-index: 3; font-size: 6px; font-weight: 700; color: #fff; text-shadow: 0 1px 3px #000; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lc-price { position: absolute; left: 4px; right: 4px; bottom: 5px; z-index: 3; font-size: 6px; color: var(--gold); letter-spacing: .3px; }
.lc-copies { position: absolute; top: 4px; left: 4px; z-index: 3; padding: 1px 4px; border-radius: 4px; background: rgba(0,0,0,.65); color: var(--green); font-size: 6px; font-weight: 800; }
.lc-lock { position: absolute; top: 4px; right: 4px; z-index: 3; font-size: 10px; filter: grayscale(1); }

.selected-collection { display: flex; gap: 12px; align-items: center; margin: 2px 0 14px; }
.selected-collection-img { width: 108px; height: 144px; border-radius: 9px; overflow: hidden; border: 1px solid var(--line); flex: 0 0 auto; }
.selected-collection-img img { width: 100%; height: 100%; object-fit: cover; }
.selected-collection-info { flex: 1; font-size: 10px; line-height: 1.8; }
.selected-collection-name { font-size: 13px; font-weight: 800; letter-spacing: 1px; color: var(--gold); margin-bottom: 2px; }

.classic-rules { margin-bottom: 8px; }
.classic-reason { min-height: 12px; font-size: 8px; line-height: 1.4; color: #ff9b9b; margin: 2px 0 4px; }
.classic-action { width: 100%; justify-content: center; margin-top: 7px; }
.classic-note { font-size: 8px; line-height: 1.5; color: var(--muted); margin-top: 10px; }
.classic-note b { color: var(--gold); }
.classic-table-note { font-size: 7px; line-height: 1.4; color: var(--muted); text-align: center; margin-top: 2px; position: relative; z-index: 3; }

.card.same-cost { border-color: rgba(255,95,95,.6); box-shadow: 0 0 12px rgba(255,95,95,.18); }
.card.same-cost::before { content: "="; position: absolute; top: 5px; right: 5px; z-index: 4; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; background: var(--red); color: #fff; font-size: 11px; font-weight: 900; box-shadow: 0 2px 8px rgba(0,0,0,.45); }
.collection-card.same-cost { border-color: rgba(255,95,95,.5); }
.collection-card.same-cost .cc-status { color: #ffb3b3; }

@media (max-width: 900px) {
  .classic-layout { grid-template-columns: 1fr; }
  .lobby-collections { max-height: none; }
}
@media (max-width: 620px) {
  .lobby-collections { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
  .lc-name { font-size: 5px; bottom: 15px; }
  .lc-price { font-size: 5px; bottom: 4px; }
  .selected-collection-img { width: 82px; height: 110px; }
  .selected-collection-name { font-size: 11px; }
  .classic-action { padding: 11px 9px; }
}

.difficulty-row { display:flex; align-items:center; justify-content:space-between; gap:8px; margin:6px 0 2px; }
.difficulty-label { font-size:8px; letter-spacing:1px; color:var(--muted); }
.difficulty-pills { display:flex; gap:4px; }
.diff-pill { border:1px solid rgba(255,255,255,.1); background:rgba(0,0,0,.3); color:var(--muted); border-radius:999px; padding:4px 8px; font-size:7px; letter-spacing:1px; cursor:pointer; }
.diff-pill.active { color:#1d1605; background:var(--gold); border-color:var(--gold); font-weight:800; }
.difficulty-hint { min-height:11px; margin-bottom:6px; font-size:7.5px; line-height:1.45; color:var(--muted); }
@media (max-width: 620px) {
  .difficulty-label { font-size:7px; }
  .diff-pill { font-size:6px; padding:3px 6px; }
  .difficulty-hint { font-size:7px; }
}

/* ============================================================
   PORTFOLIO REDESIGN
   ============================================================ */

.drawer-overlay {
  background: rgba(0,0,0,.08);
  backdrop-filter: none;
}

.drawer {
  width: min(380px, 94vw);
}

@media (min-width: 621px) {
  .match-screen {
    transition: padding-right .28s ease;
  }
  .match-screen.drawer-open {
    padding-right: 390px;
  }
}

.collection-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.collection-card .cc-cost {
  font-size: 10px;
  padding: 1px 5px;
}
.collection-card .cc-status {
  font-size: 7px;
  line-height: 1.25;
}

@media (max-width: 620px) {
  .drawer {
    height: 58dvh;
  }
  .collection-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }
  .collection-card .cc-status {
    font-size: 7px;
  }
}

/* table preview inside portfolio */
.drawer-table-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 2px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(0,0,0,.38);
  font-size: 8px;
  min-height: 58px;
}
.drawer-mini {
  width: 38px;
  height: 54px;
  border-radius: 5px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.14);
  position: relative;
  flex: 0 0 auto;
  background: #15151c;
}
.drawer-mini img { width:100%; height:100%; object-fit:cover; display:block; }
.drawer-mini .mini-cost {
  position:absolute; top:2px; left:2px; z-index:2; background:var(--gold); color:#211a06;
  font-size:8px; font-weight:900; border-radius:3px; padding:0 3px;
}
.drawer-mini.empty { display:grid; place-items:center; color:#555; font-size:7px; text-align:center; padding:3px; }
.drawer-preview-info { flex:1; display:grid; gap:3px; color:var(--muted); line-height:1.35; }
.drawer-preview-info b { color:var(--gold); }
.drawer-preview-vs { color:var(--gold-2); font-size:9px; font-weight:800; }

/* larger portfolio cards: 3 columns, compact mobile sheet */
.collection-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
@media (max-width: 620px) {
  .drawer {
    height: 46dvh;
  }
  .collection-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }
}

/* ============================================================
   PORTFOLIO: ALWAYS SIDE DRAWER
   ============================================================ */

.drawer {
  top: 0;
  bottom: auto;
  left: auto;
  right: 0;
  height: 100dvh;
  width: min(380px, 92vw);
  border-left: 1px solid var(--line);
  border-top: 0;
  border-radius: 0;
  transform: translateX(102%);
  padding-bottom: 12px;
}
.drawer.open {
  transform: translateX(0);
}

@media (max-width: 620px) {
  .drawer {
    width: min(360px, 90vw);
    height: 100dvh;
  }
}

/* ============================================================
   MOBILE HAND: 4-COLUMN GRID, NO HORIZONTAL SCROLL
   ============================================================ */

@media (max-width: 620px) {
  .hand {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-rows: auto;
    gap: 5px;
    justify-content: stretch;
    align-items: stretch;
    overflow: visible;
    min-height: 0;
    padding: 6px 2px 4px;
    scroll-snap-type: none;
  }
  .hand .card {
    width: 100%;
    height: 104px;
    flex: none;
    scroll-snap-align: none;
  }
  .hand .card img {
    height: 100%;
  }
  .hand .card-name {
    font-size: 6px;
  }
}

@media (max-width: 390px) {
  .hand .card {
    height: 96px;
  }
}

/* ============================================================
   PORTFOLIO: 4 x 6 GRID, ALL 24 VISIBLE, NO SCROLL
   ============================================================ */

.drawer {
  width: min(440px, 92vw);
}

@media (min-width: 621px) {
  .match-screen.drawer-open {
    padding-right: 450px;
  }
}

.collection-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: minmax(0, 1fr);
  gap: 5px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding: 0;
}

.collection-card {
  aspect-ratio: auto;
  height: 100%;
  min-height: 0;
}

.collection-card .cc-cost {
  font-size: 9px;
  padding: 0 4px;
}
.collection-card .cc-status {
  font-size: 6.5px;
  line-height: 1.2;
}

@media (max-width: 620px) {
  .drawer {
    width: min(360px, 90vw);
    height: 100dvh;
  }
}

.collection-card .cc-name {
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 13px;
  z-index: 3;
  font-size: 6px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 3px #000;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.collection-card .cc-status {
  font-size: 7px;
  letter-spacing: .2px;
}
.collection-card .cc-cost {
  font-size: 10px;
}
