* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #0b0f1a;
  --panel: #141b2e;
  --ink: #eef2ff;
  --dim: #8b93ad;
  --cyan: #35e0ff;
  --magenta: #ff5cf0;
  --green: #2fd575;
  --red: #ff5c6c;
  --gold: #ffd166;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
}

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro", "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
  overscroll-behavior: none;
}

#app { position: fixed; inset: 0; }

button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
input {
  font: inherit; color: var(--ink);
  -webkit-user-select: text; user-select: text;
}

/* ---------- shared screens ---------- */

.screen {
  position: fixed; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px; padding: 24px;
  background:
    radial-gradient(120% 90% at 50% 0%, #16204000 0%, #0b0f1a 70%),
    radial-gradient(80% 60% at 50% 110%, #251435 0%, #0b0f1a 65%),
    var(--bg);
  text-align: center;
  z-index: 30;
}

.brand {
  font-size: 13px; font-weight: 700; letter-spacing: 0.28em;
  color: var(--dim); text-transform: uppercase;
}

.title { font-size: 34px; font-weight: 800; letter-spacing: -0.02em; }
.subtitle { color: var(--dim); font-size: 15px; max-width: 300px; line-height: 1.45; }

.game-card {
  width: min(340px, 88vw);
  background: linear-gradient(160deg, #1a2340, #121a30);
  border: 1px solid #2a3558;
  border-radius: 22px;
  padding: 22px 24px;
  display: flex; align-items: center; gap: 16px;
  text-align: left;
  box-shadow: 0 10px 40px #0007;
  transition: transform 0.08s ease;
}
.game-card:active { transform: scale(0.97); }
.game-card .emoji { font-size: 40px; }
.game-card h2 { font-size: 20px; font-weight: 800; }
.game-card p { color: var(--dim); font-size: 13.5px; margin-top: 3px; line-height: 1.35; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 16px 34px;
  border-radius: 999px;
  font-size: 19px; font-weight: 800; letter-spacing: 0.02em;
  background: linear-gradient(135deg, var(--cyan), #3a7bff);
  color: #04121c;
  box-shadow: 0 6px 30px #35e0ff44;
  transition: transform 0.08s ease;
}
.btn:active { transform: scale(0.95); }
.btn.secondary {
  background: #1c2440; color: var(--ink); box-shadow: none;
  border: 1px solid #2e3a60;
  font-size: 16px; padding: 12px 22px;
}
.btn.magenta { background: linear-gradient(135deg, var(--magenta), #b44dff); box-shadow: 0 6px 30px #ff5cf044; }
.btn:disabled { opacity: 0.4; }

.name-input {
  width: min(280px, 80vw);
  padding: 14px 18px;
  border-radius: 14px;
  border: 1px solid #2e3a60;
  background: #121a30;
  font-size: 18px; text-align: center;
}
.name-input:focus { outline: 2px solid var(--cyan); }

.room-code { color: var(--dim); font-size: 13px; letter-spacing: 0.12em; }

/* ---------- invite pill ---------- */

.invite {
  display: flex; gap: 10px; align-items: center; justify-content: center;
  flex-wrap: wrap;
}
.invite .pill {
  display: inline-flex; align-items: center; gap: 7px;
  background: #1c2440; border: 1px solid #2e3a60;
  padding: 11px 18px; border-radius: 999px;
  font-size: 15px; font-weight: 700;
}
.invite .pill:active { transform: scale(0.95); }

/* ---------- toasts ---------- */

#toasts {
  position: fixed; top: calc(var(--sat) + 14px); left: 50%;
  transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 8px; align-items: center;
  z-index: 90; pointer-events: none;
}
.toast {
  background: #1c2440ee; border: 1px solid #2e3a60;
  padding: 9px 16px; border-radius: 999px;
  font-size: 13.5px; font-weight: 600;
  animation: toast-in 0.18s ease, toast-out 0.3s ease 2.7s forwards;
  max-width: 86vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-8px); } }

/* ---------- arcade (shared by the mini-game pack) ---------- */

.game-canvas { position: fixed; inset: 0; width: 100%; height: 100%; touch-action: none; }

.screen .cards {
  display: flex; flex-direction: column; gap: 12px;
  overflow-y: auto; max-height: 54vh; padding: 4px;
  -webkit-overflow-scrolling: touch;
}

/* ---------- draft arena ---------- */

.dr-panel {
  position: fixed; inset: 0; z-index: 20;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; padding: 24px 16px calc(var(--sab) + 20px);
  background: #0b0f1af2;
}
.dr-head { font-size: 26px; font-weight: 900; letter-spacing: 0.04em; }
.dr-head .dr-of { color: var(--dim); font-size: 15px; font-weight: 700; }
.dr-clockbar { width: min(320px, 80vw); height: 6px; border-radius: 999px; background: #1c2440; overflow: hidden; }
.dr-clockfill { height: 100%; background: linear-gradient(90deg, var(--cyan), var(--magenta)); transition: width 0.2s linear; }
.dr-offers { display: flex; gap: 10px; justify-content: center; width: 100%; }
.dr-card {
  flex: 1; max-width: 128px; min-height: 150px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  background: linear-gradient(160deg, #1a2340, #121a30);
  border: 1.5px solid #2e3a60; border-radius: 18px; padding: 12px 8px;
  transition: transform 0.08s ease;
}
.dr-card:active { transform: scale(0.94); }
.dr-card.locked { opacity: 0.45; }
.dr-emoji { font-size: 44px; }
.dr-name { font-size: 14px; font-weight: 800; }
.dr-cost { font-size: 12.5px; font-weight: 800; color: var(--gold); }
.dr-stats { font-size: 10.5px; color: var(--dim); text-align: center; line-height: 1.3; }
.dr-wait { color: var(--dim); font-size: 13.5px; font-weight: 600; }
.dr-decks { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; width: 100%; align-items: center; }
.dr-deckrow {
  display: flex; gap: 6px; align-items: center;
  font-size: 12px; font-weight: 800;
}
.dr-mini {
  display: inline-flex; align-items: center; gap: 3px;
  background: #1c2440; border: 1px solid #2e3a60; border-radius: 999px;
  padding: 3px 8px; font-size: 11px;
}
.dr-mini .dr-emoji { font-size: 16px; }
.dr-mini .dr-name { display: none; }
.dr-mini .dr-cost { font-size: 10px; }

.hand-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; flex-direction: column; gap: 6px;
  padding: 8px 10px calc(var(--sab) + 10px);
  background: linear-gradient(#0b0f1a00, #0b0f1aee 30%);
}
.hand-energy {
  position: relative; height: 16px; border-radius: 999px; background: #1c2440;
  overflow: hidden; margin: 0 4px;
}
.hand-efill { height: 100%; background: linear-gradient(90deg, #ffd166, #ff9a3d); transition: width 0.2s linear; }
.hand-energy span {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 900; color: #0b0f1a;
}
.hand-cards { display: flex; gap: 7px; justify-content: center; }
.hand-card {
  position: relative; flex: 1; max-width: 76px; min-height: 68px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: linear-gradient(160deg, #1a2340, #121a30);
  border: 1.5px solid #2e3a60; border-radius: 14px; padding: 6px 4px;
  overflow: hidden;
}
.hand-card .dr-emoji { font-size: 26px; }
.hand-card .dr-name { font-size: 9.5px; }
.hand-card .dr-cost { font-size: 10px; }
.hand-card.selected { border-color: var(--cyan); box-shadow: 0 0 18px #35e0ff66; }
.hand-card.blocked { opacity: 0.45; }
.hand-card .hand-cd {
  position: absolute; left: 0; right: 0; bottom: 0; height: 0%;
  background: #0b0f1aaa; pointer-events: none;
}
.hand-hint { text-align: center; color: var(--dim); font-size: 11.5px; font-weight: 600; }

/* ---------- bank or bust ---------- */

.dice-btns {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; gap: 12px; justify-content: center;
  padding: 10px 18px calc(var(--sab) + 16px);
  background: linear-gradient(#0b0f1a00, #0b0f1add 40%);
}
.dice-btn {
  flex: 1; max-width: 190px; padding: 18px 8px;
  border-radius: 18px; font-size: 19px; font-weight: 900;
  transition: transform 0.08s ease;
}
.dice-btn:active { transform: scale(0.94); }
.dice-btn.roll { background: linear-gradient(135deg, var(--gold), #ff9a3d); color: #241503; box-shadow: 0 6px 26px #ffd16644; }
.dice-btn.bank { background: #0e3b24; color: var(--green); border: 1.5px solid #1b5c3a; }

/* ---------- duel ---------- */

#duel-canvas { position: fixed; inset: 0; width: 100%; height: 100%; touch-action: none; }

.ovl {
  position: fixed; inset: 0; z-index: 40;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; padding: 24px; text-align: center;
  background: #0b0f1acc;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.ovl.clear { background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; pointer-events: none; }
.ovl.top {
  justify-content: flex-start; padding-top: max(11vh, calc(var(--sat) + 40px));
  background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none;
  pointer-events: none;
}
.ovl .panel {
  pointer-events: auto;
  background: #141b2ef2; border: 1px solid #2e3a60; border-radius: 22px;
  padding: 24px 22px;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  max-width: 88vw;
  box-shadow: 0 14px 50px #000a;
}
.ovl .big {
  font-size: 92px; font-weight: 900;
  text-shadow: 0 0 40px var(--cyan);
  animation: pop 0.35s ease;
}
@keyframes pop { from { transform: scale(1.7); opacity: 0; } }
.ovl .winner { font-size: 30px; font-weight: 900; }
.ovl .series { color: var(--dim); font-size: 15px; font-weight: 600; }

.hint { color: var(--dim); font-size: 13.5px; }

/* ---------- poker ---------- */

.ptable { position: fixed; inset: 0; overflow: hidden; }

.felt {
  position: absolute; left: 50%; top: 44%;
  width: min(92vw, 480px); height: min(66vh, 620px);
  transform: translate(-50%, -50%);
  border-radius: 46% / 40%;
  background: radial-gradient(ellipse at 50% 38%, #14523a, #0c3526 62%, #082517);
  border: 10px solid #1d1526;
  box-shadow: inset 0 0 60px #0009, 0 20px 60px #000a;
}

.board {
  position: absolute; left: 50%; top: 40%;
  transform: translate(-50%, -50%);
  display: flex; gap: 6px; z-index: 2;
}
.pot {
  position: absolute; left: 50%; top: 51%;
  transform: translateX(-50%);
  font-size: 14px; font-weight: 800; color: var(--gold);
  background: #00000055; padding: 4px 14px; border-radius: 999px;
  z-index: 2;
}

.card {
  width: 46px; height: 66px;
  background: #fdfdf6; border-radius: 7px;
  color: #101014;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-weight: 800;
  box-shadow: 0 3px 10px #0008;
  animation: card-in 0.25s ease;
}
@keyframes card-in { from { transform: translateY(-10px); opacity: 0; } }
.card .r { font-size: 21px; line-height: 1; }
.card .s { font-size: 17px; line-height: 1.15; }
.card.red { color: #d3303e; }
.card.small { width: 26px; height: 38px; border-radius: 5px; }
.card.small .r { font-size: 13px; }
.card.small .s { font-size: 11px; }
.card.back {
  background: repeating-linear-gradient(45deg, #2b3a6b, #2b3a6b 4px, #223056 4px, #223056 8px);
  border: 2px solid #3c4f8a;
}
.card.big { width: 74px; height: 106px; border-radius: 11px; }
.card.big .r { font-size: 34px; }
.card.big .s { font-size: 27px; }

.seat {
  position: absolute; z-index: 3;
  transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  width: 92px;
  transition: opacity 0.2s;
}
.seat .ava {
  width: 52px; height: 52px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 900;
  background: #1c2440; border: 2.5px solid #2e3a60;
  position: relative;
}
.seat .ring {
  position: absolute; inset: -7px; border-radius: 50%;
  background: conic-gradient(var(--gold) calc(var(--p) * 100%), #ffffff18 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4.5px), #000 calc(100% - 4px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 4.5px), #000 calc(100% - 4px));
}
.seat .nm {
  font-size: 12.5px; font-weight: 700;
  max-width: 92px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.seat .stk { font-size: 12px; font-weight: 700; color: var(--gold); }
.seat .cards { display: flex; gap: 3px; margin-top: 2px; min-height: 38px; }
.seat.folded { opacity: 0.35; }
.seat.away .nm { color: var(--dim); }
.seat .badge {
  position: absolute; top: -6px; right: -10px;
  font-size: 9.5px; font-weight: 900; letter-spacing: 0.04em;
  background: var(--red); color: #fff;
  padding: 2px 6px; border-radius: 999px;
}
.seat .badge.bot { right: auto; left: -12px; background: #7c5cff; }
.seat .dbtn {
  position: absolute; bottom: -4px; right: -12px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff; color: #111; font-size: 11px; font-weight: 900;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px #0008;
}
.seat .betchip {
  position: absolute;
  font-size: 12px; font-weight: 800; color: #fff;
  background: #0e1b33ee; border: 1px solid #33417077;
  padding: 3px 10px; border-radius: 999px;
  white-space: nowrap;
}

/* bet chip sits between the seat and the table center */
.seat.pos0 .betchip { top: -34px; left: 70%; }
.seat.pos1 .betchip { top: -14px; right: -66px; }
.seat.pos2 .betchip { bottom: -14px; right: -66px; }
.seat.pos3 .betchip { bottom: -36px; left: 50%; transform: translateX(-50%); }
.seat.pos4 .betchip { bottom: -14px; left: -66px; }
.seat.pos5 .betchip { top: -14px; left: -66px; }

.pos0 { left: 22%; top: 79%; } /* hero seat sits left of the big hole cards */
.pos1 { left: 13%; top: 64%; }
.pos2 { left: 13%; top: 26%; }
.pos3 { left: 50%; top: 12%; }
.pos4 { left: 87%; top: 26%; }
.pos5 { left: 87%; top: 64%; }

.mycards {
  position: absolute; left: 50%; bottom: calc(var(--sab) + 96px);
  transform: translateX(-50%);
  display: flex; gap: 8px; z-index: 4;
}
.mycards .card { box-shadow: 0 8px 30px #000c; }
.mycards.folded { opacity: 0.3; filter: grayscale(1); }

.controls {
  position: fixed; left: 0; right: 0; bottom: 0;
  padding: 12px 14px calc(var(--sab) + 12px);
  display: flex; gap: 10px; justify-content: center; align-items: center;
  z-index: 5;
  background: linear-gradient(#0b0f1a00, #0b0f1add 40%);
}
.controls .act {
  flex: 1; max-width: 130px;
  padding: 15px 6px;
  border-radius: 16px;
  font-size: 16px; font-weight: 800;
  text-align: center;
}
.controls .fold { background: #3a1622; color: var(--red); border: 1px solid #5a2333; }
.controls .call { background: #12314e; color: var(--cyan); border: 1px solid #1d4a74; }
.controls .raise { background: #0e3b24; color: var(--green); border: 1px solid #1b5c3a; }
.controls .act:active { transform: scale(0.95); }
.controls .waitmsg { color: var(--dim); font-size: 14px; font-weight: 600; padding: 14px 0; }

.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  background: #141b2e; border-radius: 22px 22px 0 0;
  border-top: 1px solid #2e3a60;
  padding: 20px 20px calc(var(--sab) + 20px);
  display: flex; flex-direction: column; gap: 14px;
  animation: sheet-in 0.18s ease;
}
@keyframes sheet-in { from { transform: translateY(40px); opacity: 0; } }
.sheet .amount { font-size: 30px; font-weight: 900; text-align: center; color: var(--green); }
.sheet input[type="range"] { width: 100%; accent-color: var(--green); height: 40px; }
.sheet .presets { display: flex; gap: 8px; justify-content: center; }
.sheet .presets button {
  padding: 9px 14px; border-radius: 999px;
  background: #1c2440; border: 1px solid #2e3a60;
  font-size: 13.5px; font-weight: 700;
}
.sheet .row { display: flex; gap: 10px; }
.sheet .row .act { flex: 1; padding: 15px; border-radius: 16px; font-size: 16px; font-weight: 800; text-align: center; }

.banner {
  position: absolute; left: 50%; top: 58%;
  transform: translate(-50%, -50%);
  z-index: 6; text-align: center;
  background: #0b0f1ae6; border: 1px solid #2e3a60;
  border-radius: 18px; padding: 14px 22px;
  animation: pop 0.3s ease;
  max-width: 88vw;
}
.banner .w { font-size: 19px; font-weight: 900; color: var(--gold); }
.banner .l { font-size: 13.5px; color: var(--dim); margin-top: 3px; }

.tophint {
  position: fixed; top: calc(var(--sat) + 10px); left: 50%;
  transform: translateX(-50%);
  color: var(--dim); font-size: 12.5px; font-weight: 600;
  z-index: 4; white-space: nowrap;
}

/* ---------- phase 3: zero-prompt entry + wow ---------- */

.splash .joining {
  display: flex; align-items: center; gap: 9px;
  color: var(--dim); font-size: 15px; font-weight: 600;
}
.splash .dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--cyan);
  animation: pulse 0.9s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: 0.25; transform: scale(0.7); } }

.namepill {
  position: fixed; left: 12px; bottom: calc(var(--sab) + 12px);
  z-index: 45;
  background: #141b2ecc; border: 1px solid #2e3a60;
  padding: 8px 13px; border-radius: 999px;
  font-size: 13px; font-weight: 700;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.namepill:active { transform: scale(0.94); }

.mutebtn {
  position: fixed; right: 12px; top: calc(var(--sat) + 10px);
  z-index: 45;
  width: 38px; height: 38px; border-radius: 50%;
  background: #141b2ecc; border: 1px solid #2e3a60;
  font-size: 16px;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}

.backbtn {
  position: fixed; left: 12px; top: calc(var(--sat) + 10px);
  z-index: 45;
  width: 38px; height: 38px; border-radius: 50%;
  background: #141b2ecc; border: 1px solid #2e3a60;
  font-size: 19px; font-weight: 800;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}

.fsbtn {
  position: fixed; right: 58px; top: calc(var(--sat) + 10px);
  z-index: 45;
  width: 38px; height: 38px; border-radius: 50%;
  background: #141b2ecc; border: 1px solid #2e3a60;
  font-size: 17px; color: #e8ecff;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.sheet.a2hs { text-align: center; }
.sheet.a2hs .a2hs-step { font-size: 17px; padding: 6px 0; }
.sheet.a2hs .pill { align-self: center; min-width: 120px; }
.backbtn:active { transform: scale(0.92); }

.arcade-prev {
  width: 100%; height: 62%; margin-bottom: 24vh;
  display: flex; align-items: center; justify-content: center;
}
.arcade-prev span {
  font-size: 110px;
  filter: drop-shadow(0 0 34px var(--accent));
  animation: bob 2.2s ease-in-out infinite;
}

.wshead { text-align: center; font-size: 15px; }
.wshead b { color: var(--gold); }

/* ---------- phase 7a: TikTok chrome ---------- */

.fpill {
  position: absolute; top: calc(var(--sat) + 58px); left: 14px;
  z-index: 3;
  background: #141b2ecc; border: 1px solid #2e3a60;
  padding: 6px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 700; color: var(--gold);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.fpill:empty { display: none; }

.workpill {
  position: absolute; top: calc(var(--sat) + 96px); left: 14px;
  z-index: 3;
  background: #2b2410ee; border: 1px solid #6b5a1e;
  padding: 5px 11px; border-radius: 999px;
  font-size: 12px; font-weight: 700; color: #ffd166;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.workpill.insheet { position: static; align-self: center; }

.sheet.search .srchlist {
  display: flex; flex-direction: column; gap: 6px;
  max-height: 45vh; overflow-y: auto;
}
.srchrow {
  text-align: left; padding: 12px 14px; border-radius: 12px;
  background: #1b2438; border: 1px solid #2e3a60; color: inherit;
  font-size: 15px;
}
.srchrow .hint { font-size: 12px; }

.coinflip {
  position: fixed; inset: 0; z-index: 55;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; pointer-events: none;
}
.coinflip .coin {
  font-size: 64px;
  animation: coinspin 0.15s linear infinite;
  filter: drop-shadow(0 4px 18px #0009);
}
.coinflip .coin.done { animation: none; transform: rotateY(0); }
.coinflip .coinwho {
  font-size: 22px; font-weight: 900; color: #ffd166;
  text-shadow: 0 2px 12px #000c;
  opacity: 0; transition: opacity 0.2s;
}
@keyframes coinspin { from { transform: rotateY(0); } to { transform: rotateY(180deg); } }

.frail {
  position: absolute; right: 10px; bottom: 24vh;
  z-index: 4;
  display: flex; flex-direction: column; gap: 18px;
  align-items: center;
}
.railbtn {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  filter: drop-shadow(0 2px 8px #000c);
}
.railbtn .ric { font-size: 30px; }
.railbtn .rct { font-size: 11.5px; font-weight: 700; color: #fff; }
.railbtn:active { transform: scale(0.88); }

.fbody {
  align-items: flex-start;
  text-align: left;
}
.finfo { max-width: 72vw; }
.finfo .ftitle { font-size: 26px; }
.finfo .ftag { margin-top: 2px; }
.finfo .fmeta { margin-top: 4px; }

.heartburst {
  position: fixed; z-index: 95; pointer-events: none;
  font-size: 26px;
  animation: heart-fly 0.85s cubic-bezier(0.2, 0.7, 0.4, 1) forwards;
}
@keyframes heart-fly {
  0% { transform: translate(-50%, -50%) scale(0.4); opacity: 0.9; }
  100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(var(--sc)); opacity: 0; }
}

.sheet.profile { z-index: 66; max-height: 78vh; max-height: 78svh; overflow-y: auto; }
.pfhead { display: flex; align-items: center; gap: 14px; padding: 4px 2px 10px; }
.pfava {
  width: 62px; height: 62px; border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan), #3a7bff);
  color: #04121c; font-size: 26px; font-weight: 900;
  display: flex; align-items: center; justify-content: center;
}
.pfname { font-size: 19px; font-weight: 800; }
.pftabs { display: flex; gap: 6px; border-bottom: 1px solid #2e3a60; padding-bottom: 8px; }
.pftab { padding: 8px 14px; border-radius: 999px; font-size: 13.5px; font-weight: 700; color: var(--dim); }
.pftab.active { background: #2a3558; color: var(--ink); }
.pfgrid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  padding: 12px 2px;
}
.pgame {
  aspect-ratio: 1; border-radius: 16px;
  background: color-mix(in srgb, var(--accent) 16%, #141b2e);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, #2e3a60);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
}
.pgame:active { transform: scale(0.94); }
.pemoji { font-size: 34px; }
.pname { font-size: 11.5px; font-weight: 700; }

.connbar {
  position: fixed; top: calc(var(--sat) + 52px); left: 50%;
  transform: translateX(-50%);
  z-index: 80;
  background: #4a3a10ee; color: var(--gold);
  border: 1px solid #6b5518;
  padding: 7px 16px; border-radius: 999px;
  font-size: 13px; font-weight: 700;
}

.chipfly {
  position: fixed; z-index: 70;
  width: 18px; height: 18px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffe9a8, var(--gold) 60%, #a8781a);
  border: 2px solid #fff5;
  pointer-events: none;
  transition: transform 0.7s cubic-bezier(0.5, 0, 0.6, 1), opacity 0.7s;
}

.confetti {
  position: fixed; z-index: 75;
  width: 8px; height: 12px; border-radius: 2px;
  pointer-events: none;
  animation: confetti-fly 1.3s cubic-bezier(0.2, 0.6, 0.4, 1) forwards;
}
@keyframes confetti-fly {
  to {
    transform: translate(var(--dx), calc(var(--dy) + 60vh)) rotate(var(--rot));
    opacity: 0;
  }
}

.streakline { color: var(--gold); font-size: 15px; font-weight: 800; }

.sheet.rename { z-index: 65; }
.seat.me { cursor: pointer; }

/* ---------- phase 4: the feed ---------- */

.feed {
  position: fixed; inset: 0;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
}
.fcard {
  /* bars-always-visible rule: svh = the viewport WITH browser chrome showing */
  height: 100vh;
  height: 100svh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  position: relative;
  display: flex; align-items: flex-end; justify-content: center;
  background:
    radial-gradient(100% 70% at 50% 0%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%),
    var(--bg);
}
.fpreview {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  opacity: 0.9;
}
.fprev-canvas { width: 100%; height: 62%; margin-bottom: 24vh; }
.fbody {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 0 26px calc(var(--sab) + 56px);
  text-align: center; width: 100%;
  background: linear-gradient(#0b0f1a00, #0b0f1ae6 55%);
  padding-top: 90px;
}
.femoji { font-size: 44px; }
.ftitle { font-size: 32px; font-weight: 900; letter-spacing: -0.02em; }
.ftag { color: var(--dim); font-size: 15px; max-width: 320px; line-height: 1.4; }
.fmeta {
  color: var(--accent); font-size: 12.5px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
}
.fbtns { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; width: min(320px, 84vw); }
.fbtns .btn { width: 100%; }
.fbtns .fmatch.searching {
  background: #1c2440; color: var(--gold);
  animation: pulse 1.2s ease-in-out infinite;
}
.fswipe {
  position: absolute; bottom: calc(var(--sab) + 12px); left: 50%;
  transform: translateX(-50%);
  color: var(--dim); font-size: 12px; font-weight: 600;
  animation: bob 1.6s ease-in-out infinite;
  z-index: 3;
}
@keyframes bob { 50% { transform: translateX(-50%) translateY(-5px); } }

.pfelt-mini {
  width: min(75vw, 330px); height: min(38vh, 260px);
  margin-bottom: 22vh;
  border-radius: 46% / 40%;
  background: radial-gradient(ellipse at 50% 38%, #14523a, #0c3526 62%, #082517);
  border: 7px solid #1d1526;
  box-shadow: inset 0 0 40px #0009, 0 16px 40px #000a;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.pcard-anim {
  width: 44px; height: 62px;
  background: #fdfdf6; border-radius: 7px;
  color: #101014; font-weight: 800; font-size: 18px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  box-shadow: 0 3px 10px #0008;
  animation: card-loop 4.5s ease-in-out infinite;
}
.pcard-anim .red { color: #d3303e; }
@keyframes card-loop {
  0% { transform: translateY(-16px) rotateY(90deg); opacity: 0; }
  12%, 82% { transform: none; opacity: 1; }
  95%, 100% { transform: translateY(8px); opacity: 0; }
}

/* ---------- feed v2: sync + social ---------- */

.feedtabs {
  position: fixed; top: calc(var(--sat) + 8px); left: 50%;
  transform: translateX(-50%);
  z-index: 47;
  display: flex; gap: 4px;
  background: #141b2ee6; border: 1px solid #2e3a60;
  padding: 4px; border-radius: 999px;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.ftab {
  padding: 8px 16px; border-radius: 999px;
  font-size: 13px; font-weight: 700; color: var(--dim);
}
.ftab.active { background: #2a3558; color: var(--ink); }

.feedroot.tab-solo .friendonly { display: none; }
.feedroot.tab-friend .soloonly { display: none; }

.syncbar {
  position: fixed; top: calc(var(--sat) + 56px); left: 50%;
  transform: translateX(-50%);
  z-index: 46;
  display: flex; align-items: center; gap: 10px;
  max-width: 94vw;
  background: #141b2ee6; border: 1px solid #2e3a60;
  padding: 8px 14px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  white-space: nowrap; overflow: hidden;
}
.syncbar.dim { opacity: 0.55; }
.syncbar .invite.inline { gap: 6px; }
.syncbar .invite.inline .pill { padding: 5px 10px; font-size: 12px; }

.fsocial { display: flex; gap: 8px; margin-bottom: 2px; }
.pill.slim { padding: 6px 12px; font-size: 12.5px; background: #1c2440cc; }

.fplay.armed { background: linear-gradient(135deg, var(--gold), #ff8f5c); color: #201200; }
.fplay.pulse { animation: pulse 1.1s ease-in-out infinite; }

.sheet.comments { z-index: 66; max-height: 72vh; max-height: 72svh; }
.cmt-list {
  overflow-y: auto; max-height: 42vh; max-height: 42svh;
  display: flex; flex-direction: column; gap: 8px;
  padding: 4px 2px;
}
.cmt {
  background: #1c2440; border: 1px solid #2e3a60;
  border-radius: 12px; padding: 8px 12px;
  font-size: 13.5px; line-height: 1.35;
  position: relative; padding-right: 34px;
  -webkit-user-select: text; user-select: text;
}
.cmt b { color: var(--cyan); margin-right: 4px; }
.cmt.maintainer {
  border-color: #7c5cff;
  background: #221d40;
}
.cmt.maintainer b { color: #b8a5ff; }
.cmt.reply { margin-left: 18px; }
.ftab#admin-btn { padding: 8px 11px; }
.cmt-report {
  position: absolute; right: 6px; top: 6px;
  font-size: 12px; opacity: 0.5;
}
.cmt-report:active { opacity: 1; }
.cmt-input { flex: 1; text-align: left; font-size: 15px; }
/* ---------- chip wagers (earned-only chips) ---------- */

.chipbadge {
  position: fixed; left: 12px; top: calc(var(--sat) + 10px);
  z-index: 45;
  background: #141b2ecc; border: 1px solid #4a3a1866;
  padding: 8px 14px; border-radius: 999px;
  font-size: 13.5px; font-weight: 800; color: var(--gold);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}

.stakerow { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.stakechip {
  background: #241d0e; border: 1px solid #4a3a18;
  color: var(--gold);
  padding: 10px 16px; border-radius: 999px;
  font-size: 14px; font-weight: 800;
  transition: transform 0.08s ease;
}
.stakechip:active { transform: scale(0.94); }
.stakechip.dim { opacity: 0.4; }

.dare-head {
  font-size: 13px; font-weight: 900; letter-spacing: 0.26em;
  color: var(--gold); text-transform: uppercase;
}
.dare-amt {
  font-size: 52px; font-weight: 900; color: var(--gold);
  text-shadow: 0 0 38px #ffd16677;
}
.dare-sub { color: var(--dim); font-size: 14px; line-height: 1.45; max-width: 300px; }

.potline {
  font-size: 16px; font-weight: 800; color: var(--gold);
  text-shadow: 0 0 20px #ffd16655;
}
.rivline { color: var(--dim); font-size: 14px; font-weight: 600; }
.rivline b { color: var(--ink); }

.stakestatus {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: center;
  color: var(--gold); font-size: 14px; font-weight: 800;
}
.linkbtn { color: var(--dim); font-size: 13.5px; font-weight: 600; text-decoration: underline; }
.linkbtn:active { transform: scale(0.96); }

.btn.gold {
  background: linear-gradient(135deg, var(--gold), #ff9d3a);
  color: #241500;
  box-shadow: 0 6px 30px #ffd16644;
}
.sheet.stake { z-index: 65; }

/* ---------- ranks: the RANKED reveal ---------- */

.rankpop {
  position: fixed; inset: 0; z-index: 80;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; text-align: center;
  background: radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--tier) 26%, transparent), #0b0f1aee 70%), #0b0f1acc;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  animation: rankpop-in 0.25s ease-out;
}
.rankpop.out { opacity: 0; transition: opacity 0.3s; }
@keyframes rankpop-in { from { opacity: 0; } }
.rankpop .slam {
  font-size: 26px; font-weight: 900; letter-spacing: 6px; color: var(--ink);
  animation: rank-slam 0.45s cubic-bezier(0.2, 2.2, 0.4, 1) both;
}
@keyframes rank-slam { from { transform: scale(2.6); opacity: 0; } }
.rankpop .badge {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  animation: rank-badge 0.5s 0.25s cubic-bezier(0.2, 1.9, 0.4, 1) both;
}
@keyframes rank-badge { from { transform: scale(0.2); opacity: 0; } }
.rankpop .badge .emoji { font-size: 74px; filter: drop-shadow(0 0 24px var(--tier)); }
.rankpop .badge .tname {
  font-size: 44px; font-weight: 900; letter-spacing: 3px; color: var(--tier);
  text-shadow: 0 0 30px var(--tier);
  animation: rank-glow 1.6s 0.6s ease-in-out infinite alternate;
}
@keyframes rank-glow { to { text-shadow: 0 0 12px var(--tier); } }
.rankpop .where { color: var(--dim); font-size: 16px; font-weight: 700; }
.rankpop .pill {
  padding: 10px 18px; border-radius: 999px; background: #1c2440cc;
  font-weight: 800; font-size: 14.5px; box-shadow: 0 0 0 1px #2b3a63;
  animation: rank-badge 0.4s 0.7s both;
}
.rankpop .hint { color: var(--dim); font-size: 12.5px; }
.rankpop .burst { position: absolute; left: 50%; top: 42%; pointer-events: none; }
.rankpop .burst i {
  position: absolute; width: 7px; height: 7px; border-radius: 2px;
  background: var(--tier); box-shadow: 0 0 8px var(--tier);
  animation: spark-fly 0.9s ease-out both;
}
@keyframes spark-fly {
  from { transform: translate(0, 0) scale(1); opacity: 1; }
  to { transform: translate(var(--dx), var(--dy)) scale(0.2) rotate(200deg); opacity: 0; }
}

/* ---------- ranks: promotion / demotion banner ---------- */

.tierbanner {
  position: fixed; top: calc(var(--sat) + 14px); left: 50%; transform: translateX(-50%);
  z-index: 75; padding: 10px 20px; border-radius: 999px;
  font-weight: 900; font-size: 15px; letter-spacing: 1px; white-space: nowrap;
  background: #141b2eee; box-shadow: 0 0 0 1px color-mix(in srgb, var(--tier) 55%, transparent), 0 6px 30px color-mix(in srgb, var(--tier) 35%, transparent);
  animation: tierbanner-in 0.35s cubic-bezier(0.2, 1.6, 0.4, 1) both, toast-out 0.3s 2.8s both;
}
.tierbanner .t { color: var(--tier); text-shadow: 0 0 14px var(--tier); }
.tierbanner.down { opacity: 0.92; filter: saturate(0.55); }
@keyframes tierbanner-in { from { transform: translateX(-50%) translateY(-24px) scale(0.8); opacity: 0; } }

/* ---------- ranks: end-overlay status line ---------- */

.rankline { color: var(--dim); font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.rankline .t { font-weight: 900; }
.rankline .lb-link {
  padding: 5px 12px; border-radius: 999px; background: #1c2440cc;
  font-size: 12.5px; font-weight: 800; box-shadow: 0 0 0 1px #2b3a63;
}
.rankline .lb-link:active { transform: scale(0.95); }

/* ---------- /g/<game>/leaders ---------- */

.leaders {
  position: fixed; inset: 0; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: calc(var(--sat) + 52px) 16px calc(var(--sab) + 24px);
  display: flex; flex-direction: column; gap: 12px; max-width: 520px; margin: 0 auto;
}
.leaders .joining { color: var(--dim); display: flex; gap: 8px; align-items: center; justify-content: center; padding-top: 40vh; }
.lb-head { text-align: center; display: flex; flex-direction: column; gap: 2px; }
.lb-head .lb-emoji { font-size: 44px; filter: drop-shadow(0 0 18px var(--accent)); }
.lb-head .lb-title { font-size: 26px; font-weight: 900; }
.lb-head .lb-sub { color: var(--dim); font-size: 12.5px; font-weight: 800; letter-spacing: 3px; }
.dare {
  text-align: center; padding: 12px 16px; border-radius: 14px; font-size: 15.5px; font-weight: 800;
  background: color-mix(in srgb, var(--accent) 14%, #141b2e);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent);
  animation: tierbanner-in 0.35s cubic-bezier(0.2, 1.6, 0.4, 1) both;
}
.dare b { color: var(--accent); }
.lb-list { display: flex; flex-direction: column; gap: 6px; }
.lb-row {
  display: grid; grid-template-columns: 42px 92px 1fr auto 46px; align-items: center; gap: 8px;
  background: var(--panel); border-radius: 12px; padding: 10px 12px; font-size: 14.5px;
}
.lb-row .pos { color: var(--dim); font-weight: 900; }
.lb-row .tier { font-weight: 900; font-size: 12.5px; white-space: nowrap; }
.lb-row .name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-row .rec { color: var(--dim); font-size: 12.5px; }
.lb-row .score { text-align: right; font-weight: 900; color: var(--gold); }
.lb-row.you { box-shadow: 0 0 0 1.5px var(--cyan); background: #16233d; }
.lb-row.you.loose { margin-top: 2px; }
.lb-row .youtag { color: var(--cyan); font-size: 10.5px; letter-spacing: 1px; }
.lb-empty, .lb-teaser { text-align: center; color: var(--dim); padding: 18px 8px; font-size: 14.5px; line-height: 1.5; }
.lb-teaser { padding: 6px; font-weight: 700; }
.lb-actions { display: flex; flex-direction: column; align-items: center; gap: 10px; padding-top: 4px; }
.lb-actions .btn { width: 100%; max-width: 340px; }
.lb-actions .pill {
  padding: 9px 16px; border-radius: 999px; background: #1c2440cc;
  font-weight: 800; font-size: 13.5px; box-shadow: 0 0 0 1px #2b3a63;
}
.lb-actions .pill:active { transform: scale(0.96); }
.leaders-page .backbtn { z-index: 20; }

/* ---------- /admin: the founders console ---------- */

.admin {
  position: fixed; inset: 0; overflow-y: auto;
  padding: calc(var(--sat) + 14px) 14px calc(var(--sab) + 20px);
  display: flex; flex-direction: column; gap: 18px;
  -webkit-user-select: text; user-select: text;
}
.adm-head { display: flex; align-items: center; justify-content: space-between; }
.adm-head h1 { font-size: 22px; font-weight: 900; }
.admin h2 { font-size: 15px; font-weight: 800; color: var(--dim); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.06em; }
.adm-scroll { overflow-x: auto; }
.adm-table { border-collapse: collapse; width: 100%; font-size: 13px; min-width: 640px; }
.adm-table th { text-align: left; color: var(--dim); font-size: 11px; text-transform: uppercase; padding: 6px 8px; border-bottom: 1px solid #2e3a60; }
.adm-table td { padding: 8px; border-bottom: 1px solid #1c2440; vertical-align: top; }
.adm-archived { opacity: 0.45; }
.adm-list { display: flex; flex-direction: column; gap: 8px; }
.adm-item {
  background: #141b2e; border: 1px solid #2e3a60; border-radius: 12px;
  padding: 9px 12px; font-size: 13.5px; line-height: 1.4;
}
.adm-pill {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 800; background: #2a3558; margin-right: 6px;
}
.adm-pill.working { background: #4a3a10; color: var(--gold); }
.adm-pill.done { background: #0e3b24; color: var(--green); }
.adm-pill.failed { background: #3a1622; color: var(--red); }
.adm-compose .row { display: flex; gap: 8px; }


/* ---------- slash-command palette ---------- */

.cmdpalette {
  position: fixed; z-index: 98;
  max-height: 240px; overflow-y: auto;
  background: #141b2ef6; border: 1px solid #2e3a60; border-radius: 14px;
  box-shadow: 0 -8px 40px #000a;
  display: flex; flex-direction: column;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.cmditem {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  padding: 11px 14px; text-align: left;
  border-bottom: 1px solid #1c2440;
  font-size: 14px;
}
.cmditem:last-child { border-bottom: 0; }
.cmditem:active, .cmditem:hover { background: #1c2440; }
.cmditem b { color: var(--cyan); }
.cmdargs { color: var(--dim); font-size: 12.5px; }
.cmddesc { flex-basis: 100%; color: var(--dim); font-size: 12px; }

/* ---------- profile (PROFILE lane) ---------- */
.ftab.avabtn { padding: 4px 6px; display: flex; align-items: center; }
.ftab.avabtn svg { border-radius: 8px; display: block; }

.profroot {
  min-height: 100vh; min-height: 100svh; overflow-y: auto; overflow-x: hidden;
  padding: calc(var(--sat) + 14px) 16px calc(var(--sab) + 28px);
  max-width: 520px; margin: 0 auto;
  display: flex; flex-direction: column; gap: 14px;
}
.phead { display: flex; flex-direction: column; align-items: center; gap: 8px; padding-top: 34px; }
.pavatar svg { border-radius: 26px; box-shadow: 0 0 40px #35e0ff22; }
.pname {
  font-size: 24px; font-weight: 900; color: var(--ink);
  display: flex; align-items: center; gap: 7px; padding: 4px 10px; border-radius: 12px;
}
.pname:not(.ro):active { background: #1c2440; transform: scale(0.97); }
.pname .pedit { font-size: 14px; opacity: 0.7; }
.pname.ro { cursor: default; }
.pshort { color: var(--dim); font-size: 13px; letter-spacing: 0.06em; }
.pstats { display: flex; gap: 22px; margin-top: 6px; }
.pstat { display: flex; flex-direction: column; align-items: center; }
.pstat b { font-size: 18px; }
.pstat span { color: var(--dim); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.08em; }
.pshare { margin-top: 4px; }

.ptabs {
  display: flex; gap: 4px; justify-content: center;
  background: #141b2ee6; border: 1px solid #2e3a60;
  padding: 4px; border-radius: 999px; align-self: center;
}
.ptab { padding: 8px 13px; border-radius: 999px; font-size: 12.5px; font-weight: 700; color: var(--dim); }
.ptab.active { background: #2a3558; color: var(--ink); }

.pbody { min-height: 40vh; min-height: 40svh; }
.pgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.bgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pcell {
  background: var(--panel); border: 1px solid #2e3a60; border-radius: 16px;
  padding: 14px 8px 12px; display: flex; flex-direction: column; align-items: center; gap: 6px;
  color: var(--ink); text-align: center; position: relative; overflow: hidden;
}
.pcell.game { border-color: color-mix(in srgb, var(--accent) 45%, #2e3a60); }
.pcell.game:active { transform: scale(0.96); }
.pcell.game::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(80% 60% at 50% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent);
  pointer-events: none;
}
.pcell.dim { opacity: 0.55; }
.pc-emoji { font-size: 30px; filter: drop-shadow(0 0 8px var(--accent, #35e0ff)); }
.pc-title { font-size: 13px; font-weight: 800; }
.pc-sub { font-size: 10.5px; color: var(--dim); line-height: 1.3; }
.pc-chip {
  position: absolute; top: 7px; right: 7px; font-size: 9px; font-weight: 800;
  background: #2a3252; color: var(--dim); border-radius: 999px; padding: 2px 7px;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.bcell.locked { opacity: 0.5; }
.bcell.locked .badge-art { filter: grayscale(0.9); }
.bcell.earned { border-color: #3a4a7a; }
.bcell:active { transform: scale(0.96); }

.rlist { display: flex; flex-direction: column; gap: 8px; }
.rrow {
  display: flex; align-items: center; gap: 12px;
  background: var(--panel); border: 1px solid color-mix(in srgb, var(--accent) 40%, #2e3a60);
  border-radius: 14px; padding: 10px 14px;
}
.rrow .pc-emoji { font-size: 22px; }
.rr-title { font-weight: 800; font-size: 14px; flex: 1; text-align: left; }
.rr-tier { font-weight: 900; font-size: 13px; color: var(--accent, var(--cyan)); text-shadow: 0 0 14px var(--accent, var(--cyan)); }

.pempty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 46px 24px; }
.pe-icon { font-size: 40px; opacity: 0.9; }
.pe-line { color: var(--dim); font-size: 14px; text-align: center; max-width: 260px; line-height: 1.5; }

.sheet.badge { z-index: 66; align-items: center; }
.bs-art { margin-top: 4px; }

/* badge award celebration toast */
.badge-toast {
  position: fixed; top: calc(var(--sat) + 16px); left: 50%; transform: translateX(-50%);
  z-index: 80; display: flex; align-items: center; gap: 12px;
  background: #141b2ef2; border: 1px solid #3a4a7a; border-radius: 18px;
  padding: 10px 16px 10px 10px; max-width: min(92vw, 380px);
  box-shadow: 0 8px 44px #000a, 0 0 30px #35e0ff33;
  animation: btoast-in 0.45s cubic-bezier(0.2, 1.4, 0.4, 1);
}
.badge-toast.out { animation: btoast-out 0.35s ease forwards; }
.bt-title { font-weight: 900; font-size: 14.5px; }
.bt-flavor { color: var(--dim); font-size: 12.5px; margin-top: 2px; }
@keyframes btoast-in { from { transform: translateX(-50%) translateY(-30px) scale(0.8); opacity: 0; } }
@keyframes btoast-out { to { transform: translateX(-50%) translateY(-24px); opacity: 0; } }
.rr-pos { display: block; font-size: 10.5px; font-weight: 600; color: var(--dim); margin-top: 1px; }

/* ---------- tokens lane (TOKENS-API.md): wallet, prize pools, founders ops ---------- */
.btn.gold {
  background: linear-gradient(135deg, var(--gold), #ff9a3d);
  color: #241300;
  box-shadow: 0 6px 30px #ffd16644;
}
.ftab.tokchip { font-variant-numeric: tabular-nums; white-space: nowrap; }
.ftab { white-space: nowrap; }
/* narrow phones: the wallet chip joined the pill — text tabs go icon-only */
@media (max-width: 480px) {
  .feedtabs .ftlbl { display: none; }
  .feedtabs .ftab { padding: 8px 12px; }
}

/* wallet sheet */
.sheet.wallet { z-index: 66; }
.wbal { font-size: 36px; font-weight: 900; text-align: center; margin-top: 4px; font-variant-numeric: tabular-nums; }
.wname { text-align: center; color: var(--dim); letter-spacing: 0.22em; text-transform: uppercase; font-size: 11px; margin-bottom: 8px; }
.wlog-head { color: var(--dim); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; margin-top: 10px; }
.wlog { max-height: 210px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; margin: 6px 0; }
.wrow {
  display: flex; align-items: center; gap: 9px;
  background: rgba(255, 255, 255, 0.04); border: 1px solid #1f2942;
  border-radius: 10px; padding: 8px 11px; font-size: 13.5px;
}
.wr-ic { width: 20px; text-align: center; }
.wr-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wr-label .hint { font-size: 10.5px; }
.wr-amt { font-weight: 800; font-variant-numeric: tabular-nums; }
.wpos { color: var(--green); }
.wneg { color: var(--red); }

/* coming-soon + insufficient sheets */
.sheet.soon, .sheet.short { text-align: center; z-index: 67; }
.soon-icon { font-size: 46px; }
.soon-chip {
  align-self: center; margin: 4px auto; padding: 5px 14px; border-radius: 999px;
  background: color-mix(in srgb, var(--gold) 18%, #141b2e);
  border: 1px solid color-mix(in srgb, var(--gold) 45%, #2e3a60);
  color: var(--gold); font-size: 11px; font-weight: 800; letter-spacing: 0.2em; width: fit-content;
}

/* feed card prize-pool row */
.jphost { width: min(320px, 84vw); }
.jprow {
  display: flex; flex-direction: column; gap: 8px; margin-top: 10px;
  padding: 11px 13px; border-radius: 16px;
  background: color-mix(in srgb, var(--gold) 9%, rgba(20, 27, 46, 0.85));
  border: 1px solid color-mix(in srgb, var(--gold) 32%, #2e3a60);
}
.jpline { font-size: 13.5px; line-height: 1.35; }
.jpline b { color: var(--gold); }
.jpbtn { width: 100%; font-size: 16px; padding: 12px 18px; }
.jpends { color: var(--dim); font-size: 11.5px; text-align: center; }

/* live-attempt resume banner */
.jpresume {
  position: fixed; top: calc(var(--sat) + 54px); left: 50%; transform: translateX(-50%);
  z-index: 58; max-width: min(480px, 92vw);
  padding: 10px 16px; border-radius: 999px; font-size: 13px; color: var(--ink);
  background: color-mix(in srgb, var(--gold) 16%, #141b2e);
  border: 1px solid color-mix(in srgb, var(--gold) 50%, #2e3a60);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
  animation: jpglow 2.2s ease-in-out infinite;
}
@keyframes jpglow {
  0%, 100% { box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45); }
  50% { box-shadow: 0 8px 34px #ffd16655; }
}

/* in-run attempt HUD */
.jphud {
  position: fixed; top: calc(var(--sat) + 10px); left: 50%; transform: translateX(-50%);
  z-index: 40; padding: 7px 14px; border-radius: 999px; font-size: 12.5px;
  background: rgba(11, 15, 26, 0.75); backdrop-filter: blur(8px);
  border: 1px solid color-mix(in srgb, var(--gold) 40%, #2e3a60);
  pointer-events: none; white-space: nowrap;
}
.jphud b { color: var(--gold); }

/* end-screen verdict */
.jpwait { display: flex; align-items: center; gap: 8px; color: var(--dim); font-size: 14px; }
.jpbanner {
  text-align: center; padding: 14px 22px; border-radius: 18px; margin-bottom: 4px;
  background: rgba(20, 27, 46, 0.9); border: 1px solid #2e3a60; max-width: min(420px, 88vw);
}
.jpbanner .jpbig { font-size: 24px; font-weight: 900; }
.jpbanner .jpsub { margin-top: 6px; font-size: 14px; color: var(--dim); }
.jpbanner .jpsub b { color: var(--gold); }
.jpbanner.win {
  background: color-mix(in srgb, var(--gold) 14%, #141b2e);
  border-color: color-mix(in srgb, var(--gold) 55%, #2e3a60);
  animation: jpglow 1.6s ease-in-out infinite;
}
.jpbanner.win .jpbig { color: var(--gold); }
.jpbanner.near { border-color: color-mix(in srgb, var(--cyan) 45%, #2e3a60); }

/* /dev/tokens founders console */
.devroot {
  position: fixed; inset: 0; overflow-y: auto; padding: calc(var(--sat) + 18px) 16px calc(var(--sab) + 30px);
  display: flex; flex-direction: column; gap: 14px; align-items: center;
}
.devhead { text-align: center; }
.devhead code { color: var(--gold); }
.devcard {
  width: min(560px, 94vw); background: var(--panel); border: 1px solid #232d4d;
  border-radius: 18px; padding: 16px; display: flex; flex-direction: column; gap: 10px;
}
.devlabel { color: var(--dim); font-size: 11px; letter-spacing: 0.18em; }
.devrow { display: flex; gap: 8px; }
.devin { flex: 1; font-size: 13px; }
.devbal { font-size: 30px; font-weight: 900; text-align: center; font-variant-numeric: tabular-nums; }
.devquick { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.devquick .pill, .devpool .pill {
  padding: 6px 12px; border-radius: 999px; font-size: 12px;
  background: #1c2440; border: 1px solid #2e3a60; color: var(--ink);
}
.devlog { max-height: 240px; }
.devpools { display: flex; flex-direction: column; gap: 8px; }
.devpool {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: rgba(255, 255, 255, 0.04); border-radius: 10px; padding: 8px 12px; font-size: 13px;
}
.devpool b { color: var(--gold); min-width: 44px; }
.devcfg {
  width: 100%; background: #0d1322; color: var(--ink); border: 1px solid #2e3a60;
  border-radius: 12px; padding: 10px; font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12px; line-height: 1.45; resize: vertical;
}

/* ops console v1 */
.adm-row { cursor: pointer; }
.adm-row:active { background: #1b2438; }
.adm-bad { color: #ff5c6c; }
.adm-drillbox {
  background: #141b2e; border: 1px solid #2e3a60; border-radius: 14px;
  padding: 14px; margin: 10px 0;
}
.adm-drillbox h3 { margin: 10px 0 4px; font-size: 13px; color: #9fb0d8; }
.adm-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 700px) { .adm-cols { grid-template-columns: 1fr; } }
.adm-kv { font-size: 14px; }
.adm-trace { font-size: 12px; max-height: 180px; overflow-y: auto; }
.adm-in { text-align: left; font-size: 14px; margin: 2px 0 8px; width: 100%; }
.mono { font-family: ui-monospace, monospace; word-break: break-all; }

/* FEED IA v3: prize/free tabs + friend-session overlay + background matching */
.feedroot:not(.insync) .friendonly { display: none; }
.feedroot.insync .soloonly { display: none; }
.view-prize .jprow { transform: scale(1.04); }
.view-prize .jphost { order: -1; }
.view-prize .fbody::after {
  content: "Free to play — tokens only for prize attempts";
  display: block; text-align: center; font-size: 12px; color: #9fb0d8; padding-top: 6px;
}
#matchpill {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--sab, 0px) + 16px); z-index: 58;
  display: flex; align-items: center; gap: 10px;
  background: #141b2ef2; border: 1px solid #35e0ff88; border-radius: 999px;
  padding: 10px 14px; font-size: 13px; font-weight: 700;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  animation: sheet-in 0.18s ease; max-width: 92vw;
}
#matchpill .mp-txt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#matchpill .mp-x {
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  background: #2e3a60; border: none; color: #e8ecff; font-weight: 900;
}

/* UI SIMPLICITY (Diego hard req): mobile = TikTok bottom nav, zero top chrome;
   desktop keeps the slim top bar. Fewest visible controls wins ties. */
@media (pointer: coarse) {
  .desktoponly { display: none !important; }
  .feed { height: 100vh; height: 100svh; }
  #matchpill { bottom: calc(var(--sab, 0px) + 36px); }
  .syncbar { bottom: calc(var(--sab, 0px) + 30px); }
}
@media not (pointer: coarse) {
  .mobileonly { display: none !important; }
}
/* NAV PLACEMENT (Diego): mobile tabs live at the TOP as feather-light overlay
   text — the bottom belongs to the browser's own chrome. TikTok grammar. */
.mobiletabs {
  position: fixed; left: 0; right: 0; top: 0; z-index: 50;
  display: flex; justify-content: center; align-items: center; gap: 26px;
  padding: calc(var(--sat, 0px) + 10px) 12px 10px;
  background: linear-gradient(#0b0f1acc, transparent);
  pointer-events: none; /* the buttons re-enable — the gradient never blocks taps */
}
.mt-tab, .mt-menu { pointer-events: auto; }
.mt-tab {
  background: none; border: none; color: #ffffffb3;
  font-size: 16px; font-weight: 700; letter-spacing: 0.3px;
  text-shadow: 0 1px 8px #000c; padding: 2px 2px 6px; position: relative;
}
.mt-tab.active { color: #fff; }
.mt-tab.active::after {
  content: ""; position: absolute; left: 30%; right: 30%; bottom: 0;
  height: 3px; border-radius: 2px; background: #fff;
}
.mt-menu {
  position: absolute; right: 12px; top: calc(var(--sat, 0px) + 8px);
  background: none; border: none; font-size: 18px;
  filter: drop-shadow(0 1px 6px #000c);
}
.sheet.menu .menurow {
  text-align: left; padding: 14px; border-radius: 12px;
  background: #1b2438; border: 1px solid #2e3a60; color: inherit; font-size: 16px;
}

/* quiet wager layer */
.wagrow { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; padding: 4px 0; }
.wagrow .pill.gold { background: #3a2f10; border-color: #6b5a1e; color: #ffd166; }
.wagline { font-size: 15px; padding: 4px 0; color: #ffd166; }

/* auto-hiding nav (mobile): slide out on committed browsing; summon via
   nudge / handle / pause. Handle is the a11y fallback. */
.mobiletabs { transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1); }
.mobiletabs.navhidden { transform: translateY(calc(-100% - var(--sat, 0px))); }
#navhandle {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--sab, 0px) + 8px); z-index: 49;
  width: 44px; height: 18px; padding: 0; border: none; background: none;
  opacity: 0; pointer-events: none; transition: opacity 150ms ease;
}
#navhandle::after {
  content: ""; display: block; margin: 6px auto;
  width: 36px; height: 5px; border-radius: 999px; background: #9fb0d866;
}
#navhandle.show { opacity: 1; pointer-events: auto; }
.navhint {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--sab, 0px) + 30px); z-index: 57;
  background: #141b2ef2; border: 1px solid #2e3a60; border-radius: 999px;
  padding: 8px 14px; font-size: 12px; font-weight: 700;
  animation: sheet-in 0.18s ease;
}
@media (prefers-reduced-motion: reduce) {
  .mobiletabs, #navhandle { transition: none; }
}

/* in-game summonable nav: pill is always the deliberate trigger */
.mobiletabs.ingame { z-index: 62; }

/* CHROME FINAL FORM: small always-visible pager; 🔍 left, 👤 right */
.mt-icon {
  position: absolute; left: 12px; top: calc(var(--sat, 0px) + 8px);
  background: none; border: none; font-size: 17px;
  filter: drop-shadow(0 1px 6px #000c); pointer-events: auto;
}

/* §FEED ENGINE v0: search sessions (TikTok grammar) */
.searchsess {
  position: fixed; inset: 0; z-index: 70; background: #0b0f1a;
  display: flex; flex-direction: column;
  padding: calc(var(--sat, 0px) + 10px) 12px calc(var(--sab, 0px) + 10px);
}
.ss-head { display: flex; gap: 10px; align-items: center; }
.ss-in { flex: 1; text-align: left; }
.ss-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
  overflow-y: auto; margin-top: 12px; padding-bottom: 20px;
}
.ss-tile {
  aspect-ratio: 3/4; border-radius: 14px; border: 1px solid #2e3a60;
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 22%, #141b2e), #10162a);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  color: inherit;
}
.ss-emoji { font-size: 42px; }
.ss-title { font-size: 13px; font-weight: 800; }
#ss-scopehead {
  position: fixed; left: 50%; transform: translateX(-50%);
  top: calc(var(--sat, 0px) + 46px); z-index: 51;
  display: flex; align-items: center; gap: 10px;
  background: #141b2ef2; border: 1px solid #2e3a60; border-radius: 999px;
  padding: 6px 12px; font-size: 12px; font-weight: 700;
}
#ss-scopehead button { background: none; border: none; color: #e8ecff; font-size: 14px; font-weight: 900; }

/* CARD CANVAS: rules sheet */
.sheet.rules { text-align: center; }
.rulesbody { font-size: 15px; line-height: 1.5; padding: 4px 6px; }
.ruletags { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.ruletag { font-size: 11px; padding: 3px 9px; border-radius: 999px; background: #1b2438; border: 1px solid #2e3a60; color: #9fb0d8; }

/* CARD CANVAS modes */
.cover-prev { position: absolute; inset: 0; background-size: cover; background-position: center; }
.arcade-prev.teaser { flex-direction: column; gap: 14px; }
.teaser-txt { max-width: 78%; font-size: 15px; line-height: 1.45; color: #e8ecffd9; text-shadow: 0 1px 8px #000c; text-align: center; }
/* DEMO-CANVAS BLEED FIX: the transform makes .demo-prev the CONTAINING BLOCK
   for position:fixed descendants (the clients' .game-canvas), so the replay
   fills its card and nothing else; overflow clips any escape attempt. */
.demo-prev {
  position: absolute; inset: 0; overflow: hidden;
  transform: translateZ(0); contain: layout paint;
}
.demo-prev canvas, .demo-prev .game-canvas {
  position: absolute !important; inset: 0;
  width: 100% !important; height: 100% !important;
}

/* Lexical composer (adopted per Diego P0) — 16px+ font is load-bearing:
   anything smaller makes iOS Safari zoom the page on focus. */
.composer {
  position: relative; display: flex; align-items: flex-end; gap: 8px;
  background: #1b2438; border: 1px solid #2e3a60; border-radius: 18px;
  padding: 10px 10px 10px 14px; flex: 1;
}
.cmp-edit {
  flex: 1; min-height: 24px; max-height: 130px; overflow-y: auto;
  font-size: 16px; line-height: 1.45; color: #e8ecff; outline: none;
  word-break: break-word; white-space: pre-wrap;
}
.cmp-ph {
  position: absolute; left: 14px; top: 12px; pointer-events: none;
  font-size: 16px; color: #9fb0d8aa;
}
.cmp-side { display: flex; align-items: center; gap: 8px; flex: none; }
.cmp-count { font-size: 12px; font-weight: 800; color: #9fb0d8; }
.cmp-count.over { color: #ff5c6c; }
.cmp-send {
  width: 36px; height: 36px; border-radius: 50%; border: none;
  background: #35e0ff; color: #0b0f1a; font-size: 16px; font-weight: 900;
}
.cmp-send:disabled { background: #2e3a60; color: #9fb0d8; }
