/* Effee's Julebord – mørk vinternatt, Effee-rødt, sveisegnister og julelys */
:root {
  --bg: #070a12;
  --bg2: #0d121d;
  --card: rgba(18, 24, 36, .86);
  --card2: #1b2333;
  --line: #263044;
  --text: #f4f1ec;
  --muted: #9aa6b8;
  --red: #e2402c;        /* Effee-logo */
  --red-dark: #c23422;
  --spark: #ff8a2a;      /* gnister */
  --gold: #f6c15b;       /* julelys */
  --green: #3fae6a;
  --radius: 14px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { margin: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 'Nunito Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
}

/* Bakgrunnsbildet (sveiserobot + gnister), dempet bak innholdet */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(7,10,18,.94) 0%, rgba(7,10,18,.82) 45%, rgba(7,10,18,.72) 100%),
    url(/effee-bakgrunn.jpg) center bottom / cover no-repeat;
  z-index: 0;
  pointer-events: none;
}

a { color: var(--gold); }

h1, h2, h3 { line-height: 1.15; margin: 0; }

.wrap { max-width: 640px; margin: 0 auto; padding: 16px 16px 80px; position: relative; z-index: 1; }

/* Toppbanner med Effee-logoen */
.banner {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 16px;
  aspect-ratio: 1254 / 470;
  object-fit: cover;
  -webkit-mask-image: linear-gradient(180deg, #000 70%, transparent);
  mask-image: linear-gradient(180deg, #000 70%, transparent);
}
header.top { text-align: center; padding: 4px 0 6px; }
header.top h1 { font-size: 1.75rem; letter-spacing: .3px; font-weight: 800; margin-top: -6px; }
header.top p { margin: 4px 0 0; color: var(--muted); }
.accent { color: var(--red); }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin: 14px 0;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.card h2 { font-size: 1.05rem; margin-bottom: 10px; color: var(--gold); font-weight: 750; }

/* Nå spilles – glødende som en sveisebue */
.now {
  display: flex; gap: 14px; align-items: center;
  background: radial-gradient(120% 140% at 0% 100%, rgba(255,138,42,.28), transparent 60%), linear-gradient(135deg, #1b130f, #241410);
  border-color: #5a2f1a;
  box-shadow: 0 0 0 1px rgba(255,138,42,.08), 0 10px 40px rgba(255,110,30,.12);
}
.now .eq { width: 34px; height: 30px; display: flex; gap: 3px; align-items: flex-end; flex: none; }
.now .eq i { flex: 1; background: var(--spark); border-radius: 2px; animation: eq 1s infinite ease-in-out; }
.now .eq i:nth-child(2) { animation-delay: -.3s; }
.now .eq i:nth-child(3) { animation-delay: -.6s; }
.now .eq i:nth-child(4) { animation-delay: -.15s; }
@keyframes eq { 0%, 100% { height: 20%; } 50% { height: 100%; } }
.now .label { font-size: .75rem; text-transform: uppercase; letter-spacing: 1.5px; color: #ffb37a; }
.now .title { font-size: 1.15rem; font-weight: 800; }
.now .artist { color: var(--muted); }
.now.idle { background: var(--card); border-color: var(--line); box-shadow: none; }
.now.idle .eq i { animation: none; height: 20%; background: var(--muted); }
.now:has(.art:not([hidden])) .eq { display: none; }
.now .art { width: 72px; height: 72px; border-radius: 10px; object-fit: cover; flex: none; box-shadow: 0 6px 18px rgba(0,0,0,.5); }
.progress { height: 4px; background: rgba(255,255,255,.12); border-radius: 4px; margin-top: 8px; overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--red), var(--spark), #ffd27a); box-shadow: 0 0 10px var(--spark); transition: width 1s linear; }
.upnext { margin-top: 6px; font-size: .85rem; color: #ffc89a; }

/* Skjema */
form.suggest { display: grid; gap: 10px; }
label { font-size: .85rem; color: var(--muted); display: block; margin-bottom: 4px; }
input[type=text], input[type=number], input[type=password], input[type=search] {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg2);
  color: var(--text);
  font: inherit;
  font-size: 16px; /* hindrer zoom på iPhone */
}
input:focus { outline: 2px solid var(--spark); outline-offset: 1px; border-color: transparent; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 420px) { .row2 { grid-template-columns: 1fr; } }

button, .btn {
  font: inherit;
  border: 0;
  border-radius: 10px;
  padding: 12px 16px;
  cursor: pointer;
  background: var(--red);
  color: #fff;
  font-weight: 750;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: transform .08s, background .15s, box-shadow .15s;
}
button:hover, .btn:hover { background: var(--red-dark); box-shadow: 0 0 18px rgba(226,64,44,.35); }
button:active { transform: scale(.97); }
button:disabled { opacity: .5; cursor: default; box-shadow: none; }
button.ghost, .btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--text); }
button.ghost:hover, .btn.ghost:hover { background: var(--card2); box-shadow: none; }
button.small, .btn.small { padding: 6px 10px; font-size: .85rem; border-radius: 8px; }
button.gold { background: linear-gradient(135deg, var(--spark), #ffb347); color: #2a1300; }
button.gold:hover { background: linear-gradient(135deg, #f07a1c, #f5a536); box-shadow: 0 0 18px rgba(255,138,42,.4); }

.hint { font-size: .85rem; color: var(--muted); margin: 0; }
.closed-banner { background: #2a1a10; border: 1px solid #6a3a1c; color: #ffd2a6; padding: 10px 14px; border-radius: 10px; text-align: center; }

/* Liste */
.list { list-style: none; margin: 0; padding: 0; }
.song {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.song:first-child { border-top: 0; }
.song .rank { color: var(--muted); font-weight: 800; text-align: center; font-variant-numeric: tabular-nums; }
.song:nth-child(1) .rank { color: var(--spark); }
.song .t { font-weight: 750; overflow-wrap: anywhere; }
.song .a { color: var(--muted); font-size: .9rem; overflow-wrap: anywhere; }
.song .by { color: var(--muted); font-size: .78rem; opacity: .8; }
.song .actions { display: flex; gap: 6px; align-items: center; }

.vote {
  min-width: 64px;
  padding: 8px 10px;
  background: var(--card2);
  border: 1px solid var(--line);
  color: var(--text);
  flex-direction: column;
  gap: 0;
  line-height: 1.1;
}
.vote:hover { background: #262f42; box-shadow: none; }
.vote .n { font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.vote .ico { font-size: 1.1rem; filter: grayscale(1) opacity(.6); }
.vote.on { background: var(--red); border-color: var(--red); box-shadow: 0 0 14px rgba(226,64,44,.35); }
.vote.on .ico { filter: none; }
.vote.pop { animation: pop .35s; }
@keyframes pop { 50% { transform: scale(1.15); } }

.thumb { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; background: var(--card2); display: block; }
.song.has-art { grid-template-columns: 30px 44px 1fr auto; }
.results { margin-top: 8px; }
.results .song:first-child { border-top: 0; }
.vote.small { flex-direction: row; min-width: 0; padding: 6px 10px; font-size: .85rem; gap: 4px; }

/* Faner: Effee-lista / Søk */
.tabs { display: flex; gap: 4px; margin-bottom: 12px; background: var(--bg2); padding: 4px; border-radius: 12px; border: 1px solid var(--line); }
.tab { flex: 1; min-width: 0; background: transparent; color: var(--muted); padding: 9px 8px; font-size: .9rem; border-radius: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.tab:hover { background: var(--card2); box-shadow: none; color: var(--text); }
.tab[aria-selected="true"] { background: var(--red); color: #fff; box-shadow: 0 0 14px rgba(226,64,44,.3); }

.empty { text-align: center; color: var(--muted); padding: 20px 0; }
.tag { display: inline-block; font-size: .7rem; padding: 1px 6px; border-radius: 6px; background: rgba(255,138,42,.14); color: var(--spark); margin-left: 6px; vertical-align: 2px; }

details summary { cursor: pointer; color: var(--gold); font-weight: 750; }
details[open] summary { margin-bottom: 8px; }

/* Toast */
#toast {
  position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 140%);
  background: #f4f1ec; color: #10141d; padding: 12px 18px; border-radius: 12px;
  font-weight: 700; box-shadow: 0 10px 30px rgba(0,0,0,.5); z-index: 50;
  transition: transform .25s; max-width: calc(100vw - 32px); text-align: center;
}
#toast.show { transform: translate(-50%, 0); }
#toast.err { background: #ffd9d4; color: #6b130c; }

.offline-msg { display: none; position: fixed; top: 0; left: 0; right: 0; background: #8a1d12; color: #fff; text-align: center; padding: 6px; font-size: .85rem; z-index: 60; }
body.offline .offline-msg { display: block; }

/* Snø og gnister */
.snow { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.snow span { position: absolute; top: -30px; color: #fff; animation: fall linear infinite; }
.snow span.spark { color: var(--spark); text-shadow: 0 0 6px var(--spark); animation-name: rise; top: auto; bottom: -20px; }
@keyframes fall { to { transform: translate(40px, 110vh) rotate(360deg); } }
@keyframes rise { 0% { transform: translate(0, 0); opacity: 0; } 10% { opacity: 1; } 100% { transform: translate(-60px, -45vh); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .snow { display: none; }
  .now .eq i { animation: none; }
}

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
