/* Cassetteverse – studio (forside) */
html, body { height: 100%; overflow: hidden; overscroll-behavior: none; }
body { background: var(--ink); }
#stage { position: fixed; inset: 0; overflow: hidden; background: radial-gradient(120% 90% at 50% 40%, #3a2f6b 0%, #120d1f 70%); }
#scene { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; outline: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
#scene.dragging { cursor: grabbing; }

/* tegneserie-aktig finish oppå 3D-en */
.fx-vignette { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(120% 100% at 50% 50%, transparent 58%, rgba(18, 13, 31, .55) 100%); }
.fx-halftone { position: absolute; inset: 0; pointer-events: none; opacity: .09; mix-blend-mode: multiply; background-image: radial-gradient(circle, #120d1f 1px, transparent 1.4px); background-size: 5px 5px; }

/* ── topplinje ───────────────────────────────────────────────────────────── */
.topbar { position: absolute; top: 0; left: 0; right: 0; z-index: 30; display: flex; align-items: center; gap: .8rem; padding: max(.7rem, env(safe-area-inset-top)) max(.9rem, env(safe-area-inset-right)) .6rem max(.9rem, env(safe-area-inset-left)); pointer-events: none; }
.topbar > * { pointer-events: auto; }
.brand { text-decoration: none; font-family: var(--font-display); font-size: clamp(1.15rem, 3.4vw, 1.7rem); line-height: 1; letter-spacing: .02em; display: inline-flex; gap: .08em; -webkit-text-stroke: 4px var(--ink); paint-order: stroke fill; text-shadow: 3px 3px 0 var(--ink); }
.brand-a { color: var(--yellow); } .brand-b { color: var(--cyan); }
.top-actions { margin-left: auto; display: flex; gap: .5rem; }
#btn-auth { display: inline-flex; align-items: center; gap: .45em; max-width: 46vw; }
#btn-auth .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot { width: .7em; height: .7em; border-radius: 50%; border: 2px solid var(--ink); flex: none; }
.dot.ok { background: var(--green); } .dot.wait { background: var(--yellow); } .dot.admin { background: var(--magenta); }

.hint-drag { position: absolute; left: 50%; bottom: 58px; transform: translateX(-50%); z-index: 20; font-family: var(--font-mono); font-size: .74rem; color: #fff; background: rgba(18, 13, 31, .7); padding: .35em .8em; border-radius: 99px; pointer-events: none; white-space: nowrap; animation: hintfade 9s ease-in 3s forwards; }
body.panel-open .hint-drag { display: none; }
@keyframes hintfade { to { opacity: 0; visibility: hidden; } }

/* ── hotspots ────────────────────────────────────────────────────────────── */
#hotspots { position: absolute; inset: 0; z-index: 15; pointer-events: none; overflow: hidden; transition: opacity .25s; }
#hotspots.off { opacity: 0; visibility: hidden; }
.hotspot { position: absolute; left: 0; top: 0; pointer-events: auto; translate: -50% -50%; display: grid; justify-items: center; gap: 2px; background: none; border: 0; padding: 0; cursor: pointer; will-change: transform; }
.hotspot[data-mode="l"] { translate: 0 -50%; } .hotspot[data-mode="r"] { translate: -100% -50%; }
.hs-label { display: inline-block; font-family: var(--font-display); font-size: clamp(.9rem, 2.6vw, 1.1rem); line-height: 1; padding: .55em .95em; min-height: 44px; display: inline-flex; align-items: center; background: var(--lime); color: var(--ink); border: 3px solid var(--ink); border-radius: 99px; box-shadow: 3px 3px 0 var(--ink); animation: bob 2.4s ease-in-out infinite; transition: background .15s; }
.hotspot:hover .hs-label, .hotspot:focus-visible .hs-label { background: var(--yellow); animation-play-state: paused; }
.hs-sub { font-family: var(--font-mono); font-size: .66rem; color: #fff; background: rgba(18, 13, 31, .82); padding: .1em .7em; border-radius: 99px; white-space: nowrap; }
.hs-arrow { display: none; font-size: .8rem; color: var(--ink); }
.hotspot[data-mode="l"] .hs-arrow-l, .hotspot[data-mode="r"] .hs-arrow-r { display: inline; position: absolute; top: 12px; font-size: 1rem; }
.hotspot[data-mode="l"] .hs-arrow-l { left: 10px; } .hotspot[data-mode="r"] .hs-arrow-r { right: 10px; }
.hotspot[data-mode="l"] .hs-label { padding-left: 1.9em; border-left-width: 0; border-radius: 0 99px 99px 0; }
.hotspot[data-mode="r"] .hs-label { padding-right: 1.9em; border-right-width: 0; border-radius: 99px 0 0 99px; }
.hotspot[data-mode="l"] .hs-sub, .hotspot[data-mode="r"] .hs-sub { display: none; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }

/* ── panel ───────────────────────────────────────────────────────────────── */
.panel { position: absolute; z-index: 40; display: flex; flex-direction: column; background: var(--paper); color: var(--ink); border: 4px solid var(--ink); box-shadow: 8px 8px 0 var(--magenta); overflow: hidden; animation: slidein .35s cubic-bezier(.2, .9, .3, 1.1); }
.panel[hidden] { display: none; }
@media (min-width: 820px) {
  .panel { top: 70px; right: 18px; bottom: 62px; width: min(440px, 38vw); border-radius: 20px; }
  .panel-expand { display: none; }
}
@media (max-width: 819.98px) {
  .panel { left: 0; right: 0; bottom: 0; height: 56dvh; border-radius: 20px 20px 0 0; border-bottom: 0; box-shadow: 0 -6px 0 var(--magenta); padding-bottom: env(safe-area-inset-bottom); animation-name: slideup; }
  .panel.expanded { height: 90dvh; }
}
@keyframes slidein { from { transform: translateX(30px); opacity: 0; } }
@keyframes slideup { from { transform: translateY(40px); opacity: 0; } }
.panel-head { display: flex; align-items: center; gap: .3rem; padding: .7rem .9rem .5rem 1.1rem; border-bottom: 3px solid var(--ink); background: var(--yellow); }
.panel-head h2 { margin: 0; flex: 1; font-family: var(--font-display); font-weight: 400; font-size: 1.45rem; outline: none; }
.tabs { display: flex; gap: .4rem; padding: .6rem .9rem 0; border-bottom: 3px solid var(--ink); background: var(--paper-2); overflow-x: auto; scrollbar-width: none; }
.tab { font-family: var(--font-display); font-size: .92rem; padding: .5em .9em; min-height: 44px; border: 3px solid var(--ink); border-bottom: 0; border-radius: 12px 12px 0 0; background: #fff; cursor: pointer; white-space: nowrap; }
.tab[aria-selected="true"] { background: var(--lime); }
.panel-body { flex: 1; overflow-y: auto; padding: 1rem 1.1rem 1.4rem; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.panel-body h3 { font-family: var(--font-display); font-weight: 400; font-size: 1.3rem; margin: .2rem 0 .3rem; line-height: 1.15; }
.panel-body p { margin: .35rem 0 .7rem; }
.muted { color: var(--muted); } .small { font-size: .82rem; }
.chips { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; margin-bottom: .35rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: .5rem; margin: .5rem 0; }
.linklike { background: none; border: 0; padding: 0; color: var(--purple); text-decoration: underline; cursor: pointer; font-weight: 600; }
.back { margin-bottom: .6rem; }

.card { display: flex; gap: .9rem; padding: .8rem; margin-bottom: .9rem; background: #fff; border: 3px solid var(--ink); border-radius: 16px; box-shadow: 4px 4px 0 var(--ink); }
.card .cover { width: 92px; height: 92px; flex: none; object-fit: cover; border: 3px solid var(--ink); border-radius: 12px; background: var(--ink-2); }
.cover-empty { display: grid; place-items: center; font-size: 2rem; }
.card-main { min-width: 0; flex: 1; }
.card.news, .card.demo { display: block; }
@media (max-width: 420px) { .card.release { flex-direction: column; } .card .cover { width: 100%; height: auto; aspect-ratio: 1; } }
.empty { text-align: center; padding: 1.2rem .5rem; }
.empty.big .empty-title { font-family: var(--font-display); font-size: 2.2rem; color: var(--magenta); -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill; }
.gate { text-align: center; padding: 1.4rem .4rem; } .gate-icon { font-size: 2.6rem; }
.notice { background: var(--paper-2); border: 2px dashed var(--ink); border-radius: 10px; padding: .5rem .7rem; font-size: .88rem; }
.player-slot audio { width: 100%; margin: .4rem 0; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: .7rem; margin-bottom: 1rem; }
.tile { display: grid; gap: .2rem; text-align: left; background: #fff; border: 3px solid var(--ink); border-radius: 14px; padding: .45rem; box-shadow: 3px 3px 0 var(--ink); cursor: pointer; transition: transform .1s; }
.tile:hover { transform: translate(-1px, -2px); }
.swatch { display: grid; place-items: center; aspect-ratio: 1; border: 2px solid var(--ink); border-radius: 10px; overflow: hidden; }
.swatch.art { aspect-ratio: 4 / 5; background: var(--ink-2); }
.swatch img, .hero-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.swatch-kind { font-family: var(--font-display); color: var(--ink); mix-blend-mode: difference; filter: invert(1); font-size: .9rem; padding: .3em; text-align: center; }
.swatch-kind.big { font-size: 1.6rem; }
.tile-title { font-weight: 700; font-size: .88rem; line-height: 1.15; } .tile-sub { font-family: var(--font-mono); font-size: .76rem; color: var(--muted); }
.hero-pic { display: grid; place-items: center; min-height: 190px; aspect-ratio: 1; max-height: 340px; border: 3px solid var(--ink); border-radius: 16px; overflow: hidden; margin-bottom: .7rem; }
.hero-pic.art { aspect-ratio: 4 / 5; background: var(--ink-2); max-height: 420px; margin-inline: auto; }
.hero-pic img { object-fit: contain; }
.thumbs { display: flex; gap: .4rem; overflow-x: auto; } .thumb { height: 64px; border: 2px solid var(--ink); border-radius: 8px; }
.price { font-family: var(--font-display); font-size: 1.5rem; color: var(--magenta); -webkit-text-stroke: 1px var(--ink); paint-order: stroke fill; }
.pager { display: flex; align-items: center; justify-content: space-between; margin-top: .8rem; }

.subscribe { margin-top: 1.1rem; padding: .85rem; background: var(--paper-2); border: 3px dashed var(--ink); border-radius: 14px; }
.sub-lead { margin: 0 0 .5rem !important; font-weight: 600; }
.sub-row { display: flex; gap: .5rem; margin-bottom: .5rem; }
.sub-row input { flex: 1; min-width: 0; padding: .55em .7em; border: 2.5px solid var(--ink); border-radius: 10px; background: #fff; min-height: 44px; }
.check.small { font-size: .76rem; color: var(--muted); }

/* ── ticker ─────────────────────────────────────────────────────────────── */
.ticker { position: absolute; left: 0; right: 0; bottom: 0; z-index: 25; height: 42px; padding-bottom: env(safe-area-inset-bottom); box-sizing: content-box; background: var(--ink); border-top: 3px solid var(--yellow); overflow: hidden; display: flex; align-items: center; }
.ticker-track { display: flex; width: max-content; animation: tick var(--dur, 40s) linear infinite; }
.ticker:hover .ticker-track, .ticker:focus-within .ticker-track { animation-play-state: paused; }
.ticker-set { display: flex; gap: 2.5rem; padding-right: 2.5rem; }
.tick { background: none; border: 0; color: var(--yellow); font-family: var(--font-mono); font-size: .82rem; cursor: pointer; white-space: nowrap; padding: .6rem 0; }
.tick-dot { color: var(--magenta); margin-right: .5em; }
@keyframes tick { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .ticker { overflow-x: auto; } .ticker-track { animation: none; } .hs-label { animation: none; } }

/* ── meny / auth ─────────────────────────────────────────────────────────── */
.menu { display: grid; gap: .5rem; }
.menu-item { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: .75rem .9rem; min-height: 48px; background: #fff; border: 3px solid var(--ink); border-radius: 12px; box-shadow: 3px 3px 0 var(--ink); cursor: pointer; text-align: left; }
.menu-item strong { font-family: var(--font-display); font-weight: 400; font-size: 1.1rem; }
.menu-item:hover { background: var(--lime); }
.menu-social { display: flex; gap: .5rem; flex-wrap: wrap; }
.auth-actions { display: flex; align-items: center; gap: 1rem; margin: .6rem 0; flex-wrap: wrap; }
.auth-switch { margin-top: .8rem; }

/* ── lasteskjerm / fallback ──────────────────────────────────────────────── */
.loader { position: absolute; inset: 0; z-index: 100; display: grid; place-items: center; background: radial-gradient(100% 80% at 50% 40%, #3a2f6b, #120d1f); transition: opacity .7s ease, transform .7s ease, visibility .7s; }
.loader.done { opacity: 0; transform: scale(1.25); visibility: hidden; pointer-events: none; }
.loader-card { text-align: center; color: #fff; }
.loader-tape { width: min(46vw, 200px); animation: wobble 1.6s ease-in-out infinite; }
.reel { transform-box: fill-box; transform-origin: center; animation: spin 1.4s linear infinite; }
.loader-title { font-family: var(--font-display); font-size: clamp(1.6rem, 6vw, 2.4rem); color: var(--yellow); -webkit-text-stroke: 5px var(--ink); paint-order: stroke fill; margin-top: .4rem; }
.loader-msg { font-family: var(--font-mono); font-size: .85rem; opacity: .8; margin-top: .3rem; }
.loader.error .loader-msg { color: var(--red); opacity: 1; }
@keyframes spin { to { transform: rotate(360deg); } } @keyframes wobble { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg) translateY(-4px); } }
.fallback-hero { display: none; }
body.no-webgl .fallback-hero { display: grid; position: absolute; inset: 0; place-content: center; text-align: center; gap: .6rem; padding: 2rem; color: #fff; z-index: 5; }
.fh-title { font-family: var(--font-display); font-size: clamp(2rem, 9vw, 4rem); color: var(--yellow); -webkit-text-stroke: 6px var(--ink); paint-order: stroke fill; }
.fh-sub { font-family: var(--font-mono); opacity: .85; }
body.no-webgl .hint-drag, body.no-webgl #hotspots, body.no-webgl .fx-halftone { display: none; }
.noscript { position: fixed; inset: 0; z-index: 200; display: grid; place-content: center; text-align: center; padding: 2rem; background: var(--ink); color: #fff; }

@media (max-width: 819.98px) { .hero-pic, .hero-pic.art { max-height: 30vh; } }

/* ── kontordøra: lysglimt rett før vi går inn i portalen ───────────────────── */
.door-flash { position: fixed; inset: 0; z-index: 9999; pointer-events: none; opacity: 0; transition: opacity .5s ease-in; background: radial-gradient(circle at 50% 55%, #ffffff 0%, #fff6d6 55%, #ffe08a 100%); }
.door-flash.on { opacity: 1; }
body.entering-office #hotspots, body.entering-office .topbar { opacity: 0; transition: opacity .3s; pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .door-flash { transition-duration: .01s; } }
