@font-face { font-family: 'Anton'; src: url('/fonts/Anton-Regular.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: 'Space Grotesk'; src: url('/fonts/SpaceGrotesk.ttf') format('truetype'); font-weight: 300 700; font-display: swap; }

:root {
  --petrol: #0E5E6F; --lime: #C6F432; --ink: #121212; --paper: #F6F1E7;
  --red: #D91E26; --yellow: #FFE45C; --pink: #FF4FA3; --navy: #1B2A6B; --violet: #9B2FC9; --green: #2BB65A;
  --safe-top: env(safe-area-inset-top, 0px); --safe-bottom: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--petrol); color: #fff; font-family: 'Space Grotesk', system-ui, sans-serif; -webkit-tap-highlight-color: transparent; }
button { font: inherit; cursor: pointer; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.screen { min-height: 100%; }

/* Login */
#login { padding: calc(28px + var(--safe-top)) 24px 32px; display: flex; flex-direction: column; gap: 28px; max-width: 520px; margin: 0 auto; }
.kicker { font-size: 13px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--lime); }
h1 { font-family: 'Anton', Impact, sans-serif; font-weight: 400; font-size: clamp(64px, 22vw, 112px); line-height: .86; margin: 10px 0 0; color: var(--lime); }
.lead { font-size: 20px; font-weight: 700; margin: 0 0 14px; }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tile { border: 0; height: 120px; font-family: 'Anton', Impact, sans-serif; font-size: 40px; text-transform: uppercase; text-align: left; padding: 14px 16px; display: flex; align-items: flex-end; }
.tile[data-user=arne] { background: var(--lime); color: var(--petrol); }
.tile[data-user=luca] { background: var(--red); color: #fff; }
.tile[data-user=biene] { background: var(--pink); color: var(--navy); }
.tile[data-user=mimi] { background: var(--violet); color: #fff; }
.tile:active { transform: scale(.98); }
#pin { width: 100%; height: 64px; border: 3px solid var(--lime); background: transparent; color: #fff; font-family: 'Anton', Impact, sans-serif; font-size: 34px; letter-spacing: .3em; padding: 0 16px; outline: none; }
#pin:focus { background: rgba(198, 244, 50, .1); }
.row { display: flex; gap: 12px; margin-top: 8px; }
.btn { flex: 1; height: 56px; border: 0; background: var(--lime); color: var(--petrol); font-weight: 700; font-size: 17px; text-transform: uppercase; letter-spacing: .08em; }
.btn.ghost { background: transparent; color: var(--lime); border: 2px solid var(--lime); }
.btn.wide { width: 100%; flex: none; }
.err { color: var(--yellow); font-weight: 700; min-height: 22px; margin: 10px 0 0; }

/* App-Rahmen */
#app { height: 100%; display: flex; flex-direction: column; }
.bar { display: flex; align-items: center; gap: 10px; padding: calc(10px + var(--safe-top)) 12px 10px; background: var(--petrol); z-index: 1000; }
.who { font-family: 'Anton', Impact, sans-serif; font-size: 22px; padding: 4px 10px; text-transform: uppercase; }
.geo { flex: 1; min-width: 0; height: 44px; border: 2px solid rgba(255,255,255,.35); background: transparent; color: #fff; display: flex; align-items: center; gap: 8px; padding: 0 12px; font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.geo .dot { width: 12px; height: 12px; flex-shrink: 0; background: #999; }
.geo.on .dot { background: var(--lime); box-shadow: 0 0 0 3px rgba(198,244,50,.3); }
.geo.warn .dot { background: var(--yellow); }
.geo.bad { border-color: var(--yellow); }
.geo.bad .dot { background: var(--red); }
.icon { width: 44px; height: 44px; border: 0; background: transparent; color: var(--lime); display: grid; place-items: center; }
main { flex: 1; position: relative; min-height: 0; }
.view { position: absolute; inset: 0; }
#map { position: absolute; inset: 0; background: var(--paper); }
.tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); background: var(--ink); padding-bottom: var(--safe-bottom); z-index: 1000; }
.tab { height: 60px; border: 0; background: transparent; color: #bbb; font-family: 'Anton', Impact, sans-serif; font-size: 22px; text-transform: uppercase; letter-spacing: .04em; }
.tab.on { color: var(--ink); background: var(--lime); }

.fab { position: absolute; right: 14px; bottom: 16px; z-index: 900; height: 48px; padding: 0 16px; border: 0; background: var(--ink); color: var(--lime); font-weight: 700; font-size: 15px; box-shadow: 0 2px 0 rgba(0,0,0,.25); }

/* Alarm-Banner */
.alert { position: absolute; left: 12px; right: 12px; top: calc(74px + var(--safe-top)); z-index: 1200; background: var(--yellow); color: var(--ink); padding: 14px 16px; font-weight: 700; font-size: 17px; line-height: 1.35; border: 3px solid var(--ink); }
.alert b { font-family: 'Anton', Impact, sans-serif; font-weight: 400; font-size: 22px; display: block; text-transform: uppercase; }

/* Zeit */
#view-time { overflow-y: auto; padding: 16px 14px 24px; background: var(--paper); color: var(--ink); }
.events { display: flex; flex-direction: column; gap: 14px; margin-bottom: 16px; }
.ev { padding: 18px 18px 16px; color: #fff; background: var(--petrol); }
.ev .lbl { font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--lime); }
.ev h2 { font-family: 'Anton', Impact, sans-serif; font-weight: 400; font-size: 40px; line-height: .95; margin: 6px 0 4px; text-transform: uppercase; }
.ev .cd { font-family: 'Anton', Impact, sans-serif; font-size: 58px; line-height: 1; margin: 8px 0 6px; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.ev p { margin: 0; font-size: 15px; line-height: 1.4; }
.ev.soon { background: var(--yellow); color: var(--ink); }
.ev.soon .lbl { color: var(--red); }
.ev.now { background: var(--red); color: #fff; animation: blink 1.2s steps(2) infinite; }
.ev.now .lbl { color: var(--yellow); }
.ev.done { background: #d9d3c6; color: #555; }
.ev.done .lbl { color: #555; }
@keyframes blink { 50% { background: #a3121a; } }
.hint { font-size: 13px; line-height: 1.4; color: #444; margin: 12px 2px 0; }
#wake.on { background: var(--petrol); color: var(--lime); border-color: var(--petrol); }
#view-time .btn.ghost { color: var(--petrol); border-color: var(--petrol); }

/* Personen-Liste (Orga) */
.people { position: absolute; left: 10px; right: 10px; bottom: 76px; z-index: 900; display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.person { flex: 0 0 auto; border: 0; padding: 8px 12px; text-align: left; color: #fff; min-width: 108px; }
.person b { font-family: 'Anton', Impact, sans-serif; font-weight: 400; font-size: 20px; display: block; text-transform: uppercase; }
.person span { font-size: 12px; font-weight: 700; }
.person.stale { opacity: .6; }

/* Kartenmarker */
.mk { display: grid; place-items: center; font-family: 'Anton', Impact, sans-serif; font-size: 18px; border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.mk.stale { filter: grayscale(1); opacity: .7; }
.mk.arne { font-size: 22px; animation: pulse 1.6s ease-out infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(198,244,50,.9); } 100% { box-shadow: 0 0 0 18px rgba(198,244,50,0); } }
.st { display: grid; place-items: center; font-family: 'Anton', Impact, sans-serif; font-size: 13px; background: var(--paper); color: var(--petrol); border: 2px solid var(--petrol); }
.me { width: 22px; height: 22px; border-radius: 50%; background: #2F6BFF; border: 4px solid #fff; box-shadow: 0 0 0 0 rgba(47,107,255,.7); animation: me 1.6s ease-out infinite; }
@keyframes me { 100% { box-shadow: 0 0 0 16px rgba(47,107,255,0); } }
.osm .leaflet-tile-pane { filter: grayscale(.85) contrast(1.05) brightness(1.03); }
.leaflet-container { font-family: 'Space Grotesk', system-ui, sans-serif; }

/* Arne: fester Rahmen im Plakat-Look, nur die Karte darin zoomt */
.view.framed { display: flex; flex-direction: column; background: var(--petrol); padding: 0 12px 12px; }
.view.framed[hidden] { display: none !important; }
.planhead { flex: none; padding: 10px 2px 10px; }
.planhead .pk { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; opacity: .85; }
.planhead .pr { display: flex; align-items: flex-end; gap: 12px; margin-top: 2px; }
.planhead h2 { margin: 0; font-family: 'Anton', Impact, sans-serif; font-weight: 400; font-size: 46px; line-height: .9; color: var(--lime); text-transform: uppercase; flex: none; }
.planhead p { margin: 0; font-size: 11.5px; line-height: 1.3; }
.planhead p b { display: block; font-family: 'Anton', Impact, sans-serif; font-weight: 400; font-size: 17px; color: var(--lime); }
.view.framed #map { position: relative; inset: auto; flex: 1; min-height: 0; border: 4px solid var(--ink); background: var(--petrol); }
.view.framed .fab { right: 26px; bottom: 28px; }

/* Umschlag-Knopf links unten */
.fab.left { right: auto; left: 14px; background: var(--lime); color: var(--petrol); }
.view.framed .fab.left { left: 26px; right: auto; }

/* Okko-Knopf */
.fox { position: fixed; right: 14px; bottom: calc(82px + var(--safe-bottom) + 64px); z-index: 1100; width: 74px; height: 74px; border-radius: 50%; border: 4px solid var(--ink); background: var(--yellow); padding: 6px 8px 0; display: flex; flex-direction: column; align-items: center; box-shadow: 0 3px 0 rgba(0,0,0,.3); }
.fox svg { width: 44px; height: 44px; }
.fox span { font-family: 'Anton', Impact, sans-serif; font-size: 12px; text-transform: uppercase; color: var(--ink); line-height: 1; margin-top: -2px; }
.fox:active { transform: translateY(2px); box-shadow: none; }

/* Fenster */
.sheetwrap { position: fixed; inset: 0; z-index: 2500; background: rgba(10,20,24,.55); display: flex; align-items: flex-end; }
.sheet { width: 100%; background: var(--paper); color: var(--ink); border-top: 6px solid var(--lime); padding: 20px 18px calc(18px + var(--safe-bottom)); }
.sheet h3 { margin: 0 0 6px; font-family: 'Anton', Impact, sans-serif; font-weight: 400; font-size: 32px; text-transform: uppercase; color: var(--petrol); }
.sheet p { margin: 0 0 14px; font-size: 16px; line-height: 1.4; }
.sheet .btns { display: flex; flex-direction: column; gap: 8px; }
.sheet .btn { flex: none; width: 100%; background: var(--petrol); color: var(--lime); }
.sheet .btn.ghost { background: transparent; color: var(--petrol); border: 3px solid var(--petrol); }
.numin { width: 100%; height: 64px; margin-bottom: 12px; border: 3px solid var(--petrol); background: #fff; font-family: 'Anton', Impact, sans-serif; font-size: 34px; text-align: center; color: var(--ink); }
.numin.bad { border-color: var(--red); }

/* Okko-Alarm */
.okko { position: fixed; inset: 0; z-index: 3000; background: var(--yellow); color: var(--ink); padding: calc(30px + var(--safe-top)) 24px calc(24px + var(--safe-bottom)); display: flex; flex-direction: column; animation: okko 0.76s steps(1) infinite; }
@keyframes okko { 50% { background: var(--lime); } }
.okkofox svg { width: 120px; height: 120px; animation: wig .38s ease-in-out infinite alternate; }
@keyframes wig { from { transform: rotate(-8deg); } to { transform: rotate(8deg); } }
.okko .kicker { margin-top: 18px; color: var(--ink); font-size: 15px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.okko h2 { margin: 4px 0 14px; font-family: 'Anton', Impact, sans-serif; font-weight: 400; font-size: clamp(56px, 17vw, 92px); line-height: .9; text-transform: uppercase; color: var(--petrol); }
.okko p { font-size: 18px; line-height: 1.4; margin: 0 0 auto; font-weight: 600; }
.okko .btn { flex: none; width: 100%; height: 64px; background: var(--petrol); color: var(--lime); font-size: 19px; margin-top: 24px; }

/* Treffpunkt-Stern */
.star { animation: starpulse 1s ease-in-out infinite alternate; filter: drop-shadow(0 2px 0 rgba(0,0,0,.35)); }
@keyframes starpulse { from { transform: scale(.85); } to { transform: scale(1.15); } }

/* Orga: Fortschritt */
.progress { background: var(--lime); color: var(--petrol); padding: 16px; margin-bottom: 14px; }
.progress .lbl { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.progress h2 { margin: 2px 0 2px; font-family: 'Anton', Impact, sans-serif; font-weight: 400; font-size: 36px; text-transform: uppercase; line-height: 1; }
.progress .big { margin: 0 0 4px; font-weight: 700; }
.progress .pace { margin: 0 0 10px; font-size: 13px; }
.goal { border-left: 8px solid var(--petrol); background: rgba(255,255,255,.55); padding: 8px 10px; margin-top: 8px; display: flex; flex-direction: column; gap: 2px; font-size: 14px; color: var(--ink); }
.goal b { font-family: 'Anton', Impact, sans-serif; font-weight: 400; font-size: 18px; text-transform: uppercase; color: var(--petrol); }
.goal.ok { border-color: var(--green); }
.goal.tight { border-color: #E8A400; }
.goal.late { border-color: var(--red); }
.goal .pre { font-size: 12.5px; opacity: .8; }
.log { list-style: none; margin: 6px 0 0; padding: 0; font-size: 14px; color: var(--ink); }
.log li { display: flex; gap: 10px; padding: 4px 0; border-top: 1px solid rgba(14,94,111,.2); }
.log time { font-weight: 700; color: var(--petrol); min-width: 44px; }
.log li.dead span { text-decoration: line-through; opacity: .7; }
.log li.alarm span, .log li.help span { color: var(--red); font-weight: 700; }

#view-time { padding-bottom: 120px; }

/* Okko schreit um Hilfe: 3 Sekunden blinkendes Warnrot */
.helpscreen { position: fixed; inset: 0; z-index: 3200; background: var(--red); color: #fff; padding: calc(40px + var(--safe-top)) 24px calc(30px + var(--safe-bottom)); display: flex; flex-direction: column; justify-content: center; animation: helpblink .3s steps(1) infinite; }
@keyframes helpblink { 50% { background: #7A0A10; } }
.helpscreen .okkofox svg { width: 130px; height: 130px; animation: wig .15s ease-in-out infinite alternate; }
.helpscreen h2 { margin: 18px 0 16px; font-family: 'Anton', Impact, sans-serif; font-weight: 400; font-size: clamp(58px, 18vw, 96px); line-height: .9; text-transform: uppercase; color: var(--yellow); }
.helpscreen .who { margin: 0; font-size: 20px; font-weight: 700; min-height: 28px; }

/* Orga: Handynummern */
.phones { background: #fff; border: 3px solid var(--petrol); padding: 14px; margin-bottom: 16px; color: var(--ink); }
.phones .lbl { font-family: 'Anton', Impact, sans-serif; font-size: 20px; text-transform: uppercase; color: var(--petrol); }
.phones p { margin: 4px 0 10px; font-size: 13px; line-height: 1.4; }
.prow { display: grid; grid-template-columns: 74px 1fr auto; gap: 6px; align-items: center; margin-top: 8px; }
.pname { font-family: 'Anton', Impact, sans-serif; font-size: 17px; text-transform: uppercase; padding: 10px 8px; text-align: center; }
.prow input { min-width: 0; height: 42px; border: 2px solid var(--petrol); padding: 0 10px; font-size: 16px; font-family: inherit; }
.prow button { height: 42px; border: 0; background: var(--petrol); color: var(--lime); font-weight: 700; padding: 0 10px; font-size: 13px; text-transform: uppercase; }
.prow small { grid-column: 2 / 4; font-size: 12px; font-weight: 700; color: var(--green); min-height: 0; }
.prow small:empty { display: none; }
.prow small.miss { color: var(--red); }
