/* Oaken Tower Overlay - Website
 *
 * Holz und Pergament wie im Werkzeug, aber ruhiger: eine Website hat Platz,
 * ein Overlay von 380 px nicht.
 *
 * Die Farben stehen in erzeugen.py (FARBEN) und werden dort gegen WCAG 2.1 AA
 * nachgerechnet. Wer hier eine Farbe aendert, aendert sie DORT - sonst
 * prueft der Selbsttest etwas anderes, als die Seite zeigt.
 */

:root {
  --grund:        #191210;
  --flaeche:      #241a13;
  --flaeche-hoch: #2e2219;
  --kante:        #4a3828;
  --text:         #f2e9dc;
  --text-matt:    #c9b79c;
  --akzent:       #e8b262;
  --gut:          #8fd18f;

  --rand:  clamp(1rem, 4vw, 3rem);
  --breit: 62rem;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  background: var(--grund);
  color: var(--text);
  font: 1rem/1.65 "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  -webkit-text-size-adjust: 100%;
}

/* Sprunglink: unsichtbar, bis er den Fokus bekommt. */
.sprung {
  position: absolute; left: -9999px;
  background: var(--akzent); color: var(--grund);
  padding: .6rem 1rem; z-index: 10; font-weight: 700;
}
.sprung:focus { left: var(--rand); top: .5rem; }

:focus-visible {
  outline: 3px solid var(--akzent);
  outline-offset: 2px;
}

/* ---------------------------------------------------------------- Gerüst */

header {
  border-bottom: 1px solid var(--kante);
  padding: .9rem var(--rand);
  display: flex; flex-wrap: wrap; gap: .5rem 2rem;
  align-items: baseline; justify-content: space-between;
}
.marke { margin: 0; font-size: 1.05rem; font-weight: 700; letter-spacing: .02em; }
.marke a { color: var(--text); text-decoration: none; }

nav { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; }
nav a {
  color: var(--text-matt); text-decoration: none;
  padding: .25rem 0; border-bottom: 2px solid transparent;
}
nav a:hover { color: var(--text); border-bottom-color: var(--kante); }
nav a[aria-current="page"] { color: var(--akzent); border-bottom-color: var(--akzent); }

main { max-width: var(--breit); margin: 0 auto; padding: 2.5rem var(--rand) 4rem; }

footer {
  border-top: 1px solid var(--kante);
  padding: 2rem var(--rand) 3rem;
  color: var(--text-matt); font-size: .9rem;
}
footer p { max-width: var(--breit); margin: 0 auto .5rem; }

a { color: var(--akzent); }
a:hover { color: var(--text); }

/* -------------------------------------------------------------- Typografie */

h1 { font-size: clamp(1.9rem, 4.5vw, 2.6rem); line-height: 1.2; margin: 0 0 1rem; }
h2 { font-size: 1.5rem; line-height: 1.25; margin: 2.5rem 0 .75rem; }
h3 { font-size: 1.15rem; line-height: 1.3; margin: 1.5rem 0 .5rem; }
h4 { font-size: 1rem; margin: 0 0 .35rem; }

.vorspann { font-size: 1.12rem; color: var(--text); max-width: 46rem; }
.matt   { color: var(--text-matt); }
.gross  { font-size: 1.15rem; }
.duenn  { color: var(--text-matt); font-size: .9em; }

.hinweis {
  border-left: 3px solid var(--kante);
  padding: .6rem 0 .6rem 1rem;
  color: var(--text-matt);
  max-width: 46rem;
}

/* ------------------------------------------------------------------ Kästen */

.kasten {
  background: var(--flaeche);
  border: 1px solid var(--kante);
  border-radius: 10px;
  padding: 1.5rem;
  margin: 2rem 0;
}
.kasten h2 { margin-top: 0; }

.knopf {
  display: inline-block;
  background: var(--akzent); color: #191210;
  font-weight: 700; text-decoration: none;
  padding: .7rem 1.4rem; border-radius: 8px;
}
.knopf:hover { background: var(--text); color: #191210; }

.raster {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
}
.karte {
  background: var(--flaeche);
  border: 1px solid var(--kante);
  border-top-color: #5d472f;      /* eine Kante heller: das liest das Auge als Tiefe */
  border-radius: 10px;
  padding: 1.1rem 1.2rem;
}
.karte h3 { margin-top: 0; }
.karte p { margin-bottom: 0; color: var(--text-matt); }

/* ------------------------------------------------------------ Gegenstände */

.suche { margin: 1.5rem 0; }
.suche label { display: block; font-weight: 700; margin-bottom: .35rem; }
.suche input {
  width: 100%; max-width: 26rem;
  background: var(--flaeche-hoch); color: var(--text);
  border: 1px solid var(--kante); border-radius: 8px;
  padding: .6rem .8rem; font: inherit; font-size: 1rem;
}
.suche input::placeholder { color: var(--text-matt); }
#treffer { margin: .5rem 0 0; }

.item, .angebot {
  display: flex; gap: 1rem; align-items: flex-start;
  background: var(--flaeche);
  border: 1px solid var(--kante);
  border-radius: 10px;
  padding: 1rem;
  margin: .75rem 0;
}
.item[hidden] { display: none; }
.item-bild {
  flex: 0 0 auto; width: 64px; height: 64px;
  background: var(--flaeche-hoch);
  border: 1px solid var(--kante); border-radius: 8px;
  display: grid; place-items: center; overflow: hidden;
}
.item-bild img { display: block; image-rendering: pixelated; width: 56px; height: 56px; object-fit: contain; }
.kein-bild { width: 56px; height: 56px; }
.item-text { min-width: 0; }
.item-text h3, .item-text h4 { margin-top: 0; }
.item-text p { margin: .25rem 0; }

.marken { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 .5rem !important; }
.marke, .marke-selt {
  display: inline-block; font-size: .8rem; line-height: 1.4;
  padding: .1rem .55rem; border-radius: 999px;
  border: 1px solid var(--kante); color: var(--text-matt);
}
/* Farbe kommt ZUSÄTZLICH zum Wort, nie statt seiner. */
.marke-selt { color: var(--f, var(--text-matt)); border-color: var(--f, var(--kante)); }
.marke-selt.leer { font-style: italic; }

.stufen { list-style: none; margin: .5rem 0 0; padding: 0; }
.stufen li { margin: .2rem 0; color: var(--text-matt); }
.stufe {
  display: inline-block; min-width: 4.7rem;
  color: var(--text); font-size: .82rem; font-weight: 700;
}

/* ------------------------------------------------------------ Begegnungen */

.npc { margin: 2.5rem 0; }
.angebote { list-style: none; margin: 0; padding: 0; }
.bilanz { color: var(--gut) !important; font-weight: 700; }
.bilanz.matt { color: var(--text-matt) !important; font-weight: 400; }
.perks { color: var(--text-matt); }
.perks li { margin: .35rem 0; }
.perks strong { color: var(--text); }

/* ----------------------------------------------------------------- Builds */

.build {
  background: var(--flaeche);
  border: 1px solid var(--kante);
  border-top-color: #5d472f;
  border-radius: 10px;
  padding: 1.25rem 1.5rem 1.75rem;
  margin: 2rem 0;
}
.build h2 { margin-top: 0; }

.items {
  list-style: none; margin: .5rem 0 0; padding: 0;
  display: grid; gap: .75rem;
  grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
}
.items li { text-align: center; }
.items li p { margin: .35rem 0 0; font-size: .88rem; line-height: 1.35; }
.items .item-bild { margin: 0 auto; }

.synergie { color: var(--text-matt); padding-left: 1.2rem; }
.synergie li { margin: .3rem 0; }

/* ------------------------------------------------------------------ Klein */

@media (max-width: 30rem) {
  .item, .angebot { flex-direction: column; }
  header { flex-direction: column; align-items: flex-start; }
}
