:root {
  --ink: #2b2140; --ink2: #4a3d66; --paper: #fffaf0; --pink: #ff5d8f; --yellow: #ffd23f; --teal: #3ddc97;
  --sky: #4cc9f0; --purple: #7b61ff; --red: #ff4d4d; --orange: #ff9f43; --muted: #8f86a8;
  --shadow: 0 4px 0 var(--ink); --radius: 16px;
  --font: "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Microsoft YaHei UI", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #2a0f3d; color: var(--ink); font-family: var(--font); touch-action: manipulation; -webkit-user-select: none; user-select: none; overscroll-behavior: none; }
input, textarea { -webkit-user-select: text; user-select: text; font-family: inherit; }
[hidden] { display: none !important; }
button { font-family: inherit; cursor: pointer; border: 0; color: inherit; }
button:disabled { cursor: default; opacity: .45; }

#gl { position: fixed; inset: 0; width: 100vw; height: 100dvh; display: block; }
#overlay { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }

/* ------------------------------------------------ buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; padding: 10px 18px; border-radius: 14px; font-weight: 900; font-size: 17px;
  background: #fff; border: 3px solid var(--ink); box-shadow: var(--shadow); transition: transform .08s, box-shadow .08s; letter-spacing: .5px; white-space: nowrap; }
.btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.btn.big { min-height: 58px; font-size: 20px; width: 100%; }
.btn.pink { background: var(--pink); color: #fff; } .btn.yellow { background: var(--yellow); } .btn.teal { background: var(--teal); }
.btn.sky { background: var(--sky); } .btn.purple { background: var(--purple); color: #fff; } .btn.red { background: var(--red); color: #fff; } .btn.ghost { background: rgba(255,255,255,.85); }
.btn.sm { min-height: 36px; font-size: 14px; padding: 6px 12px; border-radius: 11px; box-shadow: 0 3px 0 var(--ink); }
.btn small { font-weight: 700; opacity: .85; font-size: .78em; }
.chip-btn { background: rgba(255,255,255,.92); border: 3px solid var(--ink); border-radius: 999px; padding: 6px 12px; font-weight: 900; box-shadow: 0 3px 0 var(--ink); display: inline-flex; gap: 6px; align-items: center; font-size: 15px; }
.icon-btn { position: relative; width: 44px; height: 44px; border-radius: 14px; background: rgba(255,255,255,.92); border: 3px solid var(--ink); box-shadow: 0 3px 0 var(--ink); font-size: 20px; display: grid; place-items: center; }
.icon-btn:active, .chip-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.icon-btn i { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; border-radius: 10px; background: var(--pink); color: #fff; font-size: 12px; font-style: normal; font-weight: 900; display: grid; place-items: center; border: 2px solid var(--ink); padding: 0 4px; }
.card { background: var(--paper); border: 3px solid var(--ink); border-radius: 22px; box-shadow: 0 6px 0 var(--ink); padding: 18px; }

/* ------------------------------------------------ home */
.screen { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: calc(16px + var(--safe-t)) 16px calc(16px + var(--safe-b)); gap: 14px; overflow-y: auto; }
#home { background: linear-gradient(180deg, rgba(42,15,61,.55), rgba(42,15,61,.05) 45%, rgba(42,15,61,.6)); }
.home-top { position: absolute; top: calc(12px + var(--safe-t)); right: 14px; }
.brand { text-align: center; color: #fff; }
.logo { display: flex; align-items: center; gap: 10px; justify-content: center; }
.logo h1 { margin: 0; font-size: clamp(44px, 12vw, 76px); font-weight: 900; letter-spacing: 2px; color: var(--yellow);
  -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; text-shadow: 0 6px 0 var(--ink); transform: rotate(-3deg); }
.fist { font-size: clamp(40px, 11vw, 66px); display: inline-block; animation: jab 1.6s infinite; filter: drop-shadow(0 4px 0 var(--ink)); }
@keyframes jab { 0%, 60%, 100% { transform: translateX(0) rotate(0) } 70% { transform: translateX(22px) rotate(-12deg) scale(1.15) } 80% { transform: translateX(-4px) } }
.brand p { margin: 8px 0 0; font-weight: 800; font-size: 16px; text-shadow: 0 2px 0 var(--ink); }
.home-card { width: min(400px, 100%); display: flex; flex-direction: column; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; font-weight: 800; font-size: 14px; color: var(--ink2); }
.field input, .join-row input, .chatbox input { height: 50px; border-radius: 14px; border: 3px solid var(--ink); padding: 0 14px; font-size: 18px; font-weight: 800; background: #fff; color: var(--ink); outline: none; min-width: 0; }
.field input:focus, .join-row input:focus { border-color: var(--purple); }
.join-row { display: flex; gap: 10px; }
.join-row input { flex: 1; letter-spacing: 6px; text-align: center; font-size: 22px; }
#recent { display: flex; flex-direction: column; gap: 6px; }
#recent .rec-title { font-weight: 800; font-size: 13px; color: var(--muted); margin-top: 4px; }
.rec { display: flex; align-items: center; gap: 10px; background: #fff; border: 2px solid var(--ink); border-radius: 12px; padding: 6px 6px 6px 12px; }
.rec b { font-size: 18px; letter-spacing: 3px; flex: 1; }
.rec span { font-size: 12px; color: var(--muted); }
.foot { color: rgba(255,255,255,.75); font-size: 12px; font-weight: 700; margin: 0; text-align: center; }

/* ------------------------------------------------ top bar */
#topbar { position: fixed; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 8px; padding: calc(8px + var(--safe-t)) 10px 8px; z-index: 5; pointer-events: none; }
#topbar > * { pointer-events: auto; }
#topbar .code b { letter-spacing: 2px; font-size: 16px; }
.tb-info { flex: 1; display: flex; flex-direction: column; color: #fff; font-weight: 900; font-size: 13px; text-shadow: 0 2px 0 var(--ink); line-height: 1.25; min-width: 0; }
.tb-info span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-right { display: flex; gap: 6px; }

/* ------------------------------------------------ seat plates */
.plate { position: absolute; left: 0; top: 0; transform: translate(-50%, -100%); pointer-events: auto; display: flex; flex-direction: column; align-items: center; gap: 3px; will-change: transform; cursor: pointer; }
.plate .tag { display: flex; align-items: center; gap: 6px; background: rgba(255,255,255,.95); border: 2.5px solid var(--ink); border-radius: 12px; padding: 3px 8px 3px 4px; box-shadow: 0 3px 0 var(--ink); min-width: 78px; position: relative; }
.plate .dot { width: 22px; height: 22px; border-radius: 8px; border: 2px solid var(--ink); flex: none; display: grid; place-items: center; font-size: 11px; }
.plate .nm { font-weight: 900; font-size: 12px; max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.1; }
.plate .st { font-weight: 900; font-size: 13px; color: var(--purple); line-height: 1.1; }
.plate .off { position: absolute; top: -7px; right: -7px; font-size: 12px; background: #fff; border-radius: 50%; border: 2px solid var(--ink); width: 20px; height: 20px; display: grid; place-items: center; }
.plate.me .tag { background: var(--yellow); }
.plate.active .tag { border-color: var(--pink); box-shadow: 0 3px 0 var(--pink), 0 0 0 4px rgba(255,93,143,.35); animation: pulse 1s infinite; }
@keyframes pulse { 50% { box-shadow: 0 3px 0 var(--pink), 0 0 0 8px rgba(255,93,143,.12); } }
.plate.winner .tag { background: var(--teal); animation: bounce .5s 4; }
@keyframes bounce { 50% { transform: translateY(-8px) scale(1.06); } }
.plate .ring { position: absolute; inset: -6px; pointer-events: none; }
.plate .ring rect { fill: none; stroke: var(--pink); stroke-width: 4; stroke-linecap: round; }
.badge { font-size: 11px; font-weight: 900; padding: 2px 7px; border-radius: 8px; border: 2px solid var(--ink); background: #fff; white-space: nowrap; box-shadow: 0 2px 0 var(--ink); }
.badge.win { background: var(--teal); } .badge.lose { background: #ffd0d0; }
.hn { font-size: 11px; font-weight: 900; color: #fff; background: var(--ink); border-radius: 7px; padding: 1px 6px; white-space: nowrap; }
.seatbtn { position: absolute; left: 0; top: 0; transform: translate(-50%, -50%); pointer-events: auto; width: 54px; height: 54px; border-radius: 50%; background: rgba(255,255,255,.9); border: 3px dashed var(--ink); font-size: 13px; font-weight: 900; display: grid; place-items: center; line-height: 1.05; box-shadow: 0 3px 0 var(--ink); will-change: transform; }
.seatbtn:hover { background: var(--yellow); }
.seatbtn:active { background: var(--yellow); box-shadow: 0 1px 0 var(--ink); }
.bubble { position: absolute; left: 0; top: 0; transform: translate(-50%, -100%); background: #fff; border: 2.5px solid var(--ink); border-radius: 14px; padding: 5px 10px; font-weight: 900; font-size: 14px; max-width: 180px; box-shadow: 0 3px 0 var(--ink); animation: popin .25s ease-out; will-change: transform; word-break: break-word; text-align: center; }
.bubble.emoji { font-size: 30px; padding: 2px 8px; }
.bubble::after { content: ''; position: absolute; left: 50%; bottom: -9px; width: 12px; height: 12px; background: #fff; border-right: 2.5px solid var(--ink); border-bottom: 2.5px solid var(--ink); transform: translateX(-50%) rotate(45deg); }
@keyframes popin { from { opacity: 0; scale: .5; } }

/* ------------------------------------------------ banner / center */
#banner { position: fixed; left: 50%; top: calc(64px + var(--safe-t)); transform: translateX(-50%); z-index: 4; pointer-events: none; display: flex; flex-direction: column; align-items: center; gap: 6px; width: max-content; max-width: calc(100vw - 20px); }
#banner .win { background: var(--teal); border: 3px solid var(--ink); border-radius: 16px; padding: 6px 14px; font-weight: 900; font-size: 16px; box-shadow: 0 4px 0 var(--ink); animation: drop .4s cubic-bezier(.3,1.6,.6,1); text-align: center; }
#banner .win small { display: block; font-size: 12px; opacity: .85; }
#banner .next { color: #fff; font-weight: 900; font-size: 13px; text-shadow: 0 2px 0 var(--ink); }
@keyframes drop { from { transform: translateY(-30px) scale(.7); opacity: 0; } }
#center { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 4; width: min(420px, calc(100vw - 24px)); max-height: 70dvh; overflow-y: auto; }
.lobby h3, .sheet-card h3 { margin: 0 0 10px; font-size: 20px; font-weight: 900; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.num { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 800; color: var(--ink2); }
.num input { height: 44px; border-radius: 12px; border: 3px solid var(--ink); font-size: 18px; font-weight: 900; padding: 0 10px; width: 100%; background: #fff; color: var(--ink); }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-weight: 800; font-size: 14px; padding: 8px 0; }
.toggle input { appearance: none; width: 50px; height: 30px; border-radius: 15px; background: #d7d3e2; border: 3px solid var(--ink); position: relative; flex: none; transition: background .15s; }
.toggle input::after { content: ''; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 2px solid var(--ink); transition: left .15s; }
.toggle input:checked { background: var(--teal); } .toggle input:checked::after { left: 22px; }
.hint { font-size: 13px; font-weight: 700; color: var(--muted); margin: 8px 0 0; text-align: center; }
.wait-pill { background: rgba(255,255,255,.92); border: 3px solid var(--ink); border-radius: 999px; padding: 8px 16px; font-weight: 900; text-align: center; box-shadow: 0 4px 0 var(--ink); }

/* ------------------------------------------------ dock */
#dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; padding: 0 10px calc(10px + var(--safe-b)); pointer-events: none; }
#dock > * { pointer-events: auto; }
#timerbar { height: 6px; margin: 0 auto 6px; max-width: 900px; border-radius: 3px; background: rgba(0,0,0,.25); overflow: hidden; opacity: 0; transition: opacity .2s; }
#timerbar.on { opacity: 1; }
#timerbar i { display: block; height: 100%; width: 100%; background: var(--teal); transform-origin: left; }
#timerbar.low i { background: var(--red); }
#dockMain { max-width: 900px; margin: 0 auto; display: flex; flex-direction: column; gap: 6px; }
.myrow { display: flex; align-items: flex-end; gap: 10px; }
.mycards { display: flex; gap: 4px; flex: none; }
.pcard { width: 52px; height: 74px; border-radius: 8px; background: #fffdf7; border: 2.5px solid var(--ink); box-shadow: 0 3px 0 var(--ink); position: relative; font-weight: 900; line-height: 1; animation: flipin .35s ease-out; }
.pcard .r { position: absolute; left: 5px; top: 5px; font-size: 24px; font-family: "Arial Black", var(--font); }
.pcard .s { position: absolute; right: 4px; bottom: 3px; font-size: 30px; }
.pcard.back { background: repeating-linear-gradient(45deg, var(--pink) 0 8px, var(--yellow) 8px 14px); }
.pcard.dim { filter: grayscale(.8) brightness(.8); }
@keyframes flipin { from { transform: rotateY(90deg); } }
.myinfo { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; color: #fff; text-shadow: 0 2px 0 var(--ink); font-weight: 900; }
.myinfo .stk { font-size: 20px; }
.myinfo .hand { font-size: 13px; color: var(--yellow); }
.myinfo .sub { font-size: 12px; opacity: .9; }
.fxrow { display: flex; gap: 6px; flex: none; }
.fxrow .icon-btn { width: 46px; height: 46px; font-size: 22px; }
.acts { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.acts .btn { min-height: 56px; font-size: 18px; flex-direction: column; gap: 0; padding: 4px 6px; }
.acts .btn small { font-size: 13px; }
.pre { display: flex; gap: 8px; }
.pre button { flex: 1; min-height: 44px; border-radius: 12px; border: 3px solid var(--ink); background: rgba(255,255,255,.85); font-weight: 900; font-size: 14px; box-shadow: 0 3px 0 var(--ink); }
.pre button.on { background: var(--sky); }
.miscrow { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.miscrow .btn { flex: 1; min-width: 120px; }

/* ------------------------------------------------ sheet / pop */
#sheet { position: fixed; inset: 0; z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.sheet-bg { position: absolute; inset: 0; background: rgba(20,10,35,.55); animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.sheet-card { position: relative; width: min(560px, 100%); max-height: 88dvh; overflow-y: auto; background: var(--paper); border: 3px solid var(--ink); border-bottom: 0; border-radius: 24px 24px 0 0; padding: 18px 16px calc(18px + var(--safe-b)); animation: up .25s cubic-bezier(.2,1.2,.4,1); }
@media (min-width: 700px) and (min-height: 600px) { #sheet { align-items: center; } .sheet-card { border-bottom: 3px solid var(--ink); border-radius: 24px; box-shadow: 0 8px 0 var(--ink); } }
@keyframes up { from { transform: translateY(40%); opacity: 0; } }
.sheet-card .x { position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; border-radius: 50%; background: #fff; border: 2.5px solid var(--ink); font-weight: 900; }
.sec { margin: 14px 0 6px; font-weight: 900; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opt { padding: 8px 12px; border-radius: 12px; border: 2.5px solid var(--ink); background: #fff; font-weight: 900; font-size: 14px; }
.opt.on { background: var(--yellow); box-shadow: 0 3px 0 var(--ink); }
.slider { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 14px; }
.slider input { flex: 1; accent-color: var(--purple); }
.chargrid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
@media (max-width: 420px) { .chargrid { grid-template-columns: repeat(4, 1fr); } }
.charopt { border: 3px solid var(--ink); border-radius: 16px; background: #fff; padding: 4px 2px 6px; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; font-weight: 900; position: relative; }
.charopt img { width: 100%; aspect-ratio: 1; object-fit: contain; }
.charopt.on { background: var(--yellow); box-shadow: 0 4px 0 var(--ink); transform: translateY(-3px); }
.charopt.taken { opacity: .35; }
.charopt.taken::after { content: attr(data-taken); position: absolute; top: 40%; background: var(--ink); color: #fff; padding: 2px 6px; border-radius: 6px; }
.list { display: flex; flex-direction: column; gap: 8px; }
.li { display: flex; align-items: center; gap: 10px; background: #fff; border: 2.5px solid var(--ink); border-radius: 14px; padding: 8px 10px; }
.li .nm { flex: 1; font-weight: 900; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li .on { width: 10px; height: 10px; border-radius: 50%; background: var(--teal); flex: none; border: 2px solid var(--ink); }
.li .on.no { background: #ccc; }
table.score { width: 100%; border-collapse: collapse; font-weight: 800; font-size: 14px; }
table.score th { text-align: left; font-size: 12px; color: var(--muted); padding: 4px; }
table.score td { padding: 7px 4px; border-top: 2px dashed #e4dfd0; }
.pos { color: #1f9e6e; } .neg { color: #e63946; }
.awards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.award { background: #fff; border: 2.5px solid var(--ink); border-radius: 14px; padding: 8px; text-align: center; font-weight: 900; }
.award .ic { font-size: 26px; } .award small { display: block; color: var(--muted); font-size: 11px; }
.emogrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.emogrid button { min-height: 44px; border-radius: 12px; border: 2.5px solid var(--ink); background: #fff; font-weight: 900; font-size: 14px; padding: 4px; }
.chatlog { max-height: 34dvh; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; margin: 8px 0; font-size: 14px; font-weight: 700; user-select: text; -webkit-user-select: text; }
.chatlog b { color: var(--purple); }
.chatbox { display: flex; gap: 8px; }
.chatbox input { flex: 1; height: 46px; font-size: 16px; }
.share { text-align: center; }
.share .bigcode { font-size: 46px; font-weight: 900; letter-spacing: 8px; color: var(--pink); -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill; }
.share canvas { width: 180px; height: 180px; image-rendering: pixelated; border: 3px solid var(--ink); border-radius: 12px; background: #fff; padding: 6px; }
.share .url { font-size: 12px; color: var(--muted); word-break: break-all; margin: 6px 0; user-select: text; -webkit-user-select: text; }
#pop { position: fixed; z-index: 15; transform: translate(-50%, -100%); display: flex; gap: 8px; padding: 8px; background: var(--paper); border: 3px solid var(--ink); border-radius: 18px; box-shadow: 0 5px 0 var(--ink); animation: popin .2s; }
#pop button { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 64px; padding: 6px 2px; border-radius: 12px; border: 2.5px solid var(--ink); background: #fff; font-size: 26px; font-weight: 900; }
#pop button span { font-size: 11px; }
#pop button:active { transform: scale(.92); }
#pop .who { position: absolute; top: -14px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; font-size: 12px; font-weight: 900; padding: 2px 10px; border-radius: 10px; white-space: nowrap; }

/* ------------------------------------------------ approvals / toasts / conn */
#approvals { position: fixed; top: calc(62px + var(--safe-t)); right: 10px; z-index: 8; display: flex; flex-direction: column; gap: 8px; width: min(320px, calc(100vw - 20px)); }
.appr { display: flex; align-items: center; gap: 8px; background: var(--paper); border: 3px solid var(--ink); border-radius: 16px; padding: 8px 8px 8px 12px; box-shadow: 0 4px 0 var(--ink); animation: slidein .3s cubic-bezier(.2,1.4,.4,1); font-weight: 900; }
.appr span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@keyframes slidein { from { transform: translateX(110%); } }
#toasts { position: fixed; left: 50%; bottom: calc(var(--dock-h, 210px) + 12px); transform: translateX(-50%); z-index: 9; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; width: max-content; max-width: calc(100vw - 30px); }
.toast { background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 14px; font-weight: 800; font-size: 14px; animation: popin .2s; text-align: center; }
#conn { position: fixed; top: calc(62px + var(--safe-t)); left: 50%; transform: translateX(-50%); z-index: 30; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 999px; font-weight: 800; display: flex; gap: 8px; align-items: center; font-size: 14px; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 3px solid rgba(255,255,255,.3); border-top-color: var(--yellow); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.fullmsg { position: fixed; inset: 0; z-index: 12; display: grid; place-items: center; background: rgba(20,10,35,.6); padding: 16px; }
.fullmsg .card { text-align: center; width: min(380px, 100%); display: flex; flex-direction: column; gap: 12px; }
.fullmsg .big-emoji { font-size: 60px; animation: bounce 1s infinite; }

@media (max-height: 560px) and (orientation: landscape) {
  .acts .btn { min-height: 46px; font-size: 16px; }
  #dockMain { max-width: 720px; }
}
@media (max-width: 440px) {
  #topbar { gap: 6px; padding-left: 8px; padding-right: 8px; }
  .icon-btn { width: 38px; height: 38px; font-size: 17px; border-radius: 12px; }
  .tb-right { gap: 4px; }
  #topbar .code { padding: 5px 9px; } #topbar .code b { font-size: 14px; letter-spacing: 1px; }
  .tb-info { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; } }

/* ------------------------------------------------ icon system */
.ic { width: 1.25em; height: 1.25em; flex: none; vertical-align: -0.28em; overflow: visible; }
.icon-btn .ic { width: 26px; height: 26px; }
.chip-btn .ic { width: 20px; height: 20px; }
.ic.h { width: 28px; height: 28px; margin-right: 8px; vertical-align: -7px; }
.ic.lg { width: 24px; height: 24px; }
.btn .ic { width: 22px; height: 22px; }
.btn.sm .ic { width: 18px; height: 18px; }
.btn.sq { padding: 6px 8px; }
.logo .fist { width: clamp(52px, 13vw, 84px); height: clamp(52px, 13vw, 84px); animation: jab 1.6s infinite; filter: drop-shadow(0 4px 0 var(--ink)); overflow: visible; }
.big-ic .ic { width: 72px; height: 72px; animation: bounce 1s infinite; }
.h-ic .ic { width: 30px; height: 30px; vertical-align: -8px; }
.wait-pill { display: inline-flex; align-items: center; gap: 8px; }
.wait-pill .ic { width: 22px; height: 22px; }
.toast { display: flex; align-items: center; gap: 8px; }
.toast .ic { width: 22px; height: 22px; }
.appr .ic { width: 24px; height: 24px; }
.badge .ic { width: 13px; height: 13px; margin-right: 3px; vertical-align: -2px; }
.plate .dot .ic { width: 16px; height: 16px; }
.plate .off .ic { width: 14px; height: 14px; }
.plate.edge .tag { border-style: dashed; }
.myinfo .ic { width: 22px; height: 22px; vertical-align: -4px; filter: drop-shadow(0 2px 0 var(--ink)); }
.seatbtn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; }
.seatbtn .ic { width: 22px; height: 22px; }
.seatbtn span { font-size: 11px; }
.award .aw-ic .ic { width: 34px; height: 34px; }
.thic .ic { width: 16px; height: 16px; margin-right: 1px; }
.slider .ic { width: 24px; height: 24px; }
.opt .ic { width: 18px; height: 18px; }
.sheet-card .x { display: grid; place-items: center; padding: 0; }
.sheet-card .x .ic { width: 18px; height: 18px; }
#banner .win .ic { vertical-align: -5px; }
#banner .next .ic { width: 18px; height: 18px; }

/* ------------------------------------------------ interaction bar (right edge) */
#fxbar { position: fixed; right: 10px; z-index: 6; bottom: calc(var(--dock-h, 190px) + 14px); display: flex; flex-direction: column; gap: 8px; }
.fxb { width: 60px; min-height: 60px; border-radius: 18px; border: 3px solid var(--ink); background: var(--paper); box-shadow: 0 4px 0 var(--ink); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; padding: 4px 2px; font-weight: 900; font-size: 11px; line-height: 1.1; transition: transform .08s; }
.fxb .ic { width: 30px; height: 30px; }
.fxb:active { transform: translateY(3px) scale(.95); box-shadow: 0 1px 0 var(--ink); }
.fxb.punch { background: #ffe1e1; } .fxb.poop { background: #f3e2cf; } .fxb.coffee { background: #e3f6ff; } .fxb.talk { background: #fff4c9; }
@media (max-width: 440px) { .fxb { width: 52px; min-height: 52px; border-radius: 15px; font-size: 10px; } .fxb .ic { width: 26px; height: 26px; } }
@media (max-height: 560px) and (orientation: landscape) { #fxbar { gap: 6px; right: 8px; } .fxb { width: 46px; min-height: 46px; border-radius: 14px; } .fxb .ic { width: 26px; height: 26px; } .fxb span { display: none; } }

/* popovers: player actions & target picker share one sticker card */
#pop.fxpop .fxb { width: 66px; }
#pop.picker { flex-direction: column; align-items: stretch; min-width: 170px; max-height: 60dvh; overflow-y: auto; padding-top: 18px; }
#pop .who { display: inline-flex; align-items: center; gap: 4px; }
#pop .who .ic { width: 16px; height: 16px; }
#pop .tgt { width: auto; flex-direction: row; justify-content: flex-start; gap: 8px; font-size: 15px; padding: 8px 10px; }
#pop .tgt i { width: 18px; height: 18px; border-radius: 6px; border: 2px solid var(--ink); flex: none; }

/* ------------------------------------------------ first-person hit overlays */
#selffx { position: fixed; inset: 0; pointer-events: none; z-index: 3; overflow: hidden; }
.sf-flash { position: absolute; inset: 0; background: radial-gradient(circle at 50% 45%, rgba(255,255,255,0) 20%, rgba(255,77,77,.55) 75%); animation: sfflash .7s ease-out forwards; }
@keyframes sfflash { from { opacity: 1; } to { opacity: 0; } }
.sf-pow { position: absolute; left: 50%; top: 42%; width: 260px; height: 260px; transform: translate(-50%, -50%); display: grid; place-items: center; animation: sfpow 1.1s cubic-bezier(.2,1.6,.4,1) forwards; }
.sf-pow .ic { position: absolute; inset: 0; width: 100%; height: 100%; }
.sf-pow b { position: relative; font-size: 54px; font-weight: 900; color: var(--pink); -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; transform: rotate(-8deg); font-family: "Arial Black", var(--font); }
@keyframes sfpow { 0% { transform: translate(-50%, -50%) scale(.2) rotate(-20deg); opacity: 0; } 20% { opacity: 1; } 35% { transform: translate(-50%, -50%) scale(1.1) rotate(4deg); } 80% { opacity: 1; } 100% { transform: translate(-50%, -50%) scale(1) rotate(0); opacity: 0; } }
.sf-star { position: absolute; left: 50%; top: 30%; width: 40px; height: 40px; margin: -20px 0 0 -20px; animation: sfstar 1.6s linear forwards; }
.sf-star .ic { width: 100%; height: 100%; }
@keyframes sfstar { from { transform: rotate(var(--a)) translateX(90px); opacity: 1; } to { transform: rotate(calc(var(--a) + 540deg)) translateX(90px); opacity: 0; } }
.sf-splat { position: absolute; transform: translate(-50%, -50%); animation: sfsplat 4.5s ease-in forwards; filter: drop-shadow(0 4px 0 rgba(43,33,64,.4)); }
.sf-splat .drip { animation: drip 4.5s ease-in forwards; transform-box: fill-box; transform-origin: top; }
.sf-splat .drip.d2 { animation-duration: 3.6s; }
@keyframes sfsplat { 0% { transform: translate(-50%, -50%) scale(.2); } 8% { transform: translate(-50%, -50%) scale(1.15); } 14% { transform: translate(-50%, -50%) scale(1); } 75% { opacity: 1; } 100% { transform: translate(-50%, -38%) scale(1, 1.1); opacity: 0; } }
@keyframes drip { 0%, 12% { transform: scaleY(.3); } 100% { transform: scaleY(2.6); } }
.sf-word { position: absolute; left: 50%; top: 30%; transform: translate(-50%, -50%) rotate(-6deg); font-size: 48px; font-weight: 900; -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; animation: sfword 1.2s cubic-bezier(.2,1.6,.4,1) forwards; font-family: "Arial Black", var(--font); white-space: nowrap; }
.sf-word.poo { color: #c98a4b; } .sf-word.cof { color: #7ee8ff; }
@keyframes sfword { 0% { transform: translate(-50%, -50%) scale(.2); opacity: 0; } 25% { transform: translate(-50%, -50%) scale(1.15) rotate(-6deg); opacity: 1; } 80% { opacity: 1; } 100% { transform: translate(-50%, -70%) scale(1) rotate(-6deg); opacity: 0; } }
.sf-buzz { position: absolute; inset: 0; background: radial-gradient(circle, rgba(126,232,255,0) 45%, rgba(126,232,255,.4) 100%); animation: buzz 2.6s linear forwards; }
@keyframes buzz { 0%, 100% { opacity: 0; } 10%, 80% { opacity: 1; } 12%, 16%, 20%, 24%, 28%, 32% { transform: translate(3px, -2px); } 14%, 18%, 22%, 26%, 30% { transform: translate(-3px, 2px); } }

/* ------------------------------------------------ loading screen */
#splash { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: radial-gradient(circle at 50% 40%, #5b1e4d, #2a0f3d 70%); transition: opacity .5s; }
#splash.gone { opacity: 0; pointer-events: none; }
#splash .sp-in { display: flex; flex-direction: column; align-items: center; gap: 14px; color: #fff; font-weight: 900; }
#splash .sp-logo { width: 96px; height: 96px; animation: jab 1.2s infinite; filter: drop-shadow(0 5px 0 #2b2140); }
#splash .sp-bar { width: 180px; height: 12px; border-radius: 6px; border: 3px solid #2b2140; background: rgba(255,255,255,.2); overflow: hidden; }
#splash .sp-bar i { display: block; height: 100%; width: 40%; background: var(--yellow); border-radius: 4px; animation: spbar 1.1s ease-in-out infinite; }
@keyframes spbar { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }
.splash-err { max-width: 340px; text-align: center; font-weight: 800; line-height: 1.5; }

/* home: practice */
.home-card .btn.purple .ic { width: 26px; height: 26px; }
.home-card .sub { display: block; font-size: 12px; font-weight: 700; opacity: .85; }
.btn.big.purple { flex-direction: row; }

/* ------------------------------------------------ tabs */
.tabs { display: flex; gap: 6px; margin: 0 40px 12px 0; }
.tabs button { flex: 1; display: flex; align-items: center; justify-content: center; gap: 5px; min-height: 42px; border-radius: 12px; border: 2.5px solid var(--ink); background: #fff; font-weight: 900; font-size: 13px; padding: 4px 6px; }
.tabs button.on { background: var(--yellow); box-shadow: 0 3px 0 var(--ink); }
.tabs .ic { width: 20px; height: 20px; }

/* mini cards (history / rankings) */
.mcard { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 32px; padding: 0 2px; margin-right: 2px; border-radius: 5px; border: 2px solid var(--ink); background: #fffdf7; font-weight: 900; font-size: 13px; font-family: "Arial Black", var(--font); letter-spacing: -1px; }
.mcard.back { background: repeating-linear-gradient(45deg, var(--pink) 0 5px, var(--yellow) 5px 9px); }

/* hand history */
.hist { display: flex; flex-direction: column; gap: 8px; }
.hh { background: #fff; border: 2.5px solid var(--ink); border-radius: 14px; padding: 8px 10px; }
.hh summary { display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; font-weight: 900; }
.hh summary::-webkit-details-marker { display: none; }
.hh .hid { color: var(--muted); font-size: 13px; min-width: 34px; }
.hh .hbd { flex: 1; display: flex; flex-wrap: wrap; gap: 1px; align-items: center; }
.hh .hbd i { margin: 0 4px; color: var(--muted); font-style: normal; }
.hh .hside { font-size: 13px; white-space: nowrap; }
.hps { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.hp { display: grid; grid-template-columns: 1fr auto auto auto; gap: 8px; align-items: center; font-size: 13px; font-weight: 800; }
.hp.me .nm { color: var(--purple); }
.hp .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hp .hn2 { font-size: 11px; color: var(--muted); }
.hp .mcard { min-width: 22px; height: 26px; font-size: 11px; }
.hlog { margin-top: 8px; border-top: 2px dashed #e4dfd0; padding-top: 6px; display: flex; flex-direction: column; gap: 4px; }
.hl { font-size: 12px; font-weight: 700; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.hl b { color: var(--ink2); }
.hl .hb .mcard { min-width: 20px; height: 24px; font-size: 10px; }
.hl .ha { background: #f4f0fb; border-radius: 6px; padding: 1px 6px; }

/* rankings */
.ranks { display: flex; flex-direction: column; gap: 6px; }
.rk { display: flex; align-items: center; gap: 10px; background: #fff; border: 2.5px solid var(--ink); border-radius: 14px; padding: 6px 10px; }
.rk .rn { width: 24px; height: 24px; border-radius: 8px; background: var(--yellow); border: 2px solid var(--ink); display: grid; place-items: center; font-weight: 900; font-size: 13px; flex: none; }
.rk .rt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rk .rt small { color: var(--muted); font-weight: 700; font-size: 11px; }
.rk .rc { white-space: nowrap; }
@media (max-width: 440px) { .rk .rc .mcard { min-width: 20px; height: 26px; font-size: 10px; } }

/* ------------------------------------------------ tutorial */
.tut { position: fixed; inset: 0; z-index: 25; display: grid; place-items: center; background: rgba(20,10,35,.5); padding: 16px; animation: fade .25s; }
.tut-card { width: min(360px, 100%); text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.tut-card p { margin: 0; font-weight: 800; line-height: 1.55; font-size: 15px; }
.tut-ic .ic { width: 64px; height: 64px; animation: bounce 1s infinite; }
.tut-dots { display: flex; gap: 6px; }
.tut-dots i { width: 10px; height: 10px; border-radius: 50%; background: #d7d3e2; border: 2px solid var(--ink); }
.tut-dots i.on { background: var(--pink); }
.tut .btn { width: 100%; }

/* ------------------------------------------------ keyboard hints, achievements */
kbd { display: none; }
.acts.kb .btn { position: relative; }
.acts.kb kbd { display: block; position: absolute; top: 4px; right: 6px; font: 900 10px/1 var(--font); padding: 2px 4px; border-radius: 5px; border: 1.5px solid currentColor; opacity: .55; }
.achpop { position: fixed; left: 50%; top: calc(70px + var(--safe-t)); z-index: 40; display: flex; align-items: center; gap: 10px; background: var(--ink); color: #fff; border: 3px solid var(--yellow); border-radius: 18px; padding: 10px 16px 10px 12px; box-shadow: 0 6px 0 rgba(0,0,0,.35); animation: achin 4.2s cubic-bezier(.2,1.4,.4,1) forwards; pointer-events: none; }
.achpop .ic { width: 40px; height: 40px; }
.achpop small { display: block; color: var(--yellow); font-weight: 900; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; }
.achpop b { font-size: 17px; }
@keyframes achin { 0% { transform: translate(-50%, -40px) scale(.6); opacity: 0; } 10% { transform: translate(-50%, 0) scale(1.05); opacity: 1; } 15% { transform: translate(-50%, 0) scale(1); } 88% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; transform: translate(-50%, -20px); } }
.achs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 440px) { .achs { grid-template-columns: 1fr; } }
.ach { display: flex; align-items: center; gap: 10px; background: #fff; border: 2.5px solid var(--ink); border-radius: 14px; padding: 8px 10px; opacity: .55; filter: grayscale(.9); }
.ach.on { opacity: 1; filter: none; background: #fff7d6; box-shadow: 0 3px 0 var(--ink); }
.ach .ai .ic { width: 34px; height: 34px; }
.ach b { display: block; font-size: 14px; }
.ach small { color: var(--muted); font-weight: 700; font-size: 11px; }

/* ------------------------------------------------ game mode switch & podium */
.seg { display: flex; gap: 6px; margin-bottom: 6px; }
.seg button { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; border-radius: 12px; border: 2.5px solid var(--ink); background: #fff; font-weight: 900; font-size: 15px; }
.seg button.on { background: var(--yellow); box-shadow: 0 3px 0 var(--ink); }
.seg button .ic { width: 22px; height: 22px; }
.seg-hint { margin: 0 0 10px !important; text-align: left !important; }
.num select { height: 44px; border-radius: 12px; border: 3px solid var(--ink); font-size: 16px; font-weight: 900; padding: 0 8px; background: #fff; color: var(--ink); width: 100%; }
.num[hidden] { display: none !important; }
/* ------------------------------------------------ promo / store art mode */
.promo #home, .promo #splash, .promo #toasts, .promo #conn { display: none !important; }
.promo-brand { position: fixed; z-index: 30; display: flex; align-items: center; gap: 2vmin; left: 50%; bottom: 8vh; transform: translateX(-50%) rotate(-3deg); pointer-events: none; }
.promo-brand .fist { width: 22vmin; height: 22vmin; filter: drop-shadow(0 1vmin 0 #2b2140); }
.promo-brand h1 { margin: 0; font-size: 17vmin; line-height: 1; font-weight: 900; color: var(--yellow); -webkit-text-stroke: 1.6vmin #2b2140; paint-order: stroke fill; text-shadow: 0 1.4vmin 0 #2b2140; white-space: nowrap; }
.promo-brand p { margin: 1vmin 0 0; font-size: 5.5vmin; font-weight: 900; color: #fff; -webkit-text-stroke: .6vmin #2b2140; paint-order: stroke fill; letter-spacing: .4vmin; }
@media (min-aspect-ratio: 2/1) { .promo-brand { left: 6vw; bottom: auto; top: 50%; transform: translateY(-50%) rotate(-3deg); } .promo-brand h1 { font-size: 22vmin; } .promo-brand .fist { width: 28vmin; height: 28vmin; } }
@media (max-aspect-ratio: 4/5) { .promo-brand { flex-direction: column; text-align: center; bottom: 6vh; } .promo-brand h1 { font-size: 15vw; -webkit-text-stroke: 1.2vw #2b2140; } .promo-brand .fist { width: 30vw; height: 30vw; } .promo-brand p { font-size: 5vw; } }
body.promo-logo #gl, body.promo-logo #overlay { display: none; }
body.promo-logo .promo-brand { left: 50%; top: 50%; bottom: auto; transform: translate(-50%, -50%) rotate(-3deg); }
body.promo-hero .promo-brand { display: none; }


/* enlarged card on hover / tap */
#cardTip { position: fixed; left: 0; top: 0; z-index: 16; pointer-events: none; display: flex; flex-direction: column; align-items: center; gap: 6px; will-change: transform; }
#cardTip .pcard.big { width: 110px; height: 156px; border-radius: 14px; border-width: 3.5px; box-shadow: 0 6px 0 var(--ink), 0 12px 24px rgba(0,0,0,.35); animation: tipin .14s ease-out; }
#cardTip .pcard.big .r { font-size: 48px; left: 10px; top: 10px; }
#cardTip .pcard.big .s { font-size: 62px; right: 8px; bottom: 6px; }
#cardTip > span { background: var(--ink); color: #fff; font-weight: 900; font-size: 13px; padding: 3px 10px; border-radius: 10px; white-space: nowrap; }
@keyframes tipin { from { transform: scale(.7); opacity: 0; } }

/* ------------------------------------------------ invincible button & flight overlays */
.fxb.rage { position: relative; background: #fff; overflow: hidden; }
.fxb.rage .rg { position: absolute; inset: 0; border-radius: inherit; background: conic-gradient(#ffc233 calc(var(--pct, 0) * 360deg), rgba(43,33,64,.1) 0); }
.fxb.rage .ic, .fxb.rage span { position: relative; }
.fxb.rage:not(.ready):not(.active) .ic { filter: grayscale(.6) opacity(.75); }
.fxb.rage.ready { animation: rageReady .8s ease-in-out infinite; box-shadow: 0 4px 0 var(--ink), 0 0 0 4px rgba(255,210,63,.6), 0 0 22px rgba(255,210,63,.9); }
.fxb.rage.ready .rg { background: var(--yellow); }
.fxb.rage.active .rg { background: linear-gradient(135deg, #ffe98a, #ffb000); }
@keyframes rageReady { 50% { transform: scale(1.1) rotate(-4deg); } }
.badge.inv { background: var(--yellow); }
.sf-gold { position: absolute; inset: 0; box-shadow: inset 0 0 80px 24px rgba(255,210,63,.55); animation: sfgold var(--dur, 15s) linear forwards; }
@keyframes sfgold { 0% { opacity: 0; } 6% { opacity: 1; } 92% { opacity: .8; } 100% { opacity: 0; } }
.sf-word.fly { color: var(--yellow); font-size: 54px; top: 26%; }
.sf-ping { position: absolute; inset: 0; background: radial-gradient(circle at 50% 45%, rgba(255,233,138,.0) 30%, rgba(255,210,63,.45) 80%); animation: sfflash .5s ease-out forwards; }
.sf-word.ping { color: #fff3a8; font-size: 40px; top: 40%; }

.sf-word.fly2 { color: var(--pink); font-size: 64px; top: 38%; }

/* Two independent landlord universes. */
.home-top { display:flex; gap:8px; align-items:center; }
/* en / es: the long Spanish title fits a phone; Latin placeholders drop the wide digit spacing (zh untouched) */
html[lang^="es"] .logo h1 { font-size: clamp(34px, 8.6vw, 64px); }
html[lang^="es"] .logo { flex-wrap: wrap; padding: 0 8px; }
html:not([lang^="zh"]) .join-row input::placeholder { letter-spacing: 0; font-size: 17px; }
/* the shared universe bar puts the site-wide language pill top-right (12,12): the home chips sit under it */
.nm-lang-bar .home-top { top: calc(64px + var(--safe-t)); }
.universe-link { color:var(--ink); text-decoration:none; font-size:12px; min-height:36px; }
@media(max-width:440px) { #topbar .universe-link { max-width:62px; padding:5px; font-size:11px; } }

/* ------------------------------------------------ props box */
.fxb.box { background: #ffe9cf; }
#pop.propbox { flex-wrap: wrap; width: min(300px, calc(100vw - 20px)); justify-content: center; padding-top: 18px; transform: translate(-50%, -100%); }
#pop.propbox .fxb, #pop.fxpop .fxb { width: 64px; min-height: 60px; }
#pop.fxpop { flex-wrap: wrap; width: min(310px, calc(100vw - 20px)); justify-content: center; }
.fxb.tomato { background: #ffe1e1; } .fxb.chicken { background: #fff4c9; } .fxb.water { background: #e3f6ff; } .fxb.slipper { background: #ffe3ef; } .fxb.mahjong { background: #e4f7ee; }
.sf-word.wet { color: #7fd8ff; }

/* ------------------------------------------------ wardrobe */
.wd-preview { display: grid; place-items: center; background: radial-gradient(circle, #fff7d6, #ffe9cf); border: 2.5px solid var(--ink); border-radius: 18px; margin-bottom: 4px; }
.wd-preview img { width: 170px; height: 170px; }
.wd-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; }
.wd-item { border: 2.5px solid var(--ink); border-radius: 14px; background: #fff; padding: 8px 6px; display: flex; flex-direction: column; gap: 2px; text-align: center; font-weight: 900; font-size: 14px; }
.wd-item small { font-size: 10px; color: var(--muted); font-weight: 700; min-height: 12px; }
.wd-item small .ic { width: 11px; height: 11px; vertical-align: -1px; }
.wd-item.on { background: var(--yellow); box-shadow: 0 3px 0 var(--ink); }
.wd-item.locked { opacity: .5; }

/* last-card drama: darkened edges */
#selffx::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 45%, rgba(0,0,0,0) 45%, rgba(10,4,20,.65) 100%); opacity: 0; transition: opacity 1.2s; }
#selffx.drama::before { opacity: 1; }

/* comic callouts (POW!, 中国人能飞…) — above seat plates, below the HUD */
#comics { position: fixed; inset: 0; pointer-events: none; z-index: 4; overflow: hidden; }
.comic { position: absolute; left: 0; top: 0; white-space: nowrap; font: 900 40px "Arial Black", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif; line-height: 1.1; -webkit-text-stroke: .2em var(--ink, #2b2140); paint-order: stroke fill; text-shadow: 0 .08em 0 var(--ink, #2b2140); will-change: transform, opacity; transform-origin: 50% 50%; }

/* first / third person switch in the topbar */
.view-btn { display: inline-flex; align-items: center; gap: 5px; pointer-events: auto; }
.view-btn .ic { width: 22px; height: 22px; }
@media (max-width: 560px) { .view-btn span { display: none; } .view-btn { padding: 0 8px; } }
#muteBtn { pointer-events: auto; }
#muteBtn.off { background: #e9e5f2; }

/* ================================================ 暴打斗地主 · DDZ components */
/* home */
.practice-btn { flex-direction: row; gap: 10px; }
.practice-btn .ic { width: 28px; height: 28px; }
.practice-btn .pb-t { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; }
.classic-resume { display: flex; align-items: center; justify-content: center; gap: 6px; font-weight: 900; font-size: 14px; color: var(--purple); text-decoration: underline; padding: 2px; }
.classic-resume .ic { width: 20px; height: 20px; }
.hint.lt { color: rgba(255,255,255,.92); text-shadow: 0 1px 0 var(--ink); margin: 0; text-align: center; }
@media (max-width: 440px) { .tb-info { display: none; } }

/* table-info strip: 底牌 · 癞子 · ×倍数 */
#tinfo { position: fixed; top: calc(60px + var(--safe-t)); left: 50%; transform: translateX(-50%); z-index: 4; display: flex; gap: 6px; align-items: center; background: rgba(43,33,64,.6); border-radius: 14px; padding: 4px 8px; white-space: nowrap; }
#tinfo .kit { display: flex; }
#tinfo .kit .mcard { min-width: 22px; height: 28px; font-size: 11px; margin-right: 1px; }
.lzchip { display: inline-flex; align-items: center; gap: 3px; background: var(--purple); color: #fff; border: 2px solid var(--ink); border-radius: 10px; padding: 1px 8px; font-weight: 900; font-size: 13px; white-space: nowrap; }
.lzchip .ic { width: 16px; height: 16px; }
.lzchip.dim { opacity: .75; } .lzchip.off { background: #fff; color: var(--ink); }
.lzchip.sm { font-size: 11px; padding: 0 5px; }
.mchip { background: var(--yellow); border: 2px solid var(--ink); border-radius: 10px; padding: 1px 9px; font-weight: 900; font-size: 14px; box-shadow: 0 2px 0 var(--ink); color: var(--ink); }
.mchip.pop, .multlbl.pop b { animation: mpop .32s ease-out; }
@keyframes mpop { 0% { transform: scale(1.4); } }
#pop.multpop { flex-direction: column; align-items: stretch; gap: 6px; padding-top: 18px; width: min(340px, calc(100vw - 20px)); }
.mp-row { display: flex; flex-wrap: wrap; gap: 4px; font-weight: 800; font-size: 13px; }
.mp-row span, .mb span { background: #fff; border: 2px solid var(--ink); border-radius: 8px; padding: 0 6px; }
.mp-row b, .mb b { background: var(--yellow); border: 2px solid var(--ink); border-radius: 8px; padding: 0 6px; }
.mp-sub { font-size: 12px; color: var(--muted); font-weight: 800; }

/* seat plates */
.plate .badges { display: flex; gap: 3px; flex-wrap: wrap; justify-content: center; max-width: 180px; }
.plate .badges:empty { display: none; }
.plate .pin { position: absolute; top: -9px; left: -8px; width: 20px; height: 20px; border-radius: 50%; background: var(--yellow); border: 2px solid var(--ink); display: grid; place-items: center; }
.plate .pin .ic { width: 13px; height: 13px; }
.plate .cnt { display: inline-flex; align-items: center; gap: 2px; margin-left: 2px; background: var(--ink); color: #fff; border-radius: 8px; padding: 1px 6px 1px 3px; font-size: 14px; font-weight: 900; }
.plate .cnt .ic { width: 15px; height: 15px; }
.plate .cnt.a2 { background: var(--orange); color: var(--ink); }
.plate .cnt.a1 { background: var(--red); animation: alarmp .8s infinite; }
@keyframes alarmp { 50% { transform: scale(1.14); } }
.plate.landlord .tag { background: #fff3c4; }
.plate.me.landlord .tag { background: var(--yellow); }
.plate.danger .tag { box-shadow: 0 3px 0 var(--ink), 0 0 0 4px rgba(255,77,77,.55); }
.plate .ptimer { position: relative; height: 4px; width: 100%; border-radius: 2px; background: rgba(0,0,0,.25); }
.plate .ptimer i { display: block; height: 100%; background: var(--pink); transform-origin: left; border-radius: 2px; }
.plate .clock { position: absolute; right: -10px; top: -26px; background: #fff; border: 2px solid var(--ink); border-radius: 10px; font-size: 12px; font-weight: 900; padding: 0 5px; line-height: 16px; }
.plate .clock:empty { display: none; }
.plate.hurry .clock { background: var(--red); color: #fff; animation: alarmp .5s infinite; }
.badge.bidv { background: var(--yellow); } .badge.pass { background: #d7d3e2; } .badge.ready { background: var(--teal); }
.badge.alarm1 { background: var(--red); color: #fff; animation: alarmp .7s infinite; } .badge.alarm2 { background: var(--orange); }
.badge.auto { background: #cfe3ff; } .badge.mate { background: var(--teal); } .badge.leaving, .badge.kicking { background: #ffe1e1; }
.playlbl { position: absolute; left: 0; top: 0; will-change: transform; pointer-events: none; }
.playlbl span { display: inline-block; font-weight: 900; font-size: 13px; background: rgba(255,255,255,.95); border: 2px solid var(--ink); border-radius: 10px; padding: 1px 8px; white-space: nowrap; box-shadow: 0 2px 0 var(--ink); }
.playlbl .top { background: var(--yellow); } .playlbl .bomb { background: var(--red); color: #fff; } .playlbl .pass { background: #d7d3e2; color: var(--ink2); }
.multlbl { position: absolute; left: 0; top: 0; will-change: transform; text-align: center; pointer-events: none; }
.multlbl b { display: inline-block; font-size: 18px; font-weight: 900; background: var(--yellow); border: 2.5px solid var(--ink); border-radius: 12px; padding: 1px 12px; box-shadow: 0 3px 0 var(--ink); }
.multlbl small { display: block; margin-top: 3px; font-size: 11px; font-weight: 900; color: #fff; text-shadow: 0 1px 0 var(--ink); }

/* centre: settlement card, waiting pill */
#center { top: calc(50% - var(--dock-h, 0px) / 2 + 28px); max-height: calc(100dvh - var(--dock-h, 0px) - 96px); }
.settle { padding: 14px; }
.settle .sh { display: flex; align-items: center; gap: 4px; }
.settle .sh h3 { margin: 0; font-size: 22px; font-weight: 900; }
.settle.landlord .sh { color: #9a6a00; } .settle.farmers .sh { color: #1c6f93; }
.ribbon { margin-left: auto; background: var(--pink); color: #fff; padding: 2px 12px; border-radius: 8px; border: 2px solid var(--ink); transform: rotate(4deg); font-weight: 900; box-shadow: 0 2px 0 var(--ink); }
.mb { display: flex; flex-wrap: wrap; gap: 4px; margin: 8px 0; font-size: 12px; font-weight: 800; }
.srows { display: flex; flex-direction: column; gap: 6px; }
.srow { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; grid-template-areas: "img n d" "img l l"; gap: 2px 8px; align-items: center; background: #fff; border: 2.5px solid var(--ink); border-radius: 14px; padding: 5px 8px; }
.srow.me { background: #fff7d6; }
.srow img { grid-area: img; width: 40px; height: 40px; }
.srow .sn { grid-area: n; display: flex; align-items: center; gap: 6px; min-width: 0; }
.srow .sn b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srow .sl { grid-area: l; display: flex; flex-wrap: wrap; gap: 1px; }
.srow .sl:empty { display: none; }
.srow .sl .mcard { min-width: 18px; height: 24px; font-size: 10px; margin-right: 0; }
.srow .sd { grid-area: d; font-weight: 900; font-size: 19px; text-align: right; }
.srow .sd small { display: block; font-size: 10px; color: var(--muted); }
.sfoot { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.scount { font-weight: 900; color: var(--ink2); font-size: 13px; }
.sbtns { margin-left: auto; display: flex; gap: 8px; }
.sbtns .btn { min-height: 44px; font-size: 16px; }
.rchip { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 900; border: 2px solid var(--ink); border-radius: 8px; padding: 0 6px; background: #fff; color: var(--ink); text-shadow: none; white-space: nowrap; }
.rchip.landlord { background: var(--yellow); } .rchip.farmer { background: var(--sky); }
.rchip .ic { width: 14px; height: 14px; }
.waitpill { display: flex; flex-direction: column; gap: 8px; align-items: stretch; text-align: center; }
.waitpill .wh { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 17px; }
.waitpill .wbs { display: flex; flex-direction: column; gap: 6px; }
.waitpill .wb { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: #fff; border: 2px solid var(--ink); border-radius: 12px; padding: 4px 4px 4px 10px; font-weight: 800; font-size: 13px; min-height: 40px; }
#banner .win.pill { pointer-events: auto; cursor: pointer; font-family: inherit; color: var(--ink); display: inline-flex; align-items: center; gap: 6px; }
#banner .win.pill.landlord { background: var(--yellow); } #banner .win.pill.farmers { background: var(--sky); }

/* dock: info row */
.hinfo { display: flex; align-items: center; gap: 6px; min-height: 26px; color: #fff; font-weight: 900; font-size: 13px; text-shadow: 0 2px 0 var(--ink); }
.hinfo:empty { display: none; }
.hinfo .chips, .hinfo .lbls, .hinfo .tools { display: flex; gap: 5px; align-items: center; min-width: 0; }
.hinfo .lbls { flex: 1; overflow: hidden; }
.hinfo .stk, .hinfo .cnt { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.hinfo .ic { width: 18px; height: 18px; }
.lbl { display: inline-flex; align-items: center; gap: 3px; background: #fff; color: var(--ink); text-shadow: none; border: 2px solid var(--ink); border-radius: 9px; padding: 1px 8px; white-space: nowrap; font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
.lbl .ic { width: 15px; height: 15px; }
.lbl.info { background: rgba(43,33,64,.55); color: #fff; border-color: transparent; }
.lbl.yellow { background: var(--yellow); } .lbl.grey { background: #d7d3e2; color: var(--ink2); } .lbl.red { background: var(--red); color: #fff; }
.lbl.purple { background: var(--purple); color: #fff; } .lbl.sky { background: var(--sky); }
.hinfo .chip { display: inline-flex; align-items: center; gap: 3px; background: rgba(255,255,255,.92); color: var(--ink); text-shadow: none; border: 2px solid var(--ink); border-radius: 999px; padding: 2px 8px; font-weight: 900; font-size: 12px; box-shadow: 0 2px 0 var(--ink); white-space: nowrap; }
.hinfo .chip .ic { width: 14px; height: 14px; }
.hinfo .lbls .lbl { flex: none; max-width: 100%; }
@media (max-width: 480px) { .hinfo .tx { display: none; } .hinfo .chip { padding: 3px 6px; } .hinfo .rchip { padding: 1px 4px; } .hinfo { gap: 4px; } .hinfo .chips { gap: 4px; } }

/* dock: the hand fan */
#hand.fan { position: relative; width: 100%; height: 0; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; transition: height .18s; --cw: 50px; --ch: 72px; }
.hcard { position: absolute; left: 0; top: 0; width: var(--cw); height: var(--ch); border-radius: 8px; background: #fffdf7; border: 2.5px solid var(--ink); box-shadow: -2px 2px 0 rgba(43,33,64,.35); font-weight: 900; line-height: 1; overflow: hidden;
  transition: transform .14s ease-out, left .18s ease, top .18s ease, opacity .2s, box-shadow .14s; touch-action: none; -webkit-touch-callout: none; cursor: pointer; }
.hcard .ix { position: absolute; left: 1px; top: 4px; width: calc(var(--cw) * .42); display: flex; flex-direction: column; align-items: center; }
.hcard .ix .r { font: 900 max(16px, calc(var(--cw) * .38))/1 "Arial Black", var(--font); letter-spacing: -2px; }
.hcard .ix .r.ten { letter-spacing: -3px; margin-left: -2px; }
.hcard .ix .s { font-style: normal; font-size: max(13px, calc(var(--cw) * .28)); margin-top: 1px; }
.hcard .ix .s .ic { width: 14px; height: 14px; }
.hcard .big { position: absolute; right: 3px; bottom: 1px; font-size: calc(var(--ch) * .36); line-height: 1; }
.hcard .lz { display: block; margin-top: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--purple); color: #fff; font-size: 10px; line-height: 13px; border: 1.5px solid var(--ink); font-style: normal; text-align: center; }
.hcard .jk b { display: block; font-size: 13px; line-height: 1.05; }
.hcard.joker .ix { color: var(--ink); } .hcard.joker.bj .ix { color: #e63946; }
.hcard .jkic { position: absolute; right: 3px; bottom: 4px; width: calc(var(--cw) * .5); height: calc(var(--cw) * .5); }
.hcard .jkic .ic { width: 100%; height: 100%; }
.hcard.laizi { border-color: var(--purple); border-width: 3px; background: linear-gradient(90deg, #ece3ff, #fffdf7 55%); }
.hcard.laizi::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 35%, rgba(255,255,255,.75) 48%, transparent 60%); transform: translateX(-120%); animation: shimmer 3s ease-in-out infinite; pointer-events: none; }
@keyframes shimmer { 0%, 70% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }
.hcard.wild { border-color: var(--purple); background: linear-gradient(180deg, #efe6ff, #fffdf7); }
.hcard.wild .ix { color: var(--purple); }
.hcard .orig { position: absolute; left: 4px; bottom: 16px; font-size: 11px; color: var(--muted); }
.hcard .rib { position: absolute; left: 0; right: 0; bottom: 0; background: var(--purple); color: #fff; font-size: 10px; text-align: center; padding: 1px 0; }
.hcard.sel { transform: translateY(-16px); box-shadow: -2px 2px 0 rgba(43,33,64,.35), 0 5px 0 var(--pink); }
.hcard.sweep { background: #fff3bc; outline: 2px dashed var(--ink); outline-offset: -5px; }
.hcard.fresh { box-shadow: 0 0 0 3px var(--yellow), -2px 2px 0 rgba(43,33,64,.35); transform: translateY(-8px); animation: freshp .8s ease-in-out 3; }
.hcard.fresh.sel { transform: translateY(-16px); }
@keyframes freshp { 50% { box-shadow: 0 0 0 6px rgba(255,210,63,.55), -2px 2px 0 rgba(43,33,64,.35); } }
.hcard.pending { transform: translateY(-28px); opacity: .5; }
.hcard.dim { filter: grayscale(.55) brightness(.85); cursor: default; }
.hcard.gone { transform: translateY(-140px) scale(.75); opacity: 0; transition: transform .22s ease-in, opacity .22s; }
.hcard.dealin { animation: dealin .34s cubic-bezier(.2,1.3,.4,1) both; }
@keyframes dealin { from { translate: 0 70px; rotate: 10deg; opacity: 0; } }
.hcard.lzin { animation: lzin .7s ease-out both; }
@keyframes lzin { 0% { scale: 1; } 35% { scale: 1.18; filter: brightness(1.3); } 100% { scale: 1; } }
.hcard.shake { animation: cshake .35s; }
@keyframes cshake { 25% { translate: -5px 0; } 50% { translate: 5px 0; } 75% { translate: -3px 0; } }
.hcard.focus { outline: 3px solid var(--sky); outline-offset: 1px; }
@media (hover: hover) and (pointer: fine) { .hcard:not(.sel):not(.dim):not(.pending):hover { transform: translateY(-6px); } }
/* enlarged card tip */
#cardTip .tipcards { display: flex; }
#cardTip .tipcards.many .hcard.big + .hcard.big { margin-left: -62px; }
#cardTip .hcard.big { position: relative; --cw: 96px; --ch: 136px; box-shadow: 0 6px 0 var(--ink), 0 12px 24px rgba(0,0,0,.35); animation: tipin .14s ease-out; cursor: default; flex: none; }
#cardTip .hcard.big .lz { width: 22px; height: 22px; font-size: 14px; line-height: 19px; }

/* dock: acts row */
.acts { grid-template-columns: 1fr 1fr 1.35fr; }
.acts.two { grid-template-columns: 1fr 1.6fr; } .acts.one { grid-template-columns: 1fr; } .acts.four { grid-template-columns: repeat(4, 1fr); }
.acts .btn { flex-direction: row; flex-wrap: wrap; gap: 4px 6px; }
.acts .btn small { flex-basis: 100%; text-align: center; font-size: 12px; }
.acts .btn .ic { width: 22px; height: 22px; }
.acts .btn:disabled { opacity: .5; }
.pre button { display: flex; align-items: center; justify-content: center; gap: 6px; }
.pre button .ic { width: 20px; height: 20px; }
.pre button.warn { background: #ffe1e1; }
/* the ambiguity picker */
.pick { background: var(--paper); border: 3px solid var(--ink); border-radius: 18px; padding: 8px 10px; box-shadow: 0 4px 0 var(--ink); display: flex; flex-direction: column; gap: 6px; animation: popin .18s; }
.pk-h { display: flex; align-items: center; gap: 6px; font-size: 15px; min-width: 0; }
.pk-h > .ic { width: 22px; height: 22px; }
.pk-cards { margin-left: auto; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 1px; }
.pk-cards .mcard { min-width: 20px; height: 26px; font-size: 11px; margin-right: 0; }
.pk-one { font-size: 14px; }
.pk-g { display: flex; gap: 6px; flex-wrap: wrap; }
.pk-g button { flex: 1 1 28%; min-height: 48px; border-radius: 12px; border: 2.5px solid var(--ink); background: #fff; font-weight: 900; font-size: 15px; display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; padding: 4px 6px; line-height: 1.1; }
.pk-g button.on { background: var(--yellow); box-shadow: 0 3px 0 var(--ink); }
.pk-g button small { font-size: 12px; color: var(--ink2); }
.pk-g .star { position: absolute; top: 2px; right: 3px; } .pk-g .star .ic { width: 15px; height: 15px; }
.keyrow { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--ink2); font-weight: 900; }
.keyrow button { min-height: 36px; padding: 2px 10px; border-radius: 10px; border: 2.5px solid var(--ink); background: #fff; font-weight: 900; font-size: 14px; }
.keyrow button.on { background: var(--purple); color: #fff; }
.keyrow i { font-style: normal; font-size: 10px; margin-left: 4px; opacity: .75; }
@media (pointer: fine) { .pick kbd { display: block; position: absolute; left: 5px; top: 3px; font: 900 10px/1 var(--font); opacity: .5; } }
/* spectator dock */
.spectate { background: rgba(255,255,255,.94); border: 3px solid var(--ink); border-radius: 16px; padding: 8px 10px; box-shadow: 0 4px 0 var(--ink); display: flex; flex-direction: column; gap: 6px; }
.spectate .sp-t { display: flex; align-items: center; gap: 6px; font-size: 15px; }
.spectate .sp-t .ic { width: 22px; height: 22px; }
.spectate .qn { margin-left: auto; display: inline-flex; align-items: center; gap: 3px; font-size: 13px; }
.spectate .sp-b { display: flex; gap: 8px; align-items: center; justify-content: center; }
.spectate .sp-b .btn { flex: 1; }
.spectate .qpos { font-weight: 900; font-size: 15px; }
.spectate .hint { color: var(--muted); text-shadow: none; margin: 0; font-size: 12px; }

/* mini cards */
.mcard i { font-style: normal; font-size: .8em; margin-left: 1px; }
.mcard.laizi { border-color: var(--purple); background: #ece3ff; }
.mcard.wild { background: linear-gradient(#e6dbff, #fff); color: var(--purple); border-color: var(--purple); flex-direction: column; line-height: .95; }
.mcard.wild small { font-size: 8px; color: var(--muted); letter-spacing: 0; }
.mcard.jk { font-size: 10px; letter-spacing: 0; color: var(--ink); } .mcard.jk.bj { color: #e63946; }
.num .bmin { font-size: 11px; color: var(--muted); font-weight: 700; }

/* history & guide */
.hh .hsum { flex: 1; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font-size: 13px; min-width: 0; }
.hh .hsum .ic { width: 16px; height: 16px; }
.hh .hside.landlord { color: #9a6a00; } .hh .hside.farmers { color: #1c6f93; }
.hk { margin-top: 6px; font-size: 12px; font-weight: 800; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.hk .mcard, .hcards .mcard, .hl .hb .mcard { min-width: 18px; height: 24px; font-size: 10px; margin-right: 1px; }
.hp { grid-template-columns: minmax(64px, auto) 1fr auto; }
.hp .ic { width: 15px; height: 15px; }
.hp .hcards { display: flex; flex-wrap: wrap; }
.hl .ha { display: inline-flex; align-items: center; gap: 4px; }
.hl .ha.pass { opacity: .6; }
.hl .hb { display: inline-flex; }
.gsec { margin-top: 10px; background: #fff; border: 2.5px solid var(--ink); border-radius: 14px; padding: 8px 12px; }
.gsec b { display: block; margin-bottom: 2px; }
.gsec p { margin: 4px 0; font-size: 13px; font-weight: 700; line-height: 1.5; }
.gsec ul { margin: 4px 0; padding-left: 18px; font-size: 13px; font-weight: 700; line-height: 1.55; }
.gsec.strict { background: #fff4f4; }
.rk .rc .mcard { min-width: 20px; height: 26px; font-size: 10px; margin-right: 1px; }
.thic .ic { width: 16px; height: 16px; }

/* interaction bar: 2×2 on narrow phones, a top row in landscape */
@media (max-width: 430px) {
  #fxbar { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; right: 8px; }
  .fxb { width: 50px; min-height: 50px; border-radius: 14px; }
  .fxb .ic { width: 24px; height: 24px; }
}
@media (max-width: 380px) { .fxb span { display: none; } .fxb { min-height: 46px; width: 46px; } }
@media (max-height: 560px) and (orientation: landscape) {
  #fxbar { flex-direction: row; top: calc(60px + var(--safe-t)); bottom: auto; }
  #tinfo { top: calc(8px + var(--safe-t)); }
  .hinfo { min-height: 22px; }
  .acts .btn { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) { .hcard.laizi::after { display: none; } }
