/* Brädspelsstilen: tjocka mörka konturer och hårda skuggor som matchar illustrationerna. */

:root {
  --yellow: #ffc20e;
  --hard: 0 4px 0 var(--ink);
  --shadow: 0 5px 0 var(--ink);
  --line2: #1d2433;
}

.stage {
  background:
    radial-gradient(rgba(255, 255, 255, 0.55) 1.6px, transparent 2px) 0 0 / 24px 24px,
    radial-gradient(ellipse at 50% 40%, #d9f1ff 0%, #b5e0fb 60%, #93cff3 100%);
}

/* ---------- logga ---------- */

.brand h1 { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 32px; }
.logo { width: 46px; height: 34px; object-fit: cover; }
.krona { flex: none; width: 34px; height: 25px; object-fit: cover; align-self: center; }

/* ---------- knappar och kort ---------- */

.btn, .seg, .search input, .chip, .radios.title span {
  border: 2px solid var(--ink); box-shadow: 0 3px 0 var(--ink);
}
.btn:active, .chip:active { transform: translateY(3px); box-shadow: 0 0 0 var(--ink); }
.btn.gold { background: var(--accent); border-color: var(--ink); box-shadow: var(--hard); font-family: var(--display); font-weight: 800; font-size: 18px; }
.btn.gold:hover { background: var(--accent); border-color: var(--ink); }
.seg button.on { background: var(--ink); color: #fff; }
.stats div, .regent, .freebox, .empty { border: 2px solid var(--ink); box-shadow: var(--hard); }
.stats div:first-child { background: #fff3c2; }
.stats div:last-child { background: #ffe1d9; }
.stats b { color: var(--ink); font-weight: 800; font-size: 28px; }
.empty, .freebox { border-style: solid; background: #fff; }
.regent { border-color: var(--ink); }
.regent::before { width: 10px; border-right: 2px solid var(--ink); }
.regent-top, .regent-of, .regent blockquote, .regent-meta { margin-left: 6px; }
.row-right { color: var(--ink); }
.dot { box-shadow: 0 0 0 1.5px var(--ink); }
.panel { border-left: 2px solid var(--ink); }
.tip { border-width: 2px; }
.claim { border: 3px solid var(--ink); box-shadow: 0 8px 0 var(--ink); }
.claim input[type='text'], .claim input[type='number'] { border: 2px solid var(--ink); }
.toast { border: 2px solid var(--ink); font-family: var(--display); font-weight: 800; font-size: 17px; }
.ticker { border-top: 2px solid var(--ink); }
.legend, .demo { font-weight: 600; }
.demo { border: 2px dashed var(--ink); color: var(--ink); }

.tron { width: 132px; height: auto; margin-bottom: 4px; }
.freebox .tron { width: 54px; margin: 0; }
.paying .tron { width: 150px; animation: wobble 0.9s ease-in-out infinite alternate; }
@keyframes wobble { from { transform: rotate(-4deg); } to { transform: rotate(4deg); } }

/* ---------- Tronnytt ---------- */

.news { border: 3px solid var(--ink); box-shadow: 0 6px 0 var(--ink); background: #fff; }
.news-head { padding: 7px 8px 7px 12px; }
.news-logo { font-size: 17px; }
.news-head { gap: 6px; }
.news-head button { flex: none; }
.news-head .sp { min-width: 0; }
#news-mini { width: 26px; padding: 3px 0; }
@media (min-width: 861px) and (max-width: 1500px) { .news-logo { font-size: 15px; letter-spacing: 0.04em; } }
.news.mini .news-fold { display: none; }

.scene {
  position: relative; height: 168px; overflow: hidden; border-bottom: 3px solid var(--ink);
  background: radial-gradient(rgba(29, 36, 51, 0.07) 1.5px, transparent 2px) 0 0 / 14px 14px, #fff1cf;
}
.set { position: absolute; left: 0; right: 0; bottom: -4px; aspect-ratio: 3 / 1; }
.set img { display: block; width: 100%; height: 100%; }
.set.front { clip-path: inset(69% 0 0 0); }
.screen { position: absolute; left: 51%; top: 11%; width: 21%; height: 44%; border-radius: 4px; overflow: hidden; display: grid; place-items: center; }
.screen i { position: absolute; inset: 0; background: var(--accent); transition: background 0.4s; }
.screen img { position: relative; width: 78%; height: auto; filter: drop-shadow(0 2px 0 rgba(29, 36, 51, 0.5)); }
.news.is-live .screen img { animation: pop 0.9s ease-in-out infinite alternate; }
@keyframes pop { from { transform: scale(0.9) rotate(-5deg); } to { transform: scale(1.08) rotate(5deg); } }

/* Reportern: tre bildrutor ur samma ark. Bas + mun och ögon som mjukt maskade lager, så att kroppen aldrig hoppar. */
.reporter { position: absolute; left: 20%; bottom: 12px; height: 152px; aspect-ratio: 500 / 800; transform-origin: 50% 100%; }
.reporter i { position: absolute; inset: 0; background: url(/img/reporter.webp) no-repeat; background-size: 307.2% auto; }
.reporter .f1 { background-position: 1.2548% 59.375%; }
.reporter .f2 { background-position: 48.938% 59.375%; opacity: 0; -webkit-mask-image: radial-gradient(ellipse 19% 8.5% at 51.6% 47.6%, #000 62%, transparent 100%); mask-image: radial-gradient(ellipse 19% 8.5% at 51.6% 47.6%, #000 62%, transparent 100%); }
.reporter .f3 { background-position: 96.718% 59.375%; opacity: 0; -webkit-mask-image: radial-gradient(ellipse 27% 9.5% at 52% 28.5%, #000 70%, transparent 100%); mask-image: radial-gradient(ellipse 27% 9.5% at 52% 28.5%, #000 70%, transparent 100%); }
.reporter.open .f2, .reporter.blink .f3 { opacity: 1; }
.news.talking .reporter { animation: bob 0.42s ease-in-out infinite alternate; }
@keyframes bob { from { transform: rotate(-1.2deg); } to { transform: rotate(1.2deg) translateY(-1px); } }

.news-text { padding: 10px 14px 8px; }
#news-line { min-height: 4.3em; font-size: 14.5px; font-weight: 500; }
.third { border-top: 2px solid var(--ink); background: var(--yellow); }
.third:hover { background: #ffd24a; }
.third em, .third-main span { color: var(--ink); opacity: 0.75; }
.ticker-tag { font-family: var(--display); font-size: 13px; }

/* ---------- kröningsögonblicket ---------- */

.coronation {
  position: fixed; inset: 0; z-index: 25; display: grid; place-items: center; cursor: pointer;
  background: radial-gradient(circle at 50% 45%, rgba(255, 241, 207, 0.96) 0 32%, rgba(255, 194, 14, 0.9) 33% 100%);
  animation: fadein 0.25s ease-out;
}
.coronation::before {
  content: ''; position: absolute; inset: -50%; z-index: -1;
  background: repeating-conic-gradient(rgba(255, 255, 255, 0.35) 0 10deg, transparent 10deg 20deg);
  animation: rays 14s linear infinite;
}
.coronation div { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 16px; animation: popin 0.5s cubic-bezier(0.2, 1.6, 0.4, 1); }
.coronation img { width: min(300px, 60vw); height: auto; }
.coronation small { font: 800 15px var(--display); letter-spacing: 0.14em; text-transform: uppercase; }
.coronation b { font: 800 clamp(34px, 7vw, 60px)/1 var(--display); overflow-wrap: anywhere; }
.coronation span { font: 600 20px var(--display); margin-top: 4px; }
.coronation.out { opacity: 0; transition: opacity 0.4s; }
@keyframes fadein { from { opacity: 0; } }
@keyframes popin { from { transform: scale(0.4); opacity: 0; } }
@keyframes rays { to { transform: rotate(360deg); } }
.confetti { z-index: 26; }

@media (min-width: 861px) and (max-width: 1500px) {
  .news { width: 320px; margin-left: 16px; }
}

@media (max-width: 860px) {
  .brand h1 { font-size: 25px; }
  .logo { width: 38px; height: 28px; }
  .panel { border-left: 0; border-top: 2px solid var(--ink); }
}

/* ---------- kartan som spelbräde ---------- */

/* Vågorna flyttas med transform (grafikkortet sköter det) i stället för att ritas om varje bildruta. */
.sea { position: absolute; inset: 0; pointer-events: none; opacity: 0.75; overflow: hidden; }
.sea::before {
  content: ''; position: absolute; inset: 0 0 0 -150px; will-change: transform;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='150' height='84'%3E%3Cpath d='M8 20q9-9 18 0t18 0' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round'/%3E%3Cpath d='M86 62q9-9 18 0t18 0' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E") 0 0 / 150px 84px;
  animation: drift 16s linear infinite;
}
@keyframes drift { to { transform: translateX(150px); } }

.kommuner { filter: none; }
.land-shadow { fill: #6fa9d4; stroke: #6fa9d4; stroke-width: 7; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.coast { fill: var(--ink); stroke: var(--ink); stroke-width: 7; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.kommuner path { stroke-width: 1.2; transition: opacity 0.3s ease, transform 0.12s ease; }
.kommuner path:not(.taken) { fill: #fffdf5; }
.kommuner path:hover, .kommuner path:focus-visible { transform: translateY(calc(-3px / var(--k, 1))); stroke-width: 2.2; }
.kommuner path.sel { transform: translateY(calc(-4px / var(--k, 1))); stroke: var(--ink); stroke-width: 3.5; filter: drop-shadow(0 0 5px var(--yellow)) drop-shadow(0 0 2px var(--yellow)); }

.sea-label { font: italic 600 15px var(--display); letter-spacing: 0.22em; fill: #4f97c9; text-anchor: middle; pointer-events: none; text-transform: uppercase; }
.compass { pointer-events: none; }
.compass circle { fill: #fff; stroke: var(--ink); stroke-width: 2.5; }
.compass path { fill: var(--accent); stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; }
.compass text { font: 800 15px var(--display); fill: var(--ink); text-anchor: middle; }

.pin { pointer-events: none; }
.pin rect { fill: #fff; stroke: var(--ink); stroke-width: 2; }
.pin.big rect { fill: var(--yellow); }
.labels .pin text { font: 700 12.5px var(--display); fill: var(--ink); stroke: none; text-anchor: middle; dominant-baseline: central; }

.fx { pointer-events: none; }
.ripple { fill: none; stroke: var(--accent); stroke-width: 4; transform-box: fill-box; transform-origin: center; animation: ripple 1.3s ease-out forwards; }
.ripple.r2 { opacity: 0; animation-delay: 0.35s; stroke: var(--yellow); }
@keyframes ripple { from { transform: scale(0.3); opacity: 1; } to { transform: scale(7); opacity: 0; } }
.drop { transform-box: fill-box; transform-origin: 50% 85%; animation: drop 2.3s ease-out forwards; }
@keyframes drop {
  0% { transform: translateY(-160px) rotate(-25deg); opacity: 0; }
  22% { transform: translateY(0) rotate(0); opacity: 1; }
  32% { transform: translateY(-22px) rotate(6deg); }
  42% { transform: translateY(0) rotate(0); }
  50% { transform: translateY(-7px); }
  58%, 82% { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(0) scale(0.5); opacity: 0; }
}

.zoomctl { position: absolute; z-index: 3; top: 18px; right: 16px; display: flex; flex-direction: column; border: 2px solid var(--ink); border-radius: 12px; overflow: hidden; box-shadow: 0 3px 0 var(--ink); background: #fff; }
.zoomctl button { width: 36px; height: 34px; border: 0; background: #fff; font: 800 19px/1 var(--display); }
.zoomctl button + button { border-top: 2px solid var(--ink); }
.zoomctl button:hover { background: var(--yellow); }
@media (max-width: 860px) { .zoomctl { top: auto; bottom: 44px; right: 12px; } .sea-label { font-size: 11px; } }

/* ---------- vapensköldar ---------- */

.shield { flex: none; height: auto; display: block; overflow: visible; }
.shield text { font: 800 27px var(--display); fill: #fff; stroke: #1d2433; stroke-width: 5; paint-order: stroke; stroke-linejoin: round; text-anchor: middle; dominant-baseline: central; }
.tip .shield { display: inline-block; }
#news-shield { flex: none; }
.regent-head { display: flex; align-items: center; gap: 14px; margin-left: 6px; }
.regent-head .regent-top, .regent-head .regent-of { margin-left: 0; }
.regent-head .krona { width: 28px; height: 21px; }

/* ---------- panelen: rubriker, brickor, prispall ---------- */

.panel h2 { margin: 30px 0 10px; font: 800 20px/1.1 var(--display); letter-spacing: 0; text-transform: none; color: var(--ink); }
.panel h2 + .hint { margin-top: -6px; }
.stats div { position: relative; overflow: hidden; padding-right: 54px; }
.stats img { position: absolute; right: -6px; bottom: -8px; width: 62px; height: auto; transform: rotate(8deg); }
.stats div:last-child img { bottom: -14px; right: -8px; width: 70px; }

.rank { flex: none; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: var(--ink); color: #fff; font: 800 12.5px/1 var(--display); }
.row { padding: 8px 8px; }
.row-title { font-weight: 700; }
button.row:hover, .row.active { background: #fff3c2; box-shadow: inset 0 0 0 2px var(--ink); }
.history .row:hover { box-shadow: none; }

.podium { display: flex; align-items: flex-end; gap: 8px; margin: 26px 0 10px; }
.pod { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 0; border: 0; background: none; position: relative; }
.pod .shield { margin-bottom: 4px; transition: transform 0.15s ease; }
.pod:hover .shield { transform: translateY(-4px) rotate(-4deg); }
.pod-krona { position: absolute; top: -27px; width: 40px; height: 30px; object-fit: cover; transform: rotate(-8deg); }
.pod-kommun { max-width: 100%; font: 800 15px/1.15 var(--display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pod-name { max-width: 100%; font-size: 12px; color: var(--mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pod-step { align-self: stretch; margin-top: 6px; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 2px solid var(--ink); border-bottom: 0; border-radius: 10px 10px 0 0; font-weight: 700; font-size: 13px; }
.pod-step b { font: 800 24px/1 var(--display); }
.p1 .pod-step { height: 86px; background: var(--yellow); }
.p2 .pod-step { height: 64px; background: #dfe6f0; }
.p3 .pod-step { height: 50px; background: #f6b98c; }
.podium + .list { border-top: 2px solid var(--ink); padding-top: 4px; }

/* Vald kommun: en upplyft bricka med hård skugga i stället för suddigt sken. */
.kommuner path.sel {
  transform: translateY(calc(-6px / var(--k, 1))); stroke: var(--ink); stroke-width: 3.5;
  filter: drop-shadow(0 calc(6px / var(--k, 1)) 0 var(--ink));
}
.stats div { padding-right: 46px; }
.stats b { font-size: 24px; white-space: nowrap; position: relative; z-index: 1; }
.stats span { position: relative; z-index: 1; }
.stats img { opacity: 0.9; }

/* ---------- villkor och vart pengarna går ---------- */
.agree { display: flex; gap: 10px; align-items: flex-start; margin-top: 16px; font-size: 13.5px; cursor: pointer; }
.agree input { flex: none; width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--accent); }
.money { margin-top: 26px; padding: 14px 16px; border: 2px solid var(--ink); border-radius: var(--r); background: #fff3c2; box-shadow: var(--hard); }
.money b { font: 800 17px var(--display); }
.money p { margin: 4px 0 0; font-size: 13.5px; }

/* ---------- tronhållare: namn, konto eller hemsida ---------- */
.ico { flex: none; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.radios.kind span { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; border: 2px solid var(--ink); box-shadow: 0 3px 0 var(--ink); background: var(--card); font-weight: 600; font-size: 13.5px; cursor: pointer; }
.radios.kind input:checked + span { background: var(--ink); color: #fff; }
.radios.kind { gap: 8px 6px; }
.visit { display: inline-flex; align-items: center; gap: 7px; max-width: 100%; margin: 12px 0 0 6px; padding: 6px 12px; border: 2px solid var(--ink); border-radius: 999px; background: #fff; color: var(--ink); font-weight: 700; font-size: 13.5px; text-decoration: none; box-shadow: 0 3px 0 var(--ink); overflow-wrap: anywhere; }
a.visit:hover { background: var(--yellow); }
a.visit:active { transform: translateY(3px); box-shadow: none; }
.visit.ghosted { border-style: dashed; box-shadow: none; color: var(--mute); font-weight: 600; }

/* Inga CSS-filter på kartans former: de ritas fel när kartan är inzoomad. */
.kommuner path:hover, .kommuner path:focus-visible { filter: none; }
.kommuner path.sel { filter: none; transform: none; stroke-width: 1.2; }
.sel-ring { pointer-events: none; }
.sel-ring path { fill: none; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.sel-ring .o { stroke: var(--ink); stroke-width: 8; }
.sel-ring .i { stroke: var(--yellow); stroke-width: 4; }
.kommuner path.flash { animation: flash2 1.6s ease-out; }
@keyframes flash2 { 0%, 30%, 60% { fill-opacity: 0.3; } 15%, 45%, 100% { fill-opacity: 1; } }

/* ---------- så funkar det ---------- */

.tool-row { display: flex; gap: 8px; flex-wrap: wrap; }
.how-btn { background: var(--yellow); font-weight: 700; }
.how-btn:hover { background: #ffd24a; }
.how-btn span { display: inline-grid; place-items: center; width: 20px; height: 20px; margin-right: 4px; border-radius: 50%; background: var(--ink); color: #fff; font: 800 14px/1 var(--display); }
.how-btn.nudge { animation: nudge 2.6s ease-in-out 1.2s infinite; }
@keyframes nudge { 0%, 78%, 100% { transform: none; } 82% { transform: rotate(-4deg) scale(1.06); } 88% { transform: rotate(4deg) scale(1.06); } 94% { transform: rotate(-2deg); } }

.howto { width: min(520px, calc(100vw - 24px)); }
.howto-in { position: relative; padding: 24px; }
.howto .tron { display: block; width: 84px; height: auto; margin: -6px 0 4px; }
.howto .lead { margin: 0 0 16px; font-size: 16px; }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: s; display: grid; gap: 12px; }
.steps li { counter-increment: s; position: relative; padding-left: 50px; min-height: 38px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 36px; height: 36px; display: grid; place-items: center; border: 2px solid var(--ink); border-radius: 50%; background: var(--accent); color: #fff; font: 800 19px/1 var(--display); box-shadow: 0 3px 0 var(--ink); }
.steps b { display: block; font: 800 17px/1.25 var(--display); }
.steps li > span { font-size: 14px; }
.rules { margin-top: 18px; padding: 14px 16px; border: 2px solid var(--ink); border-radius: var(--r); background: #fff3c2; box-shadow: var(--hard); }
.rules > b { font: 800 17px var(--display); }
.rules ul { margin: 6px 0 0; padding-left: 18px; font-size: 13.5px; display: grid; gap: 4px; }
.howto .fine { margin: 12px 0 0; text-align: center; font-size: 13px; color: var(--mute); }
.howto a, .agree a, .foot a { color: inherit; font-weight: 600; text-underline-offset: 2px; }

.foot { margin: 22px 0 4px; text-align: center; font-size: 13px; color: var(--mute); }
.foot button { border: 0; padding: 0; background: none; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; color: inherit; }

/* ---------- text som servern lägger i panelen innan sidan startat, och listan över alla kommuner ---------- */

.ssr h2 { margin: 18px 0 6px; font: 800 22px/1.2 var(--display); }
.ssr a, .all a { color: inherit; }
.ssr-list, .all ul { list-style: none; margin: 8px 0 0; padding: 0; columns: 2; column-gap: 16px; font-size: 14px; }
.ssr-list li, .all li { padding: 2px 0; break-inside: avoid; }
.all { margin-top: 26px; }
.all summary { cursor: pointer; font: 800 17px var(--display); }
.all a { text-decoration: none; }
.all a:hover { text-decoration: underline; }
