/* ==========================================================================
   NORDPAKT – MACHT DER JARLE · Zentrale Stildatei
   Designrichtung: dunkles Holz, geschmiedetes Eisen, Gold/Bronze, neblige Fjorde,
   nordische Ornamente, Pergament, dezentes Feuerlicht.
   Aufbau: 1 Variablen · 2 Basis · 3 Hintergrund · 4 Layout · 5 Navigation & Statusleiste
           6 Flächen · 7 Buttons & Formulare · 8 Komponenten · 9 Spielseiten · 10 Chat
           11 Moderation · 12 Öffentliche Seiten · 13 Responsiv · 14 Barrierearmut & Bewegung
   ========================================================================== */

/* 1 ─ Designvariablen ─────────────────────────────────────────────────────── */
:root {
  --wood-900: #120c08;
  --wood-800: #1d140d;
  --wood-700: #2a1d13;
  --wood-600: #3a2819;
  --wood-500: #4d3520;
  --iron-900: #15181b;
  --iron-700: #2b3137;
  --iron-500: #59626b;
  --iron-300: #9aa3ab;
  --gold-500: #d4a84b;
  --gold-400: #e6c272;
  --gold-300: #f3dca1;
  --bronze-500: #a8693a;
  --bronze-400: #c58552;
  --ember-500: #e2632b;
  --ember-400: #f08a4b;
  --blood-600: #8d2620;
  --blood-500: #b2352b;
  --moss-500: #4f7a46;
  --moss-400: #6f9c64;
  --frost-500: #5b8fa8;
  --frost-300: #a9cfe0;
  --parchment-100: #f6ecd4;
  --parchment-200: #ecdcb6;
  --parchment-300: #dcc596;
  --ink-900: #22170f;
  --ink-700: #4a3826;
  --ink-500: #6f5a43;

  --font-display: "Cinzel", "Trajan Pro", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --font-body: "Alegreya", "Iowan Old Style", "Palatino Linotype", Georgia, "Times New Roman", serif;
  --font-ui: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --radius-s: 4px;
  --radius-m: 8px;
  --radius-l: 14px;
  --gap: clamp(12px, 2vw, 22px);
  --shadow-deep: 0 14px 40px rgba(0, 0, 0, .55), 0 2px 6px rgba(0, 0, 0, .5);
  --shadow-soft: 0 6px 18px rgba(0, 0, 0, .35);
  --glow-fire: 0 0 24px rgba(226, 99, 43, .35), 0 0 4px rgba(240, 138, 75, .6);
  --rivet: radial-gradient(circle at 35% 35%, #c9ced3 0 1px, #6b737a 2px, #2b3137 3.5px, transparent 4px);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --t-fast: .15s;
  --t-med: .35s;
  --focus: 0 0 0 3px var(--gold-400), 0 0 0 5px var(--wood-900);
}

/* 2 ─ Basis ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  color: var(--parchment-100);
  background: var(--wood-900);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--gold-400); text-decoration-thickness: 1px; text-underline-offset: 3px; transition: color var(--t-fast); }
a:hover { color: var(--gold-300); }
h1, h2, h3 { font-family: var(--font-display); letter-spacing: .04em; line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(1.6rem, 3vw, 2.3rem); }
h2 { font-size: clamp(1.15rem, 2vw, 1.45rem); }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .8em; }
code { font-size: .85em; word-break: break-all; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--radius-s); }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--gold-500); color: var(--wood-900); padding: 8px 14px; border-radius: var(--radius-m); font-weight: 700; }
.skip-link:focus { top: 12px; }
.muted { color: var(--iron-300); }
.small { font-size: .88rem; }
.big { font-size: 1.6rem; font-family: var(--font-display); margin: .2em 0; }
.gold { color: var(--gold-400); }
.neg { color: #ff9a8a; }
.eyebrow { text-transform: uppercase; letter-spacing: .18em; font-size: .78rem; color: var(--bronze-400); margin: 0 0 .3em; font-family: var(--font-ui); }

/* 3 ─ Hintergrund: Fjord im Nebel mit Feuerschein ─────────────────────────── */
.fjord-bg {
  position: fixed; inset: 0; z-index: -2;
  background:
    radial-gradient(ellipse 80% 50% at 50% 115%, rgba(226, 99, 43, .22), transparent 60%),
    linear-gradient(180deg, rgba(18, 12, 8, .2) 0%, rgba(18, 12, 8, .85) 55%, var(--wood-900) 100%),
    url("../img/scenes/fjord.jpg") center top / cover no-repeat,
    var(--wood-900);
  filter: saturate(.8);
}
.fjord-bg::after {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 60% 30% at 20% 30%, rgba(200, 215, 225, .10), transparent 70%),
    radial-gradient(ellipse 50% 25% at 80% 45%, rgba(200, 215, 225, .08), transparent 70%);
  animation: fog 40s ease-in-out infinite alternate;
}
@keyframes fog { from { transform: translateX(-3%); opacity: .7; } to { transform: translateX(3%); opacity: 1; } }

/* 4 ─ Layout ─────────────────────────────────────────────────────────────── */
.shell { display: grid; grid-template-columns: 230px 1fr; gap: var(--gap); max-width: 1440px; margin: 0 auto; padding: var(--gap); }
.content { min-width: 0; display: flex; flex-direction: column; gap: var(--gap); }
.grid { display: grid; gap: var(--gap); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.grid-2-1 > aside { display: flex; flex-direction: column; gap: var(--gap); }
.grid-train { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.grid-tactics { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid-quarters, .grid-raids { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.row.spread { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.inline { display: inline; }
.narrow { max-width: 680px; margin-inline: auto; width: 100%; }

/* 5 ─ Kopfzeile, Statusleiste, Navigation ─────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 18px; padding: 10px var(--gap);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .04), transparent 40%),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, .12) 0 2px, transparent 2px 9px),
    linear-gradient(180deg, var(--wood-600), var(--wood-800));
  border-bottom: 3px solid var(--iron-700);
  box-shadow: 0 4px 18px rgba(0, 0, 0, .6), inset 0 -1px 0 rgba(212, 168, 75, .35);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--gold-400); font-family: var(--font-display); font-size: 1.35rem; letter-spacing: .12em; }
.brand img { filter: drop-shadow(0 0 6px rgba(212, 168, 75, .5)); }
.statusbar { flex: 1; display: flex; align-items: center; flex-wrap: wrap; gap: 10px 18px; }
.meter { display: grid; grid-template-columns: auto 140px auto; align-items: center; gap: 8px; font-family: var(--font-ui); font-size: .8rem; }
.meter-label { text-transform: uppercase; letter-spacing: .1em; color: var(--iron-300); }
.meter-track {
  position: relative; height: 14px; border-radius: 10px; overflow: hidden;
  background: linear-gradient(180deg, #0b0806, #231a12);
  border: 1px solid var(--iron-500);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, .7);
}
.meter-fill {
  --pct: 0%;
  position: absolute; inset: 0 auto 0 0; width: var(--pct);
  transition: width .8s var(--ease);
  background-size: 28px 100%;
}
.meter-energy .meter-fill {
  background-image: linear-gradient(90deg, rgba(255, 255, 255, .0), rgba(255, 255, 255, .25) 50%, rgba(255, 255, 255, 0)), linear-gradient(180deg, var(--gold-300), var(--gold-500) 55%, var(--bronze-500));
  animation: shimmer 2.8s linear infinite;
}
.meter-hp .meter-fill {
  background-image: linear-gradient(90deg, rgba(255, 255, 255, .0), rgba(255, 255, 255, .18) 50%, rgba(255, 255, 255, 0)), linear-gradient(180deg, #e56a5c, var(--blood-500) 55%, var(--blood-600));
  animation: shimmer 3.4s linear infinite;
}
@keyframes shimmer { from { background-position: -28px 0, 0 0; } to { background-position: 140px 0, 0 0; } }
.meter-value { min-width: 64px; font-variant-numeric: tabular-nums; color: var(--parchment-200); }
.regen { display: flex; flex-direction: column; font-family: var(--font-ui); font-size: .74rem; color: var(--iron-300); line-height: 1.2; }
.regen .countdown { font-size: .95rem; color: var(--frost-300); font-variant-numeric: tabular-nums; }
.coins { display: flex; align-items: center; gap: 6px; font-family: var(--font-display); color: var(--gold-400); font-size: 1.05rem; }
.coin-icon { width: 18px; height: 18px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, var(--gold-300), var(--gold-500) 55%, var(--bronze-500)); box-shadow: 0 0 6px rgba(212, 168, 75, .6), inset 0 0 0 2px rgba(120, 70, 20, .5); }
.levelbox { font-family: var(--font-ui); font-size: .82rem; color: var(--parchment-200); background: rgba(0, 0, 0, .3); border: 1px solid var(--iron-700); padding: 4px 10px; border-radius: 20px; }
.levelbox strong { color: var(--gold-400); }
.topbar-user { display: flex; align-items: center; gap: 10px; }
.me-link { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--parchment-100); font-family: var(--font-ui); font-size: .9rem; }
.icon-btn { position: relative; background: rgba(0, 0, 0, .3); border: 1px solid var(--iron-700); color: var(--parchment-100); border-radius: var(--radius-m); padding: 6px 10px; cursor: pointer; text-decoration: none; font-size: 1rem; }
.nav-toggle { display: none; }
.badge { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--ember-500); color: #fff; font: 700 .72rem/18px var(--font-ui); text-align: center; margin-left: 6px; box-shadow: var(--glow-fire); }
.icon-btn .badge { position: absolute; top: -6px; right: -8px; margin: 0; }

.mainnav {
  align-self: start; position: sticky; top: 84px;
  background: linear-gradient(180deg, var(--wood-700), var(--wood-800));
  border: 2px solid var(--iron-700); border-radius: var(--radius-l);
  box-shadow: var(--shadow-deep), inset 0 0 0 1px rgba(212, 168, 75, .15);
  padding: 10px;
}
.mainnav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.mainnav a, .mainnav .linklike {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 12px; border-radius: var(--radius-m);
  color: var(--parchment-200); text-decoration: none; font-family: var(--font-display); font-size: .95rem; letter-spacing: .04em;
  transition: background var(--t-fast), color var(--t-fast), transform var(--t-fast);
}
.mainnav a:hover, .mainnav .linklike:hover { background: rgba(212, 168, 75, .1); color: var(--gold-300); transform: translateX(2px); }
.mainnav a.active { background: linear-gradient(90deg, rgba(212, 168, 75, .25), rgba(212, 168, 75, .05)); color: var(--gold-300); box-shadow: inset 3px 0 0 var(--gold-500); }
.nav-icon { width: 22px; text-align: center; color: var(--bronze-400); }
.nav-sep { border-top: 1px solid rgba(212, 168, 75, .18); margin-top: 6px; padding-top: 6px; }
.activity-strip { display: flex; flex-wrap: wrap; gap: 8px 22px; padding: 10px 16px; border-radius: var(--radius-m); background: rgba(91, 143, 168, .15); border: 1px solid rgba(169, 207, 224, .35); font-family: var(--font-ui); font-size: .9rem; }
.activity-strip .countdown { color: var(--frost-300); font-variant-numeric: tabular-nums; }
.game-footer, .public-footer { text-align: center; padding: 20px; font-family: var(--font-ui); font-size: .82rem; color: var(--iron-300); }

/* 6 ─ Flächen: Holz, Pergament, Eisen ─────────────────────────────────────── */
.panel {
  position: relative; padding: clamp(16px, 2.4vw, 26px);
  border-radius: var(--radius-l);
  background: linear-gradient(180deg, rgba(58, 40, 25, .92), rgba(29, 20, 13, .95));
  border: 2px solid var(--iron-700);
  box-shadow: var(--shadow-deep), inset 0 1px 0 rgba(255, 255, 255, .05);
}
/* Nieten in den Ecken */
.panel::before {
  content: ""; position: absolute; inset: 6px; pointer-events: none; border-radius: calc(var(--radius-l) - 4px);
  background: var(--rivet) top left / 10px 10px no-repeat, var(--rivet) top right / 10px 10px no-repeat,
              var(--rivet) bottom left / 10px 10px no-repeat, var(--rivet) bottom right / 10px 10px no-repeat;
  opacity: .85;
}
.panel.wood {
  background:
    repeating-linear-gradient(92deg, rgba(0, 0, 0, .12) 0 3px, transparent 3px 14px, rgba(255, 255, 255, .02) 14px 15px, transparent 15px 26px),
    linear-gradient(180deg, var(--wood-500), var(--wood-700));
}
.panel.parchment {
  color: var(--ink-900);
  background:
    radial-gradient(ellipse at 20% 0%, rgba(255, 255, 255, .5), transparent 60%),
    radial-gradient(ellipse at 100% 100%, rgba(168, 105, 58, .25), transparent 55%),
    linear-gradient(180deg, var(--parchment-100), var(--parchment-200));
  border-color: var(--bronze-500);
  box-shadow: var(--shadow-deep), inset 0 0 40px rgba(120, 80, 30, .25);
}
.panel.parchment a { color: #7a3f14; }
.panel.parchment a:hover { color: var(--blood-600); }
.panel.parchment .muted { color: var(--ink-500); }
.panel.parchment .gold { color: #8a5a12; }
.panel.parchment h1, .panel.parchment h2 { color: var(--ink-900); }
.panel.parchment h2, .panel.wood h2 { position: relative; padding-bottom: .35em; }
.panel h2::after {
  content: ""; position: absolute; left: 0; bottom: 0; width: 70px; height: 2px;
  background: linear-gradient(90deg, var(--bronze-500), transparent);
}
.panel.parchment .eyebrow { color: var(--bronze-500); }
.letter { background: rgba(255, 255, 255, .35); border-left: 3px solid var(--bronze-500); padding: 12px 16px; border-radius: var(--radius-s); margin-bottom: 12px; white-space: normal; }
.panel.wood .letter { background: rgba(0, 0, 0, .25); }
.letter.staff { border-left-color: var(--frost-500); }

/* 7 ─ Buttons & Formulare ────────────────────────────────────────────────── */
.btn, button.btn {
  --btn-bg: linear-gradient(180deg, #5b636b, #343a40);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 8px 16px;
  font: 600 .95rem/1.2 var(--font-display); letter-spacing: .05em; text-decoration: none;
  color: var(--parchment-100);
  background: var(--btn-bg);
  border: 1px solid #15181b; border-radius: var(--radius-m);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 2px 0 #0b0d0f, 0 4px 10px rgba(0, 0, 0, .35);
  cursor: pointer; transition: transform var(--t-fast), filter var(--t-fast), box-shadow var(--t-fast);
}
.btn:hover { filter: brightness(1.12); transform: translateY(-1px); color: #fff; }
.btn:active { transform: translateY(1px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 1px 0 #0b0d0f; }
.btn[disabled], .btn:disabled { opacity: .5; cursor: not-allowed; transform: none; filter: grayscale(.4); }
.btn-primary { --btn-bg: linear-gradient(180deg, #4f7c8f, #2c4c5b); }
.btn-gold { --btn-bg: linear-gradient(180deg, var(--gold-400), var(--bronze-500)); color: var(--wood-900); text-shadow: 0 1px 0 rgba(255, 255, 255, .3); }
.btn-gold:hover { color: var(--wood-900); box-shadow: var(--glow-fire), inset 0 1px 0 rgba(255, 255, 255, .3); }
.btn-danger { --btn-bg: linear-gradient(180deg, #c2473a, var(--blood-600)); }
.btn-danger:hover { box-shadow: var(--glow-fire); }
.btn-sm { min-height: 32px; padding: 4px 10px; font-size: .82rem; }
.btn-block { width: 100%; }
.panel.parchment .btn, .panel.parchment .btn:hover { color: var(--parchment-100); }
.panel.parchment .btn-gold, .panel.parchment .btn-gold:hover { color: var(--wood-900); }
.btn.is-loading { position: relative; color: transparent !important; }
.btn.is-loading::after { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.linklike { background: none; border: 0; padding: 0; color: inherit; font: inherit; cursor: pointer; }
.chat-msg .linklike { color: var(--ink-500); text-decoration: underline; margin-left: 8px; }

label { display: flex; flex-direction: column; gap: 4px; font-family: var(--font-ui); font-size: .9rem; font-weight: 600; }
label small { font-weight: 400; color: var(--ink-500); }
label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; }
input, select, textarea {
  font: 1rem/1.4 var(--font-ui); color: var(--ink-900);
  background: #fffaf0; border: 1px solid var(--parchment-300); border-bottom: 2px solid var(--bronze-500);
  border-radius: var(--radius-s); padding: 9px 11px; min-height: 40px; width: 100%;
  box-shadow: inset 0 1px 3px rgba(80, 50, 20, .15);
}
.row input, .row select { width: auto; flex: 1 1 140px; }
input.qty { width: 70px; flex: 0 0 70px; }
input:focus, select:focus, textarea:focus { outline: none; box-shadow: var(--focus); }
input[type="checkbox"], input[type="radio"] { width: auto; min-height: 0; }
textarea { resize: vertical; }

/* 8 ─ Komponenten ────────────────────────────────────────────────────────── */
.flash { padding: 12px 16px; border-radius: var(--radius-m); font-family: var(--font-ui); font-size: .95rem; border: 1px solid; box-shadow: var(--shadow-soft); animation: drop var(--t-med) var(--ease); }
.flash-success { background: #20331c; border-color: var(--moss-400); color: #d7f0cf; }
.flash-error { background: #3a1512; border-color: var(--blood-500); color: #ffd9d2; }
.flash-info { background: #172a33; border-color: var(--frost-500); color: #d8eef8; }
.flash-warn { background: #3b2a10; border-color: var(--gold-500); color: #ffe8b4; }
@keyframes drop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font: 600 .76rem/1.6 var(--font-ui); background: rgba(0, 0, 0, .2); border: 1px solid rgba(0, 0, 0, .25); white-space: nowrap; }
.pill-green { background: #2d4d27; color: #d7f0cf; border-color: var(--moss-400); }
.pill-red { background: #5a1d18; color: #ffd9d2; border-color: var(--blood-500); }
.pill-gold { background: linear-gradient(180deg, var(--gold-400), var(--bronze-500)); color: var(--wood-900); border-color: var(--bronze-500); }
.pill-blue { background: #1f3d4b; color: #d8eef8; border-color: var(--frost-500); }
.diff-leicht { background: #2d4d27; color: #d7f0cf; }
.diff-mittel { background: #4a4317; color: #fff1b8; }
.diff-schwer { background: #5a3416; color: #ffd8b0; }
.diff-sehr-schwer { background: #5a1d18; color: #ffd9d2; }
.diff-legendär { background: #3b1d4f; color: #ecd8ff; }
.rank-leader { background: linear-gradient(180deg, var(--gold-400), var(--bronze-500)); color: var(--wood-900); }
.rank-deputy { background: #4b5a66; color: #fff; }
.rank-member { background: #2d4d27; color: #fff; }
.rank-probation { background: #5f5446; color: #fff; }
.title-badge { display: inline-block; margin: 4px 6px 4px 0; padding: 3px 12px; border-radius: 4px; background: linear-gradient(180deg, rgba(212, 168, 75, .3), rgba(168, 105, 58, .3)); border: 1px solid var(--gold-500); color: var(--gold-300); font-family: var(--font-display); font-size: .85rem; }
.panel.parchment .title-badge { color: #6d4410; }
.chip { display: inline-block; padding: 4px 12px; margin: 0 6px 6px 0; border-radius: 999px; border: 1px solid var(--bronze-500); text-decoration: none; font: .82rem var(--font-ui); }
.chip.active { background: var(--bronze-500); color: #fff !important; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 2px solid var(--bronze-500); margin-bottom: 16px; }
.tab { padding: 8px 14px; text-decoration: none; font-family: var(--font-display); border-radius: var(--radius-m) var(--radius-m) 0 0; }
.tab.active { background: var(--bronze-500); color: #fff !important; }
.table { width: 100%; border-collapse: collapse; font-family: var(--font-ui); font-size: .9rem; }
.table th { text-align: left; font-weight: 700; border-bottom: 2px solid var(--bronze-500); padding: 8px; }
.table td { padding: 8px; border-bottom: 1px solid rgba(110, 80, 40, .25); vertical-align: middle; }
.table tr.is-me, .table tr.unread { background: rgba(212, 168, 75, .18); font-weight: 600; }
.table .actions form { margin: 2px; }
.stats { width: 100%; border-collapse: collapse; font-family: var(--font-ui); font-size: .92rem; }
.stats th { text-align: left; font-weight: 600; padding: 4px 0; color: var(--ink-700); }
.stats td { text-align: right; font-variant-numeric: tabular-nums; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; font-family: var(--font-ui); font-size: .9rem; margin: 10px 0; }
.facts dt { font-weight: 700; }
.facts dd { margin: 0; }
.mini-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; font-size: .95rem; }
.mini-list li { padding-bottom: 6px; border-bottom: 1px dashed rgba(110, 80, 40, .3); }
.rune-list { list-style: none; padding: 0; }
.rune-list li { padding-left: 26px; position: relative; margin-bottom: 8px; }
.rune-list li::before { content: "ᚱ"; position: absolute; left: 0; color: var(--gold-500); font-weight: 700; }
.avatar-xs { display: inline-block; width: 24px; height: 24px; border-radius: 50%; vertical-align: middle; border: 1px solid var(--bronze-500); background: var(--wood-700); }
.avatar-sm { width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--bronze-500); background: var(--wood-700); }
.avatar-lg { width: 96px; height: 96px; border-radius: 50%; border: 3px solid var(--gold-500); box-shadow: 0 0 0 4px var(--wood-700), var(--glow-fire); background: var(--wood-700); }
.cards-list { display: flex; flex-direction: column; gap: 12px; }
.card { background: rgba(255, 255, 255, .35); border: 1px solid var(--parchment-300); border-radius: var(--radius-m); padding: 12px 16px; }
.card header { margin-bottom: 6px; }
.panel.wood .card { background: rgba(0, 0, 0, .25); border-color: var(--iron-700); }
details > summary { cursor: pointer; font-family: var(--font-ui); font-size: .9rem; margin: 8px 0; }
.report-box { margin-top: 16px; border-top: 1px dashed var(--bronze-500); padding-top: 8px; }
.pager { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 16px; }
.pager a { min-width: 36px; text-align: center; padding: 6px 8px; border: 1px solid var(--bronze-500); border-radius: var(--radius-s); text-decoration: none; font-family: var(--font-ui); }
.pager a.active { background: var(--bronze-500); color: #fff !important; }

/* 9 ─ Spielseiten ────────────────────────────────────────────────────────── */
.hero-banner {
  position: relative; min-height: 220px; border-radius: var(--radius-l); overflow: hidden;
  background: var(--wood-800) center / cover no-repeat;
  border: 2px solid var(--iron-700); box-shadow: var(--shadow-deep);
  display: flex; align-items: flex-end;
}
.hero-banner::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(18, 12, 8, .92) 0%, rgba(18, 12, 8, .55) 55%, rgba(18, 12, 8, .15) 100%), linear-gradient(0deg, rgba(226, 99, 43, .18), transparent 50%); }
.hero-banner-inner { position: relative; padding: clamp(18px, 3vw, 34px); max-width: 720px; }
.hero-banner h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); color: var(--gold-300); text-shadow: 0 2px 12px rgba(0, 0, 0, .8); margin-bottom: .2em; }
.small-hero { min-height: 170px; }
.char-head { display: flex; gap: 16px; align-items: center; margin-bottom: 12px; }
.quick-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.card-skill { display: flex; flex-direction: column; }
.card-skill header { display: flex; align-items: center; gap: 10px; }
.card-skill h2 { margin: 0; }
.card-skill h2::after { display: none; }
.skill-rune { width: 40px; height: 40px; flex: 0 0 40px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 35% 30%, var(--gold-400), var(--bronze-500)); color: var(--wood-900); font: 700 1.3rem var(--font-display); box-shadow: var(--glow-fire); }
.skill-strength .skill-rune::before { content: "ᚦ"; }
.skill-dexterity .skill-rune::before { content: "ᚹ"; }
.skill-speed .skill-rune::before { content: "ᚱ"; }
.skill-health .skill-rune::before { content: "ᛒ"; }
.skill-rhetoric .skill-rune::before { content: "ᚨ"; }
.skill-levels { font-family: var(--font-display); font-size: 1.1rem; margin-top: 10px; }
.skill-levels strong { color: var(--gold-400); }
.skill-benefit { flex: 1; color: var(--parchment-200); }
.card-skill .facts { color: var(--parchment-200); }
.card-skill.is-active, .tactic-card.is-active { border-color: var(--gold-500); box-shadow: var(--shadow-deep), 0 0 0 2px var(--gold-500), var(--glow-fire); }
.tactic-card .pros li::marker { content: "▲ "; color: var(--moss-400); }
.tactic-card .cons li::marker { content: "▼ "; color: #e56a5c; }
.tactic-card ul { padding-left: 1.4em; margin: 0 0 12px; }
.pros-h { color: var(--moss-400); } .cons-h { color: #e56a5c; }

.village-map { padding: 0; overflow: hidden; aspect-ratio: 16 / 7; min-height: 260px; }
.village-map::before { display: none; }
.map-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: sepia(.35) saturate(.8) brightness(.7); }
.map-paths { position: absolute; inset: 0; width: 100%; height: 100%; }
.map-paths line { stroke: rgba(243, 220, 161, .7); stroke-width: .5; stroke-dasharray: 1.5 1.2; vector-effect: non-scaling-stroke; stroke-width: 3; }
.map-pin { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; text-decoration: none; color: var(--parchment-100); z-index: 1; }
.pin-dot { width: 22px; height: 22px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, var(--gold-300), var(--bronze-500)); border: 2px solid var(--wood-900); box-shadow: 0 0 0 3px rgba(212, 168, 75, .5), 0 4px 10px rgba(0, 0, 0, .6); transition: transform var(--t-fast); }
.map-pin.is-here .pin-dot { background: radial-gradient(circle at 35% 30%, #ffd2b0, var(--ember-500)); animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 3px rgba(226, 99, 43, .6), 0 0 0 0 rgba(226, 99, 43, .5); } 50% { box-shadow: 0 0 0 3px rgba(226, 99, 43, .6), 0 0 0 14px rgba(226, 99, 43, 0); } }
.pin-label { margin-top: 6px; padding: 4px 10px; border-radius: var(--radius-s); background: rgba(18, 12, 8, .85); border: 1px solid var(--bronze-500); font-family: var(--font-display); text-align: center; white-space: nowrap; font-size: .95rem; }
.pin-label small { display: block; font: .72rem var(--font-ui); color: var(--parchment-300); }
.map-pin:hover .pin-dot { transform: scale(1.2); }
.card-img { width: calc(100% + 2 * clamp(16px, 2.4vw, 26px)); max-width: none; margin: calc(-1 * clamp(16px, 2.4vw, 26px)) calc(-1 * clamp(16px, 2.4vw, 26px)) 14px; height: 150px; object-fit: cover; border-radius: var(--radius-l) var(--radius-l) 0 0; filter: saturate(.85); }
.quarter-card.is-here { border-color: var(--ember-500); box-shadow: var(--shadow-deep), var(--glow-fire); }
.ownbar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: #000; border: 1px solid var(--iron-500); margin: 8px 0; }
.ownbar.big-bar { height: 18px; }
.own-npc { background: repeating-linear-gradient(45deg, #5f5446 0 6px, #4f4538 6px 12px); }
.own-player { background: linear-gradient(180deg, var(--gold-400), var(--bronze-500)); }
.raid-card.is-locked, .item-card.is-locked { opacity: .6; }

.bgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.bcard { display: flex; flex-direction: column; border-radius: var(--radius-m); overflow: hidden; background: #fffaf0; border: 1px solid var(--parchment-300); box-shadow: 0 3px 10px rgba(80, 50, 20, .2); transition: transform var(--t-fast), box-shadow var(--t-fast); }
.bcard:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(80, 50, 20, .35); }
.bcard-img img { height: 110px; width: 100%; object-fit: cover; }
.bcard-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.bcard-body h3 { font-size: .98rem; margin: 0 0 4px; }
.bcard-body form { margin-top: auto; padding-top: 8px; }
.bcard.is-mine { outline: 3px solid var(--gold-500); }
.bcard.is-owned .bcard-img { box-shadow: inset 0 -3px 0 var(--gold-500); }
.type-thorschrein .bcard-img img, .type-handelshaus .bcard-img img { filter: saturate(1.1) contrast(1.05); }
.type-thorschrein { border-color: var(--gold-500); }
.building-detail .detail-img { width: 100%; max-height: 340px; object-fit: cover; border-radius: var(--radius-m); margin-bottom: 14px; border: 2px solid var(--bronze-500); }
.opp-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.opp-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding-bottom: 8px; border-bottom: 1px dashed rgba(110, 80, 40, .3); }

.report .verdict { font: 700 2.2rem var(--font-display); margin: 0 0 10px; }
.report .verdict.win { color: var(--moss-500); text-shadow: 0 0 18px rgba(111, 156, 100, .5); }
.report .verdict.loss { color: var(--blood-500); }
.hp-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; font-family: var(--font-ui); }
.hp-compare div { background: rgba(255, 255, 255, .45); padding: 10px; border-radius: var(--radius-m); display: flex; flex-direction: column; }
.combat-log { list-style: none; padding: 14px 18px; margin: 14px 0; background: rgba(34, 23, 15, .9); color: var(--parchment-200); border-radius: var(--radius-m); font: .92rem/1.6 var(--font-ui); max-height: 480px; overflow: auto; border: 1px solid var(--iron-700); }
.combat-log li.round { color: var(--gold-400); margin-top: 6px; font-family: var(--font-display); }
.combat-log li.miss { color: var(--iron-300); }

.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.item-card { display: flex; gap: 12px; padding: 12px; border-radius: var(--radius-m); background: rgba(0, 0, 0, .28); border: 1px solid var(--iron-700); transition: border-color var(--t-fast), transform var(--t-fast); }
.item-card:hover { border-color: var(--gold-500); transform: translateY(-2px); }
.item-card img { flex: 0 0 48px; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .6)); }
.item-card h3 { margin: 0 0 4px; font-size: 1rem; color: var(--gold-300); }
.item-card.is-equipped { border-color: var(--gold-500); box-shadow: inset 0 0 0 1px var(--gold-500); }
.item-stats span { display: inline-block; margin-right: 8px; color: var(--frost-300); }
.item-stats span.neg { color: #ff9a8a; }
.perm-list { list-style: none; padding: 0; columns: 2; font-family: var(--font-ui); font-size: .9rem; }
.perm-list .yes { color: var(--moss-500); } .perm-list .no { color: var(--blood-500); }
.member-list { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.avatar-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 10px; margin-bottom: 12px; }
.avatar-pick label { align-items: center; padding: 8px; border-radius: var(--radius-m); border: 2px solid transparent; cursor: pointer; }
.avatar-pick input { position: absolute; opacity: 0; }
.avatar-pick input:checked + img { box-shadow: 0 0 0 3px var(--gold-500), var(--glow-fire); border-radius: 50%; }
.avatar-pick input:focus-visible + img { box-shadow: var(--focus); border-radius: 50%; }
.notif-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.notif-list li { padding: 8px 12px; border-radius: var(--radius-s); background: rgba(255, 255, 255, .3); }
.notif-list li.unread { border-left: 4px solid var(--ember-500); font-weight: 600; }
.stat-tiles .tile { display: flex; flex-direction: column; padding: 16px; border-radius: var(--radius-m); background: rgba(255, 255, 255, .4); text-decoration: none; border: 1px solid var(--parchment-300); font-family: var(--font-ui); }
.stat-tiles .tile strong { font: 700 2rem var(--font-display); color: var(--ink-900); }

/* 10 ─ Chat ──────────────────────────────────────────────────────────────── */
.chat-panel { display: flex; flex-direction: column; min-height: 70vh; }
.chat-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; }
.chat-log { flex: 1; min-height: 320px; max-height: 60vh; overflow-y: auto; padding: 12px; background: rgba(255, 255, 255, .45); border: 1px solid var(--parchment-300); border-radius: var(--radius-m); display: flex; flex-direction: column; gap: 6px; }
.chat-msg { display: grid; grid-template-columns: 28px 1fr; gap: 2px 8px; align-items: start; padding: 6px 8px; border-radius: var(--radius-m); animation: drop .25s var(--ease); }
.chat-msg .avatar-xs { grid-row: span 2; width: 28px; height: 28px; }
.chat-msg.mine { background: rgba(91, 143, 168, .15); }
.chat-msg.staff .chat-meta a { color: #1f5d78; font-weight: 700; }
.chat-meta { font: .78rem var(--font-ui); color: var(--ink-500); }
.chat-meta a { font-weight: 700; text-decoration: none; }
.chat-text { word-wrap: break-word; overflow-wrap: anywhere; }
.chat-form { display: flex; gap: 8px; margin-top: 10px; }
.inline-report { grid-column: 2; display: flex; gap: 6px; margin-top: 4px; }

/* 11 ─ Moderation ─────────────────────────────────────────────────────────── */
.mod-tabs { margin-top: 8px; }
.context-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.context-list li { padding: 10px 14px; border-radius: var(--radius-m); background: rgba(255, 255, 255, .35); }
.context-list li.reported { border: 2px solid var(--blood-500); background: rgba(178, 53, 43, .12); }
.sanction-perm_ban, .sanction-bot_ban, .sanction-temp_ban { border-left: 4px solid var(--blood-500); }
.sanction-warning, .sanction-chat_mute, .sanction-fine { border-left: 4px solid var(--gold-500); }
.sanction-lift_ban, .sanction-lift_mute { border-left: 4px solid var(--moss-500); }

/* 12 ─ Öffentliche Seiten (Login/Registrierung) ──────────────────────────── */
.public-main { max-width: 1040px; margin: 0 auto; padding: clamp(18px, 4vw, 48px) 16px; display: flex; flex-direction: column; gap: var(--gap); }
.public-hero { text-align: center; padding: 20px 0 10px; }
.hero-emblem { margin: 0 auto 8px; filter: drop-shadow(0 0 18px rgba(226, 99, 43, .55)); animation: ember 4s ease-in-out infinite; }
@keyframes ember { 50% { filter: drop-shadow(0 0 28px rgba(226, 99, 43, .8)); } }
.title-rune {
  font-size: clamp(2.6rem, 9vw, 5.2rem); margin: 0; letter-spacing: .2em; text-transform: uppercase;
  background: linear-gradient(180deg, var(--gold-300) 0%, var(--gold-500) 50%, var(--bronze-500) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 3px 0 rgba(0, 0, 0, .6)) drop-shadow(0 0 24px rgba(212, 168, 75, .35));
}
.subtitle { font-family: var(--font-display); letter-spacing: .5em; text-transform: uppercase; color: var(--parchment-200); margin-top: 4px; }
.subtitle::before, .subtitle::after { content: " ᛟ "; color: var(--bronze-400); letter-spacing: 0; }
.auth-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: var(--gap); align-items: start; }
.auth-card { max-width: 520px; width: 100%; justify-self: center; }
.credits { display: flex; flex-direction: column; gap: 14px; }
.credit { display: grid; grid-template-columns: 120px 1fr; gap: 14px; font: .9rem/1.5 var(--font-ui); padding-bottom: 14px; border-bottom: 1px dashed var(--bronze-500); }
.credit img { width: 120px; height: 80px; object-fit: cover; border-radius: var(--radius-s); }
.credit a { word-break: break-all; }

/* 13 ─ Responsiv ──────────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .grid-3 > :last-child { grid-column: 1 / -1; }
  .meter { grid-template-columns: auto 100px auto; }
}
@media (max-width: 860px) {
  body { font-size: 16px; }
  .shell { grid-template-columns: 1fr; padding: 12px; }
  .nav-toggle { display: inline-block; }
  .mainnav { position: fixed; top: 0; bottom: 0; left: 0; width: min(300px, 84vw); z-index: 30; border-radius: 0; transform: translateX(-105%); transition: transform var(--t-med) var(--ease); overflow-y: auto; }
  .mainnav.open { transform: none; }
  .topbar { flex-wrap: wrap; gap: 8px; padding: 8px 12px; }
  .brand span { display: none; }
  .brand .brand-logo { display: none; }
  .brand .brand-mark { display: block; }
  .statusbar { order: 3; flex-basis: 100%; gap: 6px 12px; }
  .meter { grid-template-columns: auto 1fr auto; flex: 1 1 100%; }
  .topbar-user { margin-left: auto; }
  .me-link span { display: none; }
  .grid-2, .grid-3, .grid-4, .grid-2-1, .auth-grid { grid-template-columns: 1fr; }
  .grid-3 > :last-child { grid-column: auto; }
  .village-map { aspect-ratio: 4 / 5; }
  .pin-label { font-size: .8rem; white-space: normal; max-width: 120px; }
  .table { font-size: .84rem; }
  .table thead { display: none; }
  .table tr { display: block; border-bottom: 1px solid rgba(110, 80, 40, .3); padding: 6px 0; }
  .table td { display: block; border: 0; padding: 2px 4px; }
  .perm-list { columns: 1; }
  .btn { min-height: 44px; }
  .btn-sm { min-height: 36px; }
}
@media (max-width: 420px) {
  .quick-actions { grid-template-columns: 1fr; }
  .credit { grid-template-columns: 1fr; }
  .hp-compare { grid-template-columns: 1fr; }
}

/* 14 ─ Barrierearmut & reduzierte Bewegung ───────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .fjord-bg::after { animation: none; }
}
@media (prefers-contrast: more) {
  .panel.parchment { background: var(--parchment-100); }
  .muted { color: inherit; }
}
@media print {
  .topbar, .mainnav, .fjord-bg, .game-footer { display: none; }
  .panel { box-shadow: none; }
}

.warn { color: #b3541e; font-weight: 600; }

/* Unterschlupf auf der Karte */
.map-pin.map-home .pin-dot { background: radial-gradient(circle at 35% 30%, #d9f3c8, #3f7d3a); border-radius: 3px; }
.map-pin.map-home .pin-label { background: rgba(30, 50, 25, .85); }
.map-pin.map-target .pin-dot { width: 10px; height: 10px; background: var(--gold-400, #d4a84b); }
.hideout-map { position: relative; aspect-ratio: 1 / 1; max-width: 640px; margin: 0 auto; border-radius: 10px; overflow: hidden; background: #24312a; }
.hideout-map .map-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .55; }
.travel-line { stroke: #f0d48a; stroke-width: .5; stroke-dasharray: 1.5 1; fill: none; }
.admin-table td, .admin-table th { white-space: nowrap; }
.admin-table .ip { font-family: ui-monospace, monospace; font-size: .85em; }
.dot-online { display: inline-block; width: .6em; height: .6em; border-radius: 50%; background: #4caf50; margin-right: .3em; }
.dot-offline { display: inline-block; width: .6em; height: .6em; border-radius: 50%; background: #777; margin-right: .3em; }
.hideout-map .map-svg { position: absolute; inset: 0; }
.table-wrap { overflow-x: auto; }

/* ---------- Logo und Avatare (Grafikpaket) ---------- */
.brand .brand-logo { height: 38px; width: auto; }
.brand .brand-mark { display: none; height: 38px; width: 38px; }
.title-logo { margin: 0 auto 4px; max-width: 560px; }
.title-logo img { width: 100%; height: auto; filter: drop-shadow(0 4px 18px rgba(0, 0, 0, .6)); }
.avatar-fieldset { border: 0; padding: 0; margin: 0; }
.avatar-fieldset legend { font-weight: 600; margin-bottom: 6px; }
.avatar-pick label { display: flex; flex-direction: column; text-align: center; position: relative; }
.avatar-pick img { border-radius: 50%; }
.avatar-sm, .avatar-lg { border-radius: 50%; object-fit: cover; }

/* ---------- Tagesbelohnung, Aufgaben, Balken ---------- */
.bar { height: 8px; border-radius: 4px; background: rgba(0, 0, 0, .25); overflow: hidden; margin: 4px 0; }
.bar-fill { display: block; height: 100%; width: var(--pct, 0%); background: linear-gradient(90deg, var(--bronze-500), var(--gold-400)); }
.bar-fill.bar-red { background: linear-gradient(90deg, var(--blood-600), var(--ember-500)); }
.chart-table .bar { display: inline-block; width: 60%; vertical-align: middle; margin-right: 6px; }
.streak { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; list-style: none; padding: 0; margin: 12px 0 0; }
.streak li { text-align: center; padding: 6px 2px; border-radius: 6px; background: rgba(0, 0, 0, .25); font-size: .78rem; display: flex; flex-direction: column; }
.streak li.done { background: linear-gradient(180deg, var(--gold-400), var(--bronze-500)); color: var(--wood-900); }
.task-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.task-list li { display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.task-list li > div { flex: 1; }
.event-banner { border: 2px solid var(--gold-500); box-shadow: var(--glow-fire); }
.event-banner p { margin: .3em 0; }

/* ---------- Unterschlupf-Ausbau, Erfolge ---------- */
.upgrade-card { background: rgba(0, 0, 0, .06); border-radius: var(--radius-m); padding: 10px; display: flex; flex-direction: column; gap: 4px; }
.upgrade-card h3 { margin: 0; font-size: 1rem; }
.achievement.is-locked { opacity: .7; }
.achievement.is-unlocked { border: 2px solid var(--gold-500); }
.achievement h2 { font-size: 1.05rem; }

/* ---------- Thing ---------- */
.candidate-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.candidate-list li { display: flex; gap: 10px; align-items: flex-start; }
.candidate-list li > div { flex: 1; }
.decree-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.good { color: var(--moss-400); }
.bad { color: var(--ember-400); }
.panel.parchment .good { color: var(--moss-500); }
.panel.parchment .bad { color: var(--blood-600); }
input.qty-wide { width: 120px; flex: 0 0 120px; }
tr.is-me td { background: rgba(212, 168, 75, .18); }

/* ---------- Admin-Statistik ---------- */
.stat-tiles .stat { display: flex; flex-direction: column; padding: 10px; border-radius: var(--radius-m); background: rgba(0, 0, 0, .06); }
.stat-tiles .stat strong { font-size: 1.8rem; font-family: var(--font-display); }
.stat-tiles .stat small { opacity: .8; }

/* ---------- Rechtliches ---------- */
.legal h2 { font-size: 1.1rem; margin-top: 1.2em; }
.legal ul { padding-left: 1.2em; }
.legal p, .legal li { line-height: 1.55; }
.auth-card label.check { align-items: flex-start; font-size: .9rem; }
.auth-card label.check input { margin-top: 4px; flex: 0 0 auto; }
