/* Unread Friends web. Palette and type from ios/Shared/Theme.swift. */
:root {
  --bg: #0B0D10; --card: #14171C; --card2: #1C2026; --line: #26292E;
  --ink: #E8E6E1; --mute: #8A8F98; --red: #FF453A; --amber: #FFB020; --green: #30D158;
  --blue: #0A84FF;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, "Roboto Mono", Consolas, monospace;
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px); --sar: env(safe-area-inset-right, 0px);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; }
body { overflow: hidden; overscroll-behavior: none; }
#app { height: 100%; height: 100dvh; width: 100%; overflow: hidden; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: default; }
:focus { outline: none; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; border-radius: 6px; }
input { font: inherit; }
img { display: block; }
[hidden] { display: none !important; }
p { margin: 0; }
h1, h2 { margin: 0; }

.ico { display: inline-flex; width: 1em; height: 1em; flex: none; }
.ico svg { width: 100%; height: 100%; }
.grow { flex: 1 1 auto; min-width: 0; }
.mute { color: var(--mute); } .red { color: var(--red); } .amber { color: var(--amber); } .green { color: var(--green); } .blue { color: var(--blue); }
.small { font-size: 14px; } .strong { font-weight: 600; }
.mono-sm { font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: .02em; }
.section-label { display: block; font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: 1.6px; text-transform: uppercase; color: var(--mute); margin-top: 6px; }
.kicker { font-family: var(--mono); font-weight: 800; letter-spacing: 2px; font-size: 13px; }
.title-hero { font-size: 30px; font-weight: 700; line-height: 1.15; }
.title-xl { font-size: 26px; font-weight: 700; line-height: 1.2; }
.title-lg { font-size: 22px; font-weight: 700; }
.lede { font-size: 16px; color: var(--mute); line-height: 1.45; }
.error { color: var(--red); font-size: 14px; min-height: 1em; }

.wordmark { display: inline-flex; gap: calc(var(--wm) * .5); font-family: var(--mono); font-weight: 800; font-size: var(--wm); letter-spacing: calc(var(--wm) * .22); white-space: nowrap; }
.wm-a { color: var(--ink); } .wm-b { color: var(--red); }

.scroll { overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.page { height: 100%; }
.page-inner { max-width: 560px; margin: 0 auto; padding: calc(16px + var(--sat)) calc(20px + var(--sar)) calc(32px + var(--sab)) calc(20px + var(--sal)); display: flex; flex-direction: column; gap: 16px; }
.card { background: var(--card); border-radius: 14px; padding: 14px; line-height: 1.4; position: relative; }
.card.alt { background: var(--card2); }
.card.list-card { padding: 0 14px; }
.prose p + p { margin-top: 12px; }
.row-top { display: flex; gap: 10px; align-items: flex-start; }

.btn { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 52px; border-radius: 14px; font-size: 17px; font-weight: 600; padding: 0 16px; }
.btn.primary { background: var(--red); color: #fff; }
.btn.primary:disabled { background: var(--card2); color: var(--mute); }
.btn.secondary { background: var(--card2); color: var(--ink); min-height: 48px; }
.btn.danger { background: rgba(255,69,58,.14); color: var(--red); min-height: 48px; }
.btn.ghost { background: var(--card2); width: auto; min-height: 44px; }
.link-btn { color: var(--mute); font-size: 15px; min-height: 44px; padding: 0 6px; }
.link-btn.center { align-self: center; }
.link-btn.blue { color: var(--blue); font-weight: 600; }
.pill { min-height: 40px; padding: 0 16px; border-radius: 999px; font-weight: 600; font-size: 15px; color: #fff; }
.pill.red { background: var(--red); } .pill.muted { background: var(--card2); }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; background: var(--card2); color: var(--mute); display: inline-flex; align-items: center; justify-content: center; font-size: 15px; flex: none; }
.icon-btn.small { width: 36px; height: 36px; }
.field { width: 100%; background: var(--card); color: var(--ink); border: 1px solid transparent; border-radius: 12px; padding: 14px; font-size: 17px; min-height: 52px; }
.field::placeholder { color: var(--mute); }
.field:focus { border-color: var(--amber); outline: none; }
.code-field { font-family: var(--mono); font-weight: 700; font-size: 20px; letter-spacing: 4px; text-transform: uppercase; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--mute); display: inline-block; flex: none; }
.dot.on { background: var(--green); }

.conn-banner { background: rgba(255,176,32,.14); color: var(--amber); text-align: center; font-size: 13px; font-weight: 600; padding: 6px 12px; padding-top: calc(6px + var(--sat)); }
.toast { position: fixed; left: 50%; bottom: calc(84px + var(--sab)); transform: translate(-50%, 20px); max-width: min(92vw, 420px); background: var(--card2); color: var(--ink); border: 1px solid var(--line); padding: 12px 16px; border-radius: 12px; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 100; box-shadow: 0 8px 30px rgba(0,0,0,.5); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.warn { border-color: rgba(255,176,32,.5); }

/* ---------- join ---------- */
.join-top { padding-top: 20px; }
.join-form { display: flex; flex-direction: column; gap: 8px; }
.code-row { display: flex; gap: 10px; }
.code-row .field { flex: 1; min-width: 0; }
.join-btn { width: 92px; flex: none; min-height: 54px; border-radius: 12px; }
.back-card { display: flex; align-items: center; justify-content: space-between; text-align: left; width: 100%; min-height: 64px; font-size: 18px; }
.back-card .ico { font-size: 20px; }
.store-row { margin-top: 24px; text-align: center; }
.store-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 8px; }
.store-btn { text-decoration: none; width: auto; flex: 1 1 140px; max-width: 220px; }
.join-foot { margin-top: 20px; color: var(--mute); font-size: 14px; text-align: center; }

/* ---------- lobby ---------- */
.lobby-top { display: flex; align-items: center; justify-content: space-between; }
.room-code { font-family: var(--mono); font-weight: 800; font-size: 44px; letter-spacing: 6px; user-select: all; }
.player-row { display: flex; align-items: center; gap: 10px; min-height: 48px; font-size: 17px; border-bottom: 1px solid var(--line); }
.player-row:last-child { border-bottom: 0; }
.player-row .more-btn { position: static; margin-right: -10px; flex: none; }
.you { margin-left: 6px; }

/* ---------- game shell ---------- */
.game { height: 100%; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 10px; padding: calc(10px + var(--sat)) calc(16px + var(--sar)) 10px calc(16px + var(--sal)); background: var(--bg); flex: none; }
.tb-title { font-weight: 600; font-size: 15px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-dots { display: inline-flex; gap: 4px; align-items: center; background: none; border: 0; padding: 8px 4px; cursor: pointer; color: inherit; }
.tb-dots .dot { width: 7px; height: 7px; }
.tb-code { color: var(--mute); }
.panels { flex: 1; min-height: 0; position: relative; }
.panel { position: absolute; inset: 0; }
.tabbar { flex: none; display: flex; background: rgba(20,23,28,.96); border-top: 1px solid var(--line); padding-bottom: var(--sab); padding-left: var(--sal); padding-right: var(--sar); }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 54px; color: var(--mute); font-size: 11px; font-weight: 500; }
.tab.on { color: var(--red); }
.tab-ico { position: relative; font-size: 23px; display: inline-flex; }
.badge { position: absolute; top: -5px; left: 15px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 0 5px; }

.person + .person { margin-top: 10px; }
.statement + .statement { margin-top: 12px; }
.hint { display: flex; gap: 10px; align-items: flex-start; }
.hint .ico { font-size: 18px; margin-top: 2px; }

/* ---------- evidence card (board tab) ---------- */
.ev-card { background: var(--card2); border-radius: 12px; padding: 12px 12px 12px 15px; position: relative; display: flex; flex-direction: column; gap: 6px; border: 2px solid transparent; }
.ev-card::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; background: var(--amber); border-radius: 2px; }
.ev-card.hl { border-color: var(--red); }
.ev-head { display: flex; gap: 6px; font-family: var(--mono); font-size: 11px; font-weight: 600; min-width: 0; padding-right: 36px; }
.ev-app { color: var(--amber); flex: none; } .ev-dot { color: var(--mute); }
.ev-title { color: var(--mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-owner { font-size: 12px; font-weight: 600; color: rgba(232,230,225,.8); }
.ev-img { height: 170px; border-radius: 8px; overflow: hidden; background: #000; }
.ev-img img { width: 100%; height: 100%; object-fit: cover; }
.ev-body { font-size: 15px; white-space: pre-wrap; line-height: 1.4; overflow-wrap: anywhere; }
.ev-body.mono { font-family: var(--mono); font-size: 13px; }
.ev-foot { font-family: var(--mono); font-size: 10px; color: var(--mute); text-align: right; }

.board-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.connect-help { margin-top: -8px; }
.pins-col { position: relative; display: flex; flex-direction: column; gap: 14px; }
.pin-row { position: relative; }
.pin-row.selectable .ev-card { cursor: pointer; }
.pin-tap { position: absolute; inset: 0; border-radius: 12px; }
.pin-tap:focus-visible { outline-offset: 0; }
.more-btn { position: absolute; top: 2px; right: 2px; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; color: var(--mute); font-size: 18px; border-radius: 10px; }
.gutter-svg { position: absolute; inset: 0; pointer-events: none; }
.gutter-svg svg { position: absolute; left: 0; top: 0; overflow: visible; }
.string-card { padding-right: 48px; display: flex; flex-direction: column; gap: 4px; }

/* sheets */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 50; display: flex; align-items: flex-end; justify-content: center; animation: fade .18s; }
.sheet { width: 100%; max-width: 560px; background: var(--bg); border-top: 1px solid var(--line); border-radius: 20px 20px 0 0; padding: 22px calc(20px + var(--sar)) calc(22px + var(--sab)) calc(20px + var(--sal)); display: flex; flex-direction: column; gap: 14px; animation: rise .22s ease-out; }
.sheet-title { text-align: center; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(40px); opacity: .4; } }

/* vote */
.vote-axis { display: flex; flex-direction: column; gap: 8px; }
.vote-prompt { font-size: 17px; font-weight: 600; }
.radio { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; text-align: left; padding: 12px; border-radius: 10px; background: var(--card); line-height: 1.3; }
.radio.on { background: var(--card2); }
.radio-dot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--mute); flex: none; position: relative; }
.radio.on .radio-dot { border-color: var(--red); }
.radio.on .radio-dot::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--red); }

/* reveal (phone) */
.reveal-shell { height: 100%; }
.rv-top { padding-top: 8px; }
.rv-head { display: flex; flex-direction: column; gap: 6px; }
.rv-answer { display: flex; align-items: baseline; gap: 10px; margin-top: 6px; }
.rv-answer-text { flex: 1; font-size: 18px; font-weight: 600; }
.rv-mark { font-size: 20px; align-self: center; }
.card .mono-sm { margin-top: 6px; }
.aud-line { margin-top: 6px; }
.story-p { font-size: 16px; line-height: 1.5; }
.story-p + .story-p { margin-top: 12px; }
.epilogue { font-style: italic; color: var(--amber); margin-top: 12px; }
.aha-pin { font-size: 18px; margin-top: 2px; }

/* ---------- the phone ---------- */
.phones-panel { display: flex; flex-direction: column; }
.phones { display: flex; flex-direction: column; height: 100%; }
.phone-picker { display: flex; gap: 2px; margin: 0 16px 8px; padding: 2px; background: var(--card); border-radius: 9px; flex: none; overflow-x: auto; }
.seg { flex: 1; min-height: 36px; border-radius: 7px; font-size: 14px; font-weight: 600; color: var(--ink); white-space: nowrap; padding: 0 10px; }
.seg.on { background: #3A3D44; }
.device { flex: 1; min-height: 0; position: relative; background: #000; overflow: hidden; color: #fff; }
.status-bar { align-self: stretch; display: flex; align-items: center; justify-content: space-between; padding: 6px 20px; font-size: 14px; font-weight: 600; color: rgba(255,255,255,.9); flex: none; position: relative; z-index: 2; }
.sb-right { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 500; }
.sb-sig { font-size: 12px; }
.battery { width: 24px; height: 11px; border: 1.5px solid rgba(255,255,255,.8); border-radius: 3px; padding: 1px; position: relative; display: inline-flex; }
.battery::after { content: ""; position: absolute; right: -4px; top: 3px; width: 2px; height: 4px; background: rgba(255,255,255,.8); border-radius: 0 1px 1px 0; }
.battery-fill { background: rgba(255,255,255,.9); border-radius: 1px; }
.battery.low .battery-fill { background: var(--red); }
.wallpaper { position: absolute; inset: 0; background-size: cover; background-position: center; }
.wallpaper::after { content: ""; position: absolute; inset: 0; background: linear-gradient(rgba(0,0,0,.35), transparent 40%, transparent 60%, rgba(0,0,0,.3)), rgba(0,0,0,var(--scrim)); }
.wallpaper.stripes { background: repeating-linear-gradient(-45deg, #000 0 14px, #070707 14px 22px); }

.lock { position: absolute; inset: 0; touch-action: none; user-select: none; cursor: pointer; transition: opacity .26s, transform .26s; }
.lock.leaving { opacity: 0; transform: translateY(-40px); }
.lock-content { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; }
.lock-date { font-size: 17px; font-weight: 600; color: rgba(255,255,255,.9); margin-top: 24px; text-shadow: 0 1px 6px rgba(0,0,0,.4); }
.lock-clock { font-size: clamp(64px, 22vw, 86px); font-weight: 700; line-height: 1; letter-spacing: -1px; text-shadow: 0 2px 12px rgba(0,0,0,.35); }
.lock-note { display: flex; gap: 10px; align-items: flex-start; align-self: stretch; margin: 22px 14px 0; background: rgba(28,32,38,.85); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); border-radius: 20px; padding: 12px; }
.ln-icon { width: 38px; height: 38px; border-radius: 9px; background: rgba(48,209,88,.85); display: flex; align-items: center; justify-content: center; font-size: 20px; flex: none; }
.ln-text { flex: 1; min-width: 0; }
.ln-top { display: flex; justify-content: space-between; gap: 8px; }
.ln-sender { font-size: 14px; font-weight: 600; } .ln-time { font-size: 12px; color: rgba(255,255,255,.55); }
.ln-body { font-size: 13px; color: rgba(255,255,255,.85); margin-top: 3px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lock-spacer { flex: 1; }
.lock-swipe { display: flex; flex-direction: column; align-items: center; gap: 10px; padding-bottom: 26px; }
.ls-chev { font-size: 15px; color: rgba(255,255,255,.75); animation: nudge 1.6s ease-in-out infinite; }
.ls-text { font-size: 15px; font-weight: 500; color: rgba(255,255,255,.85); text-shadow: 0 1px 4px rgba(0,0,0,.6); }
.ls-bar { width: 128px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.55); }
@keyframes nudge { 50% { transform: translateY(-5px); } }

.home { position: absolute; inset: 0; }
.home-inner { position: absolute; inset: 0; display: flex; flex-direction: column; }
.home-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 0; }
.widgets { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 0 20px; }
.widget { aspect-ratio: 1; border-radius: 22px; background: rgba(40,44,52,.55); -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px); border: .5px solid rgba(255,255,255,.12); padding: 14px; display: flex; flex-direction: column; align-items: flex-start; text-align: left; overflow: hidden; color: #fff; }
.w-photos { padding: 8px; flex-direction: row; gap: 4px; }
.w-photos .wp-cell { flex: 1; height: 100%; border-radius: 10px; overflow: hidden; }
.w-photos.grid { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.w-photos.grid .wp-cell { height: auto; }
.cover { width: 100%; height: 100%; object-fit: cover; }
.wc-day { font-size: 11px; font-weight: 600; color: var(--red); }
.wc-num { font-size: 34px; font-weight: 500; line-height: 1.05; }
.ww-spacer { flex: 1; }
.wc-ev { display: flex; gap: 6px; }
.wc-bar { width: 3px; border-radius: 2px; background: var(--blue); flex: none; }
.wc-title { font-size: 12px; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.wc-time, .wc-month { font-size: 11px; color: rgba(255,255,255,.6); }
.w-weather { background: linear-gradient(#2A6BC2, #123A6E); }
.ww-loc { font-size: 13px; font-weight: 600; } .ww-temp { font-size: 38px; font-weight: 300; } .ww-glyph { font-size: 18px; } .ww-cond { font-size: 12px; color: rgba(255,255,255,.85); }
.app-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px 10px; padding: 20px 18px 8px; }
.app-tile { display: flex; flex-direction: column; align-items: center; gap: 6px; min-height: 44px; border-radius: 16px; }
.app-name { font-size: 12px; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.7); white-space: nowrap; }
.app-icon { width: min(var(--sz), 15vw); height: min(var(--sz), 15vw); border-radius: 23.5%; display: flex; align-items: center; justify-content: center; position: relative; box-shadow: 0 3px 6px rgba(0,0,0,.35), inset 0 0 0 .5px rgba(255,255,255,.18); overflow: hidden; }
.app-icon::before { content: ""; position: absolute; inset: 0; background: linear-gradient(rgba(255,255,255,.28), transparent 50%); }
.app-glyph { width: 52%; height: 52%; color: #fff; position: relative; filter: drop-shadow(0 1px 1px rgba(0,0,0,.18)); }
.ai-notes .app-glyph { width: 60%; height: 60%; }
.ai-photos .app-glyph { width: 72%; height: 72%; }
.ai-clock .app-glyph { width: 80%; height: 80%; }
.ai-browser .app-glyph, .ai-maps .app-glyph { width: 62%; height: 62%; }
.cal-glyph { display: flex; flex-direction: column; align-items: center; position: relative; line-height: 1; padding-top: 6%; height: 100%; width: 100%; }
.cg-day { color: var(--red); font-size: calc(min(var(--sz), 15vw) * .16); font-weight: 600; margin-top: 6%; }
.cg-num { color: #000; font-size: calc(min(var(--sz), 15vw) * .44); }
.dock { margin: 0 16px calc(10px + var(--sab) * 0); padding: 14px 10px; border-radius: 30px; background: rgba(40,44,52,.5); -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px); border: .5px solid rgba(255,255,255,.12); display: flex; flex: none; margin-bottom: 10px; }
.dock-tile { flex: 1; }

.app-screen { position: absolute; inset: 0; display: flex; flex-direction: column; background: #000; }
.app-screen.home-bg .app-body { background: linear-gradient(#2A1A08, #000 50%); }
.app-screen.weather-bg .app-body { background: linear-gradient(#1E4E8C, #0B1E3A); }
.app-nav { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: 44px; padding: 0 8px; border-bottom: .5px solid #1a1a1a; flex: none; }
.nav-back { display: inline-flex; align-items: center; gap: 2px; color: var(--blue); font-size: 17px; min-height: 44px; min-width: 44px; padding-right: 8px; justify-self: start; }
.nav-back .ico { font-size: 20px; }
.nav-title { font-size: 17px; font-weight: 600; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 56vw; }
.app-body { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; position: relative; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.ph-empty { color: var(--mute); text-align: center; padding: 60px 20px; }
.ph-empty.pad { padding-top: 120px; }
.scroll-pad { padding: 16px; }
.ph-list { display: flex; flex-direction: column; }
.ph-row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 10px 16px; min-height: 56px; border-bottom: .5px solid var(--card2); color: #fff; }
.ph-row.sel { background: var(--card2); }
.ph-list.cards { padding: 12px; gap: 1px; }
.ph-list.cards > * { background: var(--card); border-bottom: 0; }
.ph-list.cards > :first-child { border-radius: 12px 12px 0 0; }
.ph-list.cards > :last-child { border-radius: 0 0 12px 12px; }
.ph-list.cards > :only-child { border-radius: 12px; }
.chev { color: rgba(255,255,255,.3); font-size: 13px; }
.pinbadge { display: none; width: 20px; height: 20px; border-radius: 50%; background: rgba(0,0,0,.7); color: var(--red); align-items: center; justify-content: center; font-size: 11px; flex: none; }
.pinbadge.on { display: inline-flex; }
.pinbar-wrap { flex: none; background: #000; border-top: .5px solid var(--line); padding: 8px 16px; padding-bottom: 8px; }
.pinbar { width: 100%; min-height: 46px; border-radius: 12px; background: var(--card2); color: #fff; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 16px; font-weight: 600; border: 1px solid transparent; }
.pinbar.on, .pincap.on { color: var(--red); background: rgba(255,69,58,.14); border-color: rgba(255,69,58,.7); }
.pinbar:disabled, .pincap:disabled { opacity: .5; }
.pinbar .ico, .pincap .ico { font-size: 1.05em; }
.p-on { display: none !important; } .on > .p-on { display: inline-flex !important; } .on > .p-off { display: none !important; }

.avatar { width: var(--av); height: var(--av); border-radius: 50%; background: var(--card2); display: inline-flex; align-items: center; justify-content: center; font-size: calc(var(--av) * .36); font-weight: 600; color: rgba(255,255,255,.8); flex: none; background-image: repeating-linear-gradient(-45deg, rgba(255,255,255,.05) 0 4px, transparent 4px 8px); }
.avatar.unknown { background: none; border: 1px dashed rgba(138,143,152,.7); color: var(--mute); }
.avatar.group .ico { font-size: calc(var(--av) * .42); }
.ml-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ml-top { display: flex; align-items: center; gap: 6px; }
.ml-name { font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ml-time { margin-left: auto; font-size: 13px; color: var(--mute); flex: none; }
.ml-preview { font-size: 14px; color: var(--mute); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mail-subj { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.unread-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; align-self: flex-start; margin-top: 7px; }
.unread-dot.on { background: var(--blue); }

.thread .app-body { display: flex; flex-direction: column; overflow: hidden; }
.thread-wrap { display: flex; flex-direction: column; height: 100%; }
.thread-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 0 14px 8px; display: flex; flex-direction: column; gap: 4px; overscroll-behavior: contain; }
.thread-head { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 0; }
.th-name { font-size: 14px; font-weight: 500; } .th-num { font-size: 11px; color: var(--mute); }
.day-label { font-size: 11px; font-weight: 500; color: var(--mute); text-align: center; padding: 10px 0; }
.msg { display: flex; flex-direction: column; gap: 3px; padding: 1px 0; }
.msg.own { align-items: flex-end; } .msg.them { align-items: flex-start; }
.msg-sender { font-size: 11px; color: var(--mute); padding: 4px 14px 0; }
.bubble { max-width: 78%; padding: 9px 14px; border-radius: 18px; font-size: 15px; line-height: 1.32; background: var(--line); color: #fff; border: 1.5px solid transparent; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.own .bubble { background: var(--blue); }
.bubble-img { width: 190px; height: 140px; border-radius: 18px; overflow: hidden; border: 1.5px solid transparent; }
.bubble.pinned, .bubble-img.pinned { border-color: rgba(255,69,58,.85); }
.msg-time { font-size: 11px; color: rgba(138,143,152,.7); padding: 0 4px; }
.cap-row { display: flex; padding: 2px 4px 8px; }
.cap-row.right { justify-content: flex-end; }
.pincap { display: inline-flex; align-items: center; gap: 5px; min-height: 32px; padding: 0 12px; border-radius: 999px; font-size: 13px; font-weight: 600; color: rgba(255,255,255,.85); background: var(--card2); border: 1px solid var(--line); position: relative; }
.pincap::after { content: ""; position: absolute; inset: -6px -2px; }
.composer { flex: none; background: #000; padding: 8px 14px; }
.composer span { display: block; padding: 9px 16px; border-radius: 999px; background: var(--card); color: rgba(138,143,152,.6); font-size: 15px; }

.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
.pg-cell { aspect-ratio: 1; position: relative; overflow: hidden; background: var(--card); }
.pg-cell .pinbadge { position: absolute; top: 4px; right: 4px; }
.ph-placeholder { width: 100%; height: 100%; background: var(--card) repeating-linear-gradient(-45deg, rgba(255,255,255,.045) 0 7px, transparent 7px 16px); }
.pager .app-body { overflow: hidden; }
.pp { height: 100%; display: flex; flex-direction: column; }
.pp-strip { flex: 1; min-height: 0; display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior: contain; }
.pp-strip::-webkit-scrollbar { display: none; }
.pp-page { flex: 0 0 100%; scroll-snap-align: start; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.pp-photo { border-radius: 6px; overflow: hidden; background: #0d0d0d; aspect-ratio: 3 / 4; max-height: 52vh; display: flex; align-items: center; justify-content: center; }
.pp-photo .contain { width: 100%; height: 100%; object-fit: cover; }
.pp-info { background: var(--card); border: 1px solid var(--card2); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 8px; font-size: 15px; }
.pp-loc, .pp-when { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 500; }
.pp-when { color: var(--mute); font-weight: 400; }
.pp-dots { display: flex; justify-content: center; gap: 7px; padding: 6px 0 2px; flex: none; }
.pp-dots span { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.3); }
.pp-dots span.on { background: #fff; }

.note-row { width: 100%; display: flex; flex-direction: column; gap: 3px; }
.nr-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.nr-title { font-size: 15px; font-weight: 600; }
.nr-sub { display: flex; gap: 8px; font-size: 12px; color: var(--mute); min-width: 0; }
.nr-first { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-body { white-space: pre-wrap; line-height: 1.7; font-size: 17px; margin-top: 12px; }
.mail-detail .md-from { font-size: 17px; font-weight: 600; }
.md-subj { font-size: 20px; font-weight: 600; margin-top: 14px; }
.md-rule { border: 0; border-top: .5px solid rgba(255,255,255,.12); margin: 18px 0; }
.md-p { font-size: 16px; line-height: 1.55; color: rgba(255,255,255,.92); white-space: pre-wrap; }
.md-p + .md-p { margin-top: 16px; }
.ce-when { width: 82px; flex: none; font-size: 11px; }
.ce-day { font-weight: 700; } .ce-time { color: var(--mute); }
.ce-bar { width: 3px; align-self: stretch; border-radius: 2px; background: var(--amber); flex: none; }
.ce-bar.tall { width: 4px; }
.ce-title { font-size: 15px; font-weight: 500; }
.ce-loc { display: flex; gap: 4px; align-items: center; font-size: 12px; color: var(--mute); margin-top: 3px; }
.ph-sheet-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.5); display: flex; align-items: flex-end; z-index: 5; animation: fade .18s; }
.ph-sheet { width: 100%; background: #0d0d0f; border-radius: 16px 16px 0 0; padding: 8px 20px 30px; min-height: 50%; animation: rise .22s ease-out; display: flex; flex-direction: column; gap: 16px; }
.sheet-top { display: flex; justify-content: flex-end; }
.es-head { display: flex; gap: 12px; }
.es-title { font-size: 24px; font-weight: 700; } .es-date { font-size: 15px; color: rgba(255,255,255,.85); margin-top: 6px; }
.es-loc { display: flex; gap: 8px; align-items: center; background: var(--card); border-radius: 12px; padding: 14px; }
.group-head { font-size: 13px; color: var(--mute); text-transform: uppercase; letter-spacing: .3px; padding: 14px 4px 6px; }
.group-card { background: var(--card); border-radius: 12px; }
.hist-row { padding: 10px 14px; border-bottom: .5px solid var(--card2); }
.hist-row:last-child { border-bottom: 0; }
.hist-title { font-size: 15px; } .hist-sub { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--mute); margin-top: 3px; }
.call-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; min-height: 56px; }
.call-ico { font-size: 18px; width: 24px; }
.call-name { font-size: 15px; font-weight: 500; } .call-when { font-size: 11px; color: var(--mute); text-align: right; max-width: 40%; }
.ha-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.ha-title { font-size: 22px; font-weight: 700; }
.ha-card { background: var(--card); border: 1px solid var(--card2); border-radius: 16px; margin-bottom: 14px; overflow: hidden; }
.ha-dev { display: flex; gap: 12px; align-items: center; padding: 14px; }
.ha-ico { width: 40px; height: 40px; border-radius: 50%; background: rgba(255,179,64,.16); color: #FFB340; padding: 10px; }
.ha-name { font-size: 16px; font-weight: 600; }
.ha-events { border-top: .5px solid var(--line); padding: 0 14px 8px; }
.ha-act { font-size: 11px; font-weight: 600; letter-spacing: .8px; color: var(--mute); padding: 10px 0 4px; }
.ha-ev { display: flex; align-items: center; gap: 8px; padding: 7px 0; font-size: 15px; }
.ha-dot { width: 6px; height: 6px; border-radius: 50%; background: #FFB340; flex: none; }
.ha-time { font-size: 13px; color: var(--mute); font-variant-numeric: tabular-nums; }

.maps { display: flex; flex-direction: column; }
.map-box { position: relative; width: 100%; aspect-ratio: 400 / 260; background: #15181D; overflow: hidden; flex: none; }
.map-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.map-region { position: absolute; left: 10px; top: 10px; font-size: 10px; font-weight: 600; letter-spacing: 1.4px; color: rgba(255,255,255,.45); pointer-events: none; }
.map-region.north { top: auto; bottom: 10px; }
.map-region.west { left: auto; right: 10px; }
.map-label { position: absolute; transform: translateY(-50%); font-size: 10px; font-weight: 600; color: rgba(255,255,255,.85); white-space: nowrap; text-shadow: 0 0 3px #000, 0 0 2px #000; pointer-events: none; }
.map-label.sel { background: #fff; color: #000; padding: 1px 5px; border-radius: 999px; text-shadow: none; font-weight: 700; }
.map-pin { position: absolute; width: 36px; height: 36px; transform: translate(-50%, -50%); display: flex; align-items: center; justify-content: center; }
.map-pin::before { content: ""; width: 11px; height: 11px; border-radius: 50%; background: var(--pc); border: 1.5px solid rgba(0,0,0,.7); }
.map-pin.home::before { display: none; }
.map-pin.home .ico { width: 18px; height: 18px; border-radius: 50%; background: var(--pc); color: #000; padding: 4px; border: 1px solid rgba(0,0,0,.6); }
.map-pin.sel::after { content: ""; position: absolute; width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 6px var(--pc); }
.segmented { display: flex; gap: 2px; margin: 10px 16px; padding: 2px; background: var(--card); border-radius: 9px; }
.segmented.pad-x { margin: 16px; }
.place-badge { width: var(--sz); height: var(--sz); border-radius: 50%; background: color-mix(in srgb, var(--pc) 16%, transparent); color: var(--pc); display: inline-flex; align-items: center; justify-content: center; flex: none; font-size: calc(var(--sz) * .45); }
.pl-name { font-size: 15px; font-weight: 600; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 0 16px 8px; }
.chips.wrap { flex-wrap: wrap; padding: 0; }
.chip { min-height: 34px; padding: 0 12px; border-radius: 999px; background: var(--card2); color: #fff; font-size: 13px; font-weight: 600; white-space: nowrap; display: inline-flex; align-items: center; }
.chip.on { background: #fff; color: #000; }
.chip.static { color: var(--ink); font-size: 15px; }

.weather { color: #fff; }
.wx-top { text-align: center; padding-top: 16px; }
.wx-loc { font-size: 30px; } .wx-temp { font-size: 92px; font-weight: 200; line-height: 1.05; } .wx-cond { font-size: 18px; color: rgba(255,255,255,.85); }
.wx-card { background: rgba(255,255,255,.14); border-radius: 16px; padding: 14px; margin-top: 18px; }
.wx-head { font-size: 12px; font-weight: 600; color: rgba(255,255,255,.6); padding-bottom: 8px; }
.wx-row { display: flex; align-items: center; gap: 8px; padding: 9px 0; border-bottom: .5px solid rgba(255,255,255,.12); font-size: 17px; }
.wx-row:last-child { border-bottom: 0; }
.wx-day { width: 64px; } .wx-glyph { width: 30px; text-align: center; } .wx-low { color: rgba(255,255,255,.6); }
.wx-range { width: 70px; height: 5px; border-radius: 3px; background: linear-gradient(90deg, #4FB8FF, var(--amber)); }
.clock-row { display: flex; align-items: flex-end; gap: 10px; padding: 10px 16px; border-bottom: .5px solid var(--card2); }
.clk-city { font-size: 26px; } .clk-time { font-size: 38px; font-weight: 200; white-space: nowrap; }
.alarm-time { font-size: 44px; font-weight: 200; } .alarm-sub { font-size: 14px; color: rgba(255,255,255,.8); }
.clock-row.off .alarm-time { color: rgba(255,255,255,.4); } .clock-row.off .alarm-sub { color: rgba(255,255,255,.35); }
.toggle { width: 51px; height: 31px; border-radius: 16px; background: #39393D; position: relative; flex: none; align-self: center; opacity: .8; }
.toggle span { position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; }
.toggle.on { background: var(--green); } .toggle.on span { left: 22px; }

/* ---------- the corkboard ---------- */
.board-area { position: relative; flex: 1; min-height: 0; display: flex; }
.wood { --k: 1; flex: 1; display: flex; padding: calc(10px * var(--k)); margin: 0 calc(16px * var(--k)) calc(6px * var(--k)); background: linear-gradient(135deg, #C9965A, #A97538 50%, #C48D50); box-shadow: 0 6px 24px rgba(0,0,0,.5), inset 0 0 0 1px rgba(0,0,0,.35); min-height: 0; }
.cork { flex: 1; position: relative; overflow: hidden; min-height: 0; background: radial-gradient(ellipse at center, transparent 45%, rgba(0,0,0,.28) 100%), var(--cork) repeat, linear-gradient(135deg, #B07D4B, #9C6A3C); }
.cork-empty { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: rgba(0,0,0,.35); color: #F4EBDD; padding: 18px 22px; border-radius: 10px; text-align: center; max-width: 80%; }
.ce-title { font-size: calc(24px * var(--k)); font-weight: 700; } .ce-sub { font-size: calc(16px * var(--k)); margin-top: 8px; }
.layer { position: absolute; inset: 0; }
.layer.svgwrap, .layer.tags { pointer-events: none; z-index: 20; }
.layer.tags { z-index: 21; }
.strings { position: absolute; left: 0; top: 0; overflow: visible; }
.strings .draw { stroke-dasharray: 2000; stroke-dashoffset: 2000; animation: drawstring 1.2s ease-out forwards; }
@keyframes drawstring { to { stroke-dashoffset: 0; } }
.string-tag { position: absolute; transform: translate(-50%, -50%); background: #FBFAF4; color: #23211E; border: 1px solid #D7261E; padding: calc(3px * var(--k)) calc(6px * var(--k)); font-size: calc(10px * var(--k)); font-weight: 600; max-width: calc(200px * var(--k)); text-align: center; line-height: 1.25; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.tile-wrap { position: absolute; transform: rotate(var(--tilt)); transition: transform .25s cubic-bezier(.3,1.4,.5,1), box-shadow .25s; z-index: 1; border-radius: 3px; }
.tile-btn { padding: 0; text-align: left; display: block; }
.tile-btn:focus-visible, .tile-btn:hover { transform: rotate(0deg) scale(1.18); z-index: 30; outline: none; box-shadow: 0 0 0 calc(3px * var(--k, 1)) var(--amber), 0 0 28px rgba(255,176,32,.55); }
.screen-board .tile-btn:hover:not(:focus-visible) { transform: rotate(0deg) scale(1.06); box-shadow: none; }
.tile-wrap.fresh { animation: pop .4s ease-out; }
.tile-wrap.hot { transform: rotate(0) scale(1.08); z-index: 5; box-shadow: 0 0 28px rgba(255,176,32,.7); }
.tile-wrap.unpinned:not(.hot) { opacity: .55; }
.not-pinned { position: absolute; left: 5px; bottom: 5px; background: var(--red); color: #fff; font-family: var(--mono); font-weight: 800; font-size: calc(8px * var(--k, 1)); padding: 2px 6px; border-radius: 999px; z-index: 2; }
@keyframes pop { from { transform: scale(.8); opacity: 0; } }

.paper { --fit: 1; position: relative; overflow: hidden; color: #23211E; box-shadow: 1px calc(3px * var(--k)) calc(6px * var(--k)) rgba(0,0,0,.45); display: flex; flex-direction: column; gap: calc(4px * var(--k)); font-family: var(--sans); }
.paper.big { width: 100%; }
.p-head { display: flex; flex-direction: column; gap: calc(1px * var(--k)); min-width: 0; flex: none; }
.p-label { font-family: var(--mono); font-weight: 700; font-size: calc(8.5px * var(--k)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-owner, .p-powner { font-size: calc(9px * var(--k)); font-weight: 600; color: #6E6A62; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-powner { font-weight: 400; font-size: calc(8.5px * var(--k)); }
.p-body { font-size: calc(11.5px * var(--k) * var(--fit)); line-height: 1.3; white-space: pre-wrap; overflow-wrap: anywhere; flex: 1; min-height: 0; overflow: hidden; }
.p-body.mono { font-family: var(--mono); font-size: calc(10px * var(--k) * var(--fit)); }
.paper.big .p-body { overflow: visible; }
.paper.lined { padding: calc(8px * var(--k)) calc(8px * var(--k)) calc(8px * var(--k)) calc(16px * var(--k));
  background:
    linear-gradient(90deg, transparent calc(11px * var(--k)), rgba(229,138,134,.7) calc(11px * var(--k)), rgba(229,138,134,.7) calc(11px * var(--k) + 1px), transparent calc(11px * var(--k) + 1px)),
    repeating-linear-gradient(180deg, transparent 0, transparent calc(15px * var(--k) - 1px), rgba(158,193,230,.55) calc(15px * var(--k) - 1px), rgba(158,193,230,.55) calc(15px * var(--k))) 0 calc(11px * var(--k)),
    #FBFAF4; }
.paper.lined .p-label { color: #B0322A; }
.paper.slip { padding: calc(8px * var(--k)); background: #EDEAE1; border-top: calc(3px * var(--k)) solid #D6D2C6; }
.paper.slip .p-label { color: #5A5650; }
.paper.sticky { padding: calc(9px * var(--k)); background: linear-gradient(#F9DE6B, #F1CE45); }
.paper.sticky .p-label { color: #7A5B00; }
.paper.polaroid { background: #F5F2EA; padding: calc(7px * var(--k)) calc(7px * var(--k)) calc(9px * var(--k)); gap: calc(5px * var(--k)); }
.p-photo { position: relative; flex: 1; min-height: 0; background: #000; overflow: hidden; }
.paper.big .p-photo { flex: none; height: calc(260px * var(--k)); }
.p-photo img { width: 100%; height: 100%; object-fit: cover; }
.p-nophoto { position: absolute; inset: 0; background: linear-gradient(#2B2F36, #15171B); }
.p-photo .p-body.light { position: relative; color: rgba(255,255,255,.92); padding: calc(6px * var(--k)); height: 100%; }
.p-ptitle { font-size: calc(10px * var(--k)); font-weight: 600; font-style: italic; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: none; }
.p-pcaption { font-size: calc(11px * var(--k)); line-height: 1.35; }

.board-overlays { position: absolute; inset: 0; pointer-events: none; z-index: 40; }
.spotlight { position: absolute; inset: 0; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; opacity: 0; transform: scale(.94); transition: opacity .35s, transform .35s; }
.spotlight.in { opacity: 1; transform: none; }
.spot-inner, .zoom-inner { display: flex; flex-direction: column; align-items: center; gap: calc(14px * var(--k, 1)); padding: 30px; width: 100%; max-height: 100%; }
.spot-label { font-family: var(--mono); font-weight: 800; letter-spacing: 3px; color: var(--amber); font-size: calc(13px * var(--k)); text-align: center; }
.spot-card, .zoom-card { width: min(calc(520px * var(--k)), 92%); max-height: calc(100% - 40px); overflow: hidden; }
.zoom-card { width: min(calc(560px * var(--k)), 94%); }
.zoom { position: absolute; inset: 0; background: rgba(0,0,0,.72); pointer-events: auto; display: flex; align-items: center; justify-content: center; animation: fade .2s; overflow: auto; }
.zoom:focus, .sreveal:focus { outline: none; }
.zoom-hint { font-family: var(--mono); font-size: calc(11px * var(--k, 1)); color: rgba(255,255,255,.7); text-align: center; letter-spacing: 1px; }

/* ---------- /board (shared screen) ---------- */
.screen-mode body, .screen-mode #app { cursor: default; }
.screen-board, .screen-lobby, .screen-reveal { --k: 1; height: 100%; display: flex; flex-direction: column; position: relative; }
.sb-header { padding: calc(10px * var(--k)) calc(20px * var(--k)); display: flex; flex-direction: column; gap: calc(6px * var(--k)); flex: none; }
.sb-row { display: flex; align-items: center; gap: calc(12px * var(--k)); min-width: 0; }
.sb-code { font-family: var(--mono); font-weight: 700; letter-spacing: 2px; color: var(--mute); font-size: calc(14px * var(--k)); }
.sb-title { font-size: calc(18px * var(--k)); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.sb-players { display: flex; gap: calc(12px * var(--k)); flex-wrap: wrap; justify-content: flex-end; }
.sb-player { display: inline-flex; align-items: center; gap: 5px; font-size: calc(13px * var(--k)); white-space: nowrap; }
.sb-player .dot { width: calc(7px * var(--k)); height: calc(7px * var(--k)); }
.sb-player.voted { color: var(--amber); }
.sb-footer { display: flex; align-items: center; gap: calc(12px * var(--k)); padding: calc(12px * var(--k)) calc(24px * var(--k)); font-size: calc(15px * var(--k)); flex: none; min-height: calc(48px * var(--k)); }
.sb-footer .ico { font-size: calc(18px * var(--k)); }
.sb-hint { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sb-aud { color: var(--mute); font-family: var(--mono); font-size: calc(12px * var(--k)); }
.screen-board .icon-btn, .screen-reveal .icon-btn, .screen-lobby .icon-btn { width: calc(36px * var(--k)); height: calc(36px * var(--k)); }

.screen-entry { height: 100%; display: flex; align-items: center; justify-content: center; padding: 24px; overflow-y: auto; }
.se-inner { max-width: 560px; width: 100%; display: flex; flex-direction: column; gap: 18px; text-align: center; align-items: center; }
.se-title { font-size: 40px; font-weight: 700; }
.se-sub { color: var(--mute); font-size: 18px; line-height: 1.45; }
.se-form { display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 420px; }
.code-field.big { font-size: 40px; text-align: center; letter-spacing: 12px; min-height: 80px; }
.se-foot { color: var(--mute); font-size: 15px; margin-top: 10px; }

.screen-lobby { align-items: center; justify-content: center; overflow-y: auto; }
.sl-close { position: absolute; top: calc(16px * var(--k)); right: calc(16px * var(--k)); }
.sl-inner { display: flex; flex-direction: column; align-items: center; gap: calc(22px * var(--k)); padding: calc(30px * var(--k)); text-align: center; }
.sl-title { font-size: calc(40px * var(--k)); font-weight: 700; }
.sl-tagline { font-size: calc(18px * var(--k)); color: var(--mute); max-width: calc(760px * var(--k)); }
.sl-card { background: var(--card); border-radius: calc(20px * var(--k)); padding: calc(24px * var(--k)) calc(40px * var(--k)); display: flex; flex-direction: column; gap: calc(8px * var(--k)); align-items: center; }
.sl-label { font-family: var(--mono); font-weight: 600; letter-spacing: 2px; color: var(--mute); font-size: calc(12px * var(--k)); }
.sl-code { font-family: var(--mono); font-weight: 800; font-size: calc(96px * var(--k)); letter-spacing: calc(14px * var(--k)); line-height: 1.05; padding-left: calc(14px * var(--k)); }
.sl-join { font-size: calc(18px * var(--k)); color: var(--mute); }
.sl-join strong { color: var(--ink); font-family: var(--mono); }
.sl-join.small { font-size: calc(14px * var(--k)); }
.sl-players { display: flex; flex-wrap: wrap; gap: calc(14px * var(--k)); justify-content: center; }
.sl-player { background: var(--card2); border-radius: 999px; padding: calc(8px * var(--k)) calc(14px * var(--k)); font-size: calc(17px * var(--k)); font-weight: 600; }
.sl-wait { color: var(--mute); font-size: calc(15px * var(--k)); }

/* reveal sequence */
.screen-reveal { overflow: hidden; }
.sr-close { position: absolute; top: calc(12px * var(--k)); right: calc(12px * var(--k)); z-index: 5; }
.sreveal { flex: 1; min-height: 0; display: flex; flex-direction: column; cursor: pointer; }
.sr-stage { flex: 1; min-height: 0; position: relative; }
.sr-step { position: absolute; inset: 0; opacity: 0; transform: scale(.98); transition: opacity .45s, transform .45s; display: flex; flex-direction: column; }
.sr-step.in { opacity: 1; transform: none; }
.sr-progress { flex: none; display: flex; flex-direction: column; align-items: center; gap: calc(6px * var(--k)); padding-bottom: calc(12px * var(--k)); }
.sr-dots { display: flex; gap: calc(6px * var(--k)); }
.sr-dot { width: calc(8px * var(--k)); height: calc(6px * var(--k)); border-radius: 3px; background: var(--line); transition: width .3s, background .3s; }
.sr-dot.on { width: calc(22px * var(--k)); background: var(--amber); }
.sr-hint { font-family: var(--mono); font-size: calc(10px * var(--k)); color: var(--mute); letter-spacing: 1px; }
.kicker.big { font-size: calc(15px * var(--k)); letter-spacing: 3px; }
.sr-votes { padding: calc(28px * var(--k)) calc(40px * var(--k)); display: flex; flex-direction: column; gap: calc(18px * var(--k)); overflow-y: auto; height: 100%; }
.sr-axis { display: flex; flex-direction: column; gap: calc(8px * var(--k)); }
.sr-prompt { font-size: calc(20px * var(--k)); font-weight: 700; }
.sr-flow { display: flex; flex-wrap: wrap; gap: calc(8px * var(--k)); }
.sr-opt { background: var(--card2); border-radius: 10px; padding: calc(10px * var(--k)) calc(12px * var(--k)); border: 2px solid transparent; display: flex; flex-direction: column; gap: 6px; }
.sr-opt.none { opacity: .55; } .sr-opt.pick { border-color: var(--amber); }
.sr-opt-label { font-size: calc(15px * var(--k)); font-weight: 600; }
.sr-opt.none .sr-opt-label { color: var(--mute); }
.sr-voters { display: flex; gap: 4px; flex-wrap: wrap; }
.sr-voter { background: rgba(255,69,58,.85); color: #fff; border-radius: 999px; padding: 3px 8px; font-size: calc(12px * var(--k)); font-weight: 700; }
.sr-answer { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: calc(18px * var(--k)); padding: calc(28px * var(--k)); text-align: center; }
.sr-who-prompt { font-size: calc(22px * var(--k)); color: var(--mute); }
.sr-culprit { font-size: calc(72px * var(--k)); font-weight: 800; line-height: 1.05; }
.pop { animation: popin .7s .4s both cubic-bezier(.3,1.5,.5,1); }
@keyframes popin { from { transform: scale(.6); opacity: 0; } }
.fade-late { animation: fade .6s .9s both; }
.verdict { display: inline-flex; align-items: center; gap: 6px; font-size: calc(14px * var(--k)); font-weight: 600; }
.verdict.big { font-size: calc(18px * var(--k)); }
.verdict.ok { color: var(--green); } .verdict.bad { color: var(--red); }
.vico { font-size: 1.15em; }
.sr-aud { color: var(--amber); font-size: calc(16px * var(--k)); font-weight: 600; }
.sr-others { display: flex; gap: calc(14px * var(--k)); flex-wrap: wrap; justify-content: center; }
.sr-other { background: var(--card); border-radius: 12px; padding: calc(14px * var(--k)); max-width: calc(340px * var(--k)); text-align: left; display: flex; flex-direction: column; gap: 6px; }
.sr-other-prompt { font-size: calc(13px * var(--k)); color: var(--mute); }
.sr-other-answer { font-size: calc(17px * var(--k)); font-weight: 600; }
.sr-replay { height: 100%; display: flex; flex-direction: column; }
.sr-replay-head { padding: calc(14px * var(--k)) calc(24px * var(--k)) calc(10px * var(--k)); font-size: calc(13px * var(--k)); }
.sr-replay-board { flex: 1; min-height: 0; display: flex; }
.sr-moment { padding: calc(10px * var(--k)) calc(24px * var(--k)) calc(8px * var(--k)); display: flex; flex-direction: column; gap: 4px; }
.sr-moment-text { font-size: calc(18px * var(--k)); font-weight: 600; line-height: 1.35; }
.sr-moment .mono-sm { font-size: calc(11px * var(--k)); }
.sr-story { height: 100%; overflow-y: auto; padding: calc(28px * var(--k)) calc(40px * var(--k)) calc(30px * var(--k)); display: flex; flex-direction: column; gap: calc(16px * var(--k)); max-width: calc(1000px * var(--k)); margin: 0 auto; width: 100%; }
.sr-story-title { font-size: calc(42px * var(--k)); font-weight: 700; }
.sr-story-card .story-p { font-size: calc(18px * var(--k)); }
.sr-story-card .epilogue { font-size: calc(17px * var(--k)); }
.sr-leave { align-self: flex-start; padding: 0 20px; }

/* ---------- /watch (audience) ---------- */
.watch { height: 100%; display: flex; flex-direction: column; }
.w-header { display: flex; align-items: center; gap: 10px; padding: calc(8px + var(--sat)) calc(12px + var(--sar)) 6px calc(16px + var(--sal)); flex: none; }
.w-code { letter-spacing: 1px; }
.w-top { flex: none; }
.w-title { font-size: 17px; font-weight: 700; padding: 0 16px 8px; }
.watch .wood { margin: 0 8px 6px; padding: 6px; }
.w-panel { flex: none; max-height: 52%; overflow-y: auto; padding: 8px calc(16px + var(--sar)) calc(12px + var(--sab)) calc(16px + var(--sal)); border-top: 1px solid var(--line); background: var(--bg); }
.w-vote { display: flex; flex-direction: column; gap: 10px; max-width: 560px; margin: 0 auto; }
.w-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.w-foot { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.4; }
.w-foot .ico { font-size: 18px; flex: none; }
.watch > .scroll { flex: 1; min-height: 0; }
.watch .rv-top { display: none; }

@media (min-width: 700px) {
  .w-opts { grid-template-columns: repeat(4, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- tutorial coach cards (coach.js) ---------- */
.coach-host { position: absolute; left: 0; right: 0; z-index: 30; pointer-events: none; padding: 0 12px; }
.coach-host.top { top: 8px; }
.coach-slot { flex: none; padding: 0 12px; }
.coach-slot:not(:empty) { padding-bottom: 8px; }
.coach-host.bottom { bottom: 12px; }
.coach-card { pointer-events: auto; display: flex; gap: 12px; align-items: flex-start; background: var(--card2); border: 1px solid rgba(255,176,32,.45); border-radius: 14px; padding: 14px; box-shadow: 0 6px 20px rgba(0,0,0,.4); max-width: 560px; margin: 0 auto; line-height: 1.4; }
.coach-card .ico { font-size: 20px; flex: none; margin-top: 1px; }
.coach-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.coach-body { font-size: 14px; color: var(--ink); opacity: .88; }
.coach-ok { align-self: flex-start; color: var(--amber); font-weight: 600; padding: 4px 0; min-height: 32px; }
.coach-inline { padding: 12px 12px 0; }
.page-inner > .coach-card { margin: 0; max-width: none; }
.tips-reset { display: block; margin: 10px auto 0; color: var(--mute); }
.sb-coach { display: flex; align-items: center; gap: calc(12px * var(--k)); padding: calc(10px * var(--k)) calc(24px * var(--k)); font-size: calc(17px * var(--k)); font-weight: 600; background: var(--card2); flex: none; }
.sb-coach .ico { font-size: calc(18px * var(--k)); }
.sb-coach[hidden] { display: none; }
