/* Kroken: lekeplassen (hvitt gulv, fysiske brikker) og konsollen (det svarte
   apparatet). Alt som beveger seg per bilde gjør det med transform. */

.kroken {
  height: 100%; max-width: var(--page-w); margin: 0 auto;
  display: grid; grid-template-columns: minmax(0, 1fr) clamp(360px, 30vw, 440px);
  gap: 16px; padding: 14px var(--gutter) 16px;
}

/* ---------- lekeplassen ---------- */
.lek {
  position: relative; min-height: 0; border-radius: var(--r-xl); overflow: hidden; isolation: isolate;
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--line), var(--shadow-1);
  touch-action: none; cursor: crosshair; --kb: 64px;
}
.lek-floor {
  position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(oklch(83% .006 262 / .7) 1px, transparent 1.5px);
  background-size: 24px 24px; background-position: 12px 12px;
}
.lek-floor::before {
  content: ''; position: absolute; inset: 10px; border-radius: calc(var(--r-xl) - 8px);
  background: repeating-conic-gradient(from 0deg at 50% 50%, transparent 0 0deg);
  box-shadow: inset 0 0 0 1px oklch(93% .004 262);
}
/* gradeskiva der kronen bor */
.lek-floor::after {
  content: ''; position: absolute; left: 50%; top: 52%; width: min(220px, 34%); aspect-ratio: 1; translate: -50% -50%; border-radius: 50%;
  background: var(--ring-dial); opacity: .8;
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 9px), #000 calc(100% - 9px)); mask: radial-gradient(farthest-side, transparent calc(100% - 9px), #000 calc(100% - 9px));
}
.app.is-disco .lek-floor { animation: disco 1.88s linear infinite; }
@keyframes disco { to { filter: hue-rotate(360deg); } }
.app.is-disco .lek-floor::after { background: conic-gradient(var(--p0), var(--p1), var(--p5), var(--p3), var(--p6), var(--p0)); opacity: .6; }
.lek-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 5000; }
.lek-layer { position: absolute; inset: 0; z-index: 1; }

.lek-head { position: absolute; top: 16px; left: 18px; right: 220px; z-index: 6000; display: flex; align-items: center; gap: 14px; pointer-events: none; }
.lek-head > * { pointer-events: auto; }
.lh-title { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.lh-name { font: var(--display-weight) clamp(22px, 2.4vw, 32px)/1 var(--font-display); letter-spacing: var(--display-track); text-transform: lowercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lh-online { display: inline-flex; align-items: center; gap: 6px; font: 500 12.5px/1 var(--font-ui); color: var(--ink-3); }
.lh-online .dot { width: 7px; height: 7px; box-shadow: 0 0 0 3px color-mix(in oklch, var(--good) 20%, transparent); }
.lh-btns { display: flex; gap: 8px; align-self: flex-start; flex: none; }
.lh-code { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px 0 10px; border-radius: 999px; background: var(--bg-2); color: var(--ink-2); font: 600 13px/1 var(--font-num); letter-spacing: .05em; align-self: flex-start; }
.lh-code .ico { width: 15px; height: 15px; }

/* kronetavla */
.lek-board {
  position: absolute; top: 14px; right: 14px; z-index: 6000; width: 196px; padding: 11px 12px; border-radius: var(--r-m);
  background: color-mix(in oklch, var(--surface) 92%, transparent); box-shadow: var(--shadow-1); display: flex; flex-direction: column; gap: 7px; pointer-events: none;
}
.lb-head { display: flex; align-items: center; gap: 7px; font: 600 13px/1 var(--font-ui); }
.lb-head .crown-svg { width: 20px; height: 15px; }
.lek-board small { font: 500 12px/1.3 var(--font-ui); color: var(--ink-3); }
.lb-row { display: grid; grid-template-columns: 58px 1fr auto; align-items: center; gap: 8px; font: 500 12px/1 var(--font-ui); }
.lb-row b { font: 600 12px/1 var(--font-num); min-width: 3ch; text-align: right; }
.lb-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-bar { height: 6px; border-radius: 6px; background: var(--bg-3); position: relative; overflow: hidden; }
.lb-bar::after { content: ''; position: absolute; inset: 0; transform-origin: left; transform: scaleX(var(--w)); background: var(--pc); border-radius: inherit; transition: transform .5s var(--ease-out); }
.lb-row.is-holding .lb-name { font-weight: 700; }
.lb-row.is-holding .lb-bar::after { background: linear-gradient(90deg, var(--pc), var(--gold)); }

/* kastevarer */
.lek-tray {
  position: absolute; left: 14px; bottom: 14px; z-index: 6000; display: flex; gap: 6px; padding: 6px; border-radius: 999px;
  background: color-mix(in oklch, var(--surface) 92%, transparent); box-shadow: var(--shadow-1);
}
.tray-item { position: relative; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-2); color: var(--ink); cursor: grab; touch-action: none; }
.tray-item .ico { width: 22px; height: 22px; }
.tray-item[data-item="hjerte"] .ico { color: oklch(62% .23 352); }
.tray-item[data-item="konfetti"] .ico { color: var(--accent); }
.tray-item[data-item="and"] .ico { color: oklch(66% .15 85); }
.tray-item.is-locked { opacity: .45; cursor: default; }
.tray-lock { position: absolute; right: -2px; bottom: -2px; width: 18px; height: 18px; border-radius: 50%; background: var(--ink); color: var(--bg); display: grid; place-items: center; }
.tray-lock .ico { width: 11px; height: 11px; color: var(--bg) !important; }
.lek-ghost { position: absolute; left: 0; top: 0; z-index: 7000; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); box-shadow: var(--shadow-2); pointer-events: none; }
.lek-ghost .ico { width: 24px; height: 24px; }

.lek-hint {
  position: absolute; right: 16px; bottom: 16px; z-index: 6000; max-width: min(400px, calc(100% - 320px));
  padding: 9px 14px; border-radius: 999px; background: var(--ink); color: var(--bg); font: 500 13px/1.35 var(--font-ui); text-align: center; pointer-events: none;
  transition: opacity .4s, translate .5s var(--ease-out);
  animation: riseIn .6s var(--ease-pop) 1.2s both;
}
.lek-hint.is-gone { opacity: 0; translate: 0 10px; }

/* ---------- figurene ---------- */
.kb { position: absolute; left: 0; top: 0; width: 0; height: 0; will-change: transform; touch-action: none; }
.kb-shadow {
  position: absolute; left: calc(var(--kb) * -.5); top: calc(var(--kb) * -.13); width: var(--kb); height: calc(var(--kb) * .26);
  border-radius: 50%; background: radial-gradient(closest-side, oklch(19% .01 262 / .7), transparent); pointer-events: none; will-change: transform, opacity;
}
.kb-lift { position: absolute; left: 0; top: 0; will-change: transform; }
.kb-body {
  position: absolute; left: calc(var(--kb) * -.5); top: calc(var(--kb) * -1); width: var(--kb); height: var(--kb);
  transform-origin: 50% 100%; will-change: transform; cursor: pointer;
}
.kb.is-me .kb-body { cursor: grab; }
.kb.is-held .kb-body { cursor: grabbing; }
.kb-body .avatar { width: 100%; height: 100%; }
.kb-body .avatar-disc { box-shadow: 0 1px 2px oklch(19% .01 262 / .1), 0 4px 10px -4px oklch(19% .01 262 / .3); }
.kb.is-aimed .kb-body .avatar { scale: .92; transition: scale 80ms var(--ease-snap); }
/* holder for klar (fjernspillere): ringen fylles rundt */
.kb-body::after {
  content: ''; position: absolute; inset: -6px; border-radius: 50%; pointer-events: none;
  background: conic-gradient(var(--pc) calc(var(--hold, 0) * 360deg), transparent 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3.5px), #000 calc(100% - 3.5px)); mask: radial-gradient(farthest-side, transparent calc(100% - 3.5px), #000 calc(100% - 3.5px));
}
.kb-name {
  position: absolute; left: 0; top: 7px; translate: -50% 0; display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 4px 0 9px;
  border-radius: 999px; background: var(--surface); box-shadow: var(--shadow-1); font: 600 12px/1 var(--font-ui); white-space: nowrap; pointer-events: none;
}
.kb-lvl { display: grid; place-items: center; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: var(--bg-3); font: 700 10px/1 var(--font-num); color: var(--ink-2); }
.kb.is-me .kb-name { background: var(--ink); color: var(--bg); }
.kb.is-me .kb-lvl { background: oklch(100% 0 0 / .16); color: var(--bg); }
.kb-bubble {
  position: absolute; left: 0; top: calc(var(--kb) * -1 - 34px); translate: -50% 0; padding: 6px 10px; border-radius: 999px;
  background: var(--ink); color: var(--bg); font: 600 11.5px/1 var(--font-ui); white-space: nowrap; pointer-events: none;
  opacity: 0; scale: .7; transition: opacity .2s, scale var(--dur-pop) var(--ease-pop);
}
.kb.is-away .kb-bubble, .kb.flash .kb-bubble { opacity: 1; scale: 1; }
.kb.has-crown .kb-bubble { top: calc(var(--kb) * -1 - 54px); }
.kb.is-away .kb-body .avatar { opacity: .55; }
.kb-check {
  position: absolute; right: -4px; bottom: 0; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%;
  background: var(--good); color: oklch(99% 0 0); box-shadow: 0 0 0 3px var(--surface); scale: 0; transition: scale var(--dur-pop) var(--ease-pop);
}
.kb-check .ico { width: 14px; height: 14px; stroke-width: 2.8; }
.kb.is-ready .kb-check { scale: 1; }
/* kronen på hodet med tid mot 30 s */
.kb-crown { position: absolute; left: 50%; top: -30%; width: 62%; translate: -50% 0; display: none; pointer-events: none; filter: drop-shadow(0 2px 2px oklch(40% .1 70 / .4)); }
.kb-crown .crown-svg { width: 100%; height: auto; display: block; }
.kb.has-crown .kb-crown { display: block; animation: crownIn .6s var(--ease-pop); }
.kb.has-crown .kb-body::before {
  content: ''; position: absolute; inset: -9px; border-radius: 50%; pointer-events: none;
  background: conic-gradient(var(--gold) calc(var(--kt, 0) * 360deg), oklch(90% .03 85 / .5) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 3px)); mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 3px));
}
/* svimmel etter en slap */
.kb.is-dizzy .kb-lift::before {
  content: ''; position: absolute; left: calc(var(--kb) * -.32); top: calc(var(--kb) * -1.16); width: calc(var(--kb) * .64); height: calc(var(--kb) * .22);
  background: radial-gradient(circle at 15% 50%, var(--gold) 3px, transparent 4px), radial-gradient(circle at 50% 50%, var(--p0) 2.5px, transparent 3.5px), radial-gradient(circle at 85% 50%, var(--gold) 3px, transparent 4px);
  animation: dizzy .6s linear infinite; pointer-events: none;
}
@keyframes dizzy { 50% { transform: scaleX(-1); } }
.kb.blush .fig .cheek { animation: blush 1.4s ease-out; }
@keyframes blush { 15%, 70% { opacity: .95; } }
.kb.is-leaving { opacity: 0; transition: opacity .35s; }
.lek.is-picking .kb:not(.is-me) .kb-body .avatar-disc { box-shadow: 0 0 0 3px var(--accent), var(--shadow-1); animation: pickPulse 1.2s ease-in-out infinite; }
@keyframes pickPulse { 50% { box-shadow: 0 0 0 6px color-mix(in oklch, var(--accent) 35%, transparent), var(--shadow-1); } }

/* kronen på gulvet */
.lek-crown { position: absolute; left: 0; top: 0; width: 0; height: 0; pointer-events: none; will-change: transform; }
.lek-crown.is-held { display: none; }
.lc-shadow { position: absolute; left: -20px; top: -6px; width: 40px; height: 12px; border-radius: 50%; background: radial-gradient(closest-side, oklch(40% .08 75 / .5), transparent); }
.lc-lift { position: absolute; left: 0; top: 0; will-change: transform; }
.lc-lift .crown-svg { position: absolute; left: -22px; top: -34px; width: 44px; height: 33px; filter: drop-shadow(0 3px 3px oklch(40% .1 70 / .35)); animation: crownBob 2.2s ease-in-out infinite; }
.lc-glow { position: absolute; left: -34px; top: -38px; width: 68px; height: 40px; border-radius: 50%; background: radial-gradient(closest-side, oklch(90% .12 88 / .55), transparent); animation: glowPulse 2.2s ease-in-out infinite; }
@keyframes crownBob { 50% { translate: 0 -5px; rotate: -3deg; } }
@keyframes glowPulse { 50% { opacity: .5; scale: 1.15; } }
.crown-svg .cr-body { fill: oklch(84% .16 85); stroke: oklch(52% .12 70); stroke-width: 1.6; stroke-linejoin: round; }
.crown-svg .cr-band { fill: oklch(72% .15 78); stroke: oklch(52% .12 70); stroke-width: 1.2; }
.crown-svg .cr-gem { fill: var(--p0); }
.crown-svg .cr-gem2 { fill: var(--p3); }

/* effekter på gulvet */
.lek-star {
  position: absolute; z-index: 5500; width: 54px; height: 54px; margin: -27px 0 0 -27px; pointer-events: none;
  background: var(--gold); clip-path: polygon(50% 0, 60% 32%, 92% 18%, 70% 46%, 100% 60%, 66% 64%, 74% 98%, 50% 74%, 26% 98%, 34% 64%, 0 60%, 30% 46%, 8% 18%, 40% 32%);
  animation: starPop .5s var(--ease-out) forwards; scale: var(--s, 1);
}
@keyframes starPop { 0% { transform: scale(.2) rotate(-20deg); opacity: 1; } 40% { transform: scale(1.1) rotate(0deg); opacity: 1; } 100% { transform: scale(1.3) rotate(10deg); opacity: 0; } }
.lek-ripple { position: absolute; z-index: 2; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--ink-3); pointer-events: none; animation: ripple .65s var(--ease-out) forwards; }
@keyframes ripple { from { transform: scale(.3); opacity: .9; } to { transform: scale(1.6); opacity: 0; } }

/* ---------- konsollen ---------- */
.konsoll {
  position: relative; min-height: 0; border-radius: var(--r-xl); background: var(--app-bg); color: var(--app-ink); box-shadow: var(--shadow-3);
  overflow: hidden; display: flex; flex-direction: column;
}
.ks-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 22px 22px 24px; display: flex; flex-direction: column; gap: 20px; scrollbar-color: oklch(100% 0 0 / .15) transparent; }
.ks-body.ks-in > * { animation: riseIn .45s var(--ease-pop) both; }
.ks-body.ks-in > *:nth-child(2) { animation-delay: 40ms; } .ks-body.ks-in > *:nth-child(3) { animation-delay: 80ms; } .ks-body.ks-in > *:nth-child(4) { animation-delay: 120ms; } .ks-body.ks-in > *:nth-child(5) { animation-delay: 160ms; }
.konsoll .t-label { color: var(--app-ink-3); }
.ks-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.ks-head-row { display: flex; align-items: center; gap: 12px; }
.ks-head-text { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ks-title { font: var(--display-weight) 26px/1.05 var(--font-display); letter-spacing: -.035em; text-transform: lowercase; }
.ks-sub { font: 500 13.5px/1.4 var(--font-ui); color: var(--app-ink-2); text-wrap: pretty; max-width: 40ch; }
.ks-back { background: oklch(100% 0 0 / .08); color: var(--app-ink); }
.ks-ghost { background: oklch(100% 0 0 / .08); color: var(--app-ink-2); }
.ks-sec { display: flex; flex-direction: column; gap: 10px; }
.ks-note { font: 500 13px/1.4 var(--font-ui); color: var(--app-ink-3); }

.ks-modes { display: flex; flex-direction: column; gap: 8px; }
.mode-card { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: var(--r-m); background: var(--app-bg-2); text-align: left; }
.mode-card:hover { background: var(--app-bg-3); }
.mc-ico { width: 46px; height: 46px; flex: none; border-radius: 14px; display: grid; place-items: center; background: oklch(100% 0 0 / .08); }
.mc-ico .ico { width: 24px; height: 24px; }
.mode-card.is-party .mc-ico { background: var(--accent); color: var(--accent-ink); }
.mode-card.is-duel .mc-ico { background: var(--app-ink); color: var(--app-bg); }
.mode-card.is-byen .mc-ico { background: color-mix(in oklch, var(--p2) 75%, black); color: oklch(99% 0 0); }
.mc-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.mc-text b { font: 600 16px/1.15 var(--font-ui); }
.mc-text small { font: 500 12.5px/1.3 var(--font-ui); color: var(--app-ink-2); }
.mc-arrow { width: 18px; height: 18px; color: var(--app-ink-3); }
.ks-solo { display: flex; flex-wrap: wrap; gap: 8px; }
.solo-chip { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px 0 6px; border-radius: 999px; background: oklch(100% 0 0 / .08); font: 600 13.5px/1 var(--font-ui); }
.solo-chip .sc-art { width: 30px; height: 30px; display: grid; place-items: center; }
.solo-chip .sc-art .art { width: 26px; height: 26px; }
.solo-chip .sc-play { width: 14px; height: 14px; opacity: .6; }
.ks-people { display: flex; flex-direction: column; gap: 4px; }
.person { display: flex; align-items: center; gap: 11px; padding: 7px 8px; border-radius: var(--r-s); text-align: left; width: 100%; }
.person .avatar-disc { box-shadow: none; }
.person-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.person-text b { font: 600 14px/1.2 var(--font-ui); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-text small { font: 500 12px/1.2 var(--font-ui); color: var(--app-ink-3); }
.person.is-busy { opacity: .55; }
button.person:hover { background: oklch(100% 0 0 / .06); }
.person-act { font: 600 12.5px/1 var(--font-ui); padding: 8px 12px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); }
.person.is-busy .person-act { background: oklch(100% 0 0 / .1); color: var(--app-ink-2); }

/* partykveld: oppsett */
.ks-mode, .ks-rounds { width: 100%; }
.ks-mode .seg-opt { flex: 1; justify-content: center; }
.ks-mode .seg-opt .ico { width: 16px; height: 16px; }
.vote-tile .vt-add { width: 22px; height: 22px; color: var(--app-ink-2); }
.pl-del { padding-right: 8px; }
.pl-del .ico { width: 14px; height: 14px; color: var(--app-ink-3); transition: color .15s; }
.pl-del:hover .ico { color: var(--app-ink); }
.pl-empty { font: 500 13px/1.4 var(--font-ui); color: var(--app-ink-3); }
.ks-rounds .seg-opt { flex: 1; justify-content: center; }
.vote-tiles { display: grid; grid-template-columns: 1fr; gap: 8px; }
.vote-tile {
  position: relative; display: grid; grid-template-columns: 54px minmax(0, 1fr) auto; align-items: center; gap: 12px;
  padding: 10px 14px 10px 10px; border-radius: var(--r-m); background: var(--app-bg-2); text-align: left;
}
.vote-tile.is-voted { box-shadow: inset 0 0 0 2px var(--app-ink); background: var(--app-bg-3); }
.vote-tile.knock { animation: knock .4s var(--ease-pop); }
@keyframes knock { 30% { translate: 0 2px; scale: .985; } }
.vt-art { width: 54px; height: 54px; display: grid; place-items: center; }
.vt-art .art { width: 48px; height: 48px; overflow: visible; }
.vt-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.vt-text b { font: 600 16px/1.1 var(--font-ui); }
.vt-text small { font: 500 12px/1.3 var(--font-ui); color: var(--app-ink-2); }
.vt-dots { display: flex; gap: 4px; justify-content: flex-end; flex-wrap: wrap; max-width: 76px; }
.vt-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--pc); box-shadow: 0 0 0 2px var(--app-bg-2); }
.vt-dot.is-new { animation: popIn .45s var(--ease-pop); }
.vt-rank { position: absolute; top: -6px; left: -6px; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 999px; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font: 700 12px/1 var(--font-num); scale: 0; transition: scale var(--dur-pop) var(--ease-pop); }
.vote-tile.in-list .vt-rank { scale: 1; }
.vote-soon { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.soon-tile { display: grid; justify-items: center; gap: 4px; padding: 6px 2px; border-radius: var(--r-s); background: oklch(100% 0 0 / .04); opacity: .55; }
.soon-tile .vt-art { width: 26px; height: 26px; }
.soon-tile .vt-art .art { width: 24px; height: 24px; }
.soon-tile small { font: 500 9.5px/1 var(--font-ui); color: var(--app-ink-2); white-space: nowrap; }
.ks-playlist { display: flex; flex-wrap: wrap; gap: 6px; }
.pl-item { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px 0 5px; border-radius: 999px; background: oklch(100% 0 0 / .08); font: 600 13.5px/1 var(--font-ui); animation: popIn .4s var(--ease-pop) both; animation-delay: calc(var(--i) * 40ms); }
.pl-item b { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font: 700 11.5px/1 var(--font-num); }
.ks-ready { gap: 12px; position: sticky; bottom: -24px; z-index: 3; margin: auto -22px -24px; padding: 12px 22px 20px; background: var(--app-bg); }
.ks-ready::before { content: ''; position: absolute; left: 0; right: 0; top: -20px; height: 20px; pointer-events: none; background: linear-gradient(to bottom, transparent, var(--app-bg)); }
.ks-ready-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ks-ready-row { display: flex; gap: 4px; flex-wrap: wrap; }
.rr-av { position: relative; }
.rr-av .avatar-disc { box-shadow: none; background: var(--app-bg-3); }
.rr-av:not(.is-ready) .avatar { opacity: .5; }
.rr-check { position: absolute; right: -3px; bottom: -3px; width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center; background: var(--good); color: oklch(99% 0 0); box-shadow: 0 0 0 2px var(--app-bg); scale: 0; transition: scale var(--dur-pop) var(--ease-pop); }
.rr-check .ico { width: 10px; height: 10px; stroke-width: 3; }
.rr-av.is-ready .rr-check { scale: 1; }
.ks-ready-text { font: 600 13px/1 var(--font-num); color: var(--app-ink-2); white-space: nowrap; }
.ks-hold { width: 100%; --hold-fill: var(--good); touch-action: none; }
.ks-hold.is-holding { scale: .985; }
.ks-hold.is-ready { background: var(--good); color: oklch(99% 0 0); }
.ks-hold.is-ready::before { opacity: 0; }
.ks-count {
  position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; pointer-events: none;
  background: color-mix(in oklch, var(--app-bg) 86%, transparent); opacity: 0; transition: opacity .2s;
  font: var(--display-weight) clamp(90px, 12vw, 160px)/1 var(--font-display); letter-spacing: -.04em; font-variant-numeric: tabular-nums;
}
.ks-count.is-on { opacity: 1; }
.ks-count.pop { animation: countPop .55s var(--ease-pop); }
@keyframes countPop { from { scale: 1.6; opacity: 0; } }

/* duell */
.duel-games { display: flex; flex-direction: column; gap: 8px; }
.duel-game { position: relative; display: grid; grid-template-columns: 54px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 14px 10px 10px; border-radius: var(--r-m); background: var(--app-bg-2); text-align: left; }
.duel-game.is-on { box-shadow: inset 0 0 0 2px var(--app-ink); background: var(--app-bg-3); }
.dg-tag { height: 24px; font-size: 11.5px; }
.ks-pending:empty { display: none; }
.pending-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r-m); background: oklch(100% 0 0 / .08); font: 600 14px/1.2 var(--font-ui); }
.pending-card > span:nth-child(2) { flex: 1; }
.duel-spin { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; flex: none; opacity: .8; }
@keyframes spin { to { rotate: 360deg; } }

/* tavla */
.tavle { position: relative; }
.tv-row {
  position: absolute; left: 0; right: 0; top: 0; height: 48px; display: grid; grid-template-columns: 22px 36px minmax(0, 1fr) auto auto auto; align-items: center; gap: 10px;
  padding: 0 12px 0 10px; border-radius: var(--r-s); background: var(--app-bg-2); will-change: transform;
}
.tv-row.is-me { box-shadow: inset 0 0 0 1.5px color-mix(in oklch, var(--pc) 80%, transparent); }
.tv-row .avatar-disc { box-shadow: none; background: var(--app-bg-3); }
.tv-rank { font: 600 13px/1 var(--font-num); color: var(--app-ink-3); text-align: center; }
.tv-name { font: 600 14px/1.1 var(--font-ui); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tv-total { font: 650 17px/1 var(--font-num); min-width: 5ch; text-align: right; }
.tv-delta { font: 600 12px/1 var(--font-num); color: var(--good); opacity: 0; translate: 8px 0; transition: opacity .3s, translate var(--dur-pop) var(--ease-pop); }
.tv-row.show-delta .tv-delta { opacity: 1; translate: 0 0; }
.tv-move { display: inline-flex; align-items: center; gap: 1px; font: 700 11.5px/1 var(--font-num); min-width: 26px; }
.tv-move .ico { width: 14px; height: 14px; stroke-width: 2.6; }
.tv-row.tv-up .tv-move { color: var(--good); animation: popIn .45s var(--ease-pop); }
.tv-row.tv-fall .tv-move { color: oklch(70% .17 25); animation: popIn .45s var(--ease-pop); }
.tv-crown { position: absolute; left: 38px; top: -9px; width: 20px; height: 20px; color: var(--gold); scale: 0; transition: scale var(--dur-pop) var(--ease-pop); }
.tv-crown .ico { width: 20px; height: 20px; fill: var(--gold); stroke: oklch(52% .12 70); }
.tv-row.is-lead .tv-crown { scale: 1; }
.ks-next { display: flex; align-items: center; gap: 12px; padding: 10px 14px 10px 10px; border-radius: var(--r-m); background: oklch(100% 0 0 / .06); }
.ks-next .vt-text small { color: var(--app-ink-3); }
.ks-live { display: flex; flex-direction: column; gap: 6px; }
.live-row { display: grid; grid-template-columns: 20px 28px 1fr auto; align-items: center; gap: 10px; padding: 6px 8px; border-radius: var(--r-s); background: var(--app-bg-2); font: 600 13.5px/1 var(--font-ui); }
.live-row .avatar-disc { box-shadow: none; background: var(--app-bg-3); }
.ks-join { width: 100%; }

/* ---------- mobil: lekeplassen over, konsollen under ---------- */
@media (max-width: 960px) {
  .kroken { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(250px, 48%) minmax(0, 1fr); gap: 10px; padding: 10px; }
  /* når konsollen har en oppgave, får den plassen og gulvet krymper */
  .kroken[data-view="party"], .kroken[data-view="tavle"], .kroken[data-view="duell"] { grid-template-rows: minmax(170px, 34%) minmax(0, 1fr); }
  .ks-ready { bottom: -20px; margin: auto -16px -20px; padding: 10px 16px 16px; }
  .ks-title { font-size: 23px; }
  .lek { border-radius: var(--r-l); }
  .konsoll { border-radius: var(--r-l); }
  .ks-body { padding: 18px 16px 20px; gap: 16px; }
  .lek-head { top: 12px; left: 14px; right: 150px; }
  .lh-code span { display: none; }
  .lh-code { width: 32px; padding: 0; justify-content: center; }
  .lek-board { width: 140px; padding: 9px 10px; gap: 6px; top: 10px; right: 10px; }
  .lb-row { grid-template-columns: 44px 1fr auto; gap: 6px; }
  .lek-tray { left: 8px; bottom: 8px; gap: 4px; padding: 4px; }
  .tray-item { width: 38px; height: 38px; }
  .tray-item .ico { width: 19px; height: 19px; }
  .lek-hint { display: none; }
  .vote-soon { grid-template-columns: repeat(7, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .lc-lift .crown-svg, .lc-glow, .kb.is-dizzy .kb-lift::before { animation: none; }
}
