:root {
  --bg: #160910;
  --ink: #fff4e4;
  --muted: #f0d7c2;
  --faint: #c4a48f;
  --gold: #f3c56a;
  --gold-deep: #a56b22;
  --line: rgba(243, 197, 106, 0.42);
  --good: #b6f3c8;
  --bad: #ffb1b1;
  --serif: "Fraunces", "Iowan Old Style", Palatino, Georgia, serif;
  --sans: "Outfit", "Segoe UI", Helvetica, sans-serif;
  --tile-bg: #fffaf3;
  --tile-bg2: #efe2cc;
  --pip: #1b1b1b;
  --tile-line: rgba(40, 30, 20, 0.38);
  --tile-edge: #e6d5b8;
  --back1: #1a4638;
  --back2: #102e26;
  --felt1: #12805c;
  --felt2: #0a4a36;
  --rail: #3b2718;
  --rail2: #d7b56a;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
html { background: #0c060c; }
body {
  margin: 0;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  background:
    radial-gradient(520px 280px at 8% -4%, rgba(255, 196, 110, 0.28), transparent 62%),
    radial-gradient(460px 260px at 96% 0%, rgba(255, 150, 70, 0.2), transparent 64%),
    radial-gradient(700px 380px at 50% 120%, rgba(122, 18, 42, 0.55), transparent 58%),
    radial-gradient(420px 240px at 50% 18%, rgba(88, 16, 36, 0.35), transparent 70%),
    linear-gradient(180deg, #3a1824 0%, #1a0c14 42%, #100810 100%);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
input { user-select: text; -webkit-user-select: text; }
img, svg { display: block; max-width: 100%; }

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(90deg, rgba(243, 197, 106, 0.05) 0 1px, transparent 1px 56px),
    repeating-linear-gradient(0deg, rgba(243, 197, 106, 0.04) 0 1px, transparent 1px 56px);
  opacity: 0.28;
  mask-image: linear-gradient(180deg, transparent 0%, #000 28%, #000 100%);
}
body::after {
  content: "";
  position: fixed;
  left: 50%;
  top: -80px;
  width: 280px;
  height: 280px;
  transform: translateX(-50%);
  pointer-events: none;
  background: radial-gradient(circle, rgba(255, 214, 140, 0.28), rgba(255, 170, 70, 0.05) 42%, transparent 68%);
  filter: blur(2px);
}
#app { min-height: 100%; position: relative; z-index: 1; }

.shell {
  width: min(1180px, 100%);
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  position: relative;
}
.main-col {
  order: 1;
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.stage {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 8px 16px 18px;
  -webkit-overflow-scrolling: touch;
}
.tabbar { order: 2; }
.shell-match { height: 100vh; height: 100dvh; }
.shell-match .stage { padding: 0; overflow: hidden; display: flex; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 8px;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand > div { min-width: 0; }
.brand strong {
  display: block;
  font-family: var(--serif);
  font-weight: 560;
  font-size: 18px;
  letter-spacing: -0.02em;
}
.brand small { color: var(--good); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap; }
.mark {
  width: 34px;
  height: 46px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: linear-gradient(#fffaf3, #efe2cc);
  color: #1b1b1b;
  font-size: 11px;
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2), 0 6px 14px rgba(0, 0, 0, 0.25);
  position: relative;
}
.mark::after {
  content: "";
  position: absolute;
  left: 4px; right: 4px; top: 50%;
  height: 1px;
  background: rgba(0, 0, 0, 0.35);
}
.live-dot {
  width: 7px; height: 7px; border-radius: 50%;
  display: inline-block; margin-right: 5px;
  background: #3ddc97;
  box-shadow: 0 0 0 0 rgba(61, 220, 151, 0.7);
  animation: pulse 1.8s infinite;
}
@keyframes pulse {
  70% { box-shadow: 0 0 0 6px rgba(61, 220, 151, 0); }
  100% { box-shadow: 0 0 0 0 rgba(61, 220, 151, 0); }
}
.top-actions { display: flex; align-items: center; gap: 8px; }
.chip-pill, .icon-btn, .tabbar button, .btn, .tile, .ghost {
  touch-action: manipulation;
}
.chip-pill {
  border: 1px solid rgba(243, 197, 106, 0.55);
  background: linear-gradient(180deg, rgba(92, 42, 28, 0.9), rgba(28, 12, 14, 0.92));
  border-radius: 999px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #ffe7b0;
  font-weight: 640;
  box-shadow: inset 0 1px 0 rgba(255, 220, 160, 0.35), 0 8px 18px rgba(0, 0, 0, 0.28);
}
.chip-ico {
  width: 16px; height: 16px; border-radius: 50%;
  background:
    radial-gradient(circle at 35% 35%, #fff3cf, #e6c27a 40%, #a9783a 72%, #6d4a1d);
  box-shadow: inset 0 0 0 2px rgba(90, 55, 16, 0.45);
}
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  display: grid; place-items: center;
  color: var(--gold);
}

.tabbar {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
  padding: 6px 8px calc(8px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(243, 197, 106, 0.38);
  background:
    linear-gradient(180deg, rgba(74, 28, 36, 0.94), rgba(18, 8, 12, 0.96));
  box-shadow: inset 0 1px 0 rgba(255, 214, 150, 0.2);
  backdrop-filter: blur(16px);
}
.tabbar button {
  border: 0;
  background: transparent;
  color: var(--faint);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 0 6px;
  font-size: 11px;
  letter-spacing: 0.02em;
}
.tabbar button.on { color: var(--gold); text-shadow: 0 0 12px rgba(243, 197, 106, 0.45); }
.tabbar svg { width: 20px; height: 20px; }

.hero, .card, .table-card, .mission, .seat, .sheet, .search-card {
  background:
    linear-gradient(180deg, rgba(92, 36, 48, 0.55), rgba(22, 10, 16, 0.88));
  border: 1px solid rgba(243, 197, 106, 0.38);
  border-radius: 20px;
  box-shadow:
    inset 0 1px 0 rgba(255, 220, 170, 0.22),
    0 18px 40px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(12px);
}
.hero { padding: 16px; display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; }
.hero h1, .screen-title, .sheet h2, .endgame h2 {
  font-family: var(--serif);
  font-weight: 560;
  letter-spacing: -0.03em;
  margin: 0;
}
.hero h1 { font-size: 28px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.section-label {
  margin: 18px 2px 8px;
  color: var(--faint);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.medal {
  width: 84px; height: 84px; border-radius: 50%;
  display: grid; place-items: center;
  box-shadow:
    inset 0 0 0 2px rgba(255, 244, 214, 0.7),
    0 0 0 4px rgba(168, 104, 32, 0.85),
    0 12px 26px rgba(0, 0, 0, 0.4);
}
.medal b { font-family: var(--serif); font-size: 26px; color: #1d140c; }
.medal-bronze { background: radial-gradient(circle at 35% 30%, #f6ddc6, #c48455 46%, #6a3b20); }
.medal-prata { background: radial-gradient(circle at 35% 30%, #fff, #d5dee6 46%, #727c86); }
.medal-ouro { background: radial-gradient(circle at 35% 30%, #fff6dc, #e6c27a 42%, #a9783a); }
.medal-platina { background: radial-gradient(circle at 35% 30%, #f4ffff, #c5e3e6 46%, #5f8f96); }
.medal-diamante { background: radial-gradient(circle at 35% 30%, #f5fbff, #c5e2ff 44%, #3d74ad); }
.medal-mestre { background: radial-gradient(circle at 35% 30%, #f7f1ff, #d2c0ee 46%, #6d4d96); }
.medal-lenda { background: radial-gradient(circle at 35% 30%, #fff0cf, #e6c27a 36%, #8d3028 74%); }

.bar { height: 8px; border-radius: 99px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.bar > span { display: block; height: 100%; background: linear-gradient(90deg, #a9783a, #f0d7a2); }
.race { height: 8px; border-radius: 99px; background: rgba(0, 0, 0, 0.28); overflow: hidden; flex: 1; }
.race > span { display: block; height: 100%; background: linear-gradient(90deg, #d7b56a, #f6f1e7); }
.race.foe > span { background: linear-gradient(90deg, #8d4a4a, #f0c2c2); }

.btn {
  border: 0;
  border-radius: 14px;
  padding: 14px 16px;
  background: linear-gradient(180deg, #fff1c9 0%, #f0c15a 42%, #c4842a 78%, #8d4e16);
  color: #2a1608;
  font-weight: 640;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    inset 0 -2px 0 rgba(90, 40, 8, 0.35),
    0 10px 24px rgba(180, 90, 20, 0.28);
}
.btn:disabled { opacity: 0.45; }
.btn.block { width: 100%; }
.btn.slim { padding: 10px 12px; border-radius: 12px; }
.ghost {
  border-radius: 14px;
  padding: 12px 14px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
}
.ghost.block { width: 100%; }
.btn-row { display: flex; gap: 8px; }
.btn-row > * { flex: 1; }

.flame {
  display: inline-flex; align-items: center; gap: 6px;
  color: #ffb15a; font-weight: 640; font-size: 13px;
}

.missions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.mission { padding: 10px; min-height: 0; display: flex; flex-direction: column; gap: 8px; }
.mission .row { align-items: center; }
.mission .btn { align-self: flex-start; padding: 6px 10px; font-size: 12px; line-height: 1.1; border-radius: 9px; box-shadow: none; }
.mission strong { font-size: 13px; }
.mission em { font-style: normal; color: var(--gold); font-size: 12px; }

.heat-list { display: flex; flex-direction: column; gap: 8px; }
.heat-item, .lb-row, .hist-row, .rival-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
}
.lb-row { grid-template-columns: 28px auto 1fr auto; }
.lb-row.you, .hist-row {
  background: rgba(230, 194, 122, 0.08);
  border-radius: 14px;
  padding: 8px;
}
.avatar {
  display: inline-grid;
  border-radius: 50%;
  overflow: hidden;
  flex: 0 0 auto;
  background: #2a1418;
  box-shadow: 0 0 0 2px rgba(243, 197, 106, 0.7), 0 6px 14px rgba(0, 0, 0, 0.35);
}
.avatar svg { width: 100%; height: 100%; }

.mode-switch { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 14px; background: rgba(18, 6, 10, 0.55); border: 1px solid var(--line); }
.mode-switch button { border: 0; background: transparent; border-radius: 11px; padding: 10px; color: var(--muted); }
.mode-switch button.on {
  background: linear-gradient(180deg, #fff1c9, #e2b04a);
  color: #2a1608;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.table-card { padding: 12px; display: grid; grid-template-columns: 74px 1fr; gap: 12px; text-align: left; width: 100%; }
.table-swatch {
  border-radius: 14px;
  min-height: 74px;
  box-shadow:
    inset 0 0 0 4px #e8c98a,
    inset 0 0 0 8px #3a2416,
    inset 0 0 24px rgba(0, 0, 0, 0.35);
}
.table-card h3 { margin: 0 0 2px; font-size: 16px; }
.table-card p { margin: 0; color: var(--faint); font-size: 13px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag { font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; border-radius: 99px; padding: 4px 7px; border: 1px solid var(--line); color: var(--muted); }
.tag.good { color: #d9ffe9; border-color: rgba(141, 222, 180, 0.4); }
.tag.warn { color: #ffd7a8; border-color: rgba(255, 183, 104, 0.45); }
.tag.lock { color: var(--faint); }
.rec {
  padding: 14px;
  border-radius: 20px;
  color: inherit;
  background:
    radial-gradient(420px 140px at 100% 0%, rgba(255, 206, 120, 0.35), transparent 52%),
    linear-gradient(135deg, rgba(122, 28, 48, 0.95), rgba(46, 16, 28, 0.92) 55%, rgba(18, 48, 36, 0.9));
  border: 1px solid rgba(243, 197, 106, 0.55);
  box-shadow: inset 0 1px 0 rgba(255, 220, 160, 0.28), 0 16px 32px rgba(0, 0, 0, 0.28);
}

.shop-tabs { display: flex; gap: 6px; }
.shop-tabs button { flex: 1; border-radius: 12px; border: 1px solid var(--line); background: transparent; padding: 10px; color: var(--muted); }
.shop-tabs button.on { color: #2a1608; background: linear-gradient(#fff1c9, #e2b04a); border-color: transparent; box-shadow: inset 0 1px 0 rgba(255,255,255,.7); }
.shop-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.shop-card { padding: 12px; text-align: left; display: flex; flex-direction: column; gap: 8px; min-height: 168px; }
.shop-card .price { color: var(--gold); font-weight: 640; }
.mini-tiles { display: flex; gap: 6px; align-items: center; min-height: 52px; }
.felt-preview { height: 64px; border-radius: 12px; box-shadow: inset 0 0 0 3px rgba(215, 181, 106, 0.7); }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stat { padding: 12px; }
.stat b { display: block; font-family: var(--serif); font-size: 26px; }
.name-field {
  width: 100%;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 12px;
  outline: none;
  font-size: 16px;
}

.search-wrap, .boot {
  min-height: 70dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 8px;
  padding: 24px 8px 40px;
}
.search-card { padding: 22px 16px; width: min(420px, 100%); }
.vs { display: flex; justify-content: center; gap: 14px; align-items: flex-start; margin: 18px 0; flex-wrap: wrap; }
.btn:active { transform: translateY(1px); }
.seek { height: 4px; border-radius: 99px; background: rgba(255,255,255,.08); overflow: hidden; margin: 14px 0; }
.seek > span { display: block; height: 100%; width: 40%; background: var(--gold); animation: seek 1.1s ease-in-out infinite; }
@keyframes seek { 50% { transform: translateX(160%); } }

.match {
  flex: 1;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  padding-top: env(safe-area-inset-top);
  background: radial-gradient(500px 180px at 50% 0%, rgba(255, 196, 110, 0.16), transparent 70%);
}
.match-top, .opp-row, .hand-wrap, .dock, .ticker { flex-shrink: 0; }
.match-top { padding: 8px 12px 4px; display: flex; gap: 8px; align-items: center; }
.scorebox { flex: 1; min-width: 0; }
.scorebox .names { display: flex; justify-content: space-between; font-size: 13px; gap: 8px; }
.scorebox .names b { font-variant-numeric: tabular-nums; }
.score-nums { display: flex; justify-content: space-between; font-family: var(--serif); font-size: 22px; }
.opp-row { display: flex; gap: 8px; padding: 4px 12px 0; overflow-x: auto; }
.seat { padding: 8px; min-width: 0; flex: 1; display: flex; gap: 8px; align-items: center; }
.seat.on { border-color: rgba(230, 194, 122, 0.7); }
.seat .who { min-width: 0; }
.seat .who strong, .seat .who span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seat .who span { color: var(--faint); font-size: 12px; }
.backs { display: flex; align-items: center; }
.backs .tile.is-back { width: 18px; height: 28px; margin-left: -7px; border-radius: 3px; box-shadow: 0 0 0 1px rgba(255,255,255,.28), 0 3px 6px rgba(0,0,0,.25); }
.backs .tile.is-back:first-child { margin-left: 0; }
.backs em { font-style: normal; margin-left: 6px; font-size: 12px; color: var(--muted); }

.felt-wrap {
  margin: 8px 12px;
  border-radius: 28px;
  padding: 14px;
  background:
    linear-gradient(#ffe7b0, #e2b45a 7%, #7a4a22 14%, #3a2416 28%, #1c120c 70%, #5c3a1e);
  box-shadow:
    0 0 0 2px #f0d090,
    0 0 0 7px #2a1810,
    0 22px 48px rgba(0, 0, 0, 0.45);
  flex: 1;
  min-height: 140px;
  display: flex;
}
.felt {
  position: relative;
  flex: 1;
  min-height: 0;
  border-radius: 16px;
  background:
    radial-gradient(ellipse at 50% 38%, rgba(255, 255, 255, 0.28), transparent 36%),
    repeating-linear-gradient(45deg, rgba(0, 0, 0, 0.06) 0 1px, transparent 1px 8px),
    repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.05) 0 1px, transparent 1px 8px),
    radial-gradient(ellipse at center, var(--felt1), var(--felt2) 78%);
  box-shadow:
    inset 0 0 70px rgba(0, 0, 0, 0.42),
    inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  overflow: hidden;
  display: flex;
  align-items: center;
}
.board-fit { position: absolute; inset: 12px; }
.board-chain { position: relative; width: 100%; height: 100%; }
.board-chain .tile { position: absolute; margin: 0; border-radius: 8px; }
.board-chain .pip { width: 4px; height: 4px; }
.board-empty { width: 100%; text-align: center; color: rgba(255, 255, 255, 0.86); padding: 12px; }
.monte {
  position: absolute;
  right: 8px;
  bottom: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
  color: white;
  font-size: 12px;
}
.monte .tile.is-back { width: 22px; height: 32px; }

.ticker {
  margin: 0 16px;
  min-height: 22px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hand-wrap {
  padding: 8px 0 0;
  background: linear-gradient(180deg, rgba(26, 12, 18, 0.2), #1a0c12 36%);
  border-top: 1px solid rgba(243, 197, 106, 0.18);
}
.dock, .ticker { background: #1a0c12; }
.hand {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  overflow-x: auto;
  padding: 8px 14px 4px;
  min-height: 108px;
}
.dock {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 8px 12px calc(10px + env(safe-area-inset-bottom));
}
.reacts { display: flex; gap: 6px; }
.reacts button, .leave {
  width: 40px; height: 40px; border-radius: 12px;
  border: 1px solid var(--line); background: rgba(0,0,0,.25);
}
.dock .btn, .dock .ghost { flex: 1; }
.react-pop {
  position: absolute;
  left: 18px;
  bottom: 92px;
  font-size: 28px;
  animation: pop 1s ease forwards;
}
@keyframes pop { 70% { transform: translateY(-16px); opacity: 1; } 100% { opacity: 0; transform: translateY(-28px); } }

.tile {
  appearance: none;
  border: 0;
  padding: 0;
  width: 86px;
  height: 46px;
  border-radius: 13px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), transparent 46%),
    linear-gradient(165deg, var(--tile-bg), var(--tile-bg2));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -3px 0 rgba(70, 42, 16, 0.12),
    0 0 0 1px rgba(243, 197, 106, 0.35),
    0 8px 14px rgba(0, 0, 0, 0.28);
  display: inline-flex;
  position: relative;
  flex: 0 0 auto;
  vertical-align: middle;
  overflow: hidden;
}
.tile.is-double { width: 52px; height: 100px; flex-direction: column; }
.board-track .tile { width: 68px; height: 36px; }
.board-track .tile.is-double { width: 36px; height: 70px; }
.half { flex: 1; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); }
.pip {
  width: 7px; height: 7px; border-radius: 50%;
  background:
    radial-gradient(circle at 32% 30%, rgba(255,255,255,.9), transparent 36%),
    radial-gradient(circle at 50% 55%, var(--pip), #120c08 72%);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.25);
  align-self: center; justify-self: center;
}
.board-track .pip { width: 5px; height: 5px; }
.split { position: absolute; background: linear-gradient(90deg, transparent, var(--tile-line), transparent); pointer-events: none; }
.tile:not(.is-double) .split { width: 1px; top: 6px; bottom: 6px; left: 50%; background: var(--tile-line); }
.tile.is-double .split { height: 1px; left: 6px; right: 6px; top: 50%; width: auto; background: var(--tile-line); }
.tile.is-back {
  background: repeating-linear-gradient(135deg, var(--back1), var(--back1) 5px, var(--back2) 5px, var(--back2) 10px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.28);
}
.tile.is-playable { transform: translateY(-6px); outline: 2px solid var(--gold); }
.tile.is-picked { transform: translateY(-12px); outline: 2px solid white; }
.tile.is-dim { opacity: 0.72; }
.hand { justify-content: flex-start; }
.pip { width: 7px; height: 7px; }
.logo { display: inline-grid; place-items: center; animation: hero-float 3.4s ease-in-out infinite; }
.logo-tile {
  width: 28px; height: 50px; border-radius: 8px; position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between; padding: 5px 0;
  background: linear-gradient(180deg, #fffaf3, #e7d3b0);
  box-shadow: inset 0 0 0 1px rgba(243, 197, 106, 0.9), 0 8px 16px rgba(0, 0, 0, 0.35);
}
.logo-lg .logo-tile { width: 54px; height: 98px; border-radius: 14px; }
.logo-pips {
  height: 22px;
  background-image: radial-gradient(circle, #1b140f 1.6px, transparent 1.8px);
  background-size: 9px 8px;
  background-position: center;
}
.logo-lg .logo-pips { height: 36px; background-size: 14px 12px; }
.logo-bar { height: 2px; margin: 0 5px; border-radius: 2px; background: rgba(90, 52, 18, 0.45); }
.logo-shine {
  position: absolute; inset: -20% auto -20% -60%; width: 45%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.85), transparent);
  transform: skewX(-18deg);
  animation: logo-sweep 2.8s ease-in-out infinite;
}
.wordmark { font-family: var(--serif); font-size: 17px; letter-spacing: -0.03em; white-space: nowrap; }
.wordmark em { font-style: normal; color: var(--gold); }
.board-empty { display: grid; justify-items: center; gap: 10px; }
.pack { text-align: left; display: flex; flex-direction: column; gap: 4px; padding: 14px; }
.pack b { color: var(--gold); font-size: 18px; }
.pack em { font-style: normal; color: var(--faint); font-size: 12px; }
.cup { padding: 14px; }
.shop-tabs { display: flex; gap: 6px; overflow-x: auto; }
@keyframes logo-sweep { 0% { left: -60%; } 55% { left: 120%; } 100% { left: 120%; } }
.tile.end-hot { box-shadow: 0 0 0 3px var(--gold), 0 8px 16px rgba(0, 0, 0, 0.35); }
.tile.is-fresh { animation: deal 0.35s ease; }
@keyframes deal { from { transform: translateY(16px) scale(0.9); opacity: 0; } }

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(4, 8, 7, 0.72);
  display: grid;
  place-items: end center;
  padding: 16px;
}
.sheet {
  width: min(460px, 100%);
  padding: 18px;
  margin-bottom: calc(8px + env(safe-area-inset-bottom));
  max-height: min(78dvh, 720px);
  overflow: auto;
}
.sheet h2 { font-size: 30px; margin-bottom: 6px; }
.sheet p { color: var(--muted); margin: 6px 0 12px; }
.endgame { text-align: center; }
.endgame .big {
  font-family: var(--serif);
  font-size: 42px;
  margin: 6px 0;
}
.delta { display: flex; justify-content: center; gap: 16px; margin: 10px 0 14px; }
.delta b { display: block; font-size: 22px; font-family: var(--serif); }
.good { color: var(--good); }
.bad { color: var(--bad); }
.remain { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 12px; text-align: left; }
.remain .line { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.pips-row { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(84px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: #f6f1e7;
  color: #1b140c;
  padding: 10px 14px;
  border-radius: 999px;
  z-index: 30;
  font-weight: 640;
  max-width: calc(100% - 32px);
}

.install {
  display: flex; justify-content: space-between; gap: 10px; align-items: center;
  padding: 12px;
}
.rules { color: var(--muted); font-size: 14px; line-height: 1.45; }
.rules li { margin: 6px 0; }

@media (min-width: 900px) {
  .shell { flex-direction: row; height: 100vh; height: 100dvh; }
  .tabbar { order: 0; }
  .hand { justify-content: center; }
  .match { width: min(1040px, 100%); margin: 0 auto; }
  .board-chain .pip { width: 6px; height: 6px; }
  .shell-match { flex-direction: column; }
  .tabbar {
    width: 96px;
    height: 100dvh;
    position: sticky;
    top: 0;
    border-top: 0;
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 16px 8px;
  }
  .main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; height: 100dvh; }
  .stage { padding: 12px 28px 28px; }
  .home-layout, .profile-split { display: grid; grid-template-columns: 340px 1fr; gap: 18px; align-items: start; }
  .shop-grid { grid-template-columns: repeat(3, 1fr); }
  .missions { grid-template-columns: 1fr; }
  .modal { place-items: center; }
  .shell-match .tabbar, .shell-search .tabbar { display: none; }
  .shell-match .main-col, .shell-search .main-col { height: 100dvh; }
}

@media (max-width: 640px) {
  .missions { grid-template-columns: 1fr; }
  .hero h1 { font-size: 24px; }
  .tile { width: 70px; }
}

.hero-live { position: relative; overflow: hidden; }
.hero-stage {
  position: relative;
  width: 96px;
  height: 96px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  overflow: hidden;
}
.hero-stage .avatar {
  position: relative;
  z-index: 2;
  animation: hero-float 3.4s ease-in-out infinite;
}
.hero-ring {
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  border: 2px solid rgba(243, 197, 106, 0.75);
  animation: hero-pulse 2.6s ease-out infinite;
}
.hero-ring.late { animation-delay: 1.3s; }
.floater {
  position: absolute;
  width: 16px;
  height: 28px;
  border-radius: 3px;
  background: linear-gradient(#fffaf3, #e7d3b0);
  box-shadow: 0 6px 10px rgba(0, 0, 0, 0.35);
  z-index: 3;
}
.floater::before, .floater::after {
  content: "";
  position: absolute;
  left: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #1b1b1b;
}
.floater::before { top: 3px; }
.floater::after { bottom: 3px; }
.floater.f1 { top: 6px; left: 4px; animation: tile-bob 2.8s ease-in-out infinite; }
.floater.f2 { right: 2px; top: 10px; animation: tile-bob 3.3s ease-in-out infinite reverse; }
.floater.f3 { left: 32px; bottom: 6px; width: 28px; height: 16px; animation: tile-bob 3.6s ease-in-out infinite; }
.floater.f3::before { left: 3px; top: 4px; }
.floater.f3::after { left: auto; right: 3px; top: 4px; bottom: auto; }
.table-scene {
  border-radius: 22px;
  padding: 8px;
  background: linear-gradient(#ffe7b0, #e2b45a 8%, #7a4a22 16%, #2a1810 40%);
  box-shadow: 0 0 0 1px #f0d090, 0 14px 28px rgba(0, 0, 0, 0.35);
}
.mini-felt { height: 148px; flex: none; border-radius: 14px; }
.scene-caption {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  padding: 8px 6px 4px;
  color: #fff4e4;
  font-size: 12px;
}
.scene-caption span { color: #f3c56a; text-align: right; }
.live-lines { position: relative; height: 16px; overflow: hidden; flex: 1; }
.live-lines span {
  position: absolute;
  right: 0;
  white-space: nowrap;
  color: #f3c56a;
  animation: line-cycle 9s ease-in-out infinite;
  opacity: 0;
}
.live-lines span:nth-child(2) { animation-delay: 3s; }
.live-lines span:nth-child(3) { animation-delay: 6s; }
.live-lines span:nth-child(4) { animation-delay: 9s; }
.search-card .hero-stage { margin: 8px auto; }

@keyframes hero-float {
  50% { transform: translateY(-5px); }
}
@keyframes hero-pulse {
  70% { transform: scale(1.22); opacity: 0; }
}
@keyframes tile-bob {
  50% { transform: translateY(-7px) rotate(-8deg); }
}
@keyframes rail-slide {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@keyframes line-cycle {
  0% { opacity: 0; transform: translateY(6px); }
  12% { opacity: 1; transform: translateY(0); }
  30% { opacity: 1; }
  40% { opacity: 0; transform: translateY(-6px); }
  100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
