/* fredagsmys – spelportal
   Concept: Friday night in a 70s Swedish living room. The TV is the hero; everything else stays calm. */

@font-face { font-family: "Krona One"; src: url("../fonts/krona-one-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Familjen Grotesk"; src: url("../fonts/familjen-grotesk-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Familjen Grotesk"; src: url("../fonts/familjen-grotesk-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Familjen Grotesk"; src: url("../fonts/familjen-grotesk-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Familjen Grotesk"; src: url("../fonts/familjen-grotesk-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --natt: #0D241D;      /* the room at night */
  --djup: #081812;      /* the dark around the screen */
  --soffa: #133429;     /* raised surfaces */
  --filt: #1E4A3B;      /* lines, borders */
  --lampa: #FFF1D0;     /* text: warm lamplight */
  --dimma: #A8C2B4;     /* secondary text */
  --taco: #FFC23C;      /* primary action */
  --taco-djup: #B8861F;
  --salsa: #FF5A36;     /* likes, warnings */
  --osd: #8CFF7A;       /* the TV's channel display */
  --teak: #8A4B26;
  --display: "Krona One", "Arial Black", sans-serif;
  --text: "Familjen Grotesk", ui-sans-serif, system-ui, sans-serif;
  --gutter: clamp(16px, 4vw, 40px);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--natt); color: var(--lampa);
  font: 400 1.0625rem/1.55 var(--text);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
main { flex: 1; }
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { margin: 0; line-height: 1.15; font-weight: 600; }
p { margin: 0; }
code { font: 500 .92em/1 ui-monospace, "SF Mono", Menlo, Consolas, monospace; background: rgba(255, 241, 208, .08); padding: .15em .4em; border-radius: 5px; }
:focus-visible { outline: 3px solid var(--taco); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--taco); color: var(--natt); }
.sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 16px; top: -60px; z-index: 100; background: var(--taco); color: var(--natt); padding: 10px 16px; border-radius: 8px; font-weight: 700; }
.skip:focus { top: 12px; }
.wrap { width: 100%; max-width: 1240px; margin-inline: auto; padding-inline: var(--gutter); }
.narrow { max-width: 780px; }
.muted { color: var(--dimma); }
.i { width: 1.15em; height: 1.15em; flex: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  height: 46px; padding: 0 22px; border-radius: 999px;
  background: var(--soffa); color: var(--lampa); border: 1px solid var(--filt);
  font-weight: 600; font-size: 1rem; text-decoration: none; white-space: nowrap;
  transition: background-color .15s, transform .08s, box-shadow .08s;
}
.btn:hover { background: var(--filt); }
.btn-primary { background: var(--taco); color: var(--natt); border-color: var(--taco); box-shadow: 0 3px 0 var(--taco-djup); }
.btn-primary:hover { background: #FFD062; }
.btn-primary:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--taco-djup); }
.btn-ghost { background: transparent; border-color: rgba(255, 241, 208, .22); }
.btn-ghost:hover { background: rgba(255, 241, 208, .06); border-color: rgba(255, 241, 208, .4); }
.btn-danger { background: transparent; color: var(--salsa); border-color: rgba(255, 90, 54, .5); }
.btn-danger:hover { background: rgba(255, 90, 54, .1); }
.btn-big { height: 56px; padding: 0 30px; font-size: 1.1rem; }
.btn-small { height: 38px; padding: 0 16px; font-size: .94rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.link { color: var(--dimma); font-weight: 500; }
.link:hover { color: var(--lampa); }
.linkish { background: none; border: 0; padding: 0; color: var(--dimma); text-decoration: underline; text-underline-offset: 3px; font-size: .94rem; }
.linkish:hover { color: var(--lampa); }

/* ---------- Header ---------- */
.top {
  position: sticky; top: 0; z-index: 50;
  background: rgba(13, 36, 29, .84); backdrop-filter: blur(12px) saturate(1.2); -webkit-backdrop-filter: blur(12px) saturate(1.2);
  border-bottom: 1px solid rgba(30, 74, 59, .7);
}
.top-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 68px; }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: 400 1.12rem/1 var(--display); letter-spacing: -.01em; color: var(--lampa); }
.logo svg { width: 34px; height: 29px; color: var(--dimma); }
.nav { display: flex; align-items: center; gap: clamp(12px, 2vw, 26px); }
.nav > a:not(.btn) { color: var(--dimma); text-decoration: none; font-weight: 500; }
.nav > a:not(.btn):hover { color: var(--lampa); }
.menu { position: relative; }
.menu summary { list-style: none; cursor: pointer; }
.menu summary::-webkit-details-marker { display: none; }
.avatar { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--teak); color: var(--lampa); font: 400 .95rem/1 var(--display); }
.avatar-big { width: 72px; height: 72px; font-size: 1.8rem; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 10px); min-width: 220px; background: var(--soffa); border: 1px solid var(--filt); border-radius: 14px; padding: 8px; box-shadow: 0 20px 50px -10px rgba(0, 0, 0, .6); }
.menu-pop a, .menu-pop button { display: block; width: 100%; text-align: left; padding: 10px 12px; border-radius: 8px; background: none; border: 0; text-decoration: none; color: var(--lampa); }
.menu-pop a:hover, .menu-pop button:hover { background: var(--filt); }
.menu-name { padding: 8px 12px 10px; font-weight: 600; border-bottom: 1px solid var(--filt); margin-bottom: 6px; }
.menu-name span { display: block; font-weight: 400; color: var(--dimma); font-size: .9rem; }
@media (max-width: 720px) {
  .nav > a:not(.btn):not([href^="/logga-in"]) { display: none; }
  .menu-pop .menu-mobile { display: block !important; }
  .nav .btn span { display: none; }
  .nav .btn { width: 40px; padding: 0; }
}

.flash, .notice { background: var(--taco); color: var(--natt); padding: 12px var(--gutter); font-weight: 600; text-align: center; }
.notice { max-width: none; border-radius: 0; }

/* ---------- Hero: the living room ---------- */
.hero { position: relative; padding: clamp(28px, 5vw, 64px) 0 clamp(24px, 4vw, 48px); overflow: hidden; isolation: isolate; }
.wall {
  position: absolute; inset: 0; z-index: -2;
  background:
    radial-gradient(ellipse 60% 70% at 8% -10%, rgba(255, 194, 60, .16), transparent 70%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='104' height='104'%3E%3Cg fill='none' stroke='%23112F25' stroke-width='9'%3E%3Ccircle r='42'/%3E%3Ccircle cx='104' r='42'/%3E%3Ccircle cy='104' r='42'/%3E%3Ccircle cx='104' cy='104' r='42'/%3E%3Ccircle cx='52' cy='52' r='15'/%3E%3C/g%3E%3C/svg%3E");
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent);
  mask-image: linear-gradient(to bottom, #000 55%, transparent);
}
.hero-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: center; gap: clamp(28px, 5vw, 80px); }
.hero-info { max-width: 34rem; }
.ch-no { display: flex; align-items: baseline; gap: 10px; color: var(--dimma); font-weight: 500; }
.ch-no b { font: 400 1.5rem/1 var(--display); color: var(--taco); letter-spacing: .02em; }
.hero-title {
  font: 400 clamp(2.1rem, 4.4vw, 4rem)/1.04 var(--display); letter-spacing: -.035em;
  margin: .28em 0 .32em; text-wrap: balance; overflow-wrap: normal;
}
.hero-by { color: var(--dimma); font-size: 1.05rem; }
.hero-by a { color: var(--lampa); }
.hero-tagline { margin-top: 14px; font-size: 1.2rem; line-height: 1.5; max-width: 32ch; text-wrap: pretty; min-height: 1.5em; }
.hero-info .techs { margin-top: 18px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.hero-info.is-tuning .hero-title, .hero-info.is-tuning .hero-tagline, .hero-info.is-tuning .hero-by { animation: tune .32s steps(4) both; }
@keyframes tune {
  0% { opacity: 0; transform: translateX(-6px); filter: blur(3px); }
  50% { opacity: .6; transform: translateX(4px); }
  100% { opacity: 1; transform: none; filter: none; }
}

/* ---------- The TV ---------- */
.tv-col { position: relative; }
.glow { position: absolute; inset: 4% 2% 12%; z-index: -1; filter: blur(64px) saturate(1.5); opacity: .5; transition: opacity .4s; pointer-events: none; }
.glow img, .glow svg { width: 100%; height: 100%; object-fit: cover; }
.tv { position: relative; width: min(100%, 640px); margin-inline: auto; padding-top: 62px; }
.tv-ears { position: absolute; top: 0; left: 50%; width: 140px; height: 70px; transform: translateX(-50%); }
.tv-ears::before { content: ""; position: absolute; bottom: 4px; left: 50%; width: 46px; height: 20px; transform: translateX(-50%); border-radius: 46px 46px 6px 6px; background: linear-gradient(#3a2a1f, #20160f); }
.tv-ears i { position: absolute; bottom: 18px; left: 50%; width: 3px; height: 92px; background: linear-gradient(90deg, #8e8a80, #e8e4d8, #8e8a80); border-radius: 3px; transform-origin: 50% 100%; }
.tv-ears i:first-child { transform: rotate(-31deg); }
.tv-ears i:last-child { transform: rotate(24deg); height: 80px; }
.tv-ears i::after { content: ""; position: absolute; top: -4px; left: -3px; width: 9px; height: 9px; border-radius: 50%; background: #d9d4c6; }
.tv-body {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) clamp(64px, 16%, 112px); gap: clamp(14px, 3%, 24px);
  padding: clamp(14px, 3.6%, 26px); border-radius: clamp(18px, 4%, 30px);
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='300'%3E%3Cfilter id='w'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.008 0.38' numOctaves='3' seed='7'/%3E%3CfeColorMatrix values='0 0 0 0 0.2  0 0 0 0 0.09  0 0 0 0 0.03  0 0 0 0.9 0'/%3E%3C/filter%3E%3Crect width='400' height='300' filter='url(%23w)'/%3E%3C/svg%3E") 0 0 / 100% 100%,
    linear-gradient(176deg, #A5603A, #8A4B26 45%, #6E3819);
  box-shadow:
    inset 0 2px 0 rgba(255, 220, 180, .25), inset 0 -5px 0 rgba(0, 0, 0, .28),
    0 2px 0 #4A250F, 0 40px 70px -24px rgba(0, 0, 0, .75);
}
.tv-screen {
  position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden;
  border-radius: 9% / 11%; background: #0a0a08;
  box-shadow: 0 0 0 clamp(6px, 1.6vw, 12px) #1d1611, 0 0 0 calc(clamp(6px, 1.6vw, 12px) + 2px) #4A2A14, inset 0 0 40px rgba(0, 0, 0, .7);
  margin: clamp(6px, 1.6vw, 12px);
}
.screen-img, .screen-img img, .screen-img svg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.screen-img { transition: filter .2s; }
.tv-screen:hover .screen-img { filter: brightness(1.08) saturate(1.1); }
.glass {
  position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background:
    radial-gradient(ellipse 60% 45% at 28% 18%, rgba(255, 255, 255, .16), transparent 70%),
    radial-gradient(ellipse at center, transparent 52%, rgba(0, 0, 0, .55) 100%),
    repeating-linear-gradient(0deg, rgba(0, 0, 0, .16) 0 1px, transparent 1px 3px);
}
.snow { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity .12s; pointer-events: none; image-rendering: pixelated; }
.snow.on { opacity: 1; }
.osd {
  position: absolute; top: 9%; right: 9%; font: 400 clamp(1.1rem, 3vw, 1.9rem)/1 var(--display); color: var(--osd);
  text-shadow: 0 0 10px rgba(140, 255, 122, .7), 2px 2px 0 rgba(0, 0, 0, .5); opacity: 0; transition: opacity .3s;
}
.osd.show { opacity: 1; transition: none; }
.tv-panel { display: flex; flex-direction: column; align-items: center; gap: clamp(10px, 2.4vw, 18px); padding: 6% 0 2%; }
.knob {
  position: relative; width: 100%; max-width: 86px; aspect-ratio: 1; border-radius: 50%; border: 0; padding: 0;
  background: conic-gradient(from 20deg, #efe9da, #9f998c 25%, #f7f2e6 50%, #8e887b 75%, #efe9da);
  box-shadow: 0 0 0 3px #3b2213, 0 6px 0 #3b2213, 0 10px 18px rgba(0, 0, 0, .45), inset 0 -4px 8px rgba(0, 0, 0, .25);
  --rot: 0deg;
}
.knob::before { /* tick marks around the dial */
  content: ""; position: absolute; inset: -11px; border-radius: 50%;
  background: repeating-conic-gradient(from -2deg, rgba(255, 241, 208, .65) 0 4deg, transparent 4deg 30deg);
  -webkit-mask: radial-gradient(circle, transparent 62%, #000 63% 70%, transparent 71%);
  mask: radial-gradient(circle, transparent 62%, #000 63% 70%, transparent 71%);
}
.knob-grip { position: absolute; inset: 10%; border-radius: 50%; transform: rotate(var(--rot)); transition: transform .45s cubic-bezier(.3, 1.6, .5, 1); }
.knob-grip::before { content: ""; position: absolute; left: 50%; top: 4%; bottom: 4%; width: 22%; transform: translateX(-50%); border-radius: 6px; background: linear-gradient(90deg, #5e584d, #c9c3b4 50%, #5e584d); box-shadow: 0 2px 4px rgba(0, 0, 0, .35); }
.knob-grip::after { content: ""; position: absolute; left: 50%; top: 10%; width: 6px; height: 6px; transform: translateX(-50%); border-radius: 50%; background: var(--salsa); }
.knob:active .knob-grip { transition-duration: .2s; }
.knob:disabled { cursor: default; }
.tv-buttons { display: flex; gap: 8px; }
.tv-buttons button { width: clamp(18px, 4vw, 28px); height: clamp(10px, 2vw, 14px); border-radius: 4px; border: 0; background: linear-gradient(#e9e3d4, #a7a193); box-shadow: 0 3px 0 #3b2213; }
.tv-buttons button:active { transform: translateY(2px); box-shadow: 0 1px 0 #3b2213; }
.tv-buttons button:disabled { cursor: default; }
.speaker { width: 80%; flex: 1; min-height: 40px; border-radius: 8px; background: repeating-linear-gradient(0deg, #2c1a10 0 3px, #6E3819 3px 7px); box-shadow: inset 0 2px 6px rgba(0, 0, 0, .5); }
.plate { font: 400 clamp(.5rem, 1.2vw, .66rem)/1 var(--display); color: #e8dcc0; background: #3b2213; padding: 5px 7px; border-radius: 3px; letter-spacing: .04em; }
.tv-feet { display: flex; justify-content: space-between; padding: 0 16%; height: 34px; }
.tv-feet i { width: 12px; background: linear-gradient(90deg, #2c1a10, #5a3420); transform-origin: top; border-radius: 0 0 4px 4px; }
.tv-feet i:first-child { transform: skewX(14deg); }
.tv-feet i:last-child { transform: skewX(-14deg); }

/* channel list ("tablån") */
.tabla { list-style: none; margin: clamp(32px, 5vw, 56px) 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); column-gap: 28px; }
.tabla button {
  position: relative; width: 100%; display: grid; grid-template-columns: 2.4em minmax(0, 1fr); column-gap: 8px; text-align: left;
  padding: 16px 0 14px; background: none; border: 0; border-top: 1px solid var(--filt); color: var(--dimma);
}
.tabla button::before { content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 3px; background: var(--taco); transform: scaleX(0); transform-origin: left; transition: transform .3s; }
.tabla button[aria-current="true"]::before { transform: scaleX(1); }
.t-no { grid-row: span 2; font: 400 .95rem/1.4 var(--display); }
.t-title { color: var(--lampa); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-by { font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tabla button[aria-current="true"] .t-no, .tabla button:hover .t-title { color: var(--taco); }

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .tv-col { order: -1; }
  .hero-title { font-size: clamp(2rem, 9vw, 3rem); }
  .tabla { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: var(--gutter); gap: 20px; padding-bottom: 6px; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); scrollbar-width: none; }
  .tabla li { flex: 0 0 62%; scroll-snap-align: start; }
}

/* ---------- Intro band ---------- */
.intro { display: grid; grid-template-columns: minmax(0, 58ch) auto; justify-content: space-between; align-items: end; gap: 24px 48px; padding-block: clamp(28px, 4vw, 48px) clamp(36px, 6vw, 72px); }
.intro p { font-size: clamp(1.1rem, 1.6vw, 1.3rem); line-height: 1.55; text-wrap: pretty; }
.intro-actions { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
@media (max-width: 860px) { .intro { grid-template-columns: 1fr; } }

/* ---------- Library ---------- */
.library { padding-bottom: 96px; }
.lib-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 32px; padding-top: 28px; border-top: 1px solid var(--filt); }
.lib-head h2, .more h2, .h2 { font: 400 clamp(1.5rem, 2.6vw, 2rem)/1.1 var(--display); letter-spacing: -.02em; }
.h2 { margin: 40px 0 18px; font-size: 1.4rem; }
.lib-count { color: var(--dimma); margin: 18px 0 22px; font-size: .95rem; }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.search { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px; border-radius: 999px; background: var(--soffa); border: 1px solid var(--filt); color: var(--dimma); }
.search:focus-within { border-color: var(--taco); }
.search input { border: 0; background: none; outline: none; width: 13rem; height: 100%; color: var(--lampa); }
.search input::placeholder { color: var(--dimma); opacity: .8; }
.seg { display: inline-flex; padding: 4px; margin: 0; border: 0; border-radius: 999px; background: var(--soffa); }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.seg span { display: block; padding: 8px 14px; border-radius: 999px; font-weight: 500; font-size: .95rem; color: var(--dimma); white-space: nowrap; }
.seg input:checked + span { background: var(--lampa); color: var(--natt); }
.seg input:focus-visible + span { outline: 3px solid var(--taco); outline-offset: 1px; }
.select select {
  appearance: none; height: 44px; padding: 0 38px 0 16px; border-radius: 999px; border: 1px solid var(--filt); cursor: pointer;
  background: var(--soffa) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23A8C2B4' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 15px center;
}
@media (max-width: 720px) {
  .filters { width: 100%; }
  .search { flex: 1 1 100%; }
  .search input { width: 100%; }
  .seg { flex: 1 1 100%; overflow-x: auto; }
  .seg label { flex: 1; text-align: center; }
  .select { flex: 1; }
  .select select { width: 100%; }
}

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 248px), 1fr)); gap: 36px 24px; transition: opacity .2s; }
[data-grid].is-loading .grid { opacity: .45; }
.card { min-width: 0; }
.card-link { display: block; text-decoration: none; }
.card-cover { position: relative; aspect-ratio: 16 / 10; border-radius: 12px; overflow: hidden; background: var(--soffa); outline: 3px solid transparent; outline-offset: 3px; transition: outline-color .15s; }
.card-cover .art { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.card-link:hover .card-cover { outline-color: var(--taco); }
.card-link:hover .art { transform: scale(1.035); }
.card-title { margin: 14px 0 2px; font-size: 1.12rem; font-weight: 600; overflow-wrap: anywhere; }
.card-link:hover .card-title { color: var(--taco); }
.card-by { color: var(--dimma); font-size: .95rem; }
.card-by a { text-decoration: none; }
.card-by a:hover { color: var(--lampa); text-decoration: underline; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.plays { display: inline-flex; align-items: center; gap: 4px; color: var(--dimma); font-size: .88rem; flex: none; }
.plays .i { width: .9em; height: .9em; }
.techs { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.techs li { font-size: .8rem; font-weight: 500; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--filt); color: var(--dimma); white-space: nowrap; }
.sticker { position: absolute; top: 10px; left: 10px; background: var(--taco); color: var(--natt); font: 400 .66rem/1 var(--display); padding: 6px 9px 5px; border-radius: 4px; transform: rotate(-4deg); box-shadow: 0 2px 0 rgba(0, 0, 0, .3); }
.sticker-inline { position: static; display: inline-block; margin-left: 10px; vertical-align: 2px; }
.empty { padding: 48px 0; color: var(--dimma); display: grid; justify-items: start; gap: 16px; }
.empty-big { padding: 64px 0; font-size: 1.1rem; max-width: 46ch; }

/* ---------- Game page ---------- */
.theater { background: var(--djup); padding: clamp(12px, 2.5vw, 28px) 0 18px; }
.stage-col { width: min(100%, calc((100svh - 190px) * var(--arn))); min-width: min(100%, 320px); margin-inline: auto; }
.stage { position: relative; aspect-ratio: var(--ar); width: 100%; background: #000; border-radius: 16px; overflow: hidden; box-shadow: 0 0 0 1px rgba(255, 241, 208, .07), 0 40px 80px -30px #000; }
.stage.is-auto-height { aspect-ratio: auto; height: var(--game-height); }
.stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.stage:fullscreen { border-radius: 0; aspect-ratio: auto; height: 100%; }
.start { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 18px; border: 0; padding: 0; background: #000; color: var(--lampa); z-index: 2; }
.start-bg { position: absolute; inset: 0; }
.start-bg .art { width: 100%; height: 100%; object-fit: cover; filter: brightness(.5) saturate(1.1); transform: scale(1.03); transition: filter .3s, transform .6s; }
button.start:hover .art { filter: brightness(.6) saturate(1.2); transform: scale(1.06); }
.start-btn { position: relative; display: grid; place-items: center; width: clamp(72px, 10vw, 104px); aspect-ratio: 1; border-radius: 50%; background: var(--taco); color: var(--natt); box-shadow: 0 6px 0 var(--taco-djup), 0 24px 60px rgba(0, 0, 0, .6); transition: transform .15s; }
.start-btn .i { width: 44%; height: 44%; margin-left: 7%; }
button.start:hover .start-btn { transform: scale(1.06); }
button.start:active .start-btn { transform: translateY(3px); box-shadow: 0 3px 0 var(--taco-djup); }
.start-label { position: relative; font: 400 clamp(.95rem, 1.8vw, 1.2rem)/1.3 var(--display); text-align: center; padding-inline: 20px; text-shadow: 0 2px 16px rgba(0, 0, 0, .8); }
.start-off { cursor: default; }
.loading { position: absolute; inset: 0; display: none; place-items: center; z-index: 1; }
.loading span { position: relative; font: 400 1rem/1 var(--display); background: rgba(0, 0, 0, .7); padding: 12px 18px; border-radius: 8px; color: var(--osd); }
.stage.is-loading .loading { display: grid; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; }
.tb-gap { flex: 1; }
.tb { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 999px; background: transparent; border: 1px solid transparent; color: var(--dimma); font-weight: 500; text-decoration: none; font-size: .95rem; }
.tb:hover { background: var(--soffa); color: var(--lampa); }
.tb:disabled { opacity: .35; pointer-events: none; }
.tb b { font-weight: 600; color: var(--lampa); }
.tb.on { color: var(--salsa); }
.tb.on .i { animation: pop .35s ease; }
@keyframes pop { 50% { transform: scale(1.35); } }
@media (max-width: 640px) { .tb span { display: none; } .tb { padding: 0 12px; } }

.game-info { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: clamp(32px, 6vw, 80px); padding-block: clamp(32px, 5vw, 56px); }
.gi-title { font: 400 clamp(2rem, 4.4vw, 3.4rem)/1.05 var(--display); letter-spacing: -.035em; text-wrap: balance; overflow-wrap: anywhere; }
.gi-by { margin-top: 12px; color: var(--dimma); }
.gi-by a { color: var(--lampa); }
.gi-tagline { margin-top: 20px; font-size: 1.3rem; line-height: 1.45; max-width: 40ch; text-wrap: pretty; }
.howto { margin-top: 32px; padding: 18px 22px; background: var(--soffa); border-left: 4px solid var(--taco); border-radius: 0 14px 14px 0; max-width: 62ch; }
.howto h2 { font-size: 1rem; font-weight: 700; margin-bottom: 6px; }
.prose { margin-top: 28px; max-width: 66ch; line-height: 1.65; }
.prose p + p { margin-top: 1em; }
.facts { margin: 0; }
.facts div { padding: 13px 0; border-bottom: 1px solid var(--filt); }
.facts div:first-child { padding-top: 4px; }
.facts dt { color: var(--dimma); font-size: .88rem; }
.facts dd { margin: 2px 0 0; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 20px 0 24px; }
.tags a { display: block; padding: 5px 12px; border-radius: 999px; background: var(--soffa); text-decoration: none; font-size: .9rem; }
.tags a:hover { background: var(--filt); }
.gi-side .btn { margin-top: 8px; }
.more { padding-bottom: 72px; }
.more h2 { margin-bottom: 24px; }
@media (max-width: 860px) { .game-info { grid-template-columns: 1fr; } }

.toast { position: fixed; left: 50%; bottom: 24px; z-index: 80; transform: translate(-50%, 160%); background: var(--lampa); color: var(--natt); padding: 12px 20px; border-radius: 999px; font-weight: 600; box-shadow: 0 16px 40px rgba(0, 0, 0, .5); transition: transform .3s cubic-bezier(.3, 1.4, .5, 1); }
.toast.show { transform: translate(-50%, 0); }

/* ---------- Page heads & forms ---------- */
.page-head { padding-top: clamp(36px, 6vw, 72px); padding-bottom: 28px; }
.page-head h1 { font: 400 clamp(2rem, 4.4vw, 3.2rem)/1.05 var(--display); letter-spacing: -.035em; text-wrap: balance; }
.lead { margin-top: 14px; font-size: 1.2rem; line-height: 1.5; color: var(--dimma); max-width: 52ch; text-wrap: pretty; }
.crumb { margin-bottom: 14px; color: var(--dimma); }
.row-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.panel { background: var(--soffa); border-radius: 20px; padding: clamp(20px, 4vw, 32px); margin-bottom: 24px; }
.panel > h2 { font-size: 1.25rem; margin-bottom: 8px; }
.panel.danger { background: transparent; border: 1px solid rgba(255, 90, 54, .3); }
.form { display: grid; gap: 20px; }
.field label { display: block; font-weight: 600; margin-bottom: 7px; }
.opt { font-weight: 400; color: var(--dimma); margin-left: 6px; font-size: .92rem; }
.field input:not([type=file]), .field textarea, .field select {
  width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--filt); background: var(--djup); color: var(--lampa);
  transition: border-color .15s, box-shadow .15s;
}
.field select { appearance: none; background: var(--djup) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23A8C2B4' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 15px center; padding-right: 38px; }
.field textarea { resize: vertical; min-height: 5em; line-height: 1.5; }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--taco); box-shadow: 0 0 0 4px rgba(255, 194, 60, .18); }
.field input::placeholder, .field textarea::placeholder { color: #6f8a7d; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 600px) { .field-row { grid-template-columns: 1fr; } }
.cover-pick { display: grid; grid-template-columns: 200px 1fr; gap: 16px; align-items: center; }
.cover-preview { aspect-ratio: 16 / 10; border-radius: 10px; overflow: hidden; background: var(--djup); border: 1px dashed var(--filt); display: grid; place-items: center; }
.cover-preview span { padding: 12px; font-size: .82rem; color: var(--dimma); text-align: center; line-height: 1.35; }
.cover-preview img, .cover-preview .art { width: 100%; height: 100%; object-fit: cover; }
input[type=file] { font-size: .92rem; color: var(--dimma); }
input[type=file]::file-selector-button { margin-right: 12px; height: 38px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--filt); background: var(--natt); color: var(--lampa); font-weight: 600; cursor: pointer; }
@media (max-width: 600px) { .cover-pick { grid-template-columns: 1fr; } }
.form-error { color: var(--salsa); font-weight: 600; }
.form-error:empty { display: none; }
.form-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 4px; }
.help { color: var(--dimma); font-size: .95rem; margin-top: 12px; }

/* upload steps (a real sequence, so numbered) */
.steps { list-style: none; margin: 8px 0 80px; padding: 0; display: grid; gap: 16px; }
.step { border-top: 1px solid var(--filt); padding-top: 22px; }
.step h2 { display: flex; align-items: center; gap: 14px; font: 400 1.15rem/1.2 var(--display); color: var(--dimma); margin-bottom: 18px; }
.step-no { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--filt); font: 400 .85rem/1 var(--display); flex: none; }
.step.is-active h2 { color: var(--lampa); }
.step.is-active .step-no { background: var(--taco); border-color: var(--taco); color: var(--natt); }
.step.is-done .step-no { background: var(--filt); border-color: var(--filt); color: var(--lampa); }
.drop {
  display: grid; justify-items: center; gap: 6px; text-align: center; cursor: pointer;
  padding: clamp(28px, 6vw, 48px) 20px; border-radius: 20px; border: 2px dashed rgba(255, 241, 208, .22); background: var(--soffa);
  transition: border-color .15s, background-color .15s;
}
.drop:hover, .drop.is-over { border-color: var(--taco); background: #174033; }
.drop-art { width: 120px; margin-bottom: 10px; transition: transform .25s cubic-bezier(.3, 1.5, .5, 1); }
.drop.is-over .drop-art { transform: translateY(8px) rotate(-3deg); }
.drop-title { font: 400 1.1rem/1.3 var(--display); }
.drop-hint { color: var(--dimma); }
.drop.is-busy { pointer-events: none; }
.drop.is-done { border-style: solid; border-color: var(--filt); }
.progress { width: min(320px, 90%); height: 8px; border-radius: 99px; background: var(--djup); overflow: hidden; margin-top: 14px; }
.progress span { display: block; height: 100%; width: var(--p, 0%); background: var(--taco); border-radius: inherit; transition: width .15s; }
.drop-status { min-height: 1.4em; color: var(--dimma); font-size: .95rem; margin-top: 4px; }
.drop-status.bad { color: var(--salsa); font-weight: 600; }
.report { display: grid; gap: 14px; margin-bottom: 28px; }
.report:empty { display: none; }
.report-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px 24px; margin: 0; padding: 20px 22px; background: var(--soffa); border-radius: 16px; }
.report-facts dt { color: var(--dimma); font-size: .85rem; }
.report-facts dd { margin: 2px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.report-note { padding: 14px 18px; border-radius: 14px; background: rgba(255, 194, 60, .1); border: 1px solid rgba(255, 194, 60, .35); }
.report-warn { padding: 14px 18px; border-radius: 14px; background: rgba(255, 90, 54, .08); border: 1px solid rgba(255, 90, 54, .35); }
.report-warn ul { margin: 6px 0 0; padding-left: 20px; }

/* ---------- Mina spel ---------- */
.rows { list-style: none; margin: 0 0 80px; padding: 0; }
.row { display: grid; grid-template-columns: 132px minmax(0, 1fr) auto auto; gap: 24px; align-items: center; padding: 18px 0; border-top: 1px solid var(--filt); }
.row-cover { display: block; aspect-ratio: 16 / 10; border-radius: 10px; overflow: hidden; background: var(--soffa); }
.row-cover .art { width: 100%; height: 100%; object-fit: cover; }
.row-main h2 { font-size: 1.15rem; margin-bottom: 6px; }
.row-main h2 a { text-decoration: none; }
.row-main h2 a:hover { color: var(--taco); }
.note { margin-top: 6px; color: var(--salsa); font-size: .95rem; }
.row-stats { display: flex; gap: 24px; margin: 0; text-align: right; }
.row-stats dt { color: var(--dimma); font-size: .82rem; }
.row-stats dd { margin: 0; font-weight: 600; }
@media (max-width: 720px) {
  .row { grid-template-columns: 96px minmax(0, 1fr); gap: 12px 16px; }
  .row-stats { grid-column: 2; text-align: left; }
  .row .btn { grid-column: 2; justify-self: start; }
}
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .82rem; font-weight: 600; margin-right: 6px; }
.pill-ok { background: rgba(140, 255, 122, .12); color: #A9F09E; }
.pill-wait { background: rgba(255, 194, 60, .14); color: var(--taco); }
.pill-bad { background: rgba(255, 90, 54, .14); color: #FF8A6E; }
.pill-off { background: rgba(168, 194, 180, .14); color: var(--dimma); }

.profile-head { display: flex; align-items: center; gap: 20px; }
.profile-head h1 { margin-bottom: 4px; }
.page-head + .wrap .grid { margin-bottom: 80px; }

/* ---------- Auth ---------- */
.auth { max-width: 460px; padding-block: clamp(40px, 7vw, 80px); }
.auth h1 { font: 400 2.2rem/1.1 var(--display); letter-spacing: -.03em; }
.auth .lead { margin-bottom: 28px; }
.auth-switch { margin-top: 24px; color: var(--dimma); }
.testcard { display: grid; grid-template-columns: repeat(7, 1fr); height: 14px; border-radius: 4px; overflow: hidden; margin-bottom: 36px; width: 168px; }
.testcard i:nth-child(1) { background: #FFF1D0; } .testcard i:nth-child(2) { background: #FFC23C; } .testcard i:nth-child(3) { background: #7FD1C7; }
.testcard i:nth-child(4) { background: #9BBF4B; } .testcard i:nth-child(5) { background: #E07AA6; } .testcard i:nth-child(6) { background: #FF5A36; } .testcard i:nth-child(7) { background: #3A6EA8; }

/* ---------- Guide ---------- */
.guide { padding-bottom: 96px; }
.guide h2 { font: 400 1.35rem/1.2 var(--display); letter-spacing: -.02em; margin: 52px 0 14px; }
.guide h2:first-child { margin-top: 12px; }
.guide p { max-width: 64ch; line-height: 1.65; }
.tree { margin: 20px 0; padding: 20px 24px; background: var(--djup); border-radius: 14px; font: 500 .95rem/1.7 ui-monospace, "SF Mono", Menlo, Consolas, monospace; color: var(--lampa); overflow-x: auto; }
.tree span { color: var(--dimma); font-weight: 400; margin-left: 1ch; }
.checks { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 14px; max-width: 64ch; }
.checks li { position: relative; padding-left: 30px; line-height: 1.6; color: var(--dimma); }
.checks li b { color: var(--lampa); font-weight: 600; }
.checks li::before { content: ""; position: absolute; left: 2px; top: .45em; width: 14px; height: 8px; border-left: 3px solid var(--taco); border-bottom: 3px solid var(--taco); transform: rotate(-45deg); }
.prompt { position: relative; margin-top: 16px; background: var(--soffa); border-radius: 16px; padding: 20px 22px; }
.prompt pre { margin: 0; white-space: pre-wrap; font: 400 .95rem/1.6 var(--text); color: var(--lampa); padding-right: 96px; }
.prompt .btn { position: absolute; top: 14px; right: 14px; }
@media (max-width: 600px) { .prompt pre { padding-right: 0; padding-top: 44px; } }
.guide-cta { margin-top: 48px; }

/* ---------- Admin ---------- */
.review { list-style: none; padding: 0; margin: 0; }
.review-head { display: grid; grid-template-columns: 160px 1fr; gap: 20px; align-items: start; }
.review-head h3 { font-size: 1.2rem; margin-bottom: 6px; }
.review-head .techs { margin-top: 10px; }
.files { margin-top: 18px; }
.files summary { cursor: pointer; font-weight: 600; }
.files-body { margin-top: 12px; display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 14px; font-size: .9rem; }
.files-list { max-height: 360px; overflow: auto; background: var(--djup); border-radius: 10px; padding: 8px; }
.files-list button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 4px 8px; border-radius: 6px; color: var(--dimma); font: 400 .85rem/1.4 ui-monospace, Menlo, Consolas, monospace; overflow-wrap: anywhere; }
.files-list button:hover, .files-list button.on { background: var(--filt); color: var(--lampa); }
.log { margin: 10px 0; max-height: 360px; overflow: auto; background: var(--djup); color: #CFE3D7; border-radius: 10px; padding: 12px 14px; font: 400 .8rem/1.5 ui-monospace, Menlo, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.install { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--filt); }
.review-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.table-wrap { overflow-x: auto; margin-bottom: 80px; }
.table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.table th { text-align: left; font-weight: 600; color: var(--dimma); padding: 10px 12px; border-bottom: 1px solid var(--filt); white-space: nowrap; font-size: .88rem; }
.table td { padding: 12px; border-bottom: 1px solid rgba(30, 74, 59, .6); vertical-align: middle; }
.table input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--taco); }
.t-actions { display: flex; gap: 14px; white-space: nowrap; }
.dialog { background: var(--soffa); color: var(--lampa); border: 1px solid var(--filt); border-radius: 18px; padding: 24px; width: min(760px, 92vw); }
.dialog::backdrop { background: rgba(0, 0, 0, .6); }
@media (max-width: 720px) { .review-head, .files-body { grid-template-columns: 1fr; } }

/* ---------- 404 ---------- */
.nosignal { display: grid; justify-items: center; text-align: center; padding-block: clamp(48px, 8vw, 96px); }
.tv-small { width: min(300px, 80vw); padding-top: 0; margin-bottom: 36px; }
.tv-small .tv-body { grid-template-columns: 1fr; }
.nosignal h1 { font: 400 clamp(2rem, 5vw, 3rem)/1.1 var(--display); letter-spacing: -.03em; }
.nosignal .lead { margin: 14px auto 28px; }

/* ---------- Footer ---------- */
.foot { border-top: 1px solid var(--filt); padding: 36px 0 48px; color: var(--dimma); font-size: .95rem; }
.foot-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px 40px; align-items: center; }
.foot-sign { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; }
.foot-sign .logo { font-size: .95rem; }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.foot nav a { text-decoration: none; }
.foot nav a:hover { color: var(--lampa); text-decoration: underline; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

.menu-mobile { display: none !important; }
.toast:not(.show) { visibility: hidden; transition: transform .3s, visibility 0s .3s; }
