/* Gullskórinn – stigatafla fyrir skjávarpa.
   Ein hugmynd: völlur að kvöldi, kóbaltblár grasflötur, gull aðeins á leiðtogann. */

:root {
  --bg: #1747A6;
  --bg-djupt: #0F2F75;
  --braut: rgba(255, 255, 255, 0.13);
  --ljos: #F6F3EA;
  --daufur: #A9BFEA;
  --gull: #F5B301;
  --gull-djupt: #B8840A;
  --leturs: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  --leturs-thett: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", system-ui, sans-serif;
  --rod: clamp(15px, 3.3vh, 46px);   /* grunnstærð einnar raðar */
}

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ljos);
  font-family: var(--leturs);
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: clamp(12px, 2.5vh, 32px) clamp(16px, 3.5vw, 56px);
  gap: clamp(8px, 1.5vh, 20px);
  -webkit-font-smoothing: antialiased;
}

/* ---- Haus ---- */
.topp {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  border-bottom: 3px solid var(--ljos);
  padding-bottom: clamp(8px, 1.4vh, 18px);
}
.merki { display: flex; align-items: center; gap: 0.35em; font-family: var(--leturs-thett); }
.merki .skor { width: 1.6em; height: auto; fill: var(--gull); font-size: clamp(28px, 5.2vh, 72px); }
.merki h1 {
  margin: 0;
  font-size: clamp(30px, 5.6vh, 76px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.01em;
}
.merki .skoli {
  align-self: flex-end;
  margin-left: 0.4em;
  margin-bottom: 0.18em;
  font-size: clamp(14px, 2.2vh, 28px);
  font-weight: 500;
  color: var(--daufur);
}
.dagur { display: flex; flex-direction: column; align-items: flex-end; gap: 0.35em; }
.dagur-texti {
  font-family: var(--leturs-thett);
  font-weight: 700;
  font-size: clamp(18px, 3.2vh, 40px);
  line-height: 1;
}
.braut { list-style: none; margin: 0; padding: 0; display: flex; gap: 0.35em; }
.braut li {
  width: clamp(14px, 2.4vh, 30px);
  height: clamp(6px, 1vh, 12px);
  background: var(--braut);
  border-radius: 2px;
}
.braut li.buinn { background: var(--ljos); }

/* ---- Raðir ---- */
.tafla { min-height: 0; }
.radir {
  list-style: none;
  margin: 0;
  padding: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: clamp(3px, 0.7vh, 8px);
}
.rod {
  flex: 1 1 0;
  min-height: 0;
  position: relative;
  display: grid;
  grid-template-columns: 1.6em 5.1em minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 0.55em;
  font-size: var(--rod);
  font-family: var(--leturs-thett);
  line-height: 1;
}
.saeti {
  font-weight: 800;
  font-size: 1.15em;
  color: var(--daufur);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.bekkur { font-weight: 700; font-size: 1.05em; white-space: nowrap; }

.bar {
  position: relative;
  height: 62%;
  min-height: 10px;
  background: var(--braut);
  border-radius: 3px;
  overflow: visible;
}
.fylling {
  display: block;
  height: 100%;
  width: 0;
  background: var(--ljos);
  border-radius: 3px;
  transition: width 1.4s cubic-bezier(0.22, 1, 0.36, 1);
}
body.inn .fylling { width: calc(var(--share, 0) * 100%); }
.bar .skor {
  position: absolute;
  right: 0.35em;
  top: 50%;
  height: 1.35em;
  width: auto;
  transform: translateY(-50%);
  fill: var(--bg-djupt);
}
.skor .reim { stroke: var(--bg); }
.bar .skor .reim { stroke: var(--gull); }

.tolur {
  display: grid;
  grid-template-columns: 3.6em 4.6em;
  align-items: center;
  column-gap: 0.45em;
  white-space: nowrap;
}
.stig {
  font-weight: 800;
  font-size: 1.2em;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.stig small { font-size: 0.55em; font-weight: 700; margin-left: 0.12em; }
.dagar {
  display: flex;
  flex-direction: column;
  gap: 0.12em;
  font-family: var(--leturs);
  font-size: 0.46em;
  color: var(--daufur);
  line-height: 1.2;
}
.dagar b { color: var(--ljos); font-weight: 600; }
.dagar i { font-style: normal; opacity: 0.7; }

/* Leiðtoginn: eina gullið á skjánum */
.leidtogi .saeti, .leidtogi .stig { color: var(--gull); }
.leidtogi .fylling { background: var(--gull); }

/* Sigur dagsins: gul pilla í stað "í dag" */
.pilla {
  display: inline-block;
  color: var(--bg-djupt);
  background: var(--gull);
  padding: 0.18em 0.5em;
  border-radius: 3px;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
}
.pilla b { color: inherit; font-weight: 800; }

/* ---- Botn ---- */
.botn {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  color: var(--daufur);
  font-size: clamp(12px, 1.9vh, 22px);
}
.botn p { margin: 0; }
.urslit {
  color: var(--gull);
  font-family: var(--leturs-thett);
  font-weight: 800;
  font-size: clamp(22px, 4.2vh, 56px);
}
.skra-hlekkur { color: inherit; opacity: 0.55; text-decoration: none; }
.skra-hlekkur:hover, .skra-hlekkur:focus-visible { opacity: 1; text-decoration: underline; }

/* ---- Keppni lokið: leiðtoginn fær allan skjáinn ---- */
.fasi-after .leidtogi .bekkur { color: var(--gull); }

/* ---- Farsími ---- */
@media (max-width: 640px) {
  body { padding: 12px 14px; }
  .rod { grid-template-columns: 1.4em 4.6em minmax(0, 1fr) auto; column-gap: 0.4em; }
  .dagar { display: none; }
  .tolur { grid-template-columns: auto; }
}

:focus-visible { outline: 3px solid var(--gull); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  .fylling { transition: none; }
}

/* ---- Hver vann í gær? ---- */
.botn-adgerdir { display: flex; align-items: center; gap: 1.2em; }
.igaer-takki {
  font: inherit;
  font-family: var(--leturs-thett);
  font-weight: 700;
  font-size: clamp(14px, 2.2vh, 26px);
  color: var(--ljos);
  background: transparent;
  border: 2px solid var(--ljos);
  border-radius: 4px;
  padding: 0.25em 0.8em;
  cursor: pointer;
}
.igaer-takki:hover, .igaer-takki:focus-visible { background: var(--ljos); color: var(--bg-djupt); }

.sigur {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: none;
  width: min(92vw, 1100px);
  color: var(--bg-djupt);
}
.sigur::backdrop { background: rgba(15, 47, 117, 0.88); }
.sigur-innihald {
  background: var(--gull);
  border-radius: 8px;
  padding: clamp(24px, 6vh, 64px) clamp(20px, 5vw, 72px);
  text-align: center;
  font-family: var(--leturs-thett);
}
.sigur-dagur {
  margin: 0 0 0.5em;
  font-family: var(--leturs);
  font-weight: 600;
  font-size: clamp(14px, 2.4vh, 26px);
}
.sigur .skor { width: clamp(90px, 20vh, 220px); height: auto; fill: var(--bg-djupt); }
.sigur .skor .reim { stroke: var(--gull); }
.sigur h2 {
  margin: 0.1em 0;
  font-size: clamp(48px, 13vh, 150px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.01em;
}
.sigur-hlutfall {
  margin: 0.2em 0 0;
  font-size: clamp(20px, 4vh, 44px);
  font-weight: 500;
}
.sigur-hlutfall b { font-weight: 800; }
.sigur-naestir {
  margin: 1.2em auto 0;
  padding: 0;
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 2em;
  font-size: clamp(16px, 2.8vh, 30px);
  font-weight: 500;
  opacity: 0.8;
}
.sigur-naestir li::before { content: counter(list-item) ". "; }
.sigur-naestir li { counter-increment: list-item; }
.sigur-loka {
  margin-top: 1.6em;
  font: inherit;
  font-weight: 700;
  font-size: clamp(14px, 2.2vh, 24px);
  color: var(--gull);
  background: var(--bg-djupt);
  border: 0;
  border-radius: 4px;
  padding: 0.4em 1.4em;
  cursor: pointer;
}
.sigur[open] .skor { animation: skor-inn 0.7s cubic-bezier(0.22, 1, 0.36, 1) both; }
.sigur[open] h2 { animation: skor-inn 0.7s 0.15s cubic-bezier(0.22, 1, 0.36, 1) both; }
@keyframes skor-inn {
  from { transform: translateY(0.4em) scale(0.6); opacity: 0; }
  to   { transform: none; opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .sigur[open] .skor, .sigur[open] h2 { animation: none; }
}
