body.phone { min-height: 100dvh; font-size: 17px; padding-bottom: env(safe-area-inset-bottom); }
#app { padding: 12px 16px 120px; max-width: 560px; margin: 0 auto; }
.conn { position: fixed; top: 0; left: 0; right: 0; z-index: 90; background: var(--kumkum); color: #fff; text-align: center; font-weight: 700; padding: 6px; font-size: 14px; }

#top:empty { display: none; }
.topbar { display: flex; align-items: center; gap: 10px; padding: 12px 16px; max-width: 560px; margin: 0 auto; }
.topbar .who { font-weight: 800; font-size: 18px; line-height: 1.1; }
.topbar .sub { color: var(--muted); font-size: 13px; }
.topbar .score { margin-left: auto; text-align: right; }
.topbar .score b { color: var(--gold); font-size: 20px; font-variant-numeric: tabular-nums; }
.topbar .room { font-family: var(--display); letter-spacing: 0.12em; color: var(--gold); }

h1.hero { font-size: 44px; color: var(--gold); text-align: center; line-height: 1.05; text-shadow: 0 0 30px rgba(255, 159, 28, 0.45); }
.hero-diya { font-size: 64px; text-align: center; animation: flicker 2s infinite; filter: drop-shadow(0 0 20px rgba(255, 159, 28, 0.8)); }
.lead { color: var(--muted); text-align: center; margin: 4px 0 18px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.card h3 { font-size: 20px; margin-bottom: 10px; color: var(--gold); }
label.lbl { display: block; font-size: 13px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); margin: 10px 0 6px; font-weight: 700; }
.field { width: 100%; background: rgba(0, 0, 0, 0.3); border: 1.5px solid var(--line); color: var(--text); border-radius: 14px; padding: 14px; font-size: 20px; font-weight: 700; outline: none; }
.field:focus { border-color: var(--gold); }
.field.code { text-transform: uppercase; letter-spacing: 0.3em; font-family: var(--display); text-align: center; font-size: 30px; }
textarea.field { resize: none; min-height: 96px; font-size: 18px; }
.btn { display: block; width: 100%; padding: 16px; border-radius: 16px; font-size: 19px; font-weight: 800; background: linear-gradient(135deg, var(--marigold), var(--rose)); color: #1a0f2e; margin-top: 12px; transition: transform 0.1s; }
.btn:active { transform: scale(0.97); }
.btn.ghost { background: var(--card-strong); color: var(--text); }
.btn.teal { background: linear-gradient(135deg, var(--teal), #1a8f84); }
.btn.red { background: linear-gradient(135deg, var(--kumkum), #8a1525); color: #fff; }
.btn.sm { padding: 10px; font-size: 15px; border-radius: 12px; }
.btn:disabled { opacity: 0.5; }
.charcount { text-align: right; font-size: 12px; color: var(--muted); margin-top: 4px; }

.avatars { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 5px; }
.avatars button { font-size: 21px; aspect-ratio: 1; border-radius: 10px; background: var(--card); padding: 0; min-width: 0; }
.avatars button.on { background: var(--marigold); box-shadow: 0 0 0 2px var(--gold); }

.fw-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.fw { display: grid; justify-items: center; gap: 2px; padding: 12px 4px; border-radius: 16px; background: var(--card-strong); font-size: 30px; transition: transform 0.1s; user-select: none; }
.fw span { font-size: 11px; font-weight: 700; color: var(--muted); }
.fw:active { transform: scale(0.88); background: var(--marigold); }
.wish-row { display: flex; gap: 8px; margin-top: 10px; }
.wish-row input { flex: 1; font-size: 16px; padding: 12px; }
.wish-row button { padding: 0 16px; border-radius: 14px; background: var(--gold); color: #1a0f2e; font-weight: 800; }

.game-list { display: grid; gap: 10px; }
.game-btn { display: flex; align-items: center; gap: 12px; text-align: left; padding: 14px; border-radius: 16px; background: var(--card-strong); border: 1px solid transparent; }
.game-btn:active { border-color: var(--gold); }
.game-btn .ge { font-size: 32px; }
.game-btn b { display: block; font-size: 18px; }
.game-btn small { color: var(--muted); font-size: 13px; line-height: 1.25; display: block; }
.vip { background: linear-gradient(135deg, rgba(255, 209, 102, 0.18), rgba(239, 71, 111, 0.12)); border-color: rgba(255, 209, 102, 0.5); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.screen-title { font-family: var(--display); font-size: 30px; color: var(--gold); text-align: center; margin: 10px 0 4px; }
.prompt { font-size: 22px; font-weight: 700; text-align: center; line-height: 1.3; margin: 8px 0 16px; text-wrap: balance; }
.timer-row { display: flex; justify-content: center; margin: 4px 0 8px; }
.look { text-align: center; padding: 40px 0 10px; }
.look .big { font-size: 72px; }
.look h2 { font-size: 28px; color: var(--gold); margin-top: 6px; }
.look p { color: var(--muted); margin: 6px 0; }
.result-big { font-size: 64px; text-align: center; margin-top: 30px; animation: pop-in 0.5s cubic-bezier(0.2, 1.6, 0.4, 1); }
.result-txt { text-align: center; font-size: 22px; font-weight: 800; }
.result-sub { text-align: center; color: var(--muted); margin-top: 4px; }
.plus { color: var(--teal); font-weight: 800; }

.people { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.person { display: grid; justify-items: center; gap: 4px; padding: 10px 4px; border-radius: 14px; background: var(--card); font-weight: 700; font-size: 14px; }
.person:active { background: var(--marigold); color: #1a0f2e; }
.person span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.choice { display: block; width: 100%; text-align: left; padding: 15px 16px; margin-bottom: 9px; border-radius: 14px; background: var(--card-strong); font-size: 18px; font-weight: 700; text-transform: uppercase; }
.choice:active { background: var(--gold); color: #1a0f2e; }
.choice.q { text-transform: none; background: #fff4e0; color: #1a0f2e; font-size: 17px; line-height: 1.3; }

.tiles4 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; height: calc(100dvh - 260px); min-height: 300px; }
.tile4 { border-radius: 18px; color: #1a0f2e; font-weight: 800; font-size: 18px; display: grid; place-items: center; padding: 10px; text-align: center; line-height: 1.2; }
.tile4 .sh { font-size: 34px; display: block; }
.tile4:active { transform: scale(0.96); }
.tile4.t0 { background: var(--c0); } .tile4.t1 { background: var(--c1); } .tile4.t2 { background: var(--c2); } .tile4.t3 { background: var(--c3); }

.reacts { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; margin-top: 24px; }
.reacts button { font-size: 28px; width: 52px; height: 52px; border-radius: 50%; background: var(--card-strong); }
.reacts button:active { transform: scale(0.85); background: var(--marigold); }
.reacts-label { text-align: center; color: var(--muted); font-size: 13px; margin-top: 18px; }

#dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; }
#dock:empty { display: none; }
.vipdock { display: flex; gap: 8px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: rgba(18, 10, 36, 0.95); border-top: 1px solid var(--line); max-width: 560px; margin: 0 auto; align-items: center; }
.vipdock .lbl2 { font-size: 12px; color: var(--gold); font-weight: 800; }
.vipdock button { flex: 1; padding: 10px; border-radius: 12px; background: var(--card-strong); font-weight: 800; font-size: 15px; }

/* mafia */
.rolecard { margin: 18px auto; width: 100%; max-width: 360px; aspect-ratio: 3/4; border-radius: 24px; display: grid; place-items: center; text-align: center; padding: 20px; user-select: none; -webkit-user-select: none; touch-action: none; background: repeating-linear-gradient(45deg, #2a1a4a, #2a1a4a 14px, #241640 14px, #241640 28px); border: 2px solid var(--line); }
.rolecard .back { font-size: 20px; font-weight: 800; color: var(--muted); }
.rolecard .back b { display: block; font-size: 64px; }
.rolecard .front { display: none; }
.rolecard.show .back { display: none; }
.rolecard.show .front { display: block; }
.rolecard.show { background: var(--rc, var(--bg3)); }
.rolecard .re { font-size: 90px; }
.rolecard h2 { font-size: 40px; }
.rolecard p { font-size: 16px; margin: 8px 0 0; }
.rolecard .team { margin-top: 12px; font-weight: 800; }
.dead-banner { text-align: center; padding: 20px; border-radius: 18px; background: rgba(230, 57, 70, 0.15); border: 1px solid rgba(230, 57, 70, 0.5); margin-top: 12px; }
.cycle { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cycle button { padding: 14px; border-radius: 14px; font-weight: 800; font-size: 17px; background: var(--card-strong); }
.cycle button.on { background: var(--gold); color: #1a0f2e; }
.script { font-size: 15px; line-height: 1.5; }
.script ol { padding-left: 20px; margin: 6px 0; }
.script li { margin-bottom: 6px; }
.ntable { display: grid; gap: 6px; }
.nrow { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; padding: 8px; border-radius: 12px; background: var(--card); }
.nrow.dead { opacity: 0.45; }
.nrow .nm { font-weight: 800; line-height: 1.1; }
.nrow .nm small { display: block; font-weight: 700; color: var(--muted); font-size: 12px; }
.nrow .nm small.mafia { color: #ff7b85; }
.nrow .acts { display: flex; gap: 4px; }
.nrow .acts button { padding: 8px 10px; border-radius: 10px; background: var(--card-strong); font-size: 15px; }
.banner { padding: 12px; border-radius: 14px; background: rgba(255, 209, 102, 0.15); border: 1px solid var(--gold); font-weight: 700; margin-bottom: 12px; }
.stepper { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; font-weight: 700; }
.stepper .pm { display: flex; gap: 6px; align-items: center; }
.stepper .pm button { width: 40px; height: 40px; border-radius: 12px; background: var(--card-strong); font-size: 20px; font-weight: 800; }
.stepper .pm b { min-width: 26px; text-align: center; font-size: 20px; color: var(--gold); }
.toggle { padding: 8px 14px; border-radius: 10px; background: var(--card-strong); font-weight: 800; }
.toggle.on { background: var(--teal); color: #0b1a19; }
select.field { font-size: 17px; padding: 10px; }
.link { color: var(--gold); text-decoration: none; font-weight: 700; }
.foot { text-align: center; margin-top: 18px; font-size: 14px; }
.foot a { color: var(--muted); }
