@font-face { font-family: 'Luckiest'; src: url('/fonts/luckiest.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'DM Sans'; src: url('/fonts/dmsans.woff2') format('woff2'); font-weight: 100 1000; font-display: swap; }

:root {
  --night: #13233F;
  --night-2: #1A2D4F;
  --night-3: #233A63;
  --ink: #4A0D18;
  --cream: #FFF3DC;
  --cream-2: #F3E3C3;
  --muted: #A9B6CF;
  --green: #2FA35F;
  --gold: #FFC23D;
  --red: #E5383B;
  --ice: #8CC8F5;
  --ginger: #C8752F;
  --display: 'Luckiest', 'Arial Black', system-ui, sans-serif;
  --ui: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --col: 560px;
  --sticker: 0 4px 0 var(--ink);
  --r: 14px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; display: flex; flex-direction: column;
  background: var(--night);
  background-image:
    radial-gradient(circle at 12% 18%, #1E355C 0 2px, transparent 3px),
    radial-gradient(circle at 78% 8%, #1E355C 0 1.5px, transparent 2.5px),
    radial-gradient(circle at 55% 62%, #1C3257 0 2px, transparent 3px);
  background-size: 180px 180px, 240px 240px, 300px 300px;
  color: var(--cream); font-family: var(--ui); font-size: 16px; line-height: 1.5;
}
a { color: var(--gold); }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
[hidden] { display: none !important; }

/* ---------- top og bund ---------- */
.top { width: 100%; max-width: var(--col); margin: 0 auto; padding: 12px 16px 4px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand img { width: 150px; height: auto; }
.account-btn { background: none; border: 2px solid var(--night-3); color: var(--cream); border-radius: 999px; padding: 6px 14px; font-weight: 700; font-size: 14px; cursor: pointer; }
.account-btn:hover { border-color: var(--muted); }
main { width: 100%; max-width: var(--col); margin: 0 auto; padding: 8px 16px 32px; flex: 1; outline: none; }
.foot { text-align: center; padding: 24px 16px 40px; }
.foot nav { display: flex; gap: 20px; justify-content: center; }
.foot a { color: var(--muted); text-decoration: none; font-size: 14px; }
.foot a:hover { color: var(--cream); }
.feedback-line { margin: 14px 0 0; }

/* ---------- typografi ---------- */
h1, h2, .display { font-family: var(--display); font-weight: 400; letter-spacing: .01em; line-height: 1.05; margin: 0; text-transform: uppercase; }
h1 { font-size: 40px; text-shadow: 0 3px 0 var(--ink); }
h2 { font-size: 26px; text-shadow: 0 2px 0 var(--ink); margin-bottom: 10px; }
.sub { color: var(--muted); margin: 4px 0 0; }
p { margin: 0 0 12px; }
.prose { max-width: 62ch; }
.prose h2 { margin-top: 28px; }
.prose li { margin-bottom: 6px; }

/* ---------- knapper ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-align: center; white-space: nowrap;
  min-height: 48px; padding: 10px 20px; border-radius: 999px; cursor: pointer;
  background: var(--cream); color: var(--ink); border: 3px solid var(--ink); box-shadow: var(--sticker);
  font-weight: 800; font-size: 16px; text-decoration: none; transition: transform .08s, box-shadow .08s;
}
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.btn.primary { background: var(--gold); }
.btn.red { background: var(--red); color: var(--cream); }
.btn.ghost { background: transparent; color: var(--cream); border-color: var(--night-3); box-shadow: none; }
.btn.small { min-height: 38px; padding: 6px 14px; font-size: 14px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: var(--sticker); }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > .btn { flex: 1; }

/* ---------- kort ---------- */
.card { background: var(--night-2); border: 2px solid var(--night-3); border-radius: 20px; padding: 18px; margin: 16px 0; }
.card.hero { padding: 20px; position: relative; overflow: hidden; }
.hero-in { display: grid; grid-template-columns: 1fr 104px; gap: 8px; align-items: center; }
.hero-in img { width: 104px; transform: rotate(6deg); }
.hero .kicker { color: var(--gold); font-weight: 800; margin-bottom: 4px; }
.hero .btn { margin-top: 14px; }
.count { font-family: var(--display); font-size: 34px; text-shadow: 0 3px 0 var(--ink); }
.count small { font-family: var(--ui); font-size: 14px; color: var(--muted); text-shadow: none; font-weight: 600; margin-left: 2px; margin-right: 10px; }

/* ---------- kalender ---------- */
.cal { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
@media (min-width: 520px) { .cal { grid-template-columns: repeat(6, 1fr); } }
.door {
  position: relative; aspect-ratio: 1; border-radius: var(--r); border: 3px solid var(--ink);
  background: var(--night-3); color: var(--cream); text-decoration: none; display: flex; flex-direction: column;
  align-items: center; justify-content: center; box-shadow: var(--sticker); cursor: pointer; padding: 4px; text-align: center;
}
.door .num { font-family: var(--display); font-size: 28px; line-height: 1; text-shadow: 0 2px 0 var(--ink); }
.door .meta { font-size: 11px; font-weight: 700; line-height: 1.2; margin-top: 3px; }
.door.locked { background: #192B4B; border-color: #22365C; color: #5D6F93; box-shadow: none; cursor: default; }
.door.locked .num { text-shadow: none; }
.door.open { background: var(--cream); color: var(--ink); }
.door.open .num { text-shadow: none; }
.door.today { background: var(--gold); color: var(--ink); animation: nudge 2.4s ease-in-out infinite; }
.door.today .num { text-shadow: none; }
.door.missed { background: transparent; border-style: dashed; border-color: var(--muted); box-shadow: none; color: var(--cream); }
.door.done { color: var(--ink); }
.door.done .num { text-shadow: none; font-size: 22px; }
.door.l0 { background: var(--green); color: var(--cream); } .door.l1 { background: var(--gold); }
.door.l2 { background: var(--red); color: var(--cream); } .door.l3 { background: var(--ice); }
.door.fail { background: #3A2A2E; color: var(--cream-2); }
.door.sunday::after { content: '×2'; position: absolute; top: -9px; right: -7px; background: var(--red); color: var(--cream); border: 2px solid var(--ink); border-radius: 999px; font-size: 11px; font-weight: 800; padding: 0 6px; }
@keyframes nudge { 0%, 88%, 100% { transform: rotate(0); } 92% { transform: rotate(-4deg); } 96% { transform: rotate(4deg); } }

/* ---------- ligaer ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list a { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--night-3); color: var(--cream); text-decoration: none; }
.list a:last-child { border-bottom: 0; }
.list .rank { font-family: var(--display); font-size: 22px; width: 36px; color: var(--gold); text-shadow: 0 2px 0 var(--ink); }
.list .name { flex: 1; font-weight: 700; }
.list .pts { font-weight: 700; color: var(--muted); font-size: 14px; }
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th { text-align: left; color: var(--muted); font-weight: 600; font-size: 13px; padding: 6px 4px; }
.table td { padding: 10px 4px; border-top: 1px solid var(--night-3); }
.table td.n, .table th.n { text-align: right; font-variant-numeric: tabular-nums; }
.table .r { font-family: var(--display); font-size: 20px; color: var(--gold); width: 34px; text-shadow: 0 2px 0 var(--ink); }
.table tr.me td { background: rgba(255, 194, 61, .08); }
.table tr.me td:first-child { border-radius: 10px 0 0 10px; } .table tr.me td:last-child { border-radius: 0 10px 10px 0; }
.x { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 18px; padding: 2px 6px; }
.winner { display: flex; gap: 10px; align-items: center; background: var(--night-3); border-radius: 14px; padding: 10px 12px; margin-bottom: 12px; font-weight: 600; }
.winner img { width: 44px; }

/* ---------- spillet ---------- */
.game-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 6px 0 14px; }
.game-head .back { display: inline-block; margin-bottom: 8px; color: var(--muted); text-decoration: none; font-weight: 700; font-size: 14px; }
.board { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.tile {
  min-height: 74px; border-radius: 12px; border: 3px solid var(--ink); background: var(--cream); color: var(--ink);
  box-shadow: var(--sticker); font-weight: 800; text-transform: uppercase; cursor: pointer; padding: 4px 3px;
  font-size: 15px; line-height: 1.1; letter-spacing: .01em; white-space: nowrap; overflow: hidden;
  transition: transform .08s, box-shadow .08s, background .12s; user-select: none; -webkit-tap-highlight-color: transparent;
}
.tile.sel { background: var(--ink); color: var(--cream); transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.tile:disabled { cursor: default; }
.board.shake { animation: shake .35s; }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-8px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(5px); } }
.band {
  grid-column: 1 / -1; border: 3px solid var(--ink); border-radius: 12px; box-shadow: var(--sticker); padding: 10px 12px;
  text-align: center; color: var(--ink); animation: pop .35s cubic-bezier(.3, 1.6, .5, 1);
}
.band .bname { font-weight: 800; font-size: 15px; display: flex; gap: 6px; justify-content: center; align-items: center; }
.band .bwords { font-size: 13px; font-weight: 600; text-transform: uppercase; margin-top: 2px; letter-spacing: .02em; }
.band.l0 { background: var(--green); color: var(--cream); } .band.l1 { background: var(--gold); }
.band.l2 { background: var(--red); color: var(--cream); } .band.l3 { background: var(--ice); }
.band.missed { opacity: .82; }
@keyframes pop { from { transform: scale(.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.lives { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 18px 0 14px; color: var(--muted); font-weight: 600; font-size: 14px; }
.lives .dots { display: flex; gap: 6px; }
.lives .dot { width: 14px; height: 14px; border-radius: 50%; background: var(--cream); border: 2px solid var(--ink); }
.lives .dot.used { background: transparent; border-color: var(--night-3); }
.controls { display: grid; grid-template-columns: 1fr 1fr 1.3fr; gap: 8px; }

/* ---------- resultat ---------- */
.result { text-align: center; }
.result .mascot { width: 150px; margin: 0 auto 4px; }
.result .mascot.win { animation: jump .9s ease-out 2; }
.result .mascot.ko { animation: wobble 1.2s ease-out 1; }
@keyframes jump { 0%, 100% { transform: translateY(0); } 30% { transform: translateY(-22px) rotate(-4deg); } 60% { transform: translateY(0) rotate(3deg); } }
@keyframes wobble { 0% { transform: rotate(0); } 30% { transform: rotate(-12deg); } 60% { transform: rotate(8deg); } 100% { transform: rotate(0); } }
.result .big { font-family: var(--display); font-size: 56px; line-height: 1; color: var(--gold); text-shadow: 0 4px 0 var(--ink); }
.result .grid { font-size: 22px; line-height: 1.25; letter-spacing: 2px; margin: 12px 0; }
.share-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.share-row .btn { padding: 10px 8px; }
.share-hint { font-size: 13px; margin-top: 10px; }
.stats { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin: 10px 0 16px; }
.stat { background: var(--night-3); border-radius: 12px; padding: 8px 12px; font-size: 14px; font-weight: 600; }
.save-card { background: var(--cream); color: var(--ink); border: 3px solid var(--ink); box-shadow: var(--sticker); }
.save-card h2 { color: var(--ink); text-shadow: none; }

/* ---------- formularer og modal ---------- */
.field { display: block; margin-bottom: 12px; }
.field span { display: block; font-weight: 700; font-size: 14px; margin-bottom: 4px; }
.field input, .field textarea { width: 100%; min-height: 48px; border-radius: 12px; border: 3px solid var(--ink); background: var(--cream); color: var(--ink); font: inherit; padding: 8px 12px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; margin: 10px 0; }
.check input { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--gold); }
.modal { position: fixed; inset: 0; background: rgba(8, 14, 28, .72); display: grid; place-items: center; padding: 16px; z-index: 50; }
.modal-card { width: 100%; max-width: 420px; max-height: calc(100dvh - 32px); overflow: auto; background: var(--night-2); border: 3px solid var(--ink); border-radius: 22px; padding: 22px; box-shadow: 0 6px 0 var(--ink); }
.modal-card h2 { margin-bottom: 6px; }
.modal-card .sub { margin-bottom: 14px; }
.tabs { display: flex; gap: 6px; margin: 12px 0 16px; background: var(--night); padding: 4px; border-radius: 999px; }
.tabs button { flex: 1; border: 0; background: none; color: var(--muted); border-radius: 999px; padding: 8px; font-weight: 700; cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--cream); color: var(--ink); }
.linkbtn { background: none; border: 0; color: var(--gold); text-decoration: underline; cursor: pointer; padding: 0; font-size: 14px; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; margin: 14px 0; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--night-3); }
.err { color: #FF9C9C; font-weight: 600; font-size: 14px; min-height: 1em; margin: 4px 0 8px; }
.ok { color: #9CE3B7; font-weight: 600; font-size: 14px; }
.copybox { display: flex; gap: 8px; }
.copybox input { flex: 1; min-width: 0; min-height: 44px; border-radius: 12px; border: 2px solid var(--night-3); background: var(--night); color: var(--cream); padding: 8px 12px; font: inherit; font-size: 14px; }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 30px); opacity: 0; background: var(--cream); color: var(--ink); border: 3px solid var(--ink); box-shadow: var(--sticker); padding: 10px 18px; border-radius: 999px; font-weight: 800; transition: .2s; pointer-events: none; z-index: 60; white-space: nowrap; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.inapp { background: var(--gold); color: var(--ink); padding: 10px 16px; font-size: 14px; font-weight: 600; text-align: center; }
.timebar { position: fixed; right: 8px; bottom: 8px; opacity: .85; background: #2B1A3A; border: 2px solid #8C5BD6; border-radius: 12px; padding: 8px; font-size: 12px; z-index: 40; display: flex; gap: 6px; align-items: center; color: #E9DAFF; }
.timebar input { font: inherit; font-size: 12px; padding: 4px; border-radius: 6px; border: 0; }
.timebar button { font-size: 12px; padding: 4px 8px; border-radius: 6px; border: 0; cursor: pointer; }
.empty { color: var(--muted); }
.press-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 12px 0 16px; }
.press-grid img { border-radius: 14px; border: 2px solid var(--night-3); }
.swatches { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.swatch { display: grid; grid-template-columns: 44px 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; }
.swatch span { grid-row: span 2; width: 44px; height: 44px; border-radius: 12px; border: 3px solid var(--ink); }
.swatch small { color: var(--muted); font-size: 12px; }
.spinner { text-align: center; padding: 40px; color: var(--muted); }

@media (min-width: 700px) {
  :root { --col: 620px; }
  h1 { font-size: 46px; }
  .tile { min-height: 86px; }
  .brand img { width: 180px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
