@font-face {
  font-family: 'Fredoka';
  src: url('assets/fonts/fredoka-latin.woff2') format('woff2');
  font-weight: 300 700;
  font-display: swap;
}

:root {
  --blue: #2f64c8;
  --blue-dark: #1f4596;
  --blue-light: #dce9fb;
  --sky: #8ec9ee;
  --teal: #4db398;
  --teal-dark: #2e8a70;
  --teal-light: #dcf2ea;
  --grass: #c3e27c;
  --grass-dark: #6aa84f;
  --sun: #ffcf3f;
  --sun-light: #fff3c6;
  --red: #e5484d;
  --red-light: #fde4e4;
  --orange: #f08a2c;
  --ink: #17223b;
  --ink-soft: #4b5670;
  --line: #d9e0ea;
  --paper: #f4f7fb;
  --card: #ffffff;
  --radius: 20px;
  --shadow: 0 3px 0 rgba(23, 34, 59, .12);
  --nav-h: 76px;
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: 'Fredoka', ui-rounded, 'Segoe UI', system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.4;
  color: var(--ink);
  background: #e8eef6;
  overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--blue); }
h1, h2, h3 { margin: 0; line-height: 1.15; font-weight: 600; }
h1 { font-size: 30px; }
h2 { font-size: 23px; }
h3 { font-size: 19px; }
p { margin: 0; }
.muted { color: var(--ink-soft); }
.small { font-size: 14px; }
.center { text-align: center; }
.hidden { display: none !important; }

#app {
  max-width: 480px;
  margin: 0 auto;
  height: 100dvh;
  background: var(--paper);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}
@media (min-width: 520px) {
  #app { box-shadow: 0 0 0 1px var(--line), 0 20px 60px rgba(23,34,59,.12); }
}

/* ---------- Topbar ---------- */
.topbar {
  display: flex; align-items: center; gap: 10px;
  padding: calc(env(safe-area-inset-top) + 10px) 16px 10px;
  background: var(--blue);
  color: #fff;
  flex-shrink: 0;
}
.topbar .logo { width: 38px; height: 38px; border-radius: 11px; border: 2px solid rgba(255,255,255,.7); }
.topbar .title { font-size: 22px; font-weight: 600; flex: 1; }
.topbar .city { background: rgba(255,255,255,.18); padding: 5px 12px; border-radius: 99px; font-size: 15px; font-weight: 500; }
.demo-chip { background: var(--sun); color: var(--ink); font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 8px; }

.offline-bar { background: var(--ink); color: #fff; text-align: center; font-size: 14px; padding: 6px 12px; }

/* ---------- Views ---------- */
#view { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; position: relative; }
.page { padding: 18px 16px 28px; display: flex; flex-direction: column; gap: 16px; }
.page-head { display: flex; align-items: center; gap: 12px; }
.page-head h1 { font-size: 26px; flex: 1; }
.back {
  width: 44px; height: 44px; border-radius: 14px; border: 0;
  background: var(--card); box-shadow: var(--shadow); display: grid; place-items: center; flex-shrink: 0;
}
.back svg { width: 22px; height: 22px; }

/* ---------- Bundnavigation ---------- */
.nav {
  flex-shrink: 0;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--card);
  border-top: 2px solid var(--line);
  padding: 6px 6px calc(env(safe-area-inset-bottom) + 6px);
  gap: 4px;
}
.nav button {
  border: 0; background: none; border-radius: 16px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 2px; font-size: 13px; font-weight: 500; color: var(--ink-soft);
  min-height: 56px; position: relative;
}
.nav button svg { width: 28px; height: 28px; }
.nav button.active { background: var(--blue-light); color: var(--blue-dark); }
.nav button.kort svg { width: 32px; height: 32px; }
.nav .dot { position: absolute; top: 6px; right: calc(50% - 20px); width: 10px; height: 10px; background: var(--red); border-radius: 50%; border: 2px solid #fff; }

/* ---------- Knapper ---------- */
.btn {
  border: 0; border-radius: 18px; padding: 15px 20px; min-height: 56px;
  font-size: 19px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--blue); color: #fff; box-shadow: 0 4px 0 var(--blue-dark);
  transition: transform .06s, box-shadow .06s; width: 100%; text-decoration: none;
}
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--blue-dark); }
.btn.green { background: var(--teal); box-shadow: 0 4px 0 var(--teal-dark); }
.btn.green:active { box-shadow: 0 1px 0 var(--teal-dark); }
.btn.light { background: var(--card); color: var(--ink); box-shadow: 0 4px 0 var(--line); border: 2px solid var(--line); }
.btn.danger { background: var(--card); color: #b3261e; box-shadow: 0 4px 0 #f1c4c4; border: 2px solid #f1c4c4; }
.btn.sun { background: var(--sun); color: var(--ink); box-shadow: 0 4px 0 #d9a918; }
.btn.small { min-height: 44px; padding: 10px 14px; font-size: 16px; border-radius: 14px; width: auto; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn-row { display: flex; gap: 10px; }
.btn-row > * { flex: 1; }
.linkbtn { border: 0; background: none; color: var(--blue); font-weight: 500; padding: 8px; text-decoration: underline; }

/* ---------- Kort / cards ---------- */
.card { background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); border: 2px solid var(--line); }
.card.tap { cursor: pointer; transition: transform .08s; text-align: left; width: 100%; font: inherit; color: inherit; }
.card.tap:active { transform: scale(.98); }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; align-items: center; gap: 10px; }

.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 500; padding: 3px 9px; border-radius: 99px; background: var(--blue-light); color: var(--blue-dark); white-space: nowrap; }
.tag.test { background: var(--sun-light); color: #7a5800; border: 1px dashed #d9a918; }
.tag.live { background: var(--teal-light); color: var(--teal-dark); }
.tag.grey { background: #eceff4; color: var(--ink-soft); }
.tag.red { background: var(--red-light); color: #b3261e; }
.tag.adult { background: #efe6fb; color: #5b3a99; }

/* Onboarding */
.onb { min-height: 100%; display: flex; flex-direction: column; padding: calc(env(safe-area-inset-top) + 24px) 20px calc(env(safe-area-inset-bottom) + 24px); gap: 18px; background: var(--paper); }
.onb.splash { background: var(--blue); color: #fff; justify-content: center; align-items: center; text-align: center; gap: 22px; position: relative; overflow: hidden; }
.splash .big-icon { width: 170px; height: 170px; border-radius: 40px; border: 5px solid #fff; box-shadow: 0 10px 0 var(--blue-dark); transform: rotate(-4deg); }
.splash h1 { font-size: 48px; }
.splash p { font-size: 20px; opacity: .95; max-width: 300px; }
.splash .btn { background: var(--sun); color: var(--ink); box-shadow: 0 5px 0 #c99a10; max-width: 320px; }
.splash .note { font-size: 14px; opacity: .85; }
.splash .blob { position: absolute; border-radius: 50%; background: var(--sky); opacity: .35; }

.steps { display: flex; gap: 6px; }
.steps span { height: 8px; flex: 1; border-radius: 8px; background: var(--line); }
.steps span.on { background: var(--teal); }
.onb .q { font-size: 30px; }

.choice {
  display: flex; align-items: center; gap: 16px; width: 100%; text-align: left;
  background: var(--card); border: 3px solid var(--line); border-radius: 22px; padding: 16px 18px;
  box-shadow: 0 4px 0 var(--line); min-height: 84px; transition: transform .06s;
}
.choice:active { transform: translateY(2px); }
.choice .emo { font-size: 42px; width: 56px; text-align: center; flex-shrink: 0; }
.choice .t { font-size: 22px; font-weight: 600; display: block; }
.choice .s { font-size: 15px; color: var(--ink-soft); display: block; }
.choice.sel { border-color: var(--teal); box-shadow: 0 4px 0 var(--teal-dark); background: var(--teal-light); }
.choice[disabled] { opacity: .5; }
.choice.login .emo { font-size: 16px; font-weight: 700; width: 72px; height: 48px; border-radius: 12px; display: grid; place-items: center; color: #fff; }
.city-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.city-grid .choice { flex-direction: column; align-items: flex-start; gap: 4px; min-height: 90px; padding: 14px; }
.city-grid .choice.full { grid-column: 1 / -1; }

.mock-box { background: var(--sun-light); border: 2px dashed #d9a918; border-radius: 16px; padding: 12px 14px; font-size: 15px; }

/* Formular */
label.f { display: flex; flex-direction: column; gap: 6px; font-weight: 500; }
.input, select.input, textarea.input {
  border: 2px solid var(--line); border-radius: 14px; padding: 12px 14px; font-size: 18px; background: #fff; min-height: 52px; width: 100%;
}
.input:focus { outline: 3px solid var(--sky); border-color: var(--blue); }
textarea.input { min-height: 90px; resize: vertical; }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: 16px; }
.check input { width: 24px; height: 24px; flex-shrink: 0; accent-color: var(--teal); margin-top: 1px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 2px solid var(--line); background: #fff; border-radius: 99px; padding: 9px 15px; font-size: 16px; font-weight: 500; min-height: 44px;
}
.chip.sel { background: var(--blue); border-color: var(--blue); color: #fff; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 2px 16px 4px; scrollbar-width: none; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chips.scroll .chip { white-space: nowrap; flex-shrink: 0; }
.nowrap { white-space: nowrap; }

.type-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.type-btn {
  border: 3px solid var(--line); background: #fff; border-radius: 20px; padding: 14px 8px; display: flex; flex-direction: column; align-items: center; gap: 4px;
  font-size: 18px; font-weight: 600; box-shadow: 0 4px 0 var(--line); min-height: 104px;
}
.type-btn .emo { font-size: 40px; }
.type-btn.sel { border-color: var(--teal); background: var(--teal-light); box-shadow: 0 4px 0 var(--teal-dark); }

/* ---------- Kortet ---------- */
.map-wrap { position: absolute; inset: 0; background: var(--grass); overflow: hidden; }
.map-wrap svg.map { width: 100%; height: 100%; display: block; }
.map-hint {
  position: absolute; left: 12px; right: 12px; top: 12px; display: flex; gap: 8px; align-items: center; justify-content: space-between;
  pointer-events: none;
}
.map-hint > * { pointer-events: auto; }
.pill { background: #fff; border-radius: 99px; padding: 8px 14px; font-size: 15px; font-weight: 500; box-shadow: 0 3px 0 rgba(23,34,59,.15); border: 2px solid var(--line); }
.pin { cursor: pointer; }
.pin .pulse { animation: pulse 1.8s ease-out infinite; transform-origin: center; transform-box: fill-box; }
@keyframes pulse { 0% { transform: scale(.6); opacity: .8; } 100% { transform: scale(1.7); opacity: 0; } }
.pin:active .pin-body { transform: translateY(2px); }
@media (prefers-reduced-motion: reduce) { .pin .pulse { animation: none; opacity: .4; } }

/* Bottom sheet */
.sheet-bg { position: absolute; inset: 0; background: rgba(23,34,59,.35); z-index: 20; animation: fade .15s; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 21; background: var(--paper); border-radius: 26px 26px 0 0;
  padding: 10px 16px 20px; max-height: 82%; overflow-y: auto; animation: up .2s ease-out; box-shadow: 0 -6px 30px rgba(0,0,0,.15);
}
.sheet .grab { width: 44px; height: 5px; border-radius: 5px; background: var(--line); margin: 0 auto 12px; }
.sheet .stack { gap: 10px; }
@keyframes up { from { transform: translateY(40%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } }

/* Aktivitetskort */
.act { display: flex; gap: 14px; align-items: center; }
.act .emo { font-size: 34px; width: 58px; height: 58px; border-radius: 18px; background: var(--grass); display: grid; place-items: center; flex-shrink: 0; }
.act .body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.act .name { font-size: 19px; font-weight: 600; }
.act .meta { font-size: 15px; color: var(--ink-soft); }
.act .tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 3px; }
.act .count { text-align: center; font-size: 13px; color: var(--ink-soft); flex-shrink: 0; }
.act .count b { display: block; font-size: 22px; color: var(--teal-dark); }

.section-title { font-size: 18px; font-weight: 600; margin-top: 4px; display: flex; align-items: center; gap: 8px; }
.empty { text-align: center; padding: 26px 16px; background: var(--card); border-radius: var(--radius); border: 2px dashed var(--line); }
.empty .emo { font-size: 44px; }

/* Detalje */
.hero { text-align: center; padding: 20px 16px 22px; border-radius: 26px; background: var(--grass); position: relative; }
.hero .emo { font-size: 70px; line-height: 1; }
.hero h1 { margin-top: 6px; }
.hero .tags { justify-content: center; display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.facts { display: flex; flex-direction: column; gap: 0; padding: 4px 16px; }
.fact { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 2px solid var(--paper); }
.fact:last-child { border-bottom: 0; }
.fact .i { font-size: 22px; width: 28px; text-align: center; }
.fact b { display: block; font-weight: 600; }
.nums { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.num { background: var(--card); border: 2px solid var(--line); border-radius: 18px; padding: 12px; text-align: center; }
.num b { font-size: 30px; display: block; color: var(--teal-dark); line-height: 1.1; }
.num span { font-size: 14px; color: var(--ink-soft); }
.status-going { background: var(--teal-light); border: 2px solid var(--teal); color: var(--teal-dark); border-radius: 16px; padding: 12px; text-align: center; font-weight: 600; }

/* Chat */
.chat-page { display: flex; flex-direction: column; height: 100%; }
.chat-list { flex: 1; overflow-y: auto; padding: 14px 12px; display: flex; flex-direction: column; gap: 10px; }
.chat-info { font-size: 14px; text-align: center; color: var(--ink-soft); background: var(--card); border-radius: 14px; padding: 8px 12px; border: 2px solid var(--line); }
.msg { display: flex; gap: 8px; align-items: flex-end; max-width: 88%; }
.msg .av { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; color: #fff; flex-shrink: 0; font-size: 16px; }
.msg .bub { background: var(--card); border: 2px solid var(--line); border-radius: 18px 18px 18px 6px; padding: 8px 12px; min-width: 0; }
.msg .who { font-size: 13px; color: var(--ink-soft); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.msg .who b { color: var(--ink); font-weight: 600; }
.msg .txt { font-size: 17px; overflow-wrap: anywhere; }
.msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.msg.mine .bub { background: var(--blue); color: #fff; border-color: var(--blue); border-radius: 18px 18px 6px 18px; }
.msg.mine .who, .msg.mine .who b { color: rgba(255,255,255,.85); }
.msg .more { border: 0; background: none; width: 36px; height: 36px; border-radius: 50%; color: var(--ink-soft); flex-shrink: 0; font-size: 20px; line-height: 1; }
.msg.hid .txt { font-style: italic; color: var(--ink-soft); }
.chat-bar { display: flex; gap: 8px; padding: 10px 12px; background: var(--card); border-top: 2px solid var(--line); }
.chat-bar .input { border-radius: 99px; min-height: 50px; }
.chat-bar .btn { width: auto; min-height: 50px; padding: 10px 18px; border-radius: 99px; }

/* Afstemning (efter skitsen: blå/grønne flader) */
.poll-bg { position: relative; min-height: 100%; background: var(--teal-light); overflow: hidden; }
.poll-bg svg.blobs { position: absolute; inset: 0; width: 100%; height: 100%; }
.poll-bg .page { position: relative; }
.poll-card { background: rgba(255,255,255,.96); border: 3px solid var(--ink); border-radius: 22px; padding: 16px; box-shadow: 0 5px 0 var(--ink); }
.poll-title { text-align: center; }
.poll-title .kicker { font-size: 20px; font-weight: 500; text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 5px; }
.poll-title h1 { font-size: 36px; margin-top: 6px; }
.opt {
  width: 100%; display: flex; align-items: center; gap: 12px; background: #fff; border: 3px solid var(--ink); border-radius: 16px;
  padding: 14px 16px; font-size: 24px; font-weight: 500; box-shadow: 0 5px 0 var(--ink); position: relative; overflow: hidden; text-align: left; min-height: 68px;
}
.opt:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--ink); }
.opt .lbl { flex: 1; position: relative; }
.opt .radio { width: 32px; height: 32px; border-radius: 50%; border: 3px solid var(--ink); position: relative; flex-shrink: 0; background: #fff; display: grid; place-items: center; }
.opt.sel .radio { background: var(--teal); border-color: var(--ink); }
.opt.sel .radio svg { width: 20px; height: 20px; }
.opt .bar { position: absolute; left: 0; top: 0; bottom: 0; background: var(--teal-light); transition: width .5s; }
.opt.sel .bar { background: #b8e6d6; }
.opt .res { position: relative; font-size: 16px; text-align: right; line-height: 1.1; }
.opt .res b { font-size: 22px; display: block; }
.opt.winner { border-color: var(--teal-dark); }
.poll-date { text-align: center; font-size: 24px; font-weight: 500; }
.poll-mini { display: flex; gap: 12px; align-items: center; }
.poll-mini .ico { width: 54px; height: 54px; border-radius: 16px; background: var(--teal); display: grid; place-items: center; color: #fff; flex-shrink: 0; }
.poll-mini .ico svg { width: 30px; height: 30px; }

/* Mere-menu */
.menu { background: var(--card); border-radius: var(--radius); border: 2px solid var(--line); overflow: hidden; box-shadow: var(--shadow); }
.menu button {
  width: 100%; border: 0; background: none; display: flex; align-items: center; gap: 14px; padding: 14px 16px; min-height: 62px;
  font-size: 18px; font-weight: 500; text-align: left; border-bottom: 2px solid var(--paper);
}
.menu button:last-child { border-bottom: 0; }
.menu .mi { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; flex-shrink: 0; }
.menu .arrow { margin-left: auto; color: var(--ink-soft); }
.profile-head { display: flex; gap: 14px; align-items: center; }
.avatar-big { width: 72px; height: 72px; border-radius: 22px; display: grid; place-items: center; font-size: 32px; font-weight: 600; color: #fff; flex-shrink: 0; }

/* Moderation */
.tabs { display: flex; gap: 6px; background: #e3e9f2; padding: 5px; border-radius: 16px; }
.tabs button { flex: 1; border: 0; background: none; border-radius: 12px; padding: 10px 6px; font-weight: 500; font-size: 15px; min-height: 44px; }
.tabs button.on { background: #fff; box-shadow: var(--shadow); }
.quote { background: var(--paper); border-left: 4px solid var(--line); border-radius: 8px; padding: 8px 12px; font-size: 16px; }

/* Toast */
.toast {
  position: absolute; left: 16px; right: 16px; bottom: calc(var(--nav-h) + 16px); z-index: 40; background: var(--ink); color: #fff;
  border-radius: 16px; padding: 14px 16px; font-size: 16px; animation: up .2s; box-shadow: 0 6px 20px rgba(0,0,0,.25);
}
.toast.err { background: #b3261e; }
.toast.ok { background: var(--teal-dark); }

.fab {
  position: absolute; right: 14px; bottom: 16px; z-index: 5; width: auto;
}
.info { background: var(--blue-light); border-radius: 16px; padding: 12px 14px; font-size: 15px; color: var(--blue-dark); }
.warn { background: var(--sun-light); border: 2px solid #f0cf5a; border-radius: 16px; padding: 12px 14px; font-size: 16px; }
