/* Innovate for Humanity: stil hämtad från eventets Luma-cover (marinblå + rosa tangenter på rutnät) */
:root {
  --navy: #0d1a3c;
  --navy-2: #12224d;
  --navy-3: #1a2d60;
  --grid: rgba(64, 120, 200, 0.16);
  --pink: #ff5fc8;
  --pink-2: #ff8fdc;
  --pink-deep: #d43aa2;
  --text: #f4f6ff;
  --muted: #a9b4d6;
  --ok: #4fe3a3;
  --font-head: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--text);
  background-color: var(--navy);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 56px 56px;
  line-height: 1.5;
}
a { color: var(--pink-2); }
button { font-family: inherit; }
h1, h2, h3 { font-family: var(--font-head); letter-spacing: -0.01em; margin: 0; }
.wrap { max-width: 720px; margin: 0 auto; padding: 0 16px; }

/* ---- Loggor ---- */
.logos { display: flex; align-items: center; justify-content: center; gap: 22px; flex-wrap: wrap; }
.logos img { height: 34px; width: auto; opacity: 0.95; }
.logos img.ih { height: 44px; }
.logos img.mlops { height: 40px; }
.logos-sm img { height: 22px; }
.logos-sm img.ih { height: 28px; }
.logos-sm img.mlops { height: 26px; }

/* ---- Startsida / inloggning ---- */
.hero { padding: 40px 0 24px; text-align: center; }
.kicker { font-family: var(--font-head); text-transform: uppercase; letter-spacing: 0.18em; font-size: 12px; color: var(--pink); margin: 28px 0 10px; }
.hero h1 { font-size: clamp(34px, 8vw, 56px); line-height: 1.02; font-weight: 700; }
.hero h1 span { color: var(--pink); }
.hero .sub { color: var(--muted); font-size: 15px; margin: 14px 0 0; }
.card {
  background: linear-gradient(180deg, var(--navy-2), var(--navy-3));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}
.login-card { margin: 26px auto 0; max-width: 460px; text-align: left; }
.login-card p { margin: 0 0 16px; color: var(--muted); font-size: 15px; }
.login-card p strong { color: var(--text); }
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
input[type=email], input[type=password], input[type=text] {
  width: 100%; padding: 14px 16px; font-size: 17px; border-radius: 12px; color: var(--text);
  background: rgba(0, 0, 0, 0.25); border: 1px solid rgba(255, 255, 255, 0.14); outline: none;
}
input:focus { border-color: var(--pink); box-shadow: 0 0 0 3px rgba(255, 95, 200, 0.25); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 22px; border-radius: 12px; border: 0; cursor: pointer;
  font-family: var(--font-head); font-weight: 700; font-size: 16px; color: #1a0a17;
  background: linear-gradient(180deg, var(--pink-2), var(--pink)); box-shadow: 0 8px 24px rgba(255, 95, 200, 0.35);
}
.btn:hover { filter: brightness(1.05); }
.btn:disabled { opacity: 0.6; cursor: default; }
.btn.block { width: 100%; margin-top: 14px; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid rgba(255, 255, 255, 0.2); box-shadow: none; }
.btn.small { padding: 8px 14px; font-size: 14px; }
.error { color: #ff9cb4; font-size: 14px; margin-top: 10px; min-height: 1em; }
.fine { color: var(--muted); font-size: 12px; margin-top: 14px; }

/* ---- Röstningsvy ---- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: rgba(13, 26, 60, 0.9); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 10px; padding-bottom: 10px; }
.topbar .title { font-family: var(--font-head); font-weight: 700; font-size: 15px; }
.topbar .title small { display: block; font-family: var(--font-body); font-weight: 400; color: var(--muted); font-size: 12px; }
.progress { text-align: right; font-size: 13px; color: var(--muted); }
.progress b { color: var(--pink); font-family: var(--font-head); font-size: 18px; }
.progress .bar { height: 4px; width: 120px; background: rgba(255, 255, 255, 0.12); border-radius: 2px; margin-top: 4px; margin-left: auto; overflow: hidden; }
.progress .bar i { display: block; height: 100%; width: 0; background: var(--pink); transition: width 0.3s; }

.jump { display: flex; gap: 6px; overflow-x: auto; padding: 12px 0 4px; scrollbar-width: none; }
.jump::-webkit-scrollbar { display: none; }
.jump a {
  flex: 0 0 auto; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  font-family: var(--font-head); font-weight: 700; font-size: 14px; text-decoration: none; color: var(--muted);
  background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.08);
}
.jump a.done { color: #1a0a17; background: var(--pink); border-color: var(--pink); }
.jump a.partial { color: var(--pink-2); border-color: var(--pink); }

.howto { margin: 14px 0 6px; font-size: 14px; color: var(--muted); }
.howto summary { cursor: pointer; color: var(--text); font-family: var(--font-head); font-weight: 600; }
.howto ul { padding-left: 18px; margin: 8px 0 0; }
.howto li b { color: var(--text); }
.howto .scale { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.howto .scale span { background: rgba(255, 255, 255, 0.06); border-radius: 8px; padding: 3px 8px; font-size: 12px; }

.banner { margin: 14px 0; padding: 14px 16px; border-radius: 12px; background: rgba(255, 95, 200, 0.14); border: 1px solid rgba(255, 95, 200, 0.4); font-size: 14px; }

.entry { margin: 14px 0; padding: 18px; scroll-margin-top: 90px; }
.entry header { display: flex; gap: 12px; align-items: flex-start; }
.entry .num {
  flex: 0 0 auto; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  font-family: var(--font-head); font-weight: 700; font-size: 18px; color: #1a0a17;
  background: linear-gradient(180deg, var(--pink-2), var(--pink)); box-shadow: 0 6px 18px rgba(255, 95, 200, 0.35);
}
.entry .sdg { font-size: 11px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--pink-2); }
.entry h3 { font-size: 19px; line-height: 1.2; margin-top: 2px; }
.entry .q { color: var(--muted); font-size: 13px; margin: 4px 0 0; font-style: italic; }
.entry .status { margin-left: auto; font-size: 12px; color: var(--ok); white-space: nowrap; opacity: 0; transition: opacity 0.2s; }
.entry .status.show { opacity: 1; }
.crit { margin-top: 14px; }
.crit .lbl { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; font-family: var(--font-head); font-weight: 600; }
.crit .lbl small { font-family: var(--font-body); font-weight: 400; color: var(--muted); font-size: 12px; }
.pills { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: 6px; }
.pill {
  padding: 9px 0 7px; border-radius: 10px; cursor: pointer; text-align: center; line-height: 1.1;
  background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.1); color: var(--text);
  transition: transform 0.08s, background 0.15s;
}
.pill b { display: block; font-family: var(--font-head); font-size: 17px; }
.pill small { display: block; font-size: 10px; color: var(--muted); }
.pill:active { transform: scale(0.96); }
.pill.on { background: var(--pink); border-color: var(--pink); color: #1a0a17; box-shadow: 0 6px 18px rgba(255, 95, 200, 0.35); }
.pill.on small { color: #1a0a17; }
.pill:disabled { cursor: default; opacity: 0.55; }
.pill.on:disabled { opacity: 1; }

footer.foot { text-align: center; padding: 36px 0 44px; color: var(--muted); font-size: 12px; }
footer.foot .logos { margin-bottom: 14px; }
footer.foot button { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font-size: 12px; }

.hidden { display: none !important; }

/* ---- Admin ---- */
.admin .wrap { max-width: 1100px; }
.admin .topbar .wrap { max-width: 1100px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 16px 0; }
.stat { padding: 16px; }
.stat .v { font-family: var(--font-head); font-size: 32px; font-weight: 700; line-height: 1; }
.stat .k { color: var(--muted); font-size: 12px; margin-top: 6px; text-transform: uppercase; letter-spacing: 0.1em; }
.stat.open .v { color: var(--ok); }
.stat.closed .v { color: #ff9cb4; }
.section { margin: 26px 0 10px; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.section h2 { font-size: 22px; }
.section p { margin: 0; color: var(--muted); font-size: 13px; }
.winners { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.winner { padding: 18px; position: relative; overflow: hidden; }
.winner .cat { font-family: var(--font-head); text-transform: uppercase; letter-spacing: 0.14em; font-size: 11px; color: var(--pink); }
.winner .name { font-family: var(--font-head); font-weight: 700; font-size: 20px; line-height: 1.15; margin: 8px 0 2px; padding-right: 84px; }
.winner .meta { color: var(--muted); font-size: 12px; }
.winner .score { position: absolute; right: 16px; top: 14px; font-family: var(--font-head); font-size: 28px; font-weight: 700; color: var(--pink-2); }
.winner ol { margin: 12px 0 0; padding-left: 18px; color: var(--muted); font-size: 13px; }
.winner ol li span { color: var(--text); }
.winner.overall { grid-column: 1 / -1; background: linear-gradient(135deg, #3a1250, var(--navy-2)); border-color: rgba(255, 95, 200, 0.5); }
.winner.overall .name { font-size: 28px; }
.winner.overall .score { font-size: 40px; }
.winner.overall .name { padding-right: 150px; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 8px 10px; text-align: left; border-bottom: 1px solid rgba(255, 255, 255, 0.08); vertical-align: top; }
th { font-family: var(--font-head); font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); font-weight: 600; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; }
tr.top td { color: var(--pink-2); }
.tablewrap { overflow-x: auto; padding: 4px 0; }
.tablewrap.card { padding: 8px 12px; }
td input[type=text] { padding: 8px 10px; font-size: 14px; }
.muted { color: var(--muted); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn.danger { background: transparent; color: #ff9cb4; border: 1px solid rgba(255, 156, 180, 0.5); box-shadow: none; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ok); color: #05261a; padding: 10px 16px; border-radius: 10px; font-weight: 600; font-size: 14px; opacity: 0; transition: opacity 0.2s; pointer-events: none; }
.toast.show { opacity: 1; }
.matrix td.c { text-align: center; font-variant-numeric: tabular-nums; white-space: nowrap; }
.matrix td.c small { color: var(--muted); }

/* Presentationsläge (projektor): bara vinnarna, stort */
body.present .topbar, body.present .stats, body.present .admin-rest { display: none; }
body.present .wrap { max-width: 1300px; }
body.present .present-head { display: block; }
.present-head { display: none; text-align: center; padding: 40px 0 10px; }
.present-head h1 { font-size: 52px; }
.present-head h1 span { color: var(--pink); }
body.present .winner .name { font-size: 30px; }
body.present .winner.overall .name { font-size: 46px; }
body.present .winners { gap: 18px; }
body.present .exit-present { position: fixed; right: 16px; top: 16px; }
.exit-present { display: none; }
body.present .exit-present { display: inline-flex; }

@media (max-width: 520px) {
  .logos { gap: 14px; }
  .logos img { height: 26px; }
  .logos img.ih { height: 34px; }
  .logos img.mlops { height: 30px; }
  .progress .bar { width: 90px; }
  .entry { padding: 14px; }
  .pill small { font-size: 9px; }
  .pill b { font-size: 16px; }
}

/* Flyttat från inline-style (CSP tillåter inte style-attribut) */
.mt10 { margin-top: 10px; }
.mt12 { margin-top: 12px; }
.code-form { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; align-items: center; }
.code-form input[type=text] { width: 90px; padding: 8px 10px; font-size: 14px; }
tr.burst td { color: #ff9cb4; }
