/* Perennia – öffentliche Webseite.
   Farben: Tannengrün als Grund, die Rangfarben Keimling und Setzling als helle Töne, Bernstein als Akzent. */
:root {
  --fir: #0f2a20;
  --fir-deep: #0a1f18;
  --moss: #173a2c;
  --moss-line: #2a5340;
  --leaf: #b5ec8e;
  --sprout: #d4f8b8;
  --amber: #f0a93b;
  --paper: #f2f6ec;
  --muted: #a3bba9;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", "URW Palladio L", Georgia, serif;
  --sans: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", "Noto Sans", Arial, sans-serif;
  --measure: 62ch;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 4.5rem; }
body {
  margin: 0;
  background: var(--fir);
  color: var(--paper);
  font: 1.0625rem/1.6 var(--sans);
  -webkit-text-size-adjust: 100%;
}
[hidden] { display: none !important; }
a { color: var(--leaf); text-underline-offset: 0.18em; }
a:hover { color: var(--sprout); }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.1; margin: 0; text-wrap: balance; }
h2 { font-size: clamp(1.9rem, 4vw, 2.75rem); letter-spacing: -0.01em; }
h3 { font-size: 1.5rem; color: var(--leaf); }
p { margin: 0; }

.skip { position: absolute; left: -999px; top: 0; background: var(--amber); color: var(--fir-deep); padding: 0.5rem 1rem; z-index: 10; }
.skip:focus { left: 0; }

/* ---- Kopfzeile ---- */
.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: 0.6rem clamp(1rem, 4vw, 3rem);
  background: rgba(10, 31, 24, 0.92);
  border-bottom: 1px solid var(--moss-line);
}
.brand { display: inline-flex; align-items: center; gap: 0.6rem; font-family: var(--serif); font-size: 1.3rem; color: var(--paper); text-decoration: none; }
.brand img { border-radius: 6px; image-rendering: pixelated; }
.top nav { display: flex; gap: clamp(0.8rem, 2.5vw, 1.8rem); flex-wrap: wrap; }
.top nav a { color: var(--paper); text-decoration: none; font-size: 0.98rem; padding: 0.25rem 0; border-bottom: 2px solid transparent; }
.top nav a:hover { border-bottom-color: var(--amber); }

main > section { padding: clamp(3rem, 8vw, 6rem) clamp(1rem, 4vw, 3rem); max-width: 78rem; margin: 0 auto; }
.section-lead { color: var(--muted); max-width: var(--measure); margin-top: 0.8rem; }
.state { color: var(--muted); padding: 1rem 0; }

/* ---- Anfang: Name links, Jahresringe rechts ---- */
.hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: clamp(2rem, 5vw, 5rem); align-items: center; min-height: min(86vh, 54rem); }
.hero h1 { font-size: clamp(3.6rem, 11vw, 8.5rem); letter-spacing: -0.03em; line-height: 0.92; color: var(--sprout); }
.meaning { font-family: var(--serif); font-size: clamp(1.3rem, 2.6vw, 1.9rem); color: var(--amber); margin-top: 0.9rem; }
.lead { margin-top: 1.4rem; max-width: 34rem; font-size: 1.15rem; }

.join { margin-top: 2rem; display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; }
.join-label { color: var(--muted); font-size: 0.95rem; width: 100%; }
.join code { font: 600 1.35rem var(--sans); background: var(--fir-deep); border: 1px solid var(--moss-line); border-radius: 8px; padding: 0.55rem 0.9rem; color: var(--paper); }
button, select, input { font: inherit; }
.join button { background: var(--amber); color: var(--fir-deep); border: 0; border-radius: 8px; padding: 0.65rem 1.1rem; font-weight: 600; cursor: pointer; }
.join button:hover { background: #ffc15e; }

.online { margin-top: 2rem; border-left: 3px solid var(--leaf); padding-left: 1rem; }
.online-count { font-weight: 600; }
.online-count.off { color: var(--muted); font-weight: 400; }
.players { list-style: none; margin: 0.5rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.3rem 0.9rem; font-size: 0.98rem; }
.players li { --rank: var(--muted); }
.players li::before { content: ""; display: inline-block; width: 0.55em; height: 0.55em; border-radius: 50%; background: var(--rank); margin-right: 0.4em; }

.rings { margin: 0; }
.rings svg { width: 100%; max-width: 30rem; display: block; margin: 0 auto; }
.rings path { fill: none; stroke-linecap: round; }
.rings .core { fill: var(--amber); stroke: none; }
.rings figcaption { max-width: 30rem; margin: 1rem auto 0; color: var(--muted); font-size: 0.98rem; }
.rings ol { list-style: none; margin: 0.7rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.25rem 1.2rem; color: var(--paper); }
.rings ol li { --rank: var(--leaf); display: flex; gap: 0.5rem; align-items: baseline; }
.rings ol li::before { content: ""; flex: none; width: 0.7em; height: 0.7em; border-radius: 50%; border: 0.18em solid var(--rank); }
.rings ol small { color: var(--muted); font-size: 0.86rem; display: block; }

@media (prefers-reduced-motion: no-preference) {
  .rings path.ring { stroke-dasharray: var(--len); stroke-dashoffset: var(--len); animation: grow 1.1s ease-out forwards; animation-delay: var(--delay); }
  @keyframes grow { to { stroke-dashoffset: 0; } }
}

/* ---- Besonderheiten: drei Gruppen, jede als Liste mit Begriff und Erklärung ---- */
.features h2 { margin-bottom: 2.5rem; }
.feature-group { display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr); gap: 1rem 3rem; padding: 2rem 0; border-top: 1px solid var(--moss-line); }
.feature-group dl { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 1.6rem 2.5rem; }
.feature-group dl > div { position: relative; padding-left: 3.6rem; min-height: 2.75rem; }
.feature-group dt { font-weight: 600; font-size: 1.1rem; color: var(--paper); }
.ico { position: absolute; left: 0; top: 0; width: 2.75rem; height: 2.75rem; padding: 0.65rem; border-radius: 12px;
  background: var(--moss); border: 1px solid var(--moss-line); color: var(--leaf);
  fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.feature-group:nth-of-type(2) .ico { color: var(--amber); }
.feature-group:nth-of-type(3) .ico { color: var(--sprout); }
.feature-group dd { margin: 0.3rem 0 0; color: var(--muted); }

/* ---- Welten: drei Tafeln, jede mit einem kleinen Bild der Welt ---- */
.world-list { margin-top: 2.5rem; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; }
.world { background: var(--fir-deep); border: 1px solid var(--moss-line); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; }
.world svg { display: block; width: 100%; height: auto; }
.world-body { padding: 1.3rem 1.4rem 1.4rem; display: flex; flex-direction: column; gap: 0.7rem; flex: 1; }
.world h3 { color: var(--sprout); font-size: 1.6rem; }
.world code, .book-entry code, .section-lead code { font: 600 0.92rem var(--sans); background: var(--moss); border: 1px solid var(--moss-line); border-radius: 6px; padding: 0.15rem 0.5rem; color: var(--amber); align-self: flex-start; }
.world p { color: var(--muted); }
.world ul { margin: 0; padding-left: 1.1rem; color: var(--paper); font-size: 0.98rem; }
.world li { margin: 0.25rem 0; }
.world li::marker { color: var(--leaf); }
.world .world-live { margin-top: auto; padding-top: 0.8rem; border-top: 1px solid var(--moss-line); color: var(--leaf); font-size: 0.95rem; min-height: 2.4em; }

/* ---- Rangtabelle ---- */
.table-wrap { margin-top: 2rem; overflow-x: auto; border: 1px solid var(--moss-line); border-radius: 10px; background: var(--fir-deep); }
.table-wrap .state { padding: 1.5rem; }
table { border-collapse: collapse; width: 100%; min-width: 46rem; font-size: 0.95rem; }
th, td { padding: 0.55rem 0.8rem; text-align: center; border-bottom: 1px solid rgba(42, 83, 64, 0.6); white-space: nowrap; }
tbody th { text-align: left; font-weight: 400; position: sticky; left: 0; background: var(--fir-deep); white-space: normal; min-width: 13rem; max-width: 18rem; }
tbody th small { display: block; color: var(--muted); font-size: 0.82rem; }
thead th { position: sticky; top: 0; background: var(--moss); font-family: var(--serif); font-size: 1.05rem; --rank: var(--paper); color: var(--rank); vertical-align: bottom; }
thead th:first-child { left: 0; z-index: 2; text-align: left; color: var(--muted); font: 400 0.9rem var(--sans); }
thead th small { display: block; font: 400 0.78rem var(--sans); color: var(--muted); }
tr.group th { background: var(--moss); color: var(--leaf); font-family: var(--serif); font-size: 1.05rem; text-align: left; position: sticky; left: 0; }
tr.group td { background: var(--moss); }
td.yes { color: var(--leaf); font-weight: 700; }
td.no { color: #5d7a69; }
td.num { font-variant-numeric: tabular-nums; }

.table-title { margin-top: 2.5rem; }
.table-note { color: var(--muted); margin-top: 0.4rem; max-width: var(--measure); }
.table-note + .table-wrap { margin-top: 1rem; }
.supporter { margin-top: 2rem; border: 1px solid var(--moss-line); border-radius: 10px; background: var(--fir-deep); }
.supporter summary { cursor: pointer; list-style: none; display: flex; align-items: baseline; gap: 1rem; flex-wrap: wrap; padding: 1rem 1.2rem; }
.supporter summary::-webkit-details-marker { display: none; }
.supporter summary::after { content: "+"; margin-left: auto; color: var(--amber); font-size: 1.5rem; line-height: 1; }
.supporter[open] summary::after { content: "–"; }
.summary-title { font-family: var(--serif); font-size: 1.35rem; color: var(--amber); }
.summary-note { color: var(--muted); font-size: 0.95rem; }
.supporter-notes { margin: 0 1.2rem 1rem; padding-left: 1.2rem; color: var(--paper); max-width: var(--measure); }
.supporter-notes li { margin: 0.3rem 0; }
.supporter .table-wrap { margin: 0; border: 0; border-top: 1px solid var(--moss-line); border-radius: 0 0 10px 10px; }

/* ---- Shops ---- */
.search { margin-top: 2rem; display: grid; grid-template-columns: minmax(0, 1fr) 14rem; gap: 0.3rem 1rem; max-width: 46rem; }
.search label { font-size: 0.92rem; color: var(--muted); }
.search label[for="q"] { grid-column: 1; grid-row: 1; }
.search label[for="mode"] { grid-column: 2; grid-row: 1; }
.search input, .search select { background: var(--fir-deep); color: var(--paper); border: 1px solid var(--moss-line); border-radius: 8px; padding: 0.7rem 0.9rem; width: 100%; }
.search input::placeholder { color: #6f8c7b; }
.offers { list-style: none; margin: 1rem 0 0; padding: 0; border-top: 1px solid var(--moss-line); }
.offers li { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr); gap: 0.2rem 1.5rem; padding: 0.85rem 0; border-bottom: 1px solid var(--moss-line); align-items: baseline; }
.offer-name { font-weight: 600; font-size: 1.08rem; }
.offer-name small { font-weight: 400; color: var(--muted); font-size: 0.86rem; margin-left: 0.5rem; }
.offer-price b { color: var(--amber); font-variant-numeric: tabular-nums; }
.offer-price span, .offer-where span { display: block; color: var(--muted); font-size: 0.9rem; }
.tag { display: inline-block; font-size: 0.78rem; font-weight: 600; border: 1px solid currentColor; border-radius: 999px; padding: 0.05rem 0.55rem; margin-left: 0.5rem; color: var(--leaf); vertical-align: 0.1em; }
.tag.stall { color: var(--amber); }

/* ---- Handbuch ---- */
.search.single { grid-template-columns: minmax(0, 1fr); max-width: 34rem; }
#book { margin-top: 0.5rem; }
.book-category { border-top: 1px solid var(--moss-line); }
.book-category:last-child { border-bottom: 1px solid var(--moss-line); }
.book-category summary { cursor: pointer; list-style: none; display: flex; align-items: baseline; gap: 0.4rem 1rem; flex-wrap: wrap; padding: 1rem 0; }
.book-category summary::-webkit-details-marker { display: none; }
.book-category summary::after { content: "+"; color: var(--muted); font-size: 1.4rem; line-height: 1; }
.book-category[open] summary::after { content: "–"; }
.book-category .title { font-family: var(--serif); font-size: 1.35rem; color: var(--leaf); }
.book-category .summary-note { flex: 1; min-width: 12rem; }
.book-category .count { color: var(--muted); font-size: 0.88rem; font-variant-numeric: tabular-nums; }
.book-entries { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 1rem; padding: 0.2rem 0 1.6rem; }
.book-entry { background: var(--fir-deep); border: 1px solid var(--moss-line); border-radius: 10px; padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: 0.5rem; }
.book-entry h4 { margin: 0; font: 600 1.05rem var(--sans); color: var(--paper); }
.book-entry p { color: var(--muted); font-size: 0.97rem; }
.book-link { align-self: center; }

/* ---- Changelog ---- */
#log { margin-top: 2rem; max-width: 46rem; }
#log details { border-top: 1px solid var(--moss-line); }
#log details:last-child { border-bottom: 1px solid var(--moss-line); }
#log summary { cursor: pointer; padding: 0.8rem 0; display: flex; gap: 1rem; align-items: baseline; list-style: none; }
#log summary::-webkit-details-marker { display: none; }
#log summary::after { content: "+"; margin-left: auto; color: var(--muted); font-size: 1.3rem; line-height: 1; }
#log details[open] summary::after { content: "–"; }
#log .version { font-variant-numeric: tabular-nums; color: var(--amber); font-weight: 600; min-width: 4.2rem; }
#log .title { font-family: var(--serif); font-size: 1.15rem; }
#log ul { margin: 0 0 1rem 5.2rem; padding: 0 0 0 1.1rem; color: var(--muted); }
#log li { margin: 0.2rem 0; }

.foot { border-top: 1px solid var(--moss-line); padding: 2rem clamp(1rem, 4vw, 3rem) 3rem; color: var(--muted); font-size: 0.9rem; max-width: 78rem; margin: 0 auto; display: grid; gap: 0.4rem; }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; min-height: 0; }
  .world-list { grid-template-columns: 1fr; }
  .feature-group { grid-template-columns: 1fr; }
  .offers li { grid-template-columns: 1fr; }
  .search { grid-template-columns: 1fr; }
  .search label[for="q"], .search label[for="mode"] { grid-column: 1; grid-row: auto; }
  #log ul { margin-left: 0; }
  .rings ol { grid-template-columns: 1fr; }
}
