/* Täyskymppi — verkkopeli: etusivun kaistale, isännän aula, liittyminen ja puhelimen pelinäkymä */

/* ---------- home: the online strip under the three modes ---------- */
.online-strip {
  display: flex; align-items: center; gap: 18px;
  margin-top: 12px; padding: 18px 20px;
  border-radius: var(--r-poster);
  background: var(--surface); border: 1px solid var(--line);
  animation: rowIn .5s var(--ease) .6s backwards;
}
.os-ico { flex: none; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: var(--t-map); color: var(--on-t-map); }
.os-ico svg { width: 28px; height: 28px; stroke-width: 1.8; }
.os-text { flex: 1; min-width: 0; }
.os-text h2 { margin: 0 0 2px; font: 800 calc(22px * var(--ds, 1))/1.1 var(--font-display); letter-spacing: -0.02em; color: var(--fg); }
.os-text p { margin: 0; font-size: 14px; line-height: 1.45; color: var(--fg-2); }
.os-actions { flex: none; display: flex; gap: 8px; }
@media (max-width: 680px) {
  .online-strip { flex-wrap: wrap; padding: 16px; gap: 14px; }
  .os-text { flex-basis: calc(100% - 70px); }
  .os-actions { width: 100%; }
  .os-actions .btn { flex: 1; }
}

/* ---------- online screens ---------- */
.screen.online { --mc: var(--t-map); --on-mc: var(--on-t-map); }
.screen.online > * { width: min(1040px, 100%); margin-left: auto; margin-right: auto; }
.screen.online.is-phone > *, .screen.online.is-join > * { width: min(560px, 100%); }
.ol-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px 6px; }
.ol-head h1 { margin: 2px 0 0; font: 800 calc(28px * var(--ds, 1))/1.05 var(--font-display); letter-spacing: -0.03em; color: var(--fg); }
.ol-head .eyebrow { display: block; }
.ol-me { display: block; font: 700 16px var(--font-ui); color: var(--fg); }
.ol-center { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; min-height: 60vh; padding: 24px; text-align: center; color: var(--fg-2); }
.ol-center h2 { margin: 0; font: 800 calc(26px * var(--ds, 1))/1.1 var(--font-display); color: var(--fg); letter-spacing: -0.02em; }
.ol-center p { margin: 0; max-width: 420px; line-height: 1.5; }
.ol-msg-ico, .ol-join-ico { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 20px; background: var(--t-map); color: var(--on-t-map); }
.ol-msg-ico svg, .ol-join-ico svg { width: 32px; height: 32px; stroke-width: 1.8; }
.ol-spin { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--surface-3); border-top-color: var(--t-map); animation: olSpin .8s linear infinite; }
@keyframes olSpin { to { transform: rotate(360deg); } }
.ol-note { margin: 0; font-size: 13px; line-height: 1.5; color: var(--fg-3); }
.ol-note:empty { display: none; }
.ol-settings { margin: 0; font: 500 12px/1.5 var(--font-mono); color: var(--fg-3); letter-spacing: .02em; }
.ol-netwarn { position: fixed; z-index: 70; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 16px); transform: translateX(-50%); padding: 10px 16px; border-radius: 999px; background: var(--bad); color: var(--on-bad, #fff); font: 600 13px var(--font-ui); box-shadow: 0 10px 30px -10px var(--shade); }
.ol-netwarn[hidden] { display: none; }

/* ---------- host lobby ---------- */
.ol-lobby { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; padding: 10px 16px 32px; align-items: start; }
@media (max-width: 820px) { .ol-lobby { grid-template-columns: 1fr; } }
.ol-join-card { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 26px 22px; border-radius: var(--r-poster); background: var(--t-map); color: var(--on-t-map); text-align: center; }
.ol-join-card .eyebrow { color: inherit; opacity: .75; }
.ol-code { display: flex; gap: 8px; }
.ol-code b { display: grid; place-items: center; width: clamp(52px, 9vw, 74px); aspect-ratio: .78; border-radius: 12px; background: var(--flap-top, #1b1e25); color: var(--flap-fg, #fff);
  font: 800 clamp(36px, 6vw, 54px)/1 var(--font-display); letter-spacing: 0; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .25), 0 10px 24px -12px rgba(0, 0, 0, .45); position: relative; }
.ol-code b::after { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 2px; margin-top: -1px; background: rgba(0, 0, 0, .35); }
.ol-qr { display: block; width: min(220px, 60vw); padding: 10px; border-radius: 14px; background: #fff; box-shadow: 0 14px 30px -16px rgba(0, 0, 0, .5); }
.ol-qr svg { display: block; width: 100%; height: auto; }
.ol-howto { margin: 0; max-width: 360px; font-size: 14px; line-height: 1.5; }
.ol-join-card .btn.ghost { color: inherit; border-color: color-mix(in srgb, currentColor 35%, transparent); }
.ol-side { display: flex; flex-direction: column; gap: 12px; }
.ol-plist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ol-plist .prow { padding-right: 7px; animation: none; }
.ol-plist .prow.new { animation: rowIn .3s var(--ease); }
.ol-plist .pc { cursor: default; font: 750 12px var(--font-ui); }
.ol-plist .prow.idle { opacity: .6; }
.ol-pname { flex: 1; min-width: 0; font: 600 16px var(--font-ui); color: var(--fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ol-pname small { font: 500 12px var(--font-mono); color: var(--fg-3); }
.ol-empty { display: flex; align-items: center; gap: 12px; padding: 18px; border-radius: var(--r); border: 1px dashed var(--line-2); color: var(--fg-3); font-size: 14px; }
.ol-dots { display: inline-flex; gap: 4px; }
.ol-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--t-map); animation: olDot 1.2s ease-in-out infinite; }
.ol-dots i:nth-child(2) { animation-delay: .15s; } .ol-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes olDot { 0%, 60%, 100% { transform: none; opacity: .4; } 30% { transform: translateY(-4px); opacity: 1; } }
.ol-start { display: flex; justify-content: flex-end; margin-top: 6px; }
.ol-start .btn { min-width: 200px; }

/* ---------- join (phone) ---------- */
.ol-join { display: flex; flex-direction: column; gap: 10px; padding: 18px 20px 40px; }
.ol-join h1 { margin: 6px 0 0; font: 800 calc(32px * var(--ds, 1))/1.05 var(--font-display); letter-spacing: -0.03em; color: var(--fg); }
.ol-join > p { margin: 0 0 8px; color: var(--fg-2); line-height: 1.5; }
.ol-join .label { margin-top: 8px; }
.ol-code-in { text-align: center; font: 800 34px/1 var(--font-display) !important; letter-spacing: .3em; text-transform: uppercase; padding: 14px 10px 14px calc(10px + .3em); }
.ol-join .btn.lg { margin-top: 14px; }
.ol-err { margin: 4px 0 0; min-height: 1.4em; color: var(--tx-bad, var(--bad)); font-size: 14px; font-weight: 600; }

/* ---------- waiting room (phone) ---------- */
.ol-wait { min-height: 50vh; }
.ol-pulse { display: grid; place-items: center; width: 84px; height: 84px; border-radius: 50%; background: var(--t-map); color: var(--on-t-map); animation: olPulse 2s ease-in-out infinite; }
.ol-pulse svg { width: 38px; height: 38px; stroke-width: 1.8; }
@keyframes olPulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in oklab, var(--t-map) 50%, transparent); } 50% { box-shadow: 0 0 0 18px transparent; } }
.ol-chips { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.ol-chips li { display: inline-flex; align-items: center; gap: 8px; padding: 5px 13px 5px 5px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--fg); font: 600 14px var(--font-ui); }
.ol-chips li.me { border-color: var(--pc); }
.ol-chips i { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--pc); color: var(--on-pc); font: 750 11px var(--font-ui); font-style: normal; }
.ol-chips i svg { width: 15px; height: 15px; }

/* ---------- game (phone) ---------- */
.ol-game { display: flex; flex-direction: column; gap: 12px; padding: 4px 14px 28px; }
.ol-me-row { display: flex; align-items: center; gap: 12px; font: 500 13px var(--font-mono); color: var(--fg-2); }
.ol-me-row > b { font: 800 26px/1 var(--font-display); color: var(--fg); letter-spacing: -0.03em; }
.ol-me-row > b small { font: 500 12px var(--font-mono); color: var(--fg-3); letter-spacing: 0; }
.ol-dot { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--pc); color: var(--on-pc); font: 750 12px var(--font-ui); }
.ol-turn { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--pc, var(--line-2)); }
.ol-turn b { font: 750 18px/1.2 var(--font-ui); color: var(--fg); }
.ol-turn span { font-size: 13px; color: var(--fg-3); }
.ol-turn.mine { background: var(--tc); color: var(--on-tc); border-color: transparent; animation: olMine .5s var(--spring, ease); }
.ol-turn.mine b, .ol-turn.mine span { color: inherit; }
.ol-turn.sum { border-left-color: var(--fg-3); }
@keyframes olMine { from { transform: scale(.96); } to { transform: none; } }
.ol-q { padding: 16px 16px 18px; border-radius: var(--r-poster); background: var(--tc); color: var(--on-tc); }
.ol-q-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; font: 600 11px var(--font-mono); letter-spacing: .12em; text-transform: uppercase; opacity: .9; }
.ol-q .type-chip { background: color-mix(in srgb, currentColor 14%, transparent); color: inherit; }
.ol-q h2 { margin: 10px 0 0; font: 800 calc(22px * var(--ds, 1))/1.15 var(--font-display); letter-spacing: -0.02em; }
.ol-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ol-tile { position: relative; display: flex; flex-direction: column; justify-content: center; gap: 2px; min-height: 58px; padding: 8px 12px; border-radius: var(--r-tile); background: var(--surface); border: 1px solid var(--line); color: var(--fg); font: inherit; text-align: left; overflow: hidden; }
button.ol-tile { cursor: default; }
button.ol-tile:disabled { opacity: 1; }
.ol-tile .ol-ti { font: 650 11px var(--font-mono); color: var(--fg-3); }
.ol-tile .ol-tl { font: 600 14px/1.25 var(--font-ui); overflow-wrap: anywhere; }
.ol-tile.can { cursor: pointer; border-color: color-mix(in oklab, var(--tc) 70%, var(--line)); box-shadow: 0 0 0 1px color-mix(in oklab, var(--tc) 40%, transparent); }
.ol-tile.can:active { transform: scale(.97); }
.ol-tile.pending { border-color: var(--tc); animation: olPend 1s ease-in-out infinite; }
@keyframes olPend { 50% { background: color-mix(in oklab, var(--tc) 18%, var(--surface)); } }
.ol-tile.done .ol-tv { font: 800 17px/1.15 var(--font-display); letter-spacing: -0.02em; overflow-wrap: anywhere; }
.ol-tile.done .ol-tl { font-size: 12.5px; font-weight: 500; opacity: .8; }
.ol-tile.ok { background: var(--ok); color: var(--on-ok); border-color: transparent; }
.ol-tile.bad { background: var(--bad); color: var(--on-bad); border-color: transparent; }
.ol-tile.reveal { background: transparent; border-style: dashed; }
.ol-tile.reveal .ol-tv { color: var(--tx-t-map, var(--fg)); color: var(--accent-tx, var(--fg)); }
.ol-tile.gold { box-shadow: inset 0 0 0 3px var(--gold); }
.ol-who { position: absolute; top: 8px; right: 8px; width: 12px; height: 12px; border-radius: 50%; background: var(--pc); box-shadow: 0 0 0 2px currentColor; }
.ol-tile .tkmap.mini { height: 1.6em; }
.ol-bar { position: sticky; bottom: 0; z-index: 2; display: flex; gap: 8px; padding: 10px 0 calc(env(safe-area-inset-bottom, 0px) + 4px); background: linear-gradient(to bottom, transparent, var(--bg) 30%); }
.ol-bar .btn { flex: 1; min-height: 52px; }
.ol-bar .btn.primary { flex: 1.6; }
.ol-sum { display: flex; flex-direction: column; gap: 6px; padding: 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.ol-sum .qsum-row { color: var(--fg); }
.ol-sum .btn { margin-top: 8px; --accent-c: var(--tc); --on-accent: var(--on-tc); }
.ol-scores { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.ol-sc { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font: 600 13px var(--font-ui); color: var(--fg-2); }
.ol-sc i { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--pc); color: var(--on-pc); font: 750 10px var(--font-ui); font-style: normal; }
.ol-sc i svg { width: 13px; height: 13px; }
.ol-sc b { font: 800 14px var(--font-display); color: var(--fg); }
.ol-sc.cur { border-color: var(--pc); color: var(--fg); }
.ol-sc.me span { text-decoration: underline; text-underline-offset: 3px; }
.ol-sc.out, .ol-sc.passed { opacity: .55; }

/* ---------- end (phone) ---------- */
.ol-end { display: flex; flex-direction: column; gap: 14px; padding: 12px 18px 40px; }
.ol-end h1 { margin: 0; font: 800 calc(30px * var(--ds, 1))/1.1 var(--font-display); letter-spacing: -0.03em; color: var(--fg); }
.ol-rank { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ol-rank li { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); color: var(--fg); }
.ol-rank li.win { border-color: var(--gold); }
.ol-rank li.me { box-shadow: inset 4px 0 0 var(--pc); }
.ol-rank .n { width: 22px; font: 700 14px var(--font-mono); color: var(--fg-3); }
.ol-rank i { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--pc); color: var(--on-pc); font: 750 11px var(--font-ui); font-style: normal; }
.ol-rank b { flex: 1; font: 650 16px var(--font-ui); }
.ol-rank .g { font: 800 18px var(--font-display); }
.ol-end .btn { align-self: flex-start; }
