/* ════════════════════════════════════════════════
   Component styles — HM 2026 Spáleikur
   ════════════════════════════════════════════════ */

/* ───────── Sidebar (desktop) ───────── */
.sidebar {
  position: sticky; top: 0; align-self: start;
  height: 100vh;
  display: flex; flex-direction: column;
  padding: 26px 18px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, var(--bg-2), var(--bg));
}
.side-logo { display: flex; align-items: center; gap: 10px; padding: 0 8px 4px; }
.side-logo img { height: 23px; width: auto; display: block; }
.side-tag {
  font-size: 10px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase;
  color: var(--accent); padding: 0 8px 24px;
}
.side-nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 13px;
  padding: 12px 14px; border-radius: var(--r-sm);
  color: var(--text-dim); font-weight: 600; font-size: 15px;
  position: relative; transition: background .15s, color .15s;
  text-align: left; width: 100%; white-space: nowrap;
}
.nav-item:hover { background: var(--surface); color: var(--text); }
.nav-item.active { background: var(--surface-2); color: var(--text); }
.nav-item.active::before {
  content: ""; position: absolute; left: -18px; top: 50%; transform: translateY(-50%);
  width: 4px; height: 22px; border-radius: 0 4px 4px 0; background: var(--accent);
  box-shadow: 0 0 16px var(--accent-glow);
}
.nav-item svg { width: 20px; height: 20px; flex: none; }
.nav-item .nav-badge {
  margin-left: auto; min-width: 22px; height: 22px; padding: 0 6px;
  display: grid; place-items: center; border-radius: 99px;
  background: var(--accent); color: var(--accent-ink);
  font-size: 11px; font-weight: 800;
}
.side-foot { margin-top: auto; padding-top: 18px; }
.me-chip {
  display: flex; align-items: center; gap: 11px; padding: 11px 12px;
  border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--line);
}
.me-chip .meta { min-width: 0; }
.me-chip .meta .nm { font-weight: 700; font-size: 14px; }
.me-chip .meta .sub { font-size: 12px; color: var(--muted); }

/* ───────── Avatar ───────── */
.avatar {
  flex: none; display: grid; place-items: center;
  border-radius: 50%; font-weight: 800; letter-spacing: .02em;
  background: var(--surface-2); color: var(--accent);
  border: 1px solid var(--line); font-size: 13px;
}
.avatar.me { background: var(--accent); color: var(--accent-ink); border-color: transparent; }

/* ───────── Mobile top + bottom nav ───────── */
.topbar { display: none; }
.bottom-nav { display: none; }
@media (max-width: 880px) {
  .topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 16px; position: sticky; top: 0; z-index: 40;
    background: color-mix(in srgb, var(--bg) 86%, transparent);
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
  }
  .topbar img { height: 20px; }
  .bottom-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
    background: color-mix(in srgb, var(--bg-2) 92%, transparent);
    -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
    border-top: 1px solid var(--line);
    padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
  }
  .bn-item {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: 6px 2px; color: var(--muted); font-size: 10px; font-weight: 700;
    border-radius: 12px; min-height: 52px; justify-content: center; white-space: nowrap;
  }
  .bn-item svg { width: 22px; height: 22px; }
  .bn-item.active { color: var(--accent); }
}

/* ───────── Buttons / pills ───────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: 99px; font-weight: 800; font-size: 14px;
  letter-spacing: .02em; transition: transform .12s, filter .15s, background .15s;
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 28px -10px var(--accent-glow); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-primary:disabled { background: var(--surface-2); color: var(--muted); box-shadow: none; cursor: not-allowed; }
.btn-ghost { background: var(--surface-2); color: var(--text); border: 1px solid var(--line); }
.btn-ghost:hover { background: var(--surface); }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: 99px; font-size: 12px; font-weight: 700;
  background: var(--surface-2); color: var(--text-dim); border: 1px solid var(--line);
}
.pill.accent { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); border-color: transparent; }
.pill.live { background: color-mix(in srgb, var(--live) 18%, transparent); color: var(--live); border-color: transparent; }

.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--live); box-shadow: 0 0 0 0 var(--live); animation: pulse 1.4s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--live) 70%, transparent); } 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

/* ───────── Section header ───────── */
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 34px 0 16px; }
.sec-head h2 { font-family: var(--font-display); font-weight: 400; text-transform: uppercase; font-size: clamp(22px, 3vw, 30px); letter-spacing: .01em; }
.sec-head .sub { color: var(--muted); font-size: 13px; font-weight: 600; }

/* ───────── Match card ───────── */
.match { padding: 16px 18px; display: flex; flex-direction: column; gap: 13px; }
.match-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.match-grp { font-size: 11px; font-weight: 800; letter-spacing: .12em; color: var(--muted); text-transform: uppercase; }
.match-body { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; }
.team-side { display: flex; align-items: center; gap: 11px; min-width: 0; }
.team-side.right { flex-direction: row-reverse; text-align: right; }
.flag { font-size: 30px; line-height: 1; flex: none; filter: drop-shadow(0 2px 4px rgba(0,0,0,.4)); }
.team-nm { font-weight: 700; font-size: 15px; line-height: 1.1; min-width: 0; }
.team-nm .code { font-size: 11px; color: var(--muted); font-weight: 800; letter-spacing: .08em; }
.vs-box { text-align: center; min-width: 64px; }
.vs-box .sc { font-family: var(--font-display); font-size: 30px; letter-spacing: .04em; }
.vs-box .sc .x { color: var(--muted); margin: 0 4px; font-size: 20px; vertical-align: 2px; }
.vs-box .ko { font-size: 12px; color: var(--muted); font-weight: 700; }
.vs-box .ko .d { color: var(--text-dim); }
.match-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--muted); font-weight: 600; border-top: 1px solid var(--line-soft); padding-top: 11px; }

/* ───────── Score predictor ───────── */
.predictor { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.pred-side { display: flex; flex-direction: column; align-items: center; gap: 9px; }
.pred-side .flag { font-size: 34px; }
.pred-side .nm { font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--text-dim); text-align: center; }
.stepper { display: flex; align-items: center; gap: 10px; }
.step-btn {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text);
  font-size: 20px; transition: background .12s, transform .1s;
}
.step-btn:hover { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.step-btn:active { transform: scale(.9); }
.pred-num {
  font-family: var(--font-display); font-size: 46px; min-width: 52px; text-align: center;
  color: var(--text);
}
.pred-num.set { color: var(--accent); }
.pred-mid { font-family: var(--font-display); font-size: 26px; color: var(--muted); padding: 0 4px; }

/* tap-to-cycle afbrigði */
.tap-num {
  font-family: var(--font-display); font-size: 50px; width: 78px; height: 78px;
  display: grid; place-items: center; border-radius: var(--r);
  background: var(--surface-2); border: 1.5px solid var(--line); color: var(--text);
  transition: transform .1s, border-color .15s, color .15s;
}
.tap-num:hover { border-color: var(--accent); }
.tap-num.set { color: var(--accent); border-color: color-mix(in srgb,var(--accent) 40%,transparent); }
.tap-num:active { transform: scale(.93); }

/* slider afbrigði */
.range-side { display:flex; flex-direction:column; gap:8px; align-items:center; }
input[type=range].score-range { -webkit-appearance:none; appearance:none; width:120px; height:6px; border-radius:99px; background:var(--surface-2); outline:none; }
input[type=range].score-range::-webkit-slider-thumb { -webkit-appearance:none; width:22px; height:22px; border-radius:50%; background:var(--accent); cursor:pointer; box-shadow:0 0 12px var(--accent-glow); }
input[type=range].score-range::-moz-range-thumb { width:22px; height:22px; border:none; border-radius:50%; background:var(--accent); cursor:pointer; }

/* ───────── Stat blocks ───────── */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: 14px; }
.stat { padding: 18px 20px; }
.stat .stat-label { font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.stat .stat-num { font-family: var(--font-display); font-size: clamp(34px,5vw,50px); line-height: .95; margin-top: 6px; }
.stat .stat-num.accent { color: var(--accent); }
.stat .stat-foot { font-size: 12px; color: var(--text-dim); font-weight: 600; margin-top: 6px; display: flex; align-items: center; gap: 6px; }
.trend-up { color: var(--accent); }
.trend-down { color: var(--live); }

/* ───────── Leaderboard ───────── */
.lb { display: flex; flex-direction: column; }
.lb-row {
  display: grid; grid-template-columns: 38px 40px 1fr auto; align-items: center; gap: 12px;
  padding: 13px 18px; border-bottom: 1px solid var(--line-soft);
  transition: background .12s;
}
.lb-row:last-child { border-bottom: none; }
.lb-row:hover { background: var(--surface); }
.lb-row.me { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.lb-row.me:hover { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.lb-rank { font-family: var(--font-display); font-size: 22px; color: var(--muted); text-align: center; }
.lb-rank.top { color: var(--text); }
.lb-name { min-width: 0; }
.lb-name .nm { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-name .sub { font-size: 12px; color: var(--muted); font-weight: 600; }
.lb-pts { text-align: right; }
.lb-pts .p { font-family: var(--font-display); font-size: 24px; }
.lb-pts .l { font-size: 10px; color: var(--muted); font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }

/* Podium */
.podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; gap: 12px; align-items: end; }
.podium-col { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 18px 12px; border-radius: var(--r); background: linear-gradient(180deg, var(--surface), var(--bg-2)); border: 1px solid var(--line); position: relative; }
.podium-col .medal { position:absolute; top:-14px; width:30px; height:30px; border-radius:50%; display:grid; place-items:center; font-family:var(--font-display); font-size:15px; color:var(--accent-ink); }
.podium-col.p1 { padding-top: 28px; }
.podium-col.p1 .medal { background: var(--gold); box-shadow: 0 0 22px rgba(255,210,74,.4); }
.podium-col.p2 .medal { background: var(--silver); }
.podium-col.p3 .medal { background: var(--bronze); }
.podium-col .nm { font-weight: 800; font-size: 14px; text-align: center; }
.podium-col .pts { font-family: var(--font-display); font-size: 30px; color: var(--accent); }
.podium-bar { width: 100%; border-radius: 8px 8px 0 0; background: var(--surface-2); }

/* ───────── Group tables ───────── */
.groups-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px,1fr)); gap: 14px; }
.gt { padding: 14px 16px 8px; }
.gt-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.gt-head .badge-grp { font-family: var(--font-display); font-size: 18px; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; background: var(--accent); color: var(--accent-ink); }
.gt-head .t { font-weight: 800; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-dim); }
.gt-row { display: grid; grid-template-columns: 18px 26px 1fr auto; align-items: center; gap: 10px; padding: 8px 4px; border-top: 1px solid var(--line-soft); font-size: 14px; }
.gt-row .pos { font-size: 12px; font-weight: 800; color: var(--muted); text-align: center; }
.gt-row .fl { font-size: 20px; }
.gt-row .tn { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gt-row.qual { }
.gt-row.qual .tn { color: var(--accent); font-weight: 800; }
.gt-row .pk { width:24px;height:24px;border-radius:7px;border:1px solid var(--line);display:grid;place-items:center;color:var(--muted); }
.gt-row .pk.on { background:var(--accent); color:var(--accent-ink); border-color:transparent; }

/* ───────── Badges / verðlaun ───────── */
.badges-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px,1fr)); gap: 12px; }
.badge-card { padding: 18px 16px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; position: relative; }
.badge-card.locked { opacity: .45; }
.badge-ico { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); }
.badge-card.earned .badge-ico { background: color-mix(in srgb, var(--accent) 18%, transparent); border-color: transparent; }
.badge-ico svg { width: 28px; height: 28px; }
.badge-card .bt { font-weight: 800; font-size: 13px; }
.badge-card .bd { font-size: 11px; color: var(--muted); font-weight: 600; line-height: 1.3; }

/* ───────── Misc ───────── */
.hero {
  position: relative; overflow: hidden;
  padding: 30px 32px; border-radius: var(--r-lg);
  background:
    radial-gradient(110% 130% at 90% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 55%),
    linear-gradient(180deg, var(--surface-2), var(--bg-2));
  border: 1px solid var(--line);
}
.hero::after {
  content: ""; position: absolute; right: -40px; bottom: -60px; width: 240px; height: 240px;
  background: radial-gradient(circle, var(--accent-glow), transparent 70%); opacity: .5; pointer-events: none;
}
.hero .h-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; position: relative; z-index: 1; }
.hero .rank-big { font-family: var(--font-display); font-size: clamp(54px, 9vw, 92px); line-height: .82; }
.hero .rank-big .hash { color: var(--accent); }
.divider { height: 1px; background: var(--line-soft); margin: 0; border: none; }

.grid-2 { display: grid; grid-template-columns: 1.55fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 980px) { .grid-2 { grid-template-columns: 1fr; } }
.col-gap { display: flex; flex-direction: column; gap: 14px; }
.row-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px,1fr)); gap: 14px; }

.empty { text-align: center; padding: 40px 20px; color: var(--muted); }

.scoring-list { display: flex; flex-direction: column; gap: 2px; }
.scoring-list .sr { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--line-soft); }
.scoring-list .sr:last-child { border-bottom: none; }
.scoring-list .sr .d { font-size: 14px; font-weight: 600; color: var(--text-dim); }
.scoring-list .sr .v { font-family: var(--font-display); font-size: 22px; color: var(--accent); }

.pts-tag { display:inline-flex; align-items:center; gap:5px; padding:4px 10px; border-radius:99px; font-weight:800; font-size:12px; }
.pts-tag.hit { background: color-mix(in srgb,var(--accent) 18%,transparent); color: var(--accent); }
.pts-tag.exact { background: var(--accent); color: var(--accent-ink); }
.pts-tag.miss { background: var(--surface-2); color: var(--muted); }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: 14px;
  padding: 13px 22px; border-radius: 99px; z-index: 200; box-shadow: 0 12px 40px -8px var(--accent-glow);
  display: flex; align-items: center; gap: 9px;
}
@media (max-width: 880px) { .toast { bottom: 92px; } }

/* ───────── Splash / hleðsla ───────── */
.splash { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.splash-inner { display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center; }
.splash-spin { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.splash-text { color: var(--text-dim); font-weight: 600; font-size: 14px; }

/* ───────── Innskráning ───────── */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 28px 16px; position: relative; z-index: 1; }
.login-card { width: 100%; max-width: 440px; padding: 34px 30px 26px; }
.login-logo { display: flex; justify-content: center; margin-bottom: 14px; }
.login-title { font-size: clamp(30px, 6vw, 42px); text-align: center; margin: 6px 0 12px; }
.login-sub { color: var(--text-dim); font-weight: 600; font-size: 14px; text-align: center; line-height: 1.5; margin-bottom: 22px; }
.fld { display: block; margin-bottom: 16px; }
.fld > span { display: block; font-size: 12px; font-weight: 800; letter-spacing: .04em; color: var(--text-dim); margin-bottom: 7px; text-transform: uppercase; }
.fld > span em { color: var(--muted); font-style: normal; font-weight: 700; text-transform: none; letter-spacing: 0; }
.fld input {
  width: 100%; padding: 13px 15px; border-radius: var(--r-sm);
  background: var(--surface); border: 1px solid var(--line); color: var(--text);
  font-size: 16px; font-weight: 600; transition: border-color .15s;
}
.fld input:focus { outline: none; border-color: var(--accent); }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.login-err { display: flex; align-items: center; gap: 7px; background: color-mix(in srgb, var(--live) 16%, transparent); color: var(--live); font-weight: 700; font-size: 13px; padding: 10px 13px; border-radius: var(--r-sm); margin-bottom: 14px; }
.login-btn { width: 100%; justify-content: center; padding: 14px; font-size: 16px; margin-top: 4px; }
.login-foot { color: var(--muted); font-size: 12px; font-weight: 600; text-align: center; margin-top: 16px; line-height: 1.5; }

/* ───────── Útskráningarhnappur ───────── */
.logout-btn { margin-left: auto; font-size: 11px; font-weight: 800; color: var(--muted); padding: 6px 10px; border-radius: 99px; border: 1px solid var(--line); }
.logout-btn:hover { color: var(--text); border-color: var(--line); background: var(--surface); }

/* ───────── Stjórnun ───────── */
.adm-list { display: flex; flex-direction: column; gap: 10px; }
.adm-match {
  display: grid; grid-template-columns: 150px 1fr auto; align-items: center; gap: 14px;
  padding: 12px 16px; border-radius: var(--r); border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
}
.adm-match.status-live { border-color: color-mix(in srgb, var(--live) 50%, var(--line)); }
.adm-match.status-finished { opacity: .82; }
.adm-when { font-size: 12px; font-weight: 700; color: var(--text-dim); }
.adm-grp { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 99px; background: var(--surface-2); color: var(--accent); font-size: 11px; font-weight: 800; }
.adm-teams { display: flex; align-items: center; gap: 10px; justify-content: center; }
.adm-team { font-size: 14px; font-weight: 700; min-width: 64px; }
.adm-team.right { text-align: right; }
.adm-score { width: 48px; padding: 8px; text-align: center; font-family: var(--font-display); font-size: 20px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); color: var(--text); }
.adm-score:disabled { opacity: .4; }
.adm-colon { font-weight: 800; color: var(--muted); }
.adm-controls { display: flex; align-items: center; gap: 8px; }
.adm-sel, .adm-min, .adm-input { padding: 9px 11px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); color: var(--text); font-size: 13px; font-weight: 600; }
.adm-min { width: 64px; }
.adm-save { padding: 9px 16px; }
.adm-save.ok { background: var(--accent); }
.adm-addrow { display: flex; gap: 8px; flex-wrap: wrap; }
.adm-addrow .adm-input { flex: 1; min-width: 140px; }
.adm-prow { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--line-soft); }
.adm-prow:last-child { border-bottom: none; }
.adm-prow .nm { font-weight: 700; font-size: 14px; display: flex; align-items: center; }
.adm-prow .sub { font-size: 12px; color: var(--muted); font-weight: 600; margin-top: 2px; }
.adm-del { font-size: 12px; padding: 7px 12px; color: var(--muted); }
.adm-del:hover { color: var(--live); }
@media (max-width: 720px) {
  .adm-match { grid-template-columns: 1fr; gap: 10px; }
  .adm-controls { justify-content: space-between; }
}

/* ───────── Leiðbeiningar / Hvernig virkar þetta ───────── */
.help-step { display: flex; gap: 14px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.help-step:last-child { border-bottom: none; }
.help-num {
  flex: none; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; font-family: var(--font-display); font-size: 16px;
  background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent);
}
.help-st { font-weight: 800; font-size: 15px; margin-bottom: 2px; }
.help-sd { font-size: 14px; color: var(--text-dim); font-weight: 500; line-height: 1.5; }
.help-sd strong { color: var(--text); font-weight: 700; }
