/* Oles Freunde: freundliche Blockwelt. Ruhige Farben, klare Karten, keine Animationen. */
:root {
  color-scheme: light;
  --paper: #f6efdb;
  --card: #fffdf4;
  --ink: #33301f;
  --muted: #6b6349;
  --line: #e0d5b6;
  --grass: #55a04a;
  --grass-dark: #3c7a35;
  --grass-light: #7cc168;
  --dirt: #8a5a34;
  --sky: #bfe6f4;
  --sun: #ffcf4d;
  --accent: #c8521f;
  --quest: #ffe28a;
  --link: #2c6e9e;
  --shadow: 5px 5px 0 rgba(51, 48, 31, .14);
}
* { box-sizing: border-box; }
html { scroll-padding-top: 1.5rem; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: "Segoe UI", system-ui, sans-serif; font-size: 17px; line-height: 1.7; }
a { color: var(--link); text-underline-offset: .2em; text-decoration-thickness: 2px; }
a:hover { color: var(--accent); }
a:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 3px; }
.skip { position: fixed; left: 1rem; top: -6rem; padding: .5rem 1rem; background: var(--ink); color: #fff; z-index: 2; border-radius: 0 0 6px 6px; }
.skip:focus { top: 0; }

/* Kopfzeile mit Grasblock-Zeichen */
.masthead { max-width: 1220px; margin: auto; padding: 1.6rem 3rem 1.2rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; border-bottom: 4px solid var(--ink); }
.brand { display: flex; align-items: center; gap: .8rem; font-size: 1.15rem; font-weight: 800; letter-spacing: .08em; text-decoration: none; color: var(--ink); }
.brand::before { content: ""; width: 34px; height: 34px; flex: none; border: 3px solid var(--ink); border-radius: 5px; background: linear-gradient(var(--grass) 0 45%, var(--dirt) 45% 100%); box-shadow: 3px 3px 0 rgba(51, 48, 31, .2); }
.brand span { display: block; font-size: .68rem; font-weight: 600; letter-spacing: .14em; color: var(--muted); }
.edition, .eyebrow, .chapter-label, .first > span { font-family: Consolas, monospace; font-size: .78rem; letter-spacing: .06em; }
.edition { color: var(--muted); }

main { max-width: 1220px; padding: 0 3rem; margin: auto; }

/* Einstieg mit Bildszene */
.hero { padding: 3.2rem 0 2.6rem; max-width: 1060px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 2.5rem; align-items: start; }
.hero-art { display: block; width: 100%; height: auto; border: 3px solid var(--ink); border-radius: 10px; box-shadow: var(--shadow); background: var(--sky); }
.eyebrow { display: inline-block; margin: 0 0 1.1rem; padding: .3rem .8rem; font-weight: 700; color: var(--ink); background: var(--quest); border: 2px solid var(--ink); border-radius: 6px; text-transform: uppercase; }
h1, h2 { font-weight: 800; letter-spacing: -.02em; line-height: 1.12; }
h1 { font-size: clamp(2.3rem, 4.6vw, 3.9rem); margin: 0 0 1.4rem; text-shadow: 3px 3px 0 rgba(85, 160, 74, .35); }
.lead { max-width: 700px; font-size: 1.18rem; color: var(--muted); }

/* Wichtig-Karte */
.first { display: grid; grid-template-columns: 135px 1fr; gap: 1.4rem; padding: 1.3rem 1.5rem; margin-top: 2.2rem; max-width: 870px; background: var(--quest); border: 3px solid var(--ink); border-radius: 10px; box-shadow: var(--shadow); }
.first > span { color: var(--ink); font-weight: bold; padding-top: .3rem; }
.first p { margin: 0; font-size: .98rem; }

/* Inhaltsverzeichnis als Quest-Chips */
.contents { display: flex; flex-wrap: wrap; gap: .7rem 1rem; padding: 1.2rem 0 1.4rem; font-family: Consolas, monospace; font-size: .88rem; }
.contents a { display: inline-block; padding: .4rem .9rem; color: var(--ink); background: var(--card); border: 2px solid var(--ink); border-radius: 999px; text-decoration: none; box-shadow: 3px 3px 0 rgba(51, 48, 31, .14); }
.contents a:hover { background: var(--quest); color: var(--ink); }

/* Kapitel als klare Karten */
.chapter { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 2.2rem; padding: 2.6rem 0; }
.chapter-label { color: var(--muted); padding-top: .4rem; }
.chapter-label .icon { display: block; width: 52px; height: 52px; padding: 6px; margin-bottom: .7rem; background: var(--card); border: 3px solid var(--ink); border-radius: 10px; box-shadow: var(--shadow); }
.chapter-body { max-width: 780px; padding: 1.7rem 2rem 1.2rem; background: var(--card); border: 3px solid var(--ink); border-radius: 12px; box-shadow: var(--shadow); }
h2 { font-size: clamp(1.55rem, 2.5vw, 2.1rem); margin: 0 0 1.1rem; }
p { margin: 0 0 1.1rem; }
.chapter-body > p:last-child { margin-bottom: .4rem; }
li { margin-bottom: .7rem; }
ol li::marker { font-weight: 700; color: var(--grass-dark); }

/* Warnhinweis */
.note { padding: 1.05rem 1.3rem; border: 3px solid var(--accent); border-left-width: 10px; border-radius: 8px; background: #ffe9d9; margin: 1.4rem 0; font-size: .97rem; }

kbd, code { font-family: Consolas, monospace; font-size: .9em; }
kbd { display: inline-block; border: 2px solid #9a9070; border-bottom-width: 4px; background: var(--card); padding: .05em .45em; border-radius: 6px; font-weight: 700; }
code { overflow-wrap: anywhere; background: #f0ead3; padding: .05em .35em; border-radius: 4px; }
pre { overflow-x: auto; padding: 1.1rem 1.2rem; background: #f0ead3; border: 2px solid var(--ink); border-left-width: 10px; border-radius: 8px; line-height: 1.6; font-size: .92rem; }
pre code { overflow-wrap: normal; background: transparent; padding: 0; }

/* Quellen als Block-Knoepfe */
.source { display: block; width: fit-content; margin-top: 1rem; padding: .55rem 1rem; color: var(--ink); background: var(--sky); border: 2px solid var(--ink); border-radius: 8px; box-shadow: 3px 3px 0 rgba(51, 48, 31, .14); font-size: .9rem; font-weight: 600; text-decoration: none; }
.source:hover { background: var(--sun); color: var(--ink); }

/* Rezeptraster und Rollenliste (Admin-Seite) */
.recipe { display: grid; grid-template-columns: repeat(3, 85px); gap: 4px; margin: 1.5rem 0; font-family: Consolas, monospace; font-size: .82rem; }
.recipe span { display: grid; place-items: center; height: 62px; background: #e9e2c8; border: 2px solid #9aa58a; border-radius: 6px; }
.recipe .empty { background: transparent; border-style: dashed; color: var(--muted); }
.recipe-tip { font-size: .94rem; }
.roles { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: .9rem 1.2rem; }
.roles dt { font-weight: 700; }
.roles dd { margin: 0; }

/* Fusszeile */
footer { margin-top: 2.5rem; padding: 2.2rem 0 3.5rem; border-top: 10px solid transparent; border-image: repeating-linear-gradient(90deg, var(--grass) 0 18px, var(--grass-dark) 18px 24px, var(--dirt) 24px 42px) 10; }
footer > p { font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; margin: 0 0 1rem; }
footer span { display: block; color: var(--muted); font-size: .8rem; }
footer > a { display: inline-block; margin-inline-end: 1.4rem; }
footer > a:hover { color: var(--accent); }

/* Karte */
.map-section { padding: 1.6rem 0 2rem; }
.map-controls, .map-legend { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem 1.4rem; }
.map-controls button { font: inherit; color: var(--ink); background: var(--card); border: 2px solid var(--ink); border-radius: 8px; padding: .4rem .8rem; cursor: pointer; }
.map-controls button:hover { background: var(--quest); }
.map-controls button:focus-visible, input:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
#coordinate-map, #coordinate-map-overview { display: block; width: 100%; height: auto; border: 3px solid var(--ink); border-radius: 10px; box-shadow: var(--shadow); margin: 1rem 0; }
#map-viewport, #map-viewport-overview { position: relative; }
#map-tooltip, #map-tooltip-overview { position: absolute; z-index: 2; pointer-events: none; max-width: calc(100% - 1rem); padding: .45rem .7rem; border: 2px solid #fff; border-radius: 6px; background: #08255a; color: #fff; font-weight: 700; box-shadow: 0 2px 8px #0006; }
.map-background { fill: var(--card); }
.map-grid { stroke: #d9d2b8; stroke-width: 1; }
.map-text { fill: var(--ink); font: 16px Consolas, monospace; }
.map-protection { fill: #c8521f33; stroke: #c8521f; stroke-width: 2; }
.map-claim-outline { fill: none; stroke: #00143d; stroke-width: 6; pointer-events: none; }
.map-claim { fill: #168bff1a; stroke: #45ceff; stroke-width: 2.5; }
.map-label { fill: #fff; stroke: #00143d; stroke-width: 3; paint-order: stroke; font: bold 16px Consolas, monospace; }
#coordinate-map [tabindex]:focus-visible, #coordinate-map-overview [tabindex]:focus-visible { outline: none; stroke: #fff; stroke-width: 4; }
.map-spawn { stroke: var(--ink); stroke-width: 4; }
.map-legend span { padding: .25rem .7rem; background: var(--card); border: 2px solid var(--ink); border-radius: 999px; font-size: .85rem; }
.legend-protection { border-bottom: 5px solid #c8521f; }
.legend-claim { border-bottom: 5px dashed #001b87; }
.legend-spawn { border-bottom: 5px solid var(--ink); }

/* Serverregeln: nummerierte Karten auf /regeln */
.rules-list { list-style: none; margin: 1.2rem 0; padding: 0; counter-reset: regel; display: grid; gap: .8rem; }
.rules-list li { counter-increment: regel; position: relative; margin: 0; padding: .9rem 1rem .9rem 3.6rem; background: #fff; border: 2px solid var(--ink); border-radius: 8px; }
.rules-list li::before { content: counter(regel); position: absolute; left: .9rem; top: .8rem; width: 1.9rem; height: 1.9rem; display: grid; place-items: center; background: var(--quest); border: 2px solid var(--ink); border-radius: 6px; font: 700 1rem Consolas, monospace; }

/* Regel-Hinweis auf der Startseite */
.rules-overlay { position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; padding: 1rem; background: rgba(51, 48, 31, .55); }
.rules-overlay[hidden] { display: none; }
.rules-dialog { width: min(560px, 100%); max-height: 92vh; overflow: auto; padding: 1.5rem 1.7rem; background: var(--card); border: 3px solid var(--ink); border-radius: 12px; box-shadow: 6px 6px 0 rgba(51, 48, 31, .3); }
.rules-dialog h2 { margin: 0 0 .4rem; }
.rules-dialog .rules-list li { padding: .7rem .9rem .7rem 3.2rem; font-size: .95rem; line-height: 1.55; }
.rules-dialog .rules-list li::before { left: .7rem; top: .6rem; }
.rules-hint { margin: .4rem 0 0; font-size: .9rem; color: var(--muted); }
.rules-ok { display: block; width: 100%; margin-top: 1.1rem; padding: .7rem 1rem; font: inherit; font-weight: 700; color: var(--ink); background: var(--quest); border: 3px solid var(--ink); border-radius: 8px; box-shadow: 3px 3px 0 rgba(51, 48, 31, .2); cursor: pointer; }
.rules-ok:hover:not(:disabled) { background: var(--sun); }
.rules-ok:disabled { background: #e9e2c8; color: var(--muted); cursor: not-allowed; box-shadow: none; }
.rules-ok:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

/* Ruhig bleiben: keine Bewegung bei reduzierter Motion */
@media (prefers-reduced-motion: reduce) {
  * { transition: none; animation: none; }
}

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-art { max-width: 420px; }
}
@media (max-width: 760px) {
  body { font-size: 16px; }
  .masthead { margin: 0 1.25rem; padding: 1.2rem 0 1rem; align-items: flex-start; }
  .edition { max-width: 115px; font-size: .6rem; text-align: right; }
  main { padding: 0 1.25rem; }
  .hero { padding-top: 2.2rem; }
  .first { grid-template-columns: 1fr; gap: .6rem; }
  .chapter { grid-template-columns: 1fr; gap: 1rem; padding: 2.1rem 0; }
  .chapter-label { padding: 0; }
  .chapter-label .icon { display: inline-block; vertical-align: middle; margin: 0 .7rem 0 0; width: 40px; height: 40px; }
  .chapter-body { padding: 1.3rem 1.3rem 1rem; }
  .roles { grid-template-columns: 1fr; gap: .4rem; }
  .roles dd { margin-bottom: .8rem; }
  .contents { gap: .55rem .8rem; }
}
@media print {
  .contents, .skip, .hero-art, .chapter-label .icon { display: none; }
  body { background: #fff; font-size: 11pt; }
  .chapter { break-inside: avoid; }
  .chapter-body, .first, .note, .source, #coordinate-map { border-width: 2px; box-shadow: none; }
  main, .masthead { padding-left: 0; padding-right: 0; }
}

/* Freischaltungsanfrage */
.request-form label { display: block; margin: 1rem 0; font-weight: 700; }
.request-form input { display: block; width: min(100%, 25rem); padding: .55rem; font: inherit; border: 2px solid var(--ink); border-radius: 6px; background: #fff; }
.request-form button { padding: .65rem 1rem; font: inherit; font-weight: 700; background: var(--grass-light); border: 2px solid var(--ink); border-radius: 8px; cursor: pointer; }
.request-form button:hover { background: var(--sun); }
.request-list { columns: 2; }
.request-list li { break-inside: avoid; }
.request-error { color: #a52222; }

/* Sichtbarer Countdown vor dem Einstieg */
.launch-banner { margin: 0; padding: 2rem 1.8rem 2.2rem; text-align: center; background: var(--quest); border: 5px solid var(--ink); border-radius: 12px; box-shadow: var(--shadow); }
.launch-kicker { margin: 0 0 .25rem; font: 800 .9rem Consolas, monospace; letter-spacing: .15em; }
.launch-banner h2 { margin: 0; font-size: clamp(1.25rem, 2.7vw, 2rem); }
.launch-display { margin: .75rem 0 .45rem; font: 800 clamp(3.2rem, 7vw, 6.5rem)/1.08 Consolas, monospace; font-variant-numeric: tabular-nums; letter-spacing: -.055em; overflow-wrap: anywhere; }
.launch-caption { margin: 0; }
.launch-banner.launch-live { background: var(--grass-light); }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
@media (max-width: 760px) { .launch-banner { padding: 1.3rem .8rem 1.5rem; } .launch-display { font-size: clamp(2.5rem, 8vw, 4rem); letter-spacing: -.07em; } }
