@font-face { font-family: Inter; src: url('../fonts/Inter.ttf') format('truetype'); font-weight: 100 900; }

:root { --grund: #1a2127; --flaeche: #232d35; --gruen: #55ad57; --text: #e8ece9; --leise: #9aa7a0; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--grund); color: var(--text); font: 15px/1.45 Inter, system-ui, sans-serif; overflow: hidden; }

body { display: grid; grid-template-rows: auto 1fr; height: 100vh; }
#haupt { display: grid; grid-template-columns: 1fr minmax(340px, 420px); min-height: 0; }
#buehne { position: relative; min-width: 0; overflow: hidden; container-type: size; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
#szene, #szene canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#laden { position: absolute; inset: 0; display: grid; place-items: center; color: var(--leise); background: var(--grund); }
#laden[hidden] { display: none; }

/* Fernglas: schwarze Maske mit zwei überlappenden Kreisen (SVG aus app.js) */
#fernglas { position: absolute; inset: 0; pointer-events: none; }
#fernglas canvas { width: 100%; height: 100%; display: block; }
#fernglas[hidden] { display: none; }

#kompass { position: absolute; bottom: 2.2vmin; width: clamp(64px, 30cqmin, 260px); transform: translateX(-50%); filter: drop-shadow(0 4px 10px rgba(0,0,0,.45)); touch-action: none; cursor: grab; }
#kompass:active { cursor: grabbing; }
#kompass svg { display: block; width: 100%; height: auto; }
body.glas #kompass { opacity: 0; }

#leiste { display: flex; gap: 10px; align-items: center; padding: 8px 14px; background: var(--flaeche); border-bottom: 1px solid #36434d; font-size: 14px; }
#leiste strong { color: var(--gruen); letter-spacing: .04em; text-transform: uppercase; margin-right: 6px; }
#leiste button { font: inherit; color: var(--text); background: var(--flaeche); border: 1px solid #36434d; border-radius: 6px; padding: 5px 12px; cursor: pointer; }
#leiste button:hover, #leiste button.an { border-color: var(--gruen); color: #fff; }
#leiste button.an { background: #2f5e30; }
.tgl { display: inline-flex; border: 1px solid #36434d; border-radius: 6px; overflow: hidden; }
.tgl button { border: 0 !important; border-radius: 0 !important; }
#seed { margin-left: auto; color: var(--leise); font-variant-numeric: tabular-nums; }

/* Seitenleiste: Meldung und Bewertung */
#meldung { background: var(--grund); border-left: 1px solid #36434d; padding: 16px 18px 24px; overflow-y: auto; font-size: 14px; }
#meldung h2 { margin: 0 0 6px; font-size: 18px; color: #fff; }
#meldung .hilfe { color: var(--leise); margin: 0 0 10px; }
#meldung kbd { background: var(--flaeche); border: 1px solid #44525c; border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; font-size: 12px; }
#meldung textarea, #beanstanden textarea { width: 100%; font: inherit; font-size: 15px; line-height: 1.45; color: var(--text); background: #11171b; border: 1px solid #44525c; border-radius: 8px; padding: 10px; resize: vertical; }
#meldung textarea:focus, #beanstanden textarea:focus { outline: none; border-color: var(--gruen); }
#meldung button, #beanstanden .knoepfe button { font: inherit; color: var(--text); background: var(--flaeche); border: 1px solid #44525c; border-radius: 6px; padding: 7px 14px; cursor: pointer; }
#meldung button:hover, #beanstanden .knoepfe button:hover { border-color: var(--gruen); }
#meldung button.haupt, #beanstanden button.haupt { background: #2f5e30; border-color: var(--gruen); color: #fff; font-weight: 600; }
.knoepfe { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 10px 0 14px; }
.knoepfe small { color: var(--leise); }
details { border-top: 1px solid #2d3840; padding-top: 10px; }
summary { cursor: pointer; color: var(--gruen); font-weight: 600; }
dl.fuenfw { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 10px 0; }
dl.fuenfw dt { color: var(--gruen); font-weight: 600; }
dl.fuenfw dd { margin: 0; }
.gesamt { background: var(--flaeche); border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; }
.gesamt b { font-size: 40px; line-height: 1; color: #fff; margin-right: 8px; }
.gesamt span { color: var(--leise); }
.balken { height: 6px; background: #11171b; border-radius: 3px; overflow: hidden; margin-top: 8px; }
.balken i { display: block; height: 100%; background: var(--gruen); }
.gesamt.teilweise .balken i, li.teilweise .balken i { background: #d6a636; }
.gesamt.fehlt .balken i, li.fehlt .balken i, li.unpraezise .balken i { background: #c9573e; }
blockquote { margin: 0 0 10px; padding: 8px 12px; border-left: 3px solid #44525c; color: #cfd6d2; font-style: italic; }
.hinweis { margin: 0 0 8px; color: #e7c46a; }
ol.ws { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 10px; }
ol.ws > li { background: var(--flaeche); border-radius: 8px; padding: 9px 12px; }
ol.ws .kopf { display: flex; align-items: baseline; gap: 8px; }
ol.ws .kopf b { color: #fff; min-width: 48px; }
ol.ws .pkt { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--leise); }
.chip { font-size: 11.5px; font-weight: 600; border-radius: 999px; padding: 1px 8px; }
li.gut .chip { background: #24452a; color: #a6e0a2; }
li.teilweise .chip { background: #4a3d1c; color: #f0cf7a; }
li.unpraezise .chip, li.fehlt .chip { background: #4d2620; color: #f2a493; }
ol.ws ul { margin: 6px 0 0; padding-left: 18px; color: #cfd6d2; }
ol.ws .tipp { margin: 6px 0 0; color: var(--gruen); }
.muster { border: 1px solid #36434d; border-left: 4px solid var(--gruen); border-radius: 8px; padding: 10px 12px; }
.muster p { margin: 4px 0; }
.muster small { color: var(--leise); }
.muster.verdeckt { border-left-color: #44525c; color: var(--leise); }
.fehler { margin: 0; font-size: 13px; }
.fehler a, #leiste a { color: var(--leise); }
.fehler a:hover, #leiste a:hover { color: var(--gruen); }
#meldung button.leise-knopf { padding: 0; font-size: 13px; color: var(--leise); background: none; border: 0; text-decoration: underline; text-underline-offset: 2px; }
#meldung button.leise-knopf:hover { color: var(--gruen); }
/* Modus: Training | Wettkampf */
#leiste .modus { display: inline-flex; background: #11171b; border: 1px solid #36434d; border-radius: 999px; padding: 2px; }
#leiste .modus button { border: 0; border-radius: 999px; padding: 4px 12px; background: none; color: var(--leise); }
#leiste .modus button.an { background: #2f5e30; color: #fff; }
body.wettkampf #neu, body.wettkampf #seed, body.wettkampf #feedback { display: none; }
body.wettkampf #hilfe-knopf { margin-left: auto; }   /* ohne Lage-Nummer rechts halten */
#leiste #version { color: #5f6d75; font-size: 12px; background: none; border: 0; padding: 2px 4px; text-decoration: underline dotted; text-underline-offset: 3px; }
#leiste #version:hover { color: var(--gruen); }
/* Dialoge: Änderungen je Version (hinter der Versionsnummer), Ergebnis beanstanden */
#aenderungen, #beanstanden, #hilfe { max-width: min(640px, 92vw); max-height: 84vh; overflow: auto; padding: 18px 22px 20px; background: var(--flaeche); color: var(--text); border: 1px solid #36434d; border-radius: 10px; box-shadow: 0 18px 50px rgba(0,0,0,.5); }
#aenderungen::backdrop, #beanstanden::backdrop, #hilfe::backdrop { background: rgba(10,14,17,.6); }
#aenderungen h2, #beanstanden h2, #hilfe h2 { margin: 0 0 4px; font-size: 18px; color: var(--gruen); }
#aenderungen h3 { margin: 18px 0 2px; font-size: 15px; }
#aenderungen h3 small { color: var(--leise); font-weight: 400; margin-left: 6px; }
#aenderungen h4 { margin: 10px 0 2px; font-size: 13px; color: var(--leise); text-transform: uppercase; letter-spacing: .04em; }
#aenderungen ul { margin: 0; padding-left: 18px; }
#aenderungen li { margin: 3px 0; }
#hilfe { max-width: min(720px, 94vw); line-height: 1.45; }
#hilfe h3 { margin: 18px 0 6px; font-size: 15px; color: #fff; }
#hilfe p { margin: 6px 0; }
#hilfe ul { margin: 4px 0; padding-left: 18px; }
#hilfe li { margin: 3px 0; }
#hilfe table { width: 100%; border-collapse: collapse; font-size: 13.5px; margin: 6px 0; }
#hilfe th { text-align: left; color: var(--leise); font-weight: 500; font-size: 12px; padding: 4px 6px; border-bottom: 1px solid #36434d; }
#hilfe td { padding: 4px 6px; border-bottom: 1px solid #263038; vertical-align: top; }
#hilfe td:first-child { white-space: nowrap; }
#hilfe .beispiel { font-style: italic; color: var(--leise); }
#hilfe .formel { font-weight: 600; color: var(--gruen); font-size: 15px; }
#hilfe .leise { color: var(--leise); font-size: 12.5px; }
#hilfe kbd { font: inherit; font-size: 12px; border: 1px solid #36434d; border-radius: 4px; padding: 0 4px; }
#aenderungen .schliessen, #beanstanden .schliessen, #hilfe .schliessen { position: sticky; top: 0; float: right; font: inherit; font-size: 22px; line-height: 1; color: var(--leise); background: none; border: 0; cursor: pointer; }
#aenderungen .schliessen:hover, #beanstanden .schliessen:hover, #hilfe .schliessen:hover { color: #fff; }
#beanstanden { width: min(460px, 92vw); }
#beanstanden fieldset { border: 0; margin: 12px 0 10px; padding: 0; }
#beanstanden legend { padding: 0; margin-bottom: 6px; color: var(--leise); font-size: 13px; }
#beanstanden-ws { display: grid; gap: 4px; }
#beanstanden-ws label { display: flex; align-items: center; gap: 10px; padding: 6px 10px; background: #11171b; border: 1px solid #2d3840; border-radius: 6px; cursor: pointer; }
#beanstanden-ws label:has(:checked) { border-color: var(--gruen); }
#beanstanden-ws input { accent-color: var(--gruen); width: 16px; height: 16px; margin: 0; }
#beanstanden-ws .pkt { margin-left: auto; color: var(--leise); font-variant-numeric: tabular-nums; }
#beanstanden .feld { display: grid; gap: 4px; color: var(--leise); font-size: 13px; }
#beanstanden .hinweis { margin: 8px 0 0; }
#beanstanden .hilfe { margin: 0; color: var(--leise); font-size: 13px; }

@media (max-width: 900px) {
  html, body { overflow: auto; height: auto; }
  body { display: block; }
  #haupt { display: block; }
  #buehne { height: min(56.25vw, calc(100svh - 49px)); }   /* Handy quer: Szene passt unter die Kopfleiste */
  #meldung { border-left: 0; border-top: 1px solid #36434d; }
}

body.ohne-ui { display: block; }
body.ohne-ui #leiste, body.ohne-ui #meldung { display: none; }
body.ohne-ui #haupt { display: block; height: 100vh; }
body.ohne-ui #buehne { height: 100%; }

/* Wettkampf: Anmeldung, Fortschritt, Auswertung je Lage, Scoreboard */
#meldung .formular { display: grid; gap: 10px; margin: 6px 0 4px; }
#meldung .formular label { display: grid; gap: 4px; color: var(--leise); font-size: 13px; }
#meldung select, #meldung input { font: inherit; font-size: 15px; color: var(--text); background: #11171b; border: 1px solid #44525c; border-radius: 8px; padding: 8px 10px; }
#meldung select:focus, #meldung input:focus { outline: none; border-color: var(--gruen); }
#meldung button:disabled { opacity: .5; cursor: wait; }
.fortschritt { display: flex; gap: 6px; margin: 2px 0 10px; }
.fortschritt i { flex: 1; height: 6px; border-radius: 3px; background: #36434d; }
.fortschritt i.fertig { background: #2f5e30; }
.fortschritt i.jetzt { background: var(--gruen); }
.leistung { background: var(--flaeche); border-radius: 8px; padding: 8px 12px; margin: 0 0 12px; }
.leistung b { color: #fff; font-size: 18px; }
.lagen { display: grid; gap: 8px; margin-bottom: 6px; }
details.lage { background: var(--flaeche); border-radius: 8px; padding: 8px 12px; }
details.lage summary { display: grid; grid-template-columns: auto auto 1fr; gap: 10px; align-items: center; cursor: pointer; }
details.lage summary b { color: #fff; }
details.lage summary .balken { margin: 0; }
details.lage[open] summary { margin-bottom: 8px; }
details.lage ol.ws > li { background: #1d262d; }
details.lage.teilweise summary .balken i { background: #d6a636; }
details.lage.fehlt summary .balken i { background: #c9573e; }
.sb-titel { margin: 18px 0 6px; font-size: 16px; color: #fff; }
.sb-titel small { color: var(--leise); font-weight: 400; margin-left: 6px; font-size: 12px; }
#meldung .filter { display: inline-flex; background: #11171b; border: 1px solid #36434d; border-radius: 999px; padding: 2px; margin-bottom: 8px; }
#meldung .filter button { border: 0; border-radius: 999px; padding: 3px 12px; background: none; color: var(--leise); }
#meldung .filter button.an { background: #2f5e30; color: #fff; }
table.sb { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.sb th { text-align: left; color: var(--leise); font-weight: 500; font-size: 12px; padding: 4px 6px; border-bottom: 1px solid #36434d; }
table.sb td { padding: 5px 6px; border-bottom: 1px solid #263038; }
table.sb td:nth-child(4) { font-weight: 600; color: #fff; }
table.sb tr.eigen td { background: rgba(85,173,87,.16); }
@media (max-width: 600px) { #leiste { flex-wrap: wrap; row-gap: 6px; column-gap: 8px; } #rechtliches .lang { display: none; } }
@media (pointer: coarse) { .knoepfe small { display: none; } }   /* Strg+Enter gibt es auf dem Handy nicht */

/* Wettkampf: ganze Seite für Anmeldung und Auswertung (Rückmeldung Runde 8) */
body.wk-seite #haupt { display: none; }
body.wk-seite #glas { display: none; }
#wk-seite { min-height: 0; overflow-y: auto; padding: 22px 16px 40px; display: grid; gap: 16px; align-content: start; justify-items: center; }
#wk-seite[hidden] { display: none; }
.wk-karte { width: min(760px, 100%); background: var(--flaeche); border: 1px solid #36434d; border-radius: 12px; padding: 18px 20px; font-size: 14px; }
.wk-karte h2 { margin: 0 0 6px; font-size: 20px; color: #fff; }
.wk-karte .hilfe { color: var(--leise); margin: 0 0 10px; }
.wk-karte button { font: inherit; color: var(--text); background: #1d262d; border: 1px solid #44525c; border-radius: 6px; padding: 7px 14px; cursor: pointer; }
.wk-karte button:hover { border-color: var(--gruen); }
.wk-karte button.haupt { background: #2f5e30; border-color: var(--gruen); color: #fff; font-weight: 600; }
.wk-karte button:disabled { opacity: .5; cursor: wait; }
.wk-karte .formular { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 8px 0 6px; }
@media (max-width: 600px) { .wk-karte .formular { grid-template-columns: 1fr; } }
.wk-karte .feld { display: grid; gap: 4px; color: var(--leise); font-size: 13px; }
.wk-karte input { font: inherit; font-size: 15px; color: var(--text); background: #11171b; border: 1px solid #44525c; border-radius: 8px; padding: 9px 10px; }
.wk-karte input:focus { outline: none; border-color: var(--gruen); }
.wk-karte .gesamt { background: #1d262d; }
.wk-karte .leistung { background: #1d262d; }
.wk-karte table.sb td { border-bottom-color: #2e3a43; }
img.logo { width: 34px; height: 34px; object-fit: contain; flex: none; background: #d9dfdb; border-radius: 6px; padding: 2px; box-sizing: border-box; }   /* helle Unterlage: Wappen sind dunkel */
img.logo.klein { width: 22px; height: 22px; vertical-align: -6px; margin-right: 6px; padding: 1px; border-radius: 4px; }
/* Clan-Auswahl mit Logos */
.clanwahl { position: relative; }
.clanwahl .clan-knopf { width: 100%; display: flex; align-items: center; gap: 10px; text-align: left; background: #11171b; border-radius: 8px; padding: 6px 10px; font-size: 15px; }
.clanwahl .clan-knopf span { flex: 1; }
.clanwahl .clan-knopf i { font-style: normal; color: var(--leise); }
.clan-liste { position: absolute; z-index: 3; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px; list-style: none; background: #11171b; border: 1px solid #44525c; border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,.45); }
.clan-liste li { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 6px; cursor: pointer; color: var(--text); }
.clan-liste li small { display: block; color: var(--leise); font-size: 12px; }
.clan-liste li:hover, .clan-liste li:focus { background: #23302f; outline: none; }
.clan-liste li[aria-selected="true"] { box-shadow: inset 3px 0 0 var(--gruen); }
/* Miniaturen der Lagen in der Auswertung */
.miniaturen { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin: 6px 0 12px; }
@media (max-width: 700px) { .miniaturen { grid-template-columns: repeat(2, 1fr); } }
.wk-karte .miniatur { display: grid; gap: 4px; padding: 6px; background: #1d262d; text-align: left; }
.miniatur img, .miniatur .ohne-bild { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 5px; display: block; background: #11171b; }
.miniatur .unter { display: flex; justify-content: space-between; align-items: baseline; }
.miniatur .unter b { color: #fff; font-size: 13px; }
.miniatur .pkt { font-weight: 700; color: #fff; }
.miniatur .balken { margin: 0; }
.miniatur.teilweise .balken i { background: #d6a636; }
.miniatur.fehlt .balken i { background: #c9573e; }
#meldung h2 small.leise { color: var(--leise); font-weight: 400; font-size: 13px; }
#meldung .filter button img.logo.klein, .wk-karte .filter button img.logo.klein { margin-right: 4px; }
.wk-karte .filter { display: inline-flex; background: #11171b; border: 1px solid #36434d; border-radius: 999px; padding: 2px; margin-bottom: 8px; }
.wk-karte .filter button { border: 0; border-radius: 999px; padding: 3px 12px; background: none; color: var(--leise); }
.wk-karte .filter button.an { background: #2f5e30; color: #fff; }

/* Handy hochkant: große Ablese-Leiste unter der Szene (folgt dem Kompass) */
#ablesung { display: none; }
@media (max-width: 600px) and (orientation: portrait) {
  #ablesung { display: block; padding: 6px 12px 2px; background: var(--grund); }
  body.ohne-ui #ablesung, body.wk-seite #ablesung { display: none; }
  #ablesung svg { display: block; width: 100%; height: auto; max-height: 48px; }
}

/* Impressum und Datenschutz (impressum.html, Aufbau wie im RKB-Tool) */
body.rechtliches-seite { display: block; height: auto; min-height: 100vh; overflow: auto; font-size: 16px; line-height: 1.5; }
html:has(body.rechtliches-seite) { overflow: auto; height: auto; }
.karte { background: var(--flaeche); border-radius: 12px; padding: 22px 24px; }
.karte.schmal { max-width: 680px; margin: 24px auto; }
.rechtliches h1, .rechtliches h2 { line-height: 1.2; margin: 0 0 .6em; }
.rechtliches h1 { font-size: 26px; }
.rechtliches h2 { font-size: 17px; margin-top: 22px; }
.rechtliches ul { padding-left: 20px; }
.rechtliches .leise { color: var(--leise); }
.rechtliches .klein { font-size: 13px; }
@media (max-width: 600px) { .karte.schmal { margin: 12px; padding: 18px; } }
