:root {
  --bg: #080b14;
  --bg-2: #0e1422;
  --card: rgba(255, 255, 255, .055);
  --card-2: rgba(255, 255, 255, .09);
  --line: rgba(255, 255, 255, .1);
  --text: #eef2ff;
  --muted: #8d99b8;
  --accent: #7c5cff;
  --accent-2: #22d3ee;
  --gold: #fbbf24;
  --good: #34d399;
  --bad: #fb7185;
  --radius: 20px;
  --shadow: 0 18px 40px -22px rgba(0, 0, 0, .9);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, system-ui, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { margin: 0; padding: 0; }

body {
  background:
    radial-gradient(1000px 540px at 12% -10%, rgba(124, 92, 255, .3), transparent 60%),
    radial-gradient(760px 480px at 92% 4%, rgba(34, 211, 238, .18), transparent 62%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 620px; margin: 0 auto; padding: 18px 16px 120px; }

h1, h2, h3 { margin: 0; line-height: 1.15; letter-spacing: -.02em; }

button { font-family: inherit; cursor: pointer; border: 0; color: inherit; }

.hidden { display: none !important; }

/* ------------------------------------------------------------ topbar */
.topbar { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.brand { flex: 1; min-width: 0; }
.brand .kicker {
  font-size: 11px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--muted); font-weight: 700;
}
.brand h1 { font-size: 23px; font-weight: 800; }
.brand h1 span {
  background: linear-gradient(100deg, var(--accent-2), var(--accent));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.me-chip {
  display: flex; align-items: center; gap: 9px; padding: 7px 13px 7px 8px;
  background: var(--card); border: 1px solid var(--line); border-radius: 999px;
  font-size: 14px; font-weight: 650;
}
.me-chip .av { width: 28px; height: 28px; font-size: 16px; }

.av {
  display: grid; place-items: center; width: 42px; height: 42px; flex: none;
  border-radius: 50%; font-size: 22px; line-height: 1;
  background: var(--card-2); border: 2px solid var(--line);
}

/* -------------------------------------------------------- scoreboard */
.board {
  background: linear-gradient(170deg, rgba(255, 255, 255, .085), rgba(255, 255, 255, .03));
  border: 1px solid var(--line); border-radius: 24px; padding: 14px;
  box-shadow: var(--shadow); margin-bottom: 20px;
}
.board-head {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 2px 4px 12px;
}
.board-head h2 { font-size: 14px; letter-spacing: .14em; text-transform: uppercase; }
.board-head .hint { font-size: 11.5px; color: var(--muted); }

.periods {
  display: flex; flex-wrap: wrap; gap: 5px; padding: 0 2px 12px;
}
.periods button {
  flex: none; padding: 7px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 700;
  color: var(--muted); background: rgba(255, 255, 255, .05);
  border: 1px solid transparent; white-space: nowrap; transition: .15s;
}
.periods button.on {
  color: var(--text); background: rgba(124, 92, 255, .22); border-color: rgba(124, 92, 255, .5);
}
.periods button[data-period="total"] {
  margin-left: auto; color: var(--gold); background: rgba(251, 191, 36, .1);
}
.periods button[data-period="total"].on {
  background: rgba(251, 191, 36, .22); border-color: rgba(251, 191, 36, .5);
}

.crown {
  margin: 0 2px 10px; padding: 10px 13px; border-radius: 13px; font-size: 12.5px;
  font-weight: 650; color: #ffe6ab; background: rgba(251, 191, 36, .12);
  border: 1px solid rgba(251, 191, 36, .28);
}
.crown.quiet {
  color: var(--muted); background: rgba(255, 255, 255, .04); border-color: var(--line);
  font-weight: 600;
}

.resets {
  text-align: center; font-size: 11px; color: var(--muted); padding: 12px 0 2px;
  letter-spacing: .03em;
}

.row {
  display: flex; align-items: center; gap: 12px; padding: 11px 10px;
  border-radius: 16px; position: relative; overflow: hidden;
}
.row + .row { margin-top: 4px; }
.row::before {
  content: ""; position: absolute; inset: 0; border-radius: 16px;
  background: var(--member-color); opacity: .09;
}
.row.is-me::before { opacity: .2; }
.row > * { position: relative; }

.rank { width: 26px; text-align: center; font-size: 17px; font-weight: 800; color: var(--muted); }
.rank.medal { font-size: 20px; }

.who { flex: 1; min-width: 0; }
.who .nm {
  font-weight: 750; font-size: 15.5px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.who .sub { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.bar { height: 4px; border-radius: 999px; background: rgba(255, 255, 255, .1); margin-top: 6px; }
.bar i {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
}

.pts { text-align: right; font-variant-numeric: tabular-nums; }
.pts b { display: block; font-size: 23px; font-weight: 850; letter-spacing: -.03em; }
.pts small { font-size: 10.5px; color: var(--muted); letter-spacing: .04em; }
.pts.neg b { color: var(--bad); }

/* --------------------------------------------------------------- tabs */
.tabs {
  display: flex; gap: 6px; background: var(--card); border: 1px solid var(--line);
  padding: 5px; border-radius: 16px; margin-bottom: 18px;
}
.tabs button {
  flex: 1; background: transparent; padding: 10px 6px; border-radius: 12px;
  font-size: 13.5px; font-weight: 700; color: var(--muted); transition: .18s;
}
.tabs button.on { background: var(--card-2); color: var(--text); box-shadow: var(--shadow); }
.tabs .pip {
  display: inline-grid; place-items: center; min-width: 19px; height: 19px; padding: 0 5px;
  margin-left: 5px; border-radius: 999px; background: var(--accent);
  color: #fff; font-size: 11px; font-weight: 800; vertical-align: 1px;
}

.sec-title {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); font-weight: 750; margin: 24px 4px 10px;
}
.sec-title:first-child { margin-top: 4px; }

/* -------------------------------------------------------------- quests */
.quest {
  display: flex; align-items: center; gap: 13px; width: 100%; text-align: left;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 13px 14px; transition: .15s;
}
.quest + .quest { margin-top: 8px; }
.quest:active { transform: scale(.985); background: var(--card-2); }
.quest .ic {
  display: grid; place-items: center; width: 44px; height: 44px; flex: none;
  border-radius: 14px; background: rgba(255, 255, 255, .06); font-size: 22px;
}
.quest .tx { flex: 1; min-width: 0; }
.quest .tx b { display: block; font-size: 15px; font-weight: 650; }
.quest .tx small { font-size: 11.5px; color: var(--muted); }

.pill {
  flex: none; padding: 6px 11px; border-radius: 999px; font-size: 14px; font-weight: 800;
  font-variant-numeric: tabular-nums;
  background: rgba(251, 191, 36, .16); color: var(--gold); border: 1px solid rgba(251, 191, 36, .3);
}
.pill.minus {
  background: rgba(251, 113, 133, .14); color: var(--bad);
  border-color: rgba(251, 113, 133, .3);
}

/* ---------------------------------------------------------- afstemning */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden;
}
.card + .card { margin-top: 10px; }
.card .top { display: flex; align-items: center; gap: 11px; padding: 13px 14px; }
.card .top .tx { flex: 1; min-width: 0; }
.card .top .tx b { font-size: 14.5px; font-weight: 700; }
.card .top .tx div { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.card .shot {
  display: block; width: 100%; max-height: 300px; object-fit: cover;
  background: #000; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.card .note {
  padding: 10px 14px 0; font-size: 13px; color: #c3ccea; font-style: italic;
}
.card .foot { padding: 12px 14px; }

.tally {
  display: flex; align-items: center; gap: 8px; font-size: 11.5px;
  color: var(--muted); margin-bottom: 11px; font-weight: 600;
}
.dots { display: flex; gap: 4px; }
.dots i {
  width: 9px; height: 9px; border-radius: 50%; background: rgba(255, 255, 255, .15);
}
.dots i.y { background: var(--good); }
.dots i.n { background: var(--bad); }

.vote { display: flex; gap: 8px; }
.vote button {
  flex: 1; padding: 12px; border-radius: 14px; font-size: 14px; font-weight: 750;
  background: var(--card-2); border: 1px solid var(--line); transition: .15s;
}
.vote button:active { transform: scale(.97); }
.vote button.yes { color: var(--good); border-color: rgba(52, 211, 153, .35); }
.vote button.yes.picked { background: rgba(52, 211, 153, .2); }
.vote button.no { color: var(--bad); border-color: rgba(251, 113, 133, .35); }
.vote button.no.picked { background: rgba(251, 113, 133, .2); }

/* --------------------------------------------------------- indsigelser */
.card.disputed {
  border-color: rgba(251, 191, 36, .4);
  background: linear-gradient(180deg, rgba(251, 191, 36, .08), var(--card) 140px);
}
.card .top .scale { font-size: 24px; flex: none; }

.versus { display: flex; align-items: stretch; gap: 10px; padding: 0 14px 14px; }
.versus .side {
  flex: 1; min-width: 0; padding: 11px 12px; border-radius: 14px;
  background: rgba(255, 255, 255, .05); border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 6px; align-items: flex-start;
}
.versus .side.alt { border-color: rgba(251, 191, 36, .4); background: rgba(251, 191, 36, .09); }
.versus .side .lbl {
  font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); font-weight: 750;
}
.versus .side b { font-size: 13.5px; font-weight: 650; line-height: 1.3; }
.versus .side .pill { font-size: 12.5px; padding: 3px 9px; }
.versus .vs {
  display: grid; place-items: center; font-size: 11px; color: var(--muted);
  font-weight: 750; text-transform: uppercase; letter-spacing: .08em;
}

.objection {
  display: block; width: 100%; margin-top: 9px; padding: 11px;
  border-radius: 13px; font-size: 13px; font-weight: 650; color: var(--gold);
  background: rgba(251, 191, 36, .1); border: 1px solid rgba(251, 191, 36, .28);
}
.objection:active { background: rgba(251, 191, 36, .2); }

.replay {
  margin: 0 14px 12px; padding: 10px 12px; border-radius: 12px; font-size: 12.5px;
  color: #ffe6ab; background: rgba(251, 191, 36, .1);
  border: 1px solid rgba(251, 191, 36, .25);
}

.smallprint {
  margin-top: 10px; text-align: center; font-size: 11.5px; color: var(--muted); line-height: 1.5;
}

.claimbox {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 14px; margin-bottom: 16px; border-radius: 14px;
  background: rgba(255, 255, 255, .04); border: 1px solid var(--line);
}
.claimbox .lbl {
  font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); font-weight: 750; width: 100%;
}
.claimbox b { flex: 1; min-width: 0; font-size: 14px; font-weight: 650; }

.btn.warn {
  background: linear-gradient(100deg, #d97706, var(--gold)); color: #231703;
  box-shadow: 0 12px 28px -14px var(--gold);
}

/* ------------------------------------------------------- omrokering (admin) */
.order { display: inline-flex; flex-direction: column; gap: 2px; vertical-align: middle; }
.order button {
  width: 26px; height: 17px; padding: 0; line-height: 1; font-size: 10px;
  border-radius: 6px; background: var(--card-2); border: 1px solid var(--line);
  color: var(--muted);
}
.order button:hover:not([disabled]) { color: var(--text); border-color: var(--accent); }
.order button[disabled] { opacity: .25; cursor: default; }

.badge {
  display: inline-block; padding: 4px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 750;
}
.badge.ok { background: rgba(52, 211, 153, .16); color: var(--good); }
.badge.no { background: rgba(251, 113, 133, .16); color: var(--bad); }
.badge.dis { background: rgba(251, 191, 36, .16); color: var(--gold); }
.badge.wait { background: rgba(255, 255, 255, .1); color: var(--muted); }

/* ---------------------------------------------------------------- feed */
.feed-row {
  display: flex; align-items: center; gap: 11px; padding: 11px 13px;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
}
.feed-row + .feed-row { margin-top: 7px; }
.feed-row .ic { font-size: 20px; width: 26px; text-align: center; flex: none; }
.feed-row .tx { flex: 1; min-width: 0; font-size: 13.5px; }
.feed-row .tx small { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.feed-row .dp { font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; }
.feed-row .dp.p { color: var(--gold); }
.feed-row .dp.m { color: var(--bad); }
.feed-row.dim { opacity: .5; }

.empty {
  text-align: center; padding: 40px 20px; color: var(--muted); font-size: 14px;
  background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius);
}
.empty .big { font-size: 34px; display: block; margin-bottom: 10px; }

/* --------------------------------------------------------------- sheet */
.sheet-bg {
  position: fixed; inset: 0; background: rgba(4, 6, 12, .72); z-index: 50;
  display: flex; align-items: flex-end; justify-content: center;
  backdrop-filter: blur(6px); animation: fade .2s;
}
.sheet {
  width: 100%; max-width: 620px; max-height: 92vh; overflow-y: auto;
  background: linear-gradient(180deg, var(--bg-2), #0a0e18);
  border: 1px solid var(--line); border-bottom: 0;
  border-radius: 26px 26px 0 0; padding: 8px 18px calc(22px + env(safe-area-inset-bottom));
  animation: up .26s cubic-bezier(.2, .9, .3, 1);
}
.grip {
  width: 40px; height: 4px; border-radius: 999px; background: var(--line);
  margin: 6px auto 16px;
}
@keyframes fade { from { opacity: 0 } }
@keyframes up { from { transform: translateY(100%) } }

.sheet-head { display: flex; align-items: center; gap: 13px; margin-bottom: 18px; }
.sheet-head .ic {
  display: grid; place-items: center; width: 50px; height: 50px; flex: none;
  border-radius: 16px; background: var(--card-2); font-size: 26px;
}
.sheet-head .tx { flex: 1; }
.sheet-head h3 { font-size: 18px; font-weight: 750; }
.sheet-head p { margin: 4px 0 0; font-size: 12.5px; color: var(--muted); }

label.fld { display: block; margin-bottom: 15px; }
label.fld > span {
  display: block; font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); font-weight: 750; margin-bottom: 7px;
}
input[type=text], input[type=number], input[type=password], textarea, select {
  width: 100%; padding: 12px 14px; font-size: 15px; font-family: inherit;
  background: rgba(255, 255, 255, .05); color: var(--text);
  border: 1px solid var(--line); border-radius: 14px; outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); }
textarea { resize: vertical; min-height: 64px; }
select { appearance: none; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button {
  display: flex; align-items: center; gap: 7px; padding: 9px 13px 9px 9px;
  background: var(--card); border: 1px solid var(--line); border-radius: 999px;
  font-size: 14px; font-weight: 650; transition: .15s;
}
.chips button .av { width: 26px; height: 26px; font-size: 15px; border-width: 1px; }
.chips button.on { border-color: var(--accent); background: rgba(124, 92, 255, .2); }

.stepper { display: flex; align-items: center; gap: 14px; }
.stepper button {
  width: 46px; height: 46px; border-radius: 14px; font-size: 22px; font-weight: 700;
  background: var(--card-2); border: 1px solid var(--line);
}
.stepper .n { font-size: 20px; font-weight: 800; min-width: 48px; text-align: center; }
.stepper .lbl { font-size: 13px; color: var(--muted); }

.shot-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%;
  padding: 26px 16px; border-radius: 18px; font-size: 14.5px; font-weight: 700;
  background: rgba(255, 255, 255, .04); border: 1.5px dashed var(--line); color: var(--muted);
}
.shot-btn.has { padding: 0; border-style: solid; overflow: hidden; display: block; }
.shot-btn img { display: block; width: 100%; max-height: 240px; object-fit: cover; }

.btn {
  display: block; width: 100%; padding: 15px; border-radius: 16px;
  font-size: 15.5px; font-weight: 800; letter-spacing: .01em;
  background: linear-gradient(100deg, var(--accent), #b65cff); color: #fff;
  box-shadow: 0 12px 28px -14px var(--accent); transition: .15s;
}
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .5; box-shadow: none; }
.btn.ghost {
  background: var(--card); border: 1px solid var(--line); color: var(--muted);
  box-shadow: none; font-weight: 650; font-size: 14px; padding: 12px;
}
.btn.danger { background: linear-gradient(100deg, #e11d48, #f43f5e); box-shadow: none; }

.err {
  background: rgba(251, 113, 133, .14); border: 1px solid rgba(251, 113, 133, .3);
  color: #ffc3cd; padding: 11px 14px; border-radius: 14px; font-size: 13.5px;
  margin-bottom: 14px;
}

/* --------------------------------------------------------------- login */
.gate { max-width: 420px; margin: 0 auto; padding: 48px 20px; text-align: center; }
.gate .logo { font-size: 54px; margin-bottom: 14px; }
.gate h1 { font-size: 27px; font-weight: 850; margin-bottom: 8px; }
.gate p { color: var(--muted); font-size: 14px; margin: 0 0 30px; }
.gate .people { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.gate .person {
  width: 92px; padding: 16px 8px; border-radius: 20px; background: var(--card);
  border: 1px solid var(--line); transition: .15s;
}
.gate .person:active { transform: scale(.96); }
.gate .person .av { margin: 0 auto 9px; width: 50px; height: 50px; font-size: 27px; }
.gate .person b { font-size: 13px; font-weight: 650; }

.pinbox { display: flex; gap: 9px; justify-content: center; margin: 4px 0 20px; }
.pinbox i {
  width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line);
}
.pinbox i.on { background: var(--accent); border-color: var(--accent); }
.keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.keys button {
  padding: 17px 0; border-radius: 16px; font-size: 22px; font-weight: 700;
  background: var(--card); border: 1px solid var(--line);
}
.keys button:active { background: var(--card-2); }
.keys button.sm { font-size: 14px; font-weight: 650; color: var(--muted); }

/* ----------------------------------------------------------------- fab */
.fab {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(22px + env(safe-area-inset-bottom)); z-index: 30;
  display: flex; align-items: center; gap: 9px; padding: 14px 24px;
  border-radius: 999px; font-size: 15px; font-weight: 800;
  background: linear-gradient(100deg, #f43f5e, #fb7185); color: #fff;
  box-shadow: 0 16px 34px -14px #f43f5e;
}
.fab:active { transform: translateX(-50%) scale(.97); }

/* -------------------------------------------------------------- toast */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%);
  top: calc(16px + env(safe-area-inset-top)); z-index: 90;
  max-width: 420px; width: calc(100% - 32px);
  padding: 13px 17px; border-radius: 16px; font-size: 14px; font-weight: 650;
  background: rgba(16, 22, 38, .96); border: 1px solid var(--line);
  box-shadow: var(--shadow); animation: drop .25s;
}
.toast.good { border-color: rgba(52, 211, 153, .45); }
.toast.bad { border-color: rgba(251, 113, 133, .45); }
@keyframes drop { from { opacity: 0; transform: translate(-50%, -16px) } }

#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 80; }

/* --------------------------------------------------------------- admin */
.admin { max-width: 1060px; }
.admin .panel {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; margin-bottom: 18px;
}
.admin h2 { font-size: 16px; font-weight: 750; margin-bottom: 4px; }
.admin .panel > p { margin: 0 0 16px; font-size: 12.5px; color: var(--muted); }
.admin table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.admin th {
  text-align: left; font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); padding: 0 8px 9px; font-weight: 750;
}
.admin td { padding: 9px 8px; border-top: 1px solid var(--line); vertical-align: middle; }
.admin tr.off { opacity: .45; }
.admin .mini {
  padding: 6px 11px; border-radius: 10px; font-size: 12.5px; font-weight: 650;
  background: var(--card-2); border: 1px solid var(--line);
}
.admin .mini.red { color: var(--bad); border-color: rgba(251, 113, 133, .35); }
.admin .mini.green { color: var(--good); border-color: rgba(52, 211, 153, .35); }
.admin .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.admin .bar-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.admin .notice {
  background: rgba(251, 191, 36, .1); border: 1px solid rgba(251, 191, 36, .3);
  color: #ffe6ab; padding: 13px 16px; border-radius: 14px; font-size: 13.5px;
  margin-bottom: 18px;
}
@media (max-width: 640px) { .admin .grid2 { grid-template-columns: 1fr; } }

.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
