/* =====================================================================
   oogeloo – Look „Schulheft“
   Kästchenpapier, Kuli-Blau, Textmarker, Rotstift, Tafel.
   Laut ist nur die Arena; die Oberfläche bleibt ruhig.
   ===================================================================== */

@font-face { font-family: "Mynerve"; font-weight: 400; font-display: swap;
  src: url("/static/fonts/mynerve-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2190-2193, U+2212; }
@font-face { font-family: "Mynerve"; font-weight: 400; font-display: swap;
  src: url("/static/fonts/mynerve-greek-400-normal.woff2") format("woff2");
  unicode-range: U+0370-03FF; }
@font-face { font-family: "Commissioner"; font-weight: 400; font-display: swap;
  src: url("/static/fonts/commissioner-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2190-2193, U+2212; }
@font-face { font-family: "Commissioner"; font-weight: 400; font-display: swap;
  src: url("/static/fonts/commissioner-greek-400-normal.woff2") format("woff2"); unicode-range: U+0370-03FF; }
@font-face { font-family: "Commissioner"; font-weight: 600; font-display: swap;
  src: url("/static/fonts/commissioner-latin-600-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2190-2193, U+2212; }
@font-face { font-family: "Commissioner"; font-weight: 600; font-display: swap;
  src: url("/static/fonts/commissioner-greek-600-normal.woff2") format("woff2"); unicode-range: U+0370-03FF; }
@font-face { font-family: "Commissioner"; font-weight: 800; font-display: swap;
  src: url("/static/fonts/commissioner-latin-800-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2190-2193, U+2212; }
@font-face { font-family: "Commissioner"; font-weight: 800; font-display: swap;
  src: url("/static/fonts/commissioner-greek-800-normal.woff2") format("woff2"); unicode-range: U+0370-03FF; }

:root {
  --paper: #F7FAFE;        /* Heftpapier */
  --grid: #D5E3F3;         /* Kästchen */
  --card: #FFFFFF;
  --ink: #1C2B78;          /* Kuli-Blau */
  --ink-soft: #5566A6;
  --marker: #FFE14D;       /* Textmarker */
  --marker-soft: #FFF4B8;
  --red: #D7263D;          /* Rotstift */
  --green: #1F7A4D;
  --board: #1F3D32;        /* Tafel */
  --chalk: #F2F1EA;
  --guard: #DCEBFF;
  --hand: "Mynerve", "Comic Sans MS", "Segoe Print", cursive;
  --text: "Commissioner", "Segoe UI", system-ui, -apple-system, sans-serif;
  --r: 8px;
  /* Namen aus v1 weiter nutzbar (Admin-CSS) */
  --line: var(--ink); --muted: var(--ink-soft); --accent: var(--marker); --blue: var(--ink);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 22px 22px;
  color: var(--ink);
  font: 400 1rem/1.5 var(--text);
  min-height: 100vh;
  display: flex; flex-direction: column;
}
/* Heftrand (roter Randstrich) */
body::before {
  content: ""; position: fixed; top: 0; bottom: 0; z-index: 0; pointer-events: none;
  left: max(10px, calc(50% - 590px)); width: 2px; background: rgba(215, 38, 61, 0.45);
}
.topbar, .view, .foot, .notice, .ticker { position: relative; z-index: 1; }
.hidden { display: none !important; }
.muted { color: var(--ink-soft); font-weight: 400; font-size: 0.92em; }
h1, h2, h3, h4 { font-family: var(--hand); font-weight: 400; line-height: 1.1; margin: 0 0 12px; letter-spacing: 0.2px; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.4rem; }
a { color: var(--ink); text-decoration-thickness: 2px; text-underline-offset: 3px; }
::selection { background: var(--marker); }

/* ---------- Tafel (Kopfzeile) ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 12px 22px; color: var(--chalk);
  background:
    radial-gradient(ellipse at 20% 30%, rgba(255,255,255,0.07), transparent 60%),
    radial-gradient(ellipse at 80% 70%, rgba(255,255,255,0.05), transparent 55%),
    var(--board);
  border-bottom: 6px solid #6B4A2B;            /* Holzleiste */
  box-shadow: 0 3px 0 rgba(0,0,0,0.15);
}
.logo { font-family: var(--hand); font-size: 2rem; line-height: 1; color: var(--chalk); text-shadow: 0 0 1px rgba(255,255,255,0.6); }
.logo span { font-size: 1.15rem; color: var(--marker); margin-left: 10px; }
.topbar a:not(.btn) { color: var(--chalk); font-weight: 600; }
.top-right { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.userchip { display: flex; align-items: center; gap: 12px; }
.chip-portrait { width: 44px; height: 52px; background: var(--chalk); border-radius: 6px; }
.chip-name { font-weight: 800; }
.chip-rank { font-size: 0.85rem; color: var(--marker); }
.chip-stats { min-width: 150px; }
.chip-line { font-size: 0.85rem; opacity: 0.9; }
.xpbar { height: 7px; background: rgba(242,241,234,0.2); border-radius: 4px; overflow: hidden; margin-bottom: 4px; }
.xpbar div { height: 100%; width: 0; background: var(--marker); transition: width 0.6s; }
.lang-select, .inline-select {
  font: 600 0.95rem var(--text); padding: 5px 8px; border: 2px solid var(--chalk); border-radius: 6px;
  background: transparent; color: var(--chalk);
}
.lang-select option { color: var(--ink); }
.sound-btn { font-size: 1.2rem; background: transparent; border: 2px solid var(--chalk); border-radius: 6px; padding: 2px 8px; cursor: pointer; color: var(--chalk); }
.no-sound .sound-btn { display: none; }
input[type="range"] { accent-color: var(--ink); padding: 0; border: 0; }
.lang-select, .inline-select { width: auto; display: inline-block; margin-top: 0; }
.inline-select { border-color: var(--ink); color: var(--ink); background: var(--card); margin-left: 8px; vertical-align: middle; }

/* ---------- Grundlayout ---------- */
.view { width: 100%; max-width: 1120px; margin: 0 auto; padding: 22px 18px 44px; flex: 1; }
.card {
  background: var(--card); border: 2px solid var(--ink); border-radius: var(--r);
  box-shadow: 3px 4px 0 rgba(28, 43, 120, 0.16); padding: 18px 20px 20px; margin-bottom: 20px; min-width: 0;
}
/* Karteikarte: rote Linie unter der Überschrift */
.card > h2:first-child, .card > h2 { padding-bottom: 6px; border-bottom: 2px solid rgba(215, 38, 61, 0.55); }
.card.narrow { max-width: 660px; margin-left: auto; margin-right: auto; }

/* ---------- Startseite ---------- */
.hero { display: grid; grid-template-columns: 1.05fr 1fr; gap: 26px; align-items: center; margin: 4px 0 26px; }
.hero h1 { font-size: clamp(2.3rem, 5.2vw, 3.8rem); }
.hero h1 em { font-style: normal; }
.hero p { font-size: 1.1rem; color: var(--ink-soft); max-width: 46ch; margin: 0; }
.hero-arena {
  width: 100%; aspect-ratio: 900 / 420; display: block; border: 2px solid var(--ink); border-radius: var(--r);
  transform: rotate(1.2deg); box-shadow: 4px 5px 0 rgba(28, 43, 120, 0.18); background: #9fd6f2;
}
.auth-grid { display: grid; grid-template-columns: 1fr 1.3fr; gap: 22px; align-items: start; }
.auth-grid .card { position: relative; }
/* Tesafilm-Streifen */
.auth-grid .card::before {
  content: ""; position: absolute; top: -12px; left: 50%; width: 96px; height: 24px;
  transform: translateX(-50%) rotate(-2.5deg); background: rgba(255, 245, 200, 0.75);
  border-left: 1px dashed rgba(0,0,0,0.08); border-right: 1px dashed rgba(0,0,0,0.08);
}

label { display: block; font-weight: 600; margin-bottom: 12px; }
label small, legend small { font-weight: 400; color: var(--ink-soft); }
input, select, textarea {
  display: block; width: 100%; margin-top: 4px; padding: 10px 12px; font: 400 1rem var(--text); color: var(--ink);
  border: 2px solid var(--ink); border-radius: 6px; background: var(--card);
}
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--marker); outline-offset: 2px; box-shadow: 0 0 0 5px var(--ink);
}
fieldset { border: 0; padding: 0; margin: 0 0 14px; }
legend { font-weight: 600; margin-bottom: 8px; padding: 0; }
label.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; margin: 10px 0; }
label.check input { width: 20px; height: 20px; margin-top: 2px; flex: none; accent-color: var(--ink); }

/* ---------- Knöpfe (Textmarker) ---------- */
.btn {
  font: 800 1rem var(--text); cursor: pointer; padding: 10px 18px; color: var(--ink);
  border: 2px solid var(--ink); border-radius: 8px; background: var(--card);
  box-shadow: 0 3px 0 var(--ink); transition: transform 0.06s, box-shadow 0.06s; text-decoration: none; display: inline-block;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 4px 0 var(--ink); }
.btn:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.primary { background: var(--marker); }
.btn.danger { background: var(--red); color: #fff; }
.btn.small { padding: 6px 12px; font-size: 0.9rem; }
.btn.big { width: 100%; padding: 14px; font-size: 1.15rem; margin-top: 14px; }
.linkbtn { background: none; border: 0; padding: 8px 0 0; font: 600 0.95rem var(--text); color: var(--ink); text-decoration: underline; cursor: pointer; display: block; }

/* ---------- Figurenwahl ---------- */
.char-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.char-card {
  border: 2px solid var(--ink); border-radius: 8px; background: #EEF5FF; padding: 4px 4px 6px; cursor: pointer;
  text-align: center; font: 600 0.78rem var(--text); color: var(--ink);
}
.char-card canvas { width: 100%; height: 110px; display: block; }
.char-card[aria-pressed="true"] { background: var(--marker); box-shadow: 0 3px 0 var(--ink); }

/* ---------- Heft-Register (Tabs) ---------- */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 18px; border-bottom: 2px solid var(--ink); }
.tabs button, .tablink {
  font: 600 0.98rem var(--text); padding: 8px 14px 6px; color: var(--ink); cursor: pointer; text-decoration: none;
  border: 2px solid var(--ink); border-bottom: 0; border-radius: 8px 8px 0 0; margin-bottom: -2px;
  background: #E6EEF9;
}
.tabs button:nth-child(7n+1) { background: #FFF1A8; }
.tabs button:nth-child(7n+2) { background: #D9ECFF; }
.tabs button:nth-child(7n+3) { background: #DFF3E4; }
.tabs button:nth-child(7n+4) { background: #FFE0E6; }
.tabs button:nth-child(7n+5) { background: #EDE3FF; }
.tabs button:nth-child(7n+6) { background: #FFE9D1; }
.tabs button:nth-child(7n+7) { background: #E6EEF9; }
.tabs button.active { background: var(--card); padding-bottom: 8px; font-weight: 800; }
.tablink { background: var(--ink); color: var(--marker); }
.badge { background: var(--red); color: #fff; border-radius: 999px; padding: 0 7px; font-size: 0.8rem; margin-left: 4px; }

/* ---------- Arena ---------- */
.arena-wrap { position: relative; margin-bottom: 20px; }
.arena { width: 100%; aspect-ratio: 900 / 420; display: block; border: 2px solid var(--ink); border-radius: var(--r); box-shadow: 3px 4px 0 rgba(28,43,120,0.18); background: #9fd6f2; }
.skip { position: absolute; right: 12px; bottom: 12px; }
.fight-result {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: rgba(28, 43, 120, 0.55); border-radius: var(--r); color: #fff; text-align: center; padding: 16px;
}
.result-title { font-family: var(--hand); font-size: clamp(2.6rem, 7vw, 4.4rem); color: var(--marker); text-shadow: 3px 3px 0 var(--ink); transform: rotate(-3deg); }
.result-title.lose { color: #FFB3BD; }
.result-rewards { font-size: 1.1rem; margin: 6px 0 16px; font-weight: 800; }
.result-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

.fight-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 20px; align-items: start; }
.search { margin: 0 0 10px; }
.opp-list, .history-list { list-style: none; margin: 0; padding: 0; max-height: 440px; overflow-y: auto; }
.opp-list li, .history-list li { margin-bottom: 6px; }
.opp {
  width: 100%; display: flex; align-items: center; gap: 10px; text-align: left; font: inherit; color: var(--ink);
  padding: 6px 10px; border: 2px solid var(--ink); border-radius: 8px; background: var(--card); cursor: pointer;
}
.opp:hover:not(:disabled) { background: var(--marker-soft); }
.opp[aria-pressed="true"] { background: var(--marker); }
.opp:disabled { opacity: 0.45; cursor: not-allowed; }
.opp canvas { width: 34px; height: 42px; flex: none; }
.opp .o-name { font-weight: 800; }
.opp .o-meta { font-size: 0.82rem; color: var(--ink-soft); }
.opp .o-right { margin-left: auto; text-align: right; font-size: 0.82rem; }

/* ---------- Schlagfolge ---------- */
.builder { outline: none; }
.slots { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; margin-bottom: 12px; }
.slot {
  aspect-ratio: 1; border: 2px solid var(--ink); border-radius: 8px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; font: 800 1.25rem var(--text); cursor: pointer;
  background: var(--card); color: var(--ink); padding: 0; min-width: 0;
}
.slot small { font-size: 0.6rem; font-weight: 600; }
.slot.atk { background: var(--marker-soft); color: var(--red); }
.slot.blk { background: var(--guard); }
.slot.cursor { outline: 3px solid var(--ink); outline-offset: 2px; }
.actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.act { font: 800 0.95rem var(--text); padding: 8px 4px; border: 2px solid var(--ink); border-radius: 8px; cursor: pointer; color: var(--ink); }
.act:hover { transform: translateY(-1px); }
.act.atk { background: var(--marker-soft); }
.act.blk { background: var(--guard); }
.act small { display: block; font-weight: 400; font-size: 0.72rem; color: var(--ink-soft); }
.builder-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; gap: 8px; flex-wrap: wrap; font-size: 0.85rem; }
.builder-foot .warn { color: var(--red); font-weight: 800; }
.kbd { font: 600 0.8em var(--text); border: 1.5px solid var(--ink-soft); border-radius: 4px; padding: 0 4px; }

/* ---------- Werte ---------- */
.points-left { font-size: 1.1rem; }
.points-left strong { font-family: var(--hand); font-size: 1.6rem; background: linear-gradient(transparent 55%, var(--marker) 55%); padding: 0 4px; }
.stat-row { display: grid; grid-template-columns: 170px 1fr auto; gap: 12px; align-items: center; margin-bottom: 14px; }
.stat-row .s-name { font-weight: 800; }
.stat-row .s-desc { font-size: 0.8rem; color: var(--ink-soft); }
.stat-bar { height: 14px; border: 2px solid var(--ink); border-radius: 7px; background: var(--card); overflow: hidden; display: flex; }
.stat-bar .cur { background: var(--ink); }
.stat-bar .add { background: var(--marker); }
.stat-ctrl { display: flex; align-items: center; gap: 6px; }
.stat-ctrl button { width: 34px; height: 34px; padding: 0; }
.stat-ctrl .val { min-width: 48px; text-align: center; font-weight: 800; }
.stat-summary { margin-top: 12px; color: var(--ink-soft); }

/* ---------- Kiosk ---------- */
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.item { border: 2px solid var(--ink); border-radius: 8px; padding: 12px; background: var(--card); display: flex; flex-direction: column; gap: 6px; }
.item.equipped { background: var(--marker-soft); }
.item .i-name { font-family: var(--hand); font-size: 1.35rem; }
.item .i-desc { font-size: 0.9rem; flex: 1; }
.item .i-meta { font-size: 0.82rem; color: var(--ink-soft); }

/* ---------- Historie, Rangliste, Neuigkeiten ---------- */
.hist {
  width: 100%; display: flex; justify-content: space-between; gap: 10px; align-items: center; text-align: left;
  font: inherit; color: var(--ink); padding: 8px 12px; border: 2px solid var(--ink); border-radius: 8px; background: var(--card); cursor: pointer;
}
.hist:hover { background: var(--marker-soft); }
.hist .res { font-weight: 800; }
.hist .res.win { color: var(--green); }
.hist .res.loss { color: var(--red); }
.hist .when, .news .when { font-size: 0.8rem; color: var(--ink-soft); white-space: nowrap; }
.news { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--grid); }
.table-wrap { overflow-x: auto; }
table.board { width: 100%; border-collapse: collapse; }
.board th { font-family: var(--hand); font-weight: 400; font-size: 1.15rem; text-align: left; padding: 6px 10px; border-bottom: 2px solid var(--ink); }
.board td { padding: 8px 10px; border-bottom: 1px solid var(--grid); text-align: left; white-space: nowrap; }
.board tr:nth-child(1) td:first-child::after { content: " ★"; color: #D9A400; }
.board tr.me td { background: linear-gradient(transparent 20%, var(--marker) 20%, var(--marker) 85%, transparent 85%); font-weight: 800; }

.account-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 20px; align-items: start; }
.danger-title { margin-top: 22px; color: var(--red); }
.copyrow { display: flex; gap: 8px; }
.copyrow input { flex: 1; min-width: 0; margin: 0; }

/* ---------- Hinweise ---------- */
.notice {
  max-width: 1120px; margin: 14px auto 0; padding: 10px 16px; border: 2px solid var(--ink); border-radius: var(--r);
  background: var(--guard); display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap;
}
.notice.warn { background: var(--marker-soft); }
.card .notice { margin: 0 0 12px; }
.ticker { max-width: 1120px; margin: 14px auto 0; padding: 4px 18px; font-family: var(--hand); font-size: 1.2rem;
  display: flex; gap: 26px; flex-wrap: wrap; justify-content: center; }
.toast {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 50;
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 8px; font-weight: 600;
  box-shadow: 0 4px 0 var(--marker); max-width: calc(100vw - 32px);
}
.toast.error { background: var(--red); box-shadow: 0 4px 0 var(--ink); }
.foot { text-align: center; color: var(--ink-soft); font-size: 0.85rem; padding: 14px 16px 22px; }
.foot a { color: var(--ink-soft); margin-left: 12px; }

/* ---------- Dreifach-Registrierung ---------- */
.also-box { border: 2px dashed var(--ink); border-radius: 8px; padding: 10px 12px; margin: 6px 0 12px; background: #F3F8FF; }
.also-title { font-weight: 800; margin: 0 0 4px; }
label.check.also { margin: 8px 0; font-size: 0.93rem; }

/* ---------- Dienste (oogeloo-Konto) ---------- */
.services { display: grid; gap: 10px; }
.service { border: 2px solid var(--ink); border-radius: 8px; padding: 10px 12px; display: grid; gap: 6px; }
.service.on { background: #E9F7EE; }
.service .s-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.service .s-title { font-family: var(--hand); font-size: 1.35rem; }
.service .s-state { font-size: 0.8rem; font-weight: 800; }

/* ---------- Freunde & Chat ---------- */
.friends-grid { display: grid; grid-template-columns: minmax(280px, 1fr) 1.4fr; gap: 20px; align-items: start; }
.friend-list { list-style: none; margin: 0; padding: 0; }
.friend { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--grid); }
.friend:last-child { border-bottom: 0; }
.friend canvas { width: 34px; height: 42px; flex: none; }
.f-main { flex: 1; min-width: 0; }
.f-name { font-weight: 800; display: flex; align-items: center; gap: 6px; }
.f-meta { font-size: 0.8rem; color: var(--ink-soft); }
.f-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.chat { position: sticky; top: 12px; }
.chat-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.chat-actions { display: flex; gap: 6px; }
.chat-log { height: 380px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 6px 2px 10px;
  background: repeating-linear-gradient(transparent, transparent 27px, var(--grid) 28px); }
.bubble { max-width: 78%; padding: 8px 12px; border: 2px solid var(--ink); border-radius: 12px; background: var(--card); }
.bubble.mine { align-self: flex-end; background: var(--marker-soft); border-bottom-right-radius: 3px; }
.bubble.theirs { align-self: flex-start; border-bottom-left-radius: 3px; }
.b-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.b-meta { font-size: 0.72rem; color: var(--ink-soft); margin-top: 3px; }
.linkbtn.inline { display: inline; padding: 0 0 0 8px; font-size: 0.72rem; }
.chat-form textarea { resize: vertical; min-height: 56px; }
.chat-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }

/* ---------- Werbeplätze ---------- */
.ad { position: relative; z-index: 1; }
.ad img { display: block; max-width: 100%; height: auto; border: 2px solid var(--ink); border-radius: 6px; background: var(--card); }
.ad-label { display: block; font-size: 0.68rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 3px; }
.ad-side { position: fixed; top: 120px; width: 164px; }
.ad-left { left: max(12px, calc(50% - 560px - 188px)); }
.ad-right { right: max(12px, calc(50% - 560px - 188px)); }
.ad-bottom { max-width: 732px; margin: 6px auto 0; padding: 0 16px; }
/* Seitenbanner nur, wenn genug Platz neben dem Spiel ist */
@media (max-width: 1499px) { .ad-side { display: none !important; } }

/* ---------- Mobil ---------- */
@media (max-width: 860px) {
  .auth-grid, .fight-grid, .hero, .friends-grid { grid-template-columns: 1fr; }
  .chat { position: static; }
  .hero-arena { transform: none; }
  .chip-stats { display: none; }
  .stat-row { grid-template-columns: 1fr auto; }
  .stat-row .stat-bar { grid-column: 1 / -1; order: 3; }
  .logo { font-size: 1.6rem; }
  .logo span { display: block; margin: 4px 0 0; }
}
@media (max-width: 520px) {
  .slots { gap: 3px; }
  .slot { font-size: 1rem; }
  .actions { grid-template-columns: 1fr 1fr; }
  .tabs button { padding: 6px 9px 5px; font-size: 0.88rem; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ---------- Admin ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.kpi { border: 2px solid var(--ink); border-radius: 8px; padding: 12px; background: var(--card); }
.kpi-v { font-family: var(--hand); font-size: 2rem; line-height: 1; }
.kpi-l { font-size: 0.85rem; color: var(--ink-soft); }
.agroup { border: 2px solid var(--grid); border-radius: 8px; margin: 0 0 16px; padding: 12px 14px; background: var(--card); }
.agroup legend { font-weight: 800; padding: 0 6px; }
.afield { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; font-weight: 600; font-size: 0.9rem; }
.afield input[type="checkbox"] { width: 22px; height: 22px; }
.arow { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; margin: 6px 0; }
.arow .afield { min-width: 110px; }
.i18n-group { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; }
.i18n-in { display: flex; gap: 6px; align-items: flex-start; font-weight: 400; }
.i18n-in .lg { font-weight: 800; font-size: 0.75rem; padding-top: 10px; min-width: 22px; }
.i18n-in input, .i18n-in textarea { flex: 1; min-width: 0; }
.setting { margin-bottom: 6px; }
.rank-row { display: grid; grid-template-columns: 130px 1fr auto; gap: 10px; align-items: end; margin-bottom: 8px; }
.text-row { border-bottom: 1px solid var(--grid); padding: 8px 0; display: flex; flex-direction: column; gap: 4px; }
.text-row.overridden code { background: var(--marker); }
.text-row textarea { width: 100%; }
.mono { font-family: ui-monospace, monospace; font-size: 0.8rem; white-space: normal !important; max-width: 320px; }
@media (max-width: 640px) { .rank-row { grid-template-columns: 1fr; } }

.ad-preview { display: block; height: 180px; width: auto; border: 2px solid var(--ink); border-radius: 6px; margin-bottom: 8px; }
.ad-preview.wide { height: auto; width: 100%; max-width: 728px; }
.bg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-bottom: 10px; }
.bg-item img { width: 100%; aspect-ratio: 900 / 420; object-fit: cover; object-position: bottom; border: 2px solid var(--ink); border-radius: 6px; }
.bg-item.off img { opacity: 0.4; }
.sprite-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.sprite-cell { border: 2px solid var(--ink); border-radius: 8px; padding: 6px; text-align: center; background:
  repeating-conic-gradient(#eef2f7 0 25%, #fff 0 50%) 50% / 14px 14px; display: flex; flex-direction: column; gap: 4px; align-items: center; }
.sprite-cell.empty { border-style: dashed; }
.sprite-img { height: 110px; display: flex; align-items: flex-end; justify-content: center; }
.sprite-img img { max-height: 110px; max-width: 90px; }
.sprite-label { font-size: 0.75rem; font-weight: 800; }
.sprite-file { display: none; }
.quote { border-left: 4px solid var(--red); margin: 6px 0 10px; padding: 6px 12px; background: #FFF5F6; white-space: pre-wrap; }

/* ---------- Rechtstexte ---------- */
.legal { max-width: 760px; white-space: pre-line; }
.legal h1 { font-size: 2.4rem; }

.char-editor { display: grid; grid-template-columns: 170px 1fr; gap: 16px; align-items: start; margin-bottom: 10px; }
.char-preview-wrap { background: #EEF5FF; border: 2px solid var(--ink); border-radius: 8px; padding: 4px; }
.char-preview { width: 160px; height: 200px; display: block; }
.color-field input[type="color"] { width: 54px; height: 34px; padding: 2px; margin: 0; }
.color-field input[type="checkbox"] { width: 20px; height: 20px; margin: 6px 0 0; }
@media (max-width: 640px) { .char-editor { grid-template-columns: 1fr; } }
