:root {
  --bg: #0e1512;
  --panel: #141d18;
  --panel2: #1c2822;
  --line: #2b3a33;
  --text: #f4ecdf;
  --muted: #a9bab0;
  --dim: #6f857a;
  --amber: #f5b03c;
  --amber-soft: rgba(245, 176, 60, 0.14);
  --green: #4fbf7a;
  --bad: #ff7b6e;
  --felt: #1f5a40;
  --card: #fbf6ec;
  --ink: #1d1a17;
  --red: #c8372d;
  --blue: #1f6fd1;
  --clubs: #1d8a4a;
  --font: Nunito, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --cardfont: 'Libre Baskerville', Georgia, 'Times New Roman', serif;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; min-width: 0; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); }
body { overscroll-behavior: none; -webkit-user-select: none; user-select: none; }
input { -webkit-user-select: text; user-select: text; }
button, input { font: inherit; color: inherit; }
#app { min-height: 100%; max-width: 560px; margin: 0 auto; padding: calc(10px + var(--safe-t)) 12px calc(12px + var(--safe-b)); display: flex; flex-direction: column; }
.hidden { display: none !important; }

/* ---------- basics ---------- */
.btn { border: 1px solid #33433b; background: var(--panel2); border-radius: 12px; min-height: 44px; padding: 0 16px; font-weight: 800; font-size: 16px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 7px; transition: transform .08s, opacity .15s; }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--amber); border-color: var(--amber); color: #1d1305; }
.btn.go { background: var(--green); border-color: var(--green); color: #07160d; }
.btn.ghost { background: transparent; }
.btn.danger { color: #ff9d92; }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
.btn.block { width: 100%; }
.btn.big { min-height: 54px; font-size: 18px; border-radius: 16px; }
.btn:disabled { opacity: .35; pointer-events: none; }
.iconbtn { width: 44px; height: 44px; border-radius: 12px; border: 1px solid #33433b; background: var(--panel2); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; padding: 0; }
.iconbtn.on { background: var(--amber); border-color: var(--amber); color: #1d1305; box-shadow: 0 0 16px rgba(245,176,60,.45); }
.iconbtn.pulse { animation: pulse 1.2s ease-in-out infinite; }
.input { width: 100%; background: #101914; border: 1px solid #33433b; border-radius: 12px; padding: 13px 14px; font-size: 17px; outline: none; }
.input:focus { border-color: var(--amber); }
.input.code { text-transform: uppercase; letter-spacing: .5em; text-align: center; font-size: 28px; font-weight: 900; padding-left: calc(14px + .5em); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.row { display: flex; gap: 10px; align-items: center; }
.grow { flex: 1; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.panel { background: var(--panel); border: 1px solid #26332c; border-radius: 18px; padding: 14px; }
h2 { font-size: 26px; line-height: 1.1; margin: 0; font-weight: 900; }
h3 { font-size: 17px; margin: 0; font-weight: 900; }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 900; padding: 3px 8px; border-radius: 99px; background: var(--amber-soft); color: var(--amber); }
.tag.green { background: rgba(79,191,122,.15); color: var(--green); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); flex: none; }
.dot.off { background: #55655d; }
.avatar { width: 28px; height: 28px; border-radius: 50%; color: #0e1512; font-weight: 900; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
@keyframes pulse { 50% { box-shadow: 0 0 0 4px rgba(245,176,60,.25), 0 0 22px rgba(245,176,60,.55); } }

/* ---------- home ---------- */
.hero { text-align: center; padding: 6vh 0 22px; }
.hero h1 { font-size: 56px; line-height: 1; margin: 12px 0 6px; font-weight: 900; color: var(--amber); letter-spacing: -.02em; }
.hero p { margin: 0; color: var(--muted); }
.fan { height: 96px; display: flex; justify-content: center; }
.fan .card { margin: 0 -11px; --w: 56px; }
.fan .card:nth-child(1) { transform: rotate(-15deg) translateY(10px); }
.fan .card:nth-child(2) { transform: rotate(-5deg); }
.fan .card:nth-child(3) { transform: rotate(5deg); }
.fan .card:nth-child(4) { transform: rotate(15deg) translateY(10px); }
.namelist { display: flex; flex-direction: column; gap: 8px; }
.namebtn { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 0 14px; border-radius: 14px; border: 1.5px solid #2b3a33; background: var(--panel); font-size: 17px; font-weight: 800; text-align: left; cursor: pointer; }
.namebtn:disabled { opacity: .45; }
.namebtn.mine { border-color: var(--amber); }
.footer { margin-top: auto; padding-top: 22px; text-align: center; font-size: 12px; color: #55655d; }

/* ---------- seats editor / lobby ---------- */
.seatlist { display: flex; flex-direction: column; gap: 8px; }
.seatrow { display: flex; align-items: center; gap: 10px; min-height: 54px; padding: 0 8px 0 12px; border-radius: 14px; background: var(--panel); border: 1.5px solid #26332c; }
.seatrow .num { width: 20px; color: var(--dim); font-weight: 900; }
.seatrow.drag { border-color: var(--amber); background: #2a2418; box-shadow: 0 12px 28px rgba(0,0,0,.55); position: relative; z-index: 5; }
.handle { width: 44px; height: 44px; display: grid; place-items: center; color: var(--dim); touch-action: none; cursor: grab; }
.bigcode { font-size: 54px; font-weight: 900; letter-spacing: .16em; color: var(--amber); line-height: 1; padding-left: .16em; }
.toggle { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 0 14px; border-radius: 14px; background: var(--panel); border: 1px solid #26332c; cursor: pointer; }
.switch { width: 46px; height: 28px; border-radius: 99px; background: #33433b; position: relative; flex: none; transition: background .15s; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #f4ecdf; transition: left .15s; }
.switch.on { background: var(--amber); }
.switch.on::after { left: 21px; }

/* ---------- table ---------- */
.topbar { display: flex; align-items: center; gap: 8px; min-height: 44px; margin-bottom: 8px; }
.topbar .rnd { font-weight: 900; font-size: 17px; white-space: nowrap; }
.topbar .rnd span { color: var(--muted); font-weight: 700; }
.wildchip { display: inline-flex; align-items: center; padding: 5px 10px; border-radius: 99px; background: var(--amber-soft); border: 1px solid rgba(245,176,60,.45); color: var(--amber); font-weight: 800; font-size: 13px; white-space: nowrap; }
.felt { position: relative; height: clamp(250px, 37vh, 350px); border-radius: 32px; background: radial-gradient(120% 90% at 50% 45%, var(--felt) 0%, #143a2a 70%, #0f2c20 100%); box-shadow: inset 0 0 0 6px #3a2417, inset 0 0 0 8px #5a3a24, inset 0 10px 30px rgba(0,0,0,.45); flex: none; }
.felt.host { height: clamp(330px, 52vh, 470px); }
.seat { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 4px; }
.chip { display: flex; align-items: center; gap: 6px; padding: 3px 9px 3px 3px; border-radius: 99px; background: rgba(10,20,15,.6); white-space: nowrap; max-width: 120px; }
.chip .avatar { width: 24px; height: 24px; font-size: 12px; }
.chip .nm { font-weight: 800; font-size: 12.5px; line-height: 1.05; overflow: hidden; text-overflow: ellipsis; }
.chip .meta { font-size: 10.5px; color: #b9c9bf; line-height: 1.1; }
.chip.turn { background: var(--amber); color: #1d1305; box-shadow: 0 0 0 3px rgba(245,176,60,.35), 0 0 24px rgba(245,176,60,.6); }
.chip.turn .meta { color: #3d2a08; font-weight: 800; }
.chip.off { opacity: .55; }
.seat .badge { position: absolute; top: -8px; right: -6px; font-size: 9.5px; font-weight: 900; padding: 2px 6px; border-radius: 99px; background: var(--amber); color: #1d1305; z-index: 3; }
.seat .badge.out { background: var(--green); color: #07160d; }
.spot { position: absolute; width: 150px; height: 150px; border-radius: 50%; transform: translate(-50%, -50%); background: radial-gradient(circle, rgba(245,176,60,.3) 0%, rgba(245,176,60,0) 70%); pointer-events: none; }
.pile { position: relative; width: calc(var(--pw) + 14px); height: calc(var(--pw) * 1.4 + 12px); cursor: pointer; }
.pile .card { position: absolute; left: 7px; top: 6px; --w: var(--pw); }
.pile.can .card:last-child { box-shadow: 0 0 0 3px var(--amber), 0 0 18px rgba(245,176,60,.55), 0 4px 10px rgba(0,0,0,.4); }
.pile.empty::before { content: ''; position: absolute; left: 7px; top: 6px; width: var(--pw); height: calc(var(--pw) * 1.4); border: 2px dashed rgba(244,236,223,.18); border-radius: 7px; }
.pile.droptarget::after { content: 'Discard'; position: absolute; inset: -6px; border: 2px dashed var(--amber); border-radius: 12px; display: grid; place-items: end center; font-size: 11px; font-weight: 900; color: var(--amber); padding-bottom: 2px; }
.pile.drophover::after { background: rgba(245,176,60,.18); }
.stock { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; }
.stock .card { --w: 58px; }
.stock.can .card { box-shadow: 0 0 0 3px var(--amber), 0 0 18px rgba(245,176,60,.55), 0 4px 10px rgba(0,0,0,.4); animation: pulse 1.4s ease-in-out infinite; }
.stock.locked { opacity: .45; }
.lbl { font-size: 11.5px; font-weight: 800; color: #d7e6dc; white-space: nowrap; }
.floatcard { position: absolute; transform: translate(-50%, -50%) rotate(8deg); --w: 34px; pointer-events: none; animation: bob 1s ease-in-out infinite; }
@keyframes bob { 50% { transform: translate(-50%, -60%) rotate(4deg); } }

.turnrow { display: flex; align-items: center; gap: 8px; margin: 10px 0 6px; min-height: 36px; }
.yourturn { padding: 7px 15px; border-radius: 99px; background: var(--amber); color: #1d1305; font-weight: 900; font-size: 17px; box-shadow: 0 0 22px rgba(245,176,60,.45); white-space: nowrap; }
.whoseturn { display: flex; align-items: center; gap: 8px; font-weight: 900; font-size: 17px; }
.steps { display: flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 800; margin-left: auto; }
.steps .st { padding: 5px 9px; border-radius: 99px; border: 1.5px solid #3c4d45; color: var(--dim); white-space: nowrap; }
.steps .st.on { background: var(--text); border-color: var(--text); color: #0e1512; }
.steps .st.done { color: var(--muted); }
.steps .ln { width: 10px; height: 2px; background: #3c4d45; }
.nextup { margin-left: auto; padding: 5px 11px; border-radius: 99px; border: 1.5px solid var(--amber); color: var(--amber); font-size: 12.5px; font-weight: 900; white-space: nowrap; }
.feed { display: flex; align-items: center; gap: 8px; padding: 7px 11px; border-radius: 10px; background: #18231d; font-size: 13px; color: #e8dcc8; min-height: 34px; margin-bottom: 8px; }
.feed.cancel { background: #2a2216; }
.feed.out { background: #17301f; color: #c9f0d6; }

/* ---------- hand ---------- */
.handwrap { margin-top: auto; background: var(--panel); border: 1px solid #26332c; border-radius: 22px; padding: 10px 10px 10px; position: relative; }
.handwrap.dimmed .hand { opacity: .92; }
.hlabel { font-size: 12px; font-weight: 800; color: var(--dim); margin: 0 4px 6px; display: flex; align-items: center; gap: 6px; }
.groups { display: flex; flex-wrap: wrap; gap: 22px 10px; margin-bottom: 22px; }
.tray { position: relative; display: flex; padding: 8px 8px 8px calc(8px + var(--gw) * .5); border-radius: 14px; border: 1.5px dashed rgba(244,236,223,.32); min-height: calc(var(--gw) * 1.4 + 16px); }
.tray .card { --w: var(--gw); margin-left: calc(var(--gw) * -.5); }
.tray.valid { border: 1.5px solid rgba(79,191,122,.7); background: rgba(79,191,122,.10); }
.tray.invalid { border: 1.5px solid var(--bad); background: rgba(255,123,110,.08); }
.tray .tb { position: absolute; top: -9px; right: -7px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; z-index: 4; }
.tray.valid .tb { background: var(--green); }
.tray.invalid .tb { background: var(--bad); }
.tray .note { position: absolute; left: 0; right: 0; bottom: -17px; text-align: center; font-size: 10.5px; color: var(--dim); white-space: nowrap; }
.tray.glow, .newtray.glow { border: 2px solid var(--amber) !important; background: rgba(245,176,60,.12); box-shadow: 0 0 18px rgba(245,176,60,.35); cursor: pointer; }
.tray.drophover, .newtray.drophover, .loosezone.drophover { background: rgba(245,176,60,.18); border-color: var(--amber) !important; }
.newtray { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; width: calc(var(--gw) + 26px); min-height: calc(var(--gw) * 1.4 + 16px); border-radius: 14px; border: 1.5px dashed #3b4b43; color: var(--dim); font-size: 10.5px; font-weight: 800; text-align: center; }
.loosezone { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 12px 6px; padding-top: 10px !important; min-height: calc(var(--hw) * 1.4 + 8px); border-radius: 14px; border: 1.5px dashed transparent; padding: 2px; }
.loosezone .card { --w: var(--hw); }
.hand .card { touch-action: none; cursor: grab; transition: transform .12s, box-shadow .12s, opacity .12s; }
.hand .card.sel { transform: translateY(-12px); box-shadow: 0 0 0 3px var(--amber), 0 10px 20px rgba(0,0,0,.5); z-index: 3; }
.hand .card.new::before { content: 'NEW'; position: absolute; left: 50%; top: -9px; transform: translateX(-50%); font: 900 9px var(--font); background: var(--green); color: #07160d; padding: 1px 5px; border-radius: 99px; z-index: 2; }
.hand .card.ghost { opacity: .25; }
.hand .card.join { box-shadow: 0 0 0 3px var(--amber), 0 0 18px rgba(245,176,60,.6); }
.hand .card.join::after { content: '+'; position: absolute; inset: 0; display: grid; place-items: center; font: 900 calc(var(--w) * .6) var(--font); color: #1d1305; background: rgba(245,176,60,.55); border-radius: inherit; }
.hand .card.ins-before { box-shadow: -5px 0 0 0 var(--amber); }
.hand .card.ins-after { box-shadow: 5px 0 0 0 var(--amber); }
.hand .card.checked { box-shadow: 0 0 0 3px var(--amber); transform: translateY(-8px); }
.hand .card .ck { position: absolute; right: -6px; top: -6px; width: 20px; height: 20px; border-radius: 50%; background: var(--amber); display: grid; place-items: center; z-index: 3; }
.dragclone { position: fixed; z-index: 90; pointer-events: none; transform: translate(-50%, -60%) rotate(4deg) scale(1.08); box-shadow: 0 16px 34px rgba(0,0,0,.6) !important; transition: none !important; }
.hiddenfan { position: relative; height: 150px; display: flex; justify-content: center; cursor: pointer; }
.hiddenfan .card { position: absolute; top: 14px; --w: 62px; transform-origin: 50% 120%; }
.handbar { display: flex; gap: 8px; margin: 10px -10px -10px; padding: 10px; position: sticky; bottom: 0; background: var(--panel); border-radius: 0 0 22px 22px; z-index: 7; }
.handbar .grow .btn { width: 100%; }
.modebar { position: sticky; top: 0; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: #1d2a23; border: 1.5px solid var(--amber); margin-bottom: 10px; z-index: 6; }
.modebar b { font-size: 15px; display: block; }
.modebar span { font-size: 12.5px; color: var(--muted); }
.hint { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; background: #24301f; border: 1px solid #3f5a37; color: #e4f2d8; font-size: 13.5px; margin-bottom: 10px; }
.hint button { margin-left: auto; flex: none; }
.undo { position: fixed; left: 50%; bottom: calc(22px + var(--safe-b)); transform: translateX(-50%); z-index: 80; display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 16px; border-radius: 16px; background: #26201a; border: 1.5px solid var(--amber); box-shadow: 0 14px 32px rgba(0,0,0,.6); overflow: hidden; }
.undo .bar { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--amber); animation: shrink 2s linear forwards; }
@keyframes shrink { from { width: 100%; } to { width: 0; } }
.hostpanel { margin-top: auto; }

/* ---------- cards ---------- */
.card { --w: 56px; width: var(--w); height: calc(var(--w) * 1.4); border-radius: calc(var(--w) * .12); background: var(--card); color: var(--ink); position: relative; flex: none; box-shadow: 0 1px 0 rgba(0,0,0,.25), 0 4px 10px rgba(0,0,0,.38); font-family: var(--cardfont); }
.card.red { color: var(--red); }
.four .card.D { color: var(--blue); }
.four .card.C { color: var(--clubs); }
.card .ix { position: absolute; top: 6%; left: 9%; font-weight: 700; font-size: calc(var(--w) * .29); line-height: 1; text-align: center; }
.card .ix .s { display: block; font-size: calc(var(--w) * .26); }
.card .big { position: absolute; right: 8%; bottom: 5%; font-size: calc(var(--w) * .46); line-height: 1; }
.card.wild { background: linear-gradient(160deg, #fff3d6, #ffd98a); }
.card .wb { position: absolute; top: 5%; right: 7%; font-size: calc(var(--w) * .2); color: #b06d00; font-family: var(--font); }
.card.joker .jk { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; font-family: var(--font); font-weight: 900; font-size: calc(var(--w) * .15); color: #9b5d00; line-height: 1.1; }
.card.joker .jk b { display: block; font-size: calc(var(--w) * .46); color: #e09400; }
.card.back { background: repeating-linear-gradient(45deg, #8a2a24 0 5px, #9c342c 5px 10px); border: 3px solid var(--card); }
.card.mini { --w: 30px; box-shadow: 0 1px 3px rgba(0,0,0,.4); }
.card.mini .big, .card.mini .wb { display: none; }
.card.mini .ix { left: 0; right: 0; top: 3px; font-size: 11px; }
.card.mini .ix .s { font-size: 11px; }
.card.mini.joker .jk { font-size: 7px; }
.card.mini.joker .jk b { font-size: 13px; }
.large .loosezone .card { --w: calc(var(--hw) * 1.15); }
.large .tray .card { --w: calc(var(--gw) * 1.12); margin-left: calc(var(--gw) * -.56); }

/* ---------- reveal ---------- */
.reveal { position: fixed; inset: 0; z-index: 70; background: rgba(6,10,8,.86); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 20px; animation: fade .15s; }
.reveal h2 { text-align: center; }
.bigback { width: min(290px, 74vw); aspect-ratio: 5 / 7; border-radius: 24px; border: 9px solid var(--card); background: repeating-linear-gradient(45deg, #8a2a24 0 9px, #9c342c 9px 18px); box-shadow: 0 0 0 3px var(--amber), 0 0 40px rgba(245,176,60,.45), 0 24px 60px rgba(0,0,0,.6); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; color: var(--card); cursor: pointer; animation: rise .25s ease-out; transform: rotate(-2deg); padding: 0; }
.bigback .emb { width: 104px; height: 104px; border-radius: 50%; border: 4px solid var(--card); background: #7a221d; display: grid; place-items: center; font: 700 30px var(--cardfont); }
.bigback .tap { padding: 9px 18px; border-radius: 99px; background: rgba(14,21,18,.8); font-weight: 900; font-size: 18px; }
.flipcard { --w: min(260px, 66vw); animation: flip .35s ease-out; }
@keyframes rise { from { transform: translateY(40px) rotate(-6deg); opacity: 0; } }
@keyframes flip { from { transform: rotateY(90deg); } }
@keyframes fade { from { opacity: 0; } }

/* ---------- results ---------- */
.rlist { display: flex; flex-direction: column; gap: 10px; }
.rrow { background: var(--panel); border: 1px solid #26332c; border-radius: 14px; padding: 12px; }
.rrow .hd { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.rrow .hd .pts { margin-left: auto; font-weight: 900; font-size: 19px; }
.rrow .hd .pts.zero { color: var(--green); }
.mgroups { display: flex; flex-wrap: wrap; gap: 7px; }
.mgroup { display: flex; gap: 2px; padding: 3px; border-radius: 7px; background: rgba(79,191,122,.13); }
.mgroup.loose { background: rgba(255,123,110,.13); }
.stand { width: 100%; border-collapse: collapse; font-size: 15px; }
.stand td { padding: 9px 6px; border-bottom: 1px solid #26332c; }
.stand td:last-child { text-align: right; font-weight: 900; }
.stand .rk { width: 28px; color: var(--dim); font-weight: 900; }
.stand tr.lead td { color: var(--amber); }
.hist { overflow-x: auto; }
.hist table { border-collapse: collapse; font-size: 12.5px; min-width: 100%; }
.hist th, .hist td { padding: 7px; text-align: center; border-bottom: 1px solid #26332c; white-space: nowrap; }
.hist th:first-child, .hist td:first-child { text-align: left; position: sticky; left: 0; background: var(--panel); }
.winner { text-align: center; padding: 16px 0 4px; }
.winner .trophy { width: 70px; height: 70px; margin: 0 auto; border-radius: 50%; background: var(--amber); display: grid; place-items: center; box-shadow: 0 0 40px rgba(245,176,60,.5); }
.coin { width: 120px; height: 120px; margin: 10px auto; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ffe8a8, #f5b03c 55%, #b9791a); border: 4px solid #8a5a12; display: grid; place-items: center; font-weight: 900; font-size: 15px; color: #3d2a08; text-align: center; padding: 10px; }
.coin.spin { animation: coinspin 1.6s cubic-bezier(.2,.7,.3,1); }
@keyframes coinspin { from { transform: rotateY(0) translateY(0); } 40% { transform: rotateY(900deg) translateY(-60px); } to { transform: rotateY(1800deg) translateY(0); } }
.award { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--panel2); }

/* ---------- modal + toast + popups ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.62); display: flex; align-items: flex-end; justify-content: center; z-index: 60; animation: fade .15s; }
.modal { width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto; background: var(--panel); border: 1px solid #2b3a33; border-bottom: none; border-radius: 22px 22px 0 0; padding: 18px 16px calc(20px + var(--safe-b)); animation: up .2s ease-out; }
.modal h3 { font-size: 20px; margin-bottom: 12px; }
.modal ul { padding-left: 18px; margin: 0; line-height: 1.5; }
.modal li { margin-bottom: 6px; }
.sheetbtn { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 0 14px; border-radius: 12px; border: none; background: var(--panel2); font-weight: 800; font-size: 16px; text-align: left; cursor: pointer; }
.sheetbtn:disabled { opacity: .4; }
.prow { display: flex; align-items: center; gap: 8px; padding: 10px; border-radius: 12px; background: var(--panel2); flex-wrap: wrap; }
.prow .nm { font-weight: 800; flex: 1; min-width: 90px; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
#toast { position: fixed; left: 50%; top: calc(12px + var(--safe-t)); transform: translate(-50%, -30px); opacity: 0; background: #3a2a14; color: #ffd796; border: 1px solid #6b4c1c; padding: 11px 16px; border-radius: 12px; font-size: 14px; font-weight: 700; z-index: 100; transition: all .2s; max-width: 92vw; text-align: center; pointer-events: none; }
#toast.show { transform: translate(-50%, 0); opacity: 1; }
.popup { position: fixed; inset: 0; z-index: 95; display: grid; place-items: center; background: rgba(0,0,0,.6); padding: 24px; animation: fade .15s; }
.popup .box { background: var(--amber); color: #1d1305; border-radius: 24px; padding: 26px 22px; text-align: center; max-width: 320px; animation: wobble .5s; box-shadow: 0 20px 50px rgba(0,0,0,.6); }
.popup .box h2 { font-size: 30px; }
@keyframes wobble { 20% { transform: rotate(-6deg) scale(1.05); } 40% { transform: rotate(5deg); } 60% { transform: rotate(-3deg); } 80% { transform: rotate(2deg); } }
.flash { position: fixed; inset: 0; pointer-events: none; z-index: 85; box-shadow: inset 0 0 0 6px var(--amber); animation: flash 1s ease-out forwards; }
@keyframes flash { to { box-shadow: inset 0 0 0 0 rgba(245,176,60,0); } }
.conn { position: fixed; bottom: calc(10px + var(--safe-b)); left: 50%; transform: translateX(-50%); background: #3b1f1c; color: #ffb3a8; font-size: 13px; padding: 7px 12px; border-radius: 99px; z-index: 75; }
.paused { position: fixed; inset: 0; z-index: 65; background: rgba(6,10,8,.8); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; padding: 20px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
