/* ===== Gollum-Online – Stylesheet ===== */
:root {
  /* Hell: Pergament aus dem Auenland */
  --bg: #f5efdf;
  --bg-elev: #fffaf0;
  --text: #1f1d16;
  --muted: #6b6552;
  --border: #e2d7bb;
  --accent: #9a6f0c;
  --accent-2: #4f7a3a;
  --accent-soft: #f1e3bd;
  --kbd-bg: #efe6cf;
  --shadow: 0 1px 2px rgba(60, 45, 10, .06), 0 6px 24px rgba(60, 45, 10, .08);
  --shadow-hover: 0 2px 4px rgba(60, 45, 10, .08), 0 14px 36px rgba(60, 45, 10, .16);
  --radius: 14px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --mono: ui-monospace, "Cascadia Code", "JetBrains Mono", Consolas, monospace;
}

[data-theme="dark"] {
  /* Dunkel: Sméagols Höhle */
  --bg: #0b0e0c;
  --bg-elev: #141a16;
  --text: #ebe7d7;
  --muted: #a3ad9c;
  --border: #27322a;
  --accent: #e0b03a;
  --accent-2: #86a96f;
  --accent-soft: #2a2614;
  --kbd-bg: #1b231d;
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 6px 24px rgba(0, 0, 0, .3);
  --shadow-hover: 0 0 0 1px rgba(224, 176, 58, .25), 0 14px 36px rgba(0, 0, 0, .5), 0 0 30px rgba(224, 176, 58, .08);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }
code { font-family: var(--mono); font-size: .9em; background: var(--kbd-bg); padding: .1em .35em; border-radius: 5px; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0; }
h1, h2 { font-family: var(--serif); }

.wrap { width: min(1160px, 100% - 2.5rem); margin-inline: auto; }

.skip { position: absolute; left: -999px; top: 0; background: var(--accent); color: #fff; padding: .5rem 1rem; z-index: 100; }
.skip:focus { left: 1rem; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ===== Topbar ===== */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar__inner { display: flex; align-items: center; gap: 1.5rem; height: 64px; }
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 700; font-size: 1.1rem; color: var(--text); text-decoration: none; }
.brand__logo { width: 36px; height: 36px; filter: drop-shadow(0 0 6px rgba(224, 176, 58, .5)); }
.nav { display: flex; gap: .25rem; margin-left: auto; }
.nav a { color: var(--muted); text-decoration: none; padding: .45rem .75rem; border-radius: 8px; font-size: .95rem; font-weight: 500; }
.nav a:hover, .nav a.active { color: var(--text); background: var(--accent-soft); }

.icon-btn {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg-elev); color: var(--text); cursor: pointer;
}
.icon-btn:hover { border-color: var(--accent); }
[data-theme="light"] .i-sun, [data-theme="dark"] .i-moon { display: none; }

@media (max-width: 760px) {
  .nav { display: none; }
  .icon-btn { margin-left: auto; }
}

/* ===== Hero ===== */
.hero {
  padding: 4.5rem 0 3rem;
  background:
    radial-gradient(800px 300px at 15% 0%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%),
    radial-gradient(700px 300px at 90% 10%, color-mix(in srgb, var(--accent-2) 14%, transparent), transparent 70%);
}
.hero__eyebrow { color: var(--accent); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; font-size: .8rem; margin: 0 0 .75rem; }
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); letter-spacing: -.02em; }
.grad { background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero__lead { color: var(--muted); font-size: 1.15rem; max-width: 46ch; margin: 1rem 0 2rem; }

.search {
  display: flex; align-items: center; gap: .75rem; max-width: 560px;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: 12px;
  padding: 0 1rem; box-shadow: var(--shadow); color: var(--muted);
}
.search:focus-within { border-color: var(--accent); }
.search input { flex: 1; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; padding: .9rem 0; }
.search kbd { font-family: var(--mono); font-size: .8rem; border: 1px solid var(--border); border-radius: 6px; padding: .1rem .45rem; }
.search__empty { color: var(--muted); margin-top: 1rem; }

/* ===== Blöcke ===== */
.block { padding: 3rem 0 1rem; }
.block__head { margin-bottom: 1.5rem; }
.block__head h2 { font-size: 1.75rem; letter-spacing: -.01em; }
.block__head p { color: var(--muted); margin: .4rem 0 0; }
.subhead { font-size: 1.15rem; margin: 2.25rem 0 1rem; }

.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.grid--tools { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }

.card, .tool, .feature {
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.card { display: flex; flex-direction: column; padding: 1.25rem; }
.card--wide { grid-column: span 2; }
@media (max-width: 600px) { .card--wide { grid-column: auto; } }
.card h3, .tool h3 { font-size: 1.05rem; margin: .7rem 0 .35rem; }
.card p, .tool p { color: var(--muted); font-size: .93rem; margin: 0 0 1rem; }
.card__links { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: auto; }
.card:hover, .tool:hover, .feature:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }

.tool { display: block; padding: 1.25rem; text-decoration: none; color: inherit; }
.tool p { margin: 0; }
.tool__icon { font-size: 1.6rem; display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 12px; background: var(--accent-soft); }
.tool h3 small { color: var(--muted); font-weight: 400; }

.feature {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem;
  margin-top: 1rem; padding: 1.5rem; text-decoration: none; color: inherit;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 10%, var(--bg-elev)), color-mix(in srgb, var(--accent-2) 8%, var(--bg-elev)));
}
.feature h3 { font-size: 1.25rem; margin: .6rem 0 .25rem; }
.feature p { margin: 0; color: var(--muted); }
.feature__note { font-size: .88rem; color: var(--muted); background: var(--bg-elev); border: 1px solid var(--border); padding: .5rem .8rem; border-radius: 10px; }

.btn {
  display: inline-flex; align-items: center; gap: .3rem; padding: .45rem .9rem; border-radius: 9px;
  font-size: .88rem; font-weight: 600; text-decoration: none;
  background: var(--accent); color: #fff; border: 1px solid var(--accent);
}
[data-theme="dark"] .btn { color: #1a1406; }
.btn:hover { filter: brightness(1.08); }
.btn--ghost, [data-theme="dark"] .btn--ghost { background: transparent; color: var(--accent); }

.badge { display: inline-block; align-self: flex-start; font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: .2rem .55rem; border-radius: 999px; }
.badge--violet { background: #ede9fe; color: #6d28d9; }
.badge--orange { background: #ffedd5; color: #c2410c; }
.badge--yellow { background: #fef9c3; color: #a16207; }
.badge--indigo { background: #e0e7ff; color: #4338ca; }
.badge--blue   { background: #e0f2fe; color: #0369a1; }
.badge--green  { background: #dcfce7; color: #15803d; }
[data-theme="dark"] .badge { filter: brightness(.9) saturate(1.2); }

/* ===== Shortcuts ===== */
.tabs { display: flex; flex-wrap: wrap; gap: .4rem; padding: .35rem; background: var(--bg-elev); border: 1px solid var(--border); border-radius: 12px; width: fit-content; max-width: 100%; }
.tabs button { font: inherit; font-weight: 600; font-size: .92rem; border: 0; background: transparent; color: var(--muted); padding: .5rem 1rem; border-radius: 8px; cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--accent); color: #fff; }
[data-theme="dark"] .tabs button[aria-selected="true"] { color: #1a1406; }
.tabs button .count { font-size: .75rem; opacity: .8; margin-left: .3rem; }

.panel { margin-top: 1rem; background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: .5rem 1.25rem 1rem; }
.panel__title { margin: 1rem 0 .5rem; }

.keys { width: 100%; border-collapse: collapse; }
.keys td { padding: .55rem .5rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.keys td:first-child { white-space: nowrap; width: 1%; padding-right: 2rem; }
.keys tr:last-child td { border-bottom: 0; }
.keys tr:not(.grp):hover td { background: color-mix(in srgb, var(--accent-soft) 50%, transparent); }
.keys .grp th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); padding: 1.25rem .5rem .4rem; }
@media (max-width: 560px) { .keys td:first-child { white-space: normal; padding-right: 1rem; } }

kbd {
  font-family: var(--mono); font-size: .8rem; display: inline-block; min-width: 1.6em; text-align: center;
  padding: .12rem .45rem; border-radius: 6px; background: var(--kbd-bg);
  border: 1px solid var(--border); border-bottom-width: 2px; color: var(--text);
}

.codebox { position: relative; }
.codebox pre { margin: 0 0 .5rem; padding: 1rem 1.25rem; background: #0f172a; color: #e2e8f0; border-radius: 10px; overflow-x: auto; font-family: var(--mono); font-size: .9rem; }
.codebox code { background: none; padding: 0; }
.copy { position: absolute; top: .6rem; right: .6rem; font: inherit; font-size: .78rem; padding: .3rem .65rem; border-radius: 7px; border: 1px solid #334155; background: #1e293b; color: #e2e8f0; cursor: pointer; }
.copy:hover { background: #334155; }

/* Suche: Treffer ausblenden */
.is-hidden { display: none !important; }
mark { background: color-mix(in srgb, var(--accent-2) 35%, transparent); color: inherit; border-radius: 3px; padding: 0 .1em; }

/* ===== Footer ===== */
.footer { margin-top: 4rem; border-top: 1px solid var(--border); padding: 2rem 0; color: var(--muted); font-size: .9rem; }
.footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; align-items: center; }
.footer p { margin: 0; }
.footer nav { display: flex; gap: 1.25rem; }
.footer a { color: var(--muted); }
.footer a:hover { color: var(--accent); }

.totop {
  position: fixed; right: 1.25rem; bottom: 1.25rem; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--bg-elev); color: var(--text); font-size: 1.1rem;
  box-shadow: var(--shadow); cursor: pointer; opacity: 0; pointer-events: none; transition: opacity .2s;
}
.totop.show { opacity: 1; pointer-events: auto; }

/* ===== Rechtliche Seiten ===== */
.legal { max-width: 760px; padding: 3rem 0; }
.legal h1 { font-size: 2.2rem; margin-bottom: 1.5rem; }
.legal h2 { font-size: 1.25rem; margin: 2rem 0 .6rem; }
.legal p, .legal li { color: var(--muted); }
.legal .todo { background: #fef3c7; color: #92400e; padding: .1em .4em; border-radius: 4px; }
.back { display: inline-block; margin-top: 2rem; }

/* ===== Gollum-Extras ===== */
.hero { position: relative; overflow: hidden; }
.hero h1 { max-width: 15ch; }
.hero__ring { position: absolute; right: max(1rem, 5vw); top: 50%; width: clamp(120px, 17vw, 230px); transform: translateY(-50%) rotate(-12deg);
  filter: drop-shadow(0 0 40px rgba(224, 176, 58, .45)); animation: schweben 6s ease-in-out infinite; opacity: .95; }
@keyframes schweben { 50% { transform: translateY(-56%) rotate(-6deg); } }
@media (max-width: 1000px) { .hero__ring { opacity: .15; } }
@media (prefers-reduced-motion: reduce) { .hero__ring { animation: none; } }

.gollum-quote { position: relative; display: block; padding-left: 3rem !important; max-width: 62ch;
  font-style: italic; color: var(--text); background: color-mix(in srgb, var(--accent-2) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent-2) 35%, transparent); border-radius: 14px; padding: .8rem 1.1rem; margin: .6rem 0 0; }
.gollum-quote::before { content: "🧌"; position: absolute; left: .85rem; top: .7rem; font-style: normal; font-size: 1.4rem; line-height: 1; }

.deck-card .deck-card__meta { font-size: .82rem; color: var(--muted); margin-top: -.5rem; margin-bottom: 1rem; }

.page-title { font-size: clamp(1.8rem, 4vw, 2.6rem); }

.lang-toggle { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; border: 1px solid var(--border); border-radius: 12px; padding: .6rem 1rem; margin: 0 0 1.25rem; background: var(--bg-elev); }
.lang-toggle legend { padding: 0 .4rem; color: var(--muted); font-size: .85rem; }
.lang-toggle label { display: flex; gap: .4rem; align-items: center; cursor: pointer; }
.lang-toggle input { accent-color: var(--accent); }

.cmp-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); background: var(--bg-elev); }
.cmp { border-collapse: collapse; width: 100%; min-width: 760px; font-size: .9rem; }
.cmp th, .cmp td { padding: .6rem .75rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.cmp thead th { position: sticky; top: 0; background: var(--bg-elev); color: var(--accent); font-family: var(--serif); font-size: 1.05rem; }
.cmp tbody th { color: var(--accent-2); white-space: nowrap; font-size: .85rem; }
.cmp pre { margin: 0; font-family: var(--mono); font-size: .8rem; white-space: pre; }
.cmp tbody tr:hover { background: color-mix(in srgb, var(--accent-soft) 45%, transparent); }
