/* Forsidens kort over Stjær. Hører sammen med /js/kort.js. */
body.forside { background: #7fd3ee; overflow: hidden; -webkit-tap-highlight-color: transparent; }
.forside .page { display: block; min-height: 0; padding: 0; }

.kort { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; user-select: none; -webkit-user-select: none; }

/* Overskriften i en bue. Teksten i h1 er skjult; SVG'en viser den. */
.kort-titel { position: fixed; top: calc(6px + env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%); width: min(88vw, 62vh, 560px); margin: 0; font-size: 0; line-height: 0; color: transparent; pointer-events: none; z-index: 4; }
.kort-titel svg { display: block; width: 100%; overflow: visible; }
.kort-titel text { font: 800 92px ui-rounded, "Arial Rounded MT Bold", "Trebuchet MS", system-ui, sans-serif; text-anchor: middle; fill: #fff; stroke: #1d4e89; stroke-width: 16px; stroke-linejoin: round; paint-order: stroke; letter-spacing: 1px; }

/* Smal skærm: buen rykker lidt ned, så dens højre ende går fri af menuknappen. */
@media (max-width: 600px) and (orientation: portrait) { .kort-titel { top: calc(30px + env(safe-area-inset-top, 0px)); } }

/* Bygninger */
.bld { cursor: pointer; outline: none; }
.bld:focus-visible .hit { stroke: #fff; stroke-width: 4; stroke-dasharray: 8 6; }
.pop { transform-box: fill-box; transform-origin: 50% 100%; animation: kort-popin .9s cubic-bezier(.34, 1.7, .5, 1) both; animation-delay: var(--d, 0s); }
.wob { transform-box: fill-box; transform-origin: 50% 100%; animation: kort-wob 2.8s ease-in-out infinite; animation-delay: var(--w, 0s); }
.bld.tap .wob { animation: kort-boing .75s cubic-bezier(.3, 1.5, .5, 1); }
@keyframes kort-popin { 0% { transform: scale(.2, 0); } 60% { transform: scale(1.08, 1.15); } 80% { transform: scale(.97, .94); } 100% { transform: scale(1); } }
@keyframes kort-wob { 0%, 100% { transform: rotate(0) scale(1, 1); } 25% { transform: rotate(-1.2deg) scale(1.01, .99); } 50% { transform: rotate(0) scale(.99, 1.025); } 75% { transform: rotate(1.2deg) scale(1.01, .99); } }
@keyframes kort-boing { 0% { transform: scale(1); } 18% { transform: scale(1.18, .78); } 42% { transform: scale(.88, 1.2) translateY(-5%); } 66% { transform: scale(1.06, .95); } 100% { transform: scale(1); } }

.spin { transform-box: view-box; transform-origin: 0 0; animation: kort-spin 7s linear infinite; }
@keyframes kort-spin { to { transform: rotate(360deg); } }
.drift { animation: kort-drift 60s linear infinite; }
@keyframes kort-drift { from { transform: translateX(-300px); } to { transform: translateX(300px); } }
.tw { animation: kort-tw 3s ease-in-out infinite; }
@keyframes kort-tw { 50% { opacity: .25; } }
.blink { animation: kort-blink 1.2s steps(1) infinite; }
@keyframes kort-blink { 50% { opacity: .2; } }

/* Boble ved tryk og mærke over steder med et spil */
.bub { transform-box: fill-box; transform-origin: 50% 100%; animation: kort-bub 1.3s cubic-bezier(.3, 1.6, .5, 1) forwards; }
@keyframes kort-bub { 0% { transform: translateY(20px) scale(0); opacity: 1; } 35% { transform: translateY(-30px) scale(1.15); } 55% { transform: translateY(-34px) scale(1); } 85% { opacity: 1; } 100% { transform: translateY(-60px) scale(.9); opacity: 0; } }
.mark { pointer-events: none; animation: kort-mark 1.1s ease-in-out infinite; }
@keyframes kort-mark { 50% { transform: translateY(-10px); } }

/* Spillene som almindelige links, hvis kortet ikke kan tegnes (uden JavaScript) */
.spil-liste { position: fixed; top: 40%; left: 0; right: 0; display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; padding: 1rem; z-index: 3; }
.spil-liste ul { display: contents; list-style: none; }
.spil-liste li { display: contents; }
.har-kort .spil-liste { display: none; }

/* Menuen øverst til højre. Hører sammen med /js/menu.js. */
.menu { position: fixed; top: calc(8px + env(safe-area-inset-top, 0px)); right: calc(8px + env(safe-area-inset-right, 0px)); z-index: 7; }
.menu-knap { position: relative; z-index: 2; display: grid; place-items: center; width: 52px; height: 52px; margin-left: auto; border-radius: 50%; background: rgba(255, 255, 255, .94); color: var(--ink); box-shadow: 0 3px 12px rgba(0, 0, 0, .18); cursor: pointer; list-style: none; user-select: none; -webkit-user-select: none; }
.menu-knap::-webkit-details-marker { display: none; }
.menu-knap:focus-visible { outline: 4px solid var(--ink); outline-offset: 3px; }
/* Den aktive spillers figur som et lille mærke på knappen */
.menu-avatar { position: absolute; left: -10px; bottom: -10px; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .25); font-size: 1.2rem; line-height: 1; }
.menu-burger { width: 32px; height: 32px; fill: none; stroke: currentColor; stroke-width: 2.8; stroke-linecap: round; }
.menu-bag { position: fixed; inset: 0; z-index: 1; background: rgba(29, 53, 87, .25); }
.menu-panel { position: relative; z-index: 2; display: flex; flex-direction: column; gap: .25rem; width: min(18rem, calc(100vw - 16px)); max-height: calc(100vh - 84px); max-height: calc(100dvh - 84px); overflow-y: auto; margin-top: .5rem; padding: .5rem; border-radius: 1.5rem; background: #fff; box-shadow: 0 8px 28px rgba(0, 0, 0, .28); text-align: left; }
.menu-panel form { display: contents; }
.menu-hvem { display: flex; align-items: center; gap: .75rem; padding: .35rem .75rem .6rem; margin-bottom: .25rem; border-bottom: 2px solid #eef1f5; }
.menu-hvem .avatar { font-size: 2rem; width: 52px; height: 52px; flex: none; }
.menu-hvem .who-name { font-size: 1.35rem; min-width: 0; overflow-wrap: anywhere; }
.menu-punkt { display: flex; align-items: center; gap: .75rem; width: 100%; min-height: 60px; padding: .5rem .75rem; border: 0; border-radius: 1rem; background: none; color: var(--ink); font-family: inherit; font-size: 1.3rem; font-weight: 700; line-height: 1.2; text-align: left; text-decoration: none; cursor: pointer; }
.menu-punkt[hidden] { display: none; }
.menu-punkt:hover, .menu-punkt:active { background: #eef6fb; }
.menu-punkt:focus-visible { outline: 4px solid var(--ink); outline-offset: -4px; }
.menu-ikon { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 50%; background: #f1ead6; font-size: 1.6rem; line-height: 1; }
.kort-notice { position: fixed; top: calc(34vh); left: 50%; transform: translateX(-50%); z-index: 6; max-width: 90vw; box-shadow: 0 3px 12px rgba(0, 0, 0, .18); }

@media (prefers-reduced-motion: reduce) {
    .pop, .wob, .spin, .drift, .tw, .blink, .mark { animation: none !important; }
}
