:root {
  --ground: #141b17;
  --surface: #1d2822;
  --surface-2: #24312a;
  --line: #32423a;
  --ink: #e9eee8;
  --muted: #96a79b;
  --amber: #e2a63d;
  --amber-dim: #8a6a2e;
  --good: #7fae74;
  --danger: #c2604f;
  --radius: 10px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { background: var(--ground); }
body {
  font-family: "Segoe UI", system-ui, sans-serif;
  color: var(--ink); background: var(--ground); line-height: 1.45;
  min-height: 100vh;
}
h1, h2, h3, .serif { font-family: Cambria, Georgia, serif; }
h2 { font-size: 1.02rem; color: var(--muted); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 10px; }
.num { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
button { font: inherit; cursor: pointer; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

/* ── Auth ── */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 28px; width: 100%; max-width: 560px; display: flex; flex-direction: column; gap: 14px;
}
.auth-logo { font-size: 3rem; text-align: center; }
.auth-card h1 { text-align: center; font-size: 1.7rem; }
.auth-sub { text-align: center; color: var(--muted); font-size: 0.9rem; }
.auth-tabs { display: flex; gap: 8px; }
.auth-tab {
  flex: 1; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px;
  color: var(--muted); padding: 8px;
}
.auth-tab.active { color: var(--amber); border-color: var(--amber-dim); font-weight: 600; }
#authForm { display: flex; flex-direction: column; gap: 12px; }
#authForm label { display: flex; flex-direction: column; gap: 4px; font-size: 0.88rem; color: var(--muted); }
#authForm input {
  background: var(--ground); border: 1px solid var(--line); border-radius: 8px;
  color: var(--ink); font: inherit; padding: 10px 12px;
}
.pick-label { font-size: 0.88rem; color: var(--muted); }
.class-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 6px; }
.class-card {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 6px; text-align: center; color: var(--ink); display: flex; flex-direction: column; gap: 4px; align-items: center;
}
.class-card small { color: var(--muted); font-size: 0.7rem; line-height: 1.25; }
.class-card.sel { border-color: var(--amber); box-shadow: 0 0 0 1px var(--amber); }
.primary {
  background: var(--amber); color: #1a1408; border: none; border-radius: 8px;
  font-weight: 700; padding: 11px; font-size: 1rem;
}
.primary:hover { filter: brightness(1.08); }
.auth-error { color: var(--danger); font-size: 0.86rem; min-height: 1.2em; text-align: center; }

/* ── App-Gerüst ── */
.app { max-width: 1000px; margin: 0 auto; padding: 14px 14px 60px; display: flex; flex-direction: column; gap: 14px; }
.topbar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.logo { font-size: 1.05rem; }
.topstats { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: 0.9rem; margin-left: auto; }
.topstats strong { color: var(--ink); }
.topstats .beute { color: var(--amber); }
.topstats .energie { color: var(--good); }
.ghost { background: none; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); padding: 5px 12px; font-size: 0.82rem; }
.ghost:hover { color: var(--ink); border-color: var(--amber-dim); }

.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); padding-bottom: 0; overflow-x: auto; }
.tabs button {
  background: none; border: none; border-bottom: 2px solid transparent;
  color: var(--muted); padding: 9px 14px; font-size: 0.95rem; white-space: nowrap;
}
.tabs button.active { color: var(--amber); border-bottom-color: var(--amber); font-weight: 600; }
.tabs button:hover { color: var(--ink); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
@media (max-width: 720px) { .grid2 { grid-template-columns: 1fr; } }

/* ── Mein Wolf ── */
.char-hero { display: grid; grid-template-columns: minmax(240px, 340px) 1fr; gap: 20px; align-items: center; }
@media (max-width: 720px) { .char-hero { grid-template-columns: 1fr; } }
.char-stage-wrap { position: relative; }
.char-title { font-size: 1.5rem; }
.char-title small { display: block; color: var(--amber); font-size: 0.95rem; font-family: "Segoe UI", system-ui, sans-serif; }
.statlist { display: grid; grid-template-columns: repeat(2, minmax(120px, 1fr)); gap: 10px; margin-top: 14px; }
.statbox { background: var(--surface-2); border-radius: 8px; padding: 10px 12px; }
.statbox .v { font-size: 1.3rem; font-weight: 700; }
.statbox .k { color: var(--muted); font-size: 0.78rem; }
.xp-bar { height: 9px; background: var(--surface-2); border-radius: 5px; overflow: hidden; margin-top: 10px; }
.xp-bar > div { height: 100%; background: var(--amber); border-radius: 5px; transition: width 0.4s; }
.xp-cap { color: var(--muted); font-size: 0.8rem; margin-top: 4px; }
.stages-strip { display: flex; gap: 6px; margin-top: 16px; flex-wrap: wrap; }
.stage-dot {
  width: 64px; text-align: center; font-size: 0.68rem; color: var(--muted);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 6px 2px 4px;
}
.stage-dot.reached { border-color: var(--amber-dim); color: var(--ink); }
.stage-dot.current { border-color: var(--amber); box-shadow: 0 0 0 1px var(--amber); }
.equip-list { display: flex; flex-direction: column; gap: 8px; }
.equip-row { display: flex; align-items: center; gap: 10px; background: var(--surface-2); border-radius: 8px; padding: 8px 12px; font-size: 0.9rem; }
.equip-row .slot { color: var(--muted); width: 76px; font-size: 0.8rem; }
.equip-row select {
  background: var(--ground); color: var(--ink); border: 1px solid var(--line); border-radius: 6px;
  font: inherit; font-size: 0.85rem; padding: 4px 8px; margin-left: auto;
}

/* ── Jagd ── */
.actions { display: flex; flex-direction: column; gap: 8px; }
.act {
  display: flex; align-items: center; gap: 12px; width: 100%;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px;
  color: var(--ink); padding: 10px 12px; text-align: left;
}
.act:hover { border-color: var(--amber-dim); }
.act .label { flex: 1; }
.act .label small { display: block; color: var(--muted); font-size: 0.78rem; }
.act .gain { text-align: right; white-space: nowrap; font-size: 0.82rem; }
.act .gain .g-xp { color: var(--amber); font-weight: 700; display: block; }
.act .gain .g-en { color: var(--good); }
.honor-note { color: var(--muted); font-size: 0.8rem; margin-top: 10px; }

/* ── Arena ── */
.mob-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.mob-card {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 14px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start;
  color: var(--ink); text-align: left;
}
.mob-card:hover:not(:disabled) { border-color: var(--amber-dim); }
.mob-card:disabled { opacity: 0.45; cursor: not-allowed; }
.mob-card .m-emoji { font-size: 2rem; }
.mob-card .m-name { font-weight: 600; }
.mob-card .m-info { color: var(--muted); font-size: 0.78rem; }
.mob-card .m-reward { color: var(--amber); font-size: 0.82rem; }
.mob-card.boss { border-color: var(--danger); }
.energy-note { color: var(--muted); font-size: 0.85rem; margin-bottom: 12px; }
.energy-note strong { color: var(--good); }

.battle { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 720px) { .battle { grid-template-columns: 1fr; } }
.fighter { text-align: center; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.fighter .f-emoji { font-size: 4.5rem; line-height: 1; }
.hp-bar { width: 100%; height: 14px; background: var(--ground); border-radius: 7px; overflow: hidden; }
.hp-bar > div { height: 100%; background: var(--good); border-radius: 7px; transition: width 0.3s; }
.hp-bar > div.low { background: var(--danger); }
.hp-num { font-size: 0.85rem; color: var(--muted); }
.battle-log {
  background: var(--ground); border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; font-size: 0.86rem; max-height: 180px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 4px; grid-column: 1 / -1;
}
.moves { display: flex; gap: 8px; grid-column: 1 / -1; flex-wrap: wrap; }
.move-btn {
  flex: 1; min-width: 130px; background: var(--surface-2); border: 1px solid var(--amber-dim);
  border-radius: 8px; color: var(--ink); padding: 12px; font-weight: 600;
}
.move-btn small { display: block; color: var(--muted); font-weight: 400; font-size: 0.75rem; }
.move-btn:hover:not(:disabled) { border-color: var(--amber); }
.move-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.flee { background: none; border: 1px solid var(--line); color: var(--muted); border-radius: 8px; padding: 12px 16px; }

/* ── Laden ── */
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.shop-card {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px; display: flex; flex-direction: column; gap: 6px;
}
.shop-card .s-head { display: flex; align-items: center; gap: 8px; }
.shop-card .s-swatch { width: 22px; height: 22px; border-radius: 5px; flex-shrink: 0; }
.shop-card .s-name { font-weight: 600; font-size: 0.92rem; }
.shop-card .s-stats { color: var(--good); font-size: 0.8rem; min-height: 1.1em; }
.shop-card .s-slot { color: var(--muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; }
.shop-card .s-buy {
  margin-top: 4px; background: var(--ground); border: 1px solid var(--amber-dim); border-radius: 6px;
  color: var(--amber); padding: 7px; font-weight: 700;
}
.shop-card .s-buy:hover:not(:disabled) { border-color: var(--amber); }
.shop-card .s-buy:disabled { opacity: 0.45; cursor: not-allowed; }
.shop-card.owned { border-color: var(--good); }
.shop-card .s-owned { color: var(--good); font-size: 0.82rem; font-weight: 600; text-align: center; padding: 7px 0 2px; }
.tier3 .s-name { color: var(--amber); }

/* ── Rudel ── */
.lb-row {
  display: flex; align-items: center; gap: 12px; background: var(--surface-2);
  border-radius: 8px; padding: 8px 12px; margin-bottom: 6px;
}
.lb-row .lb-rank { width: 26px; color: var(--muted); font-weight: 700; }
.lb-row .lb-rank.top { color: var(--amber); }
.lb-row .lb-name { font-weight: 600; }
.lb-row .lb-title { color: var(--amber); font-size: 0.78rem; }
.lb-row .lb-stats { margin-left: auto; text-align: right; color: var(--muted); font-size: 0.8rem; }
.lb-row .lb-stats strong { color: var(--ink); }
.lb-row.me { border: 1px solid var(--amber-dim); }
.feed-list { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.feed-list li { display: flex; gap: 10px; font-size: 0.88rem; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.feed-list time { color: var(--muted); font-size: 0.76rem; white-space: nowrap; padding-top: 2px; }

/* ── Toast ── */
#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px);
  background: var(--surface-2); border: 1px solid var(--amber-dim); color: var(--ink);
  padding: 10px 18px; border-radius: 8px; opacity: 0; pointer-events: none;
  transition: opacity 0.25s, transform 0.25s; font-size: 0.95rem; max-width: 90vw; z-index: 50;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast strong { color: var(--amber); }

/* ── Spezies-Auswahl ── */
.species-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 6px; }
@media (max-width: 520px) { .species-grid { grid-template-columns: repeat(2, 1fr); } }
.species-card {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 6px; text-align: center; color: var(--ink); display: flex; flex-direction: column; gap: 4px; align-items: center;
}
.species-card small { color: var(--muted); font-size: 0.68rem; line-height: 1.3; }
.species-card.sel { border-color: var(--amber); box-shadow: 0 0 0 1px var(--amber); }
.species-card:hover { border-color: var(--amber-dim); }

/* ── Idle-Animation & Level-Up ── */
.char-idle { animation: idleBob 3.2s ease-in-out infinite; transform-origin: 50% 100%; }
@keyframes idleBob {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-5px) scale(1.012); }
}
.cr-flame { animation: flicker 0.9s ease-in-out infinite alternate; }
@keyframes flicker { from { opacity: 1; } to { opacity: 0.65; } }

/* ── Tages-Truhe ── */
.chest-mini {
  background: none; border: 1px solid var(--amber); border-radius: 6px; font-size: 1rem;
  padding: 2px 8px; animation: chestPulse 1.6s ease-in-out infinite;
}
@keyframes chestPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(226,166,61,0.5); }
  50% { box-shadow: 0 0 0 6px rgba(226,166,61,0); }
}
.chest-big {
  width: 100%; background: var(--surface-2); border: 1px solid var(--amber); border-radius: 10px;
  color: var(--ink); font-size: 1.1rem; font-weight: 700; padding: 16px;
  animation: chestPulse 1.6s ease-in-out infinite;
}
.chest-big small { display: block; color: var(--muted); font-weight: 400; font-size: 0.8rem; margin-top: 4px; }
.chest-done { color: var(--muted); font-size: 0.9rem; text-align: center; padding: 6px; }

/* ── Quests ── */
.quest { border-bottom: 1px solid var(--line); padding: 10px 0; }
.quest:last-child { border-bottom: none; }
.quest .q-main { display: flex; justify-content: space-between; gap: 10px; font-size: 0.9rem; }
.quest .q-prog { color: var(--muted); }
.quest .q-bar { height: 7px; background: var(--surface-2); border-radius: 4px; overflow: hidden; margin: 6px 0; }
.quest .q-bar > div { height: 100%; background: var(--amber); border-radius: 4px; transition: width 0.4s; }
.quest.done .q-bar > div { background: var(--good); }
.quest .q-reward { color: var(--muted); font-size: 0.8rem; display: flex; align-items: center; gap: 10px; }
.quest .q-claim {
  background: var(--good); border: none; border-radius: 6px; color: #10190e; font-weight: 700;
  padding: 4px 14px; animation: chestPulse 1.4s ease-in-out infinite;
}
.quest .q-check { color: var(--good); font-weight: 600; }
.quest.claimed { opacity: 0.55; }

/* ── Arena (Echtzeit) ── */
.arena-wrap { position: relative; user-select: none; -webkit-user-select: none; }
#arenaCv { display: block; width: 100%; border-radius: 10px; background: #18211c; touch-action: none; }
.arena-hud-top {
  position: absolute; top: 10px; left: 12px; right: 12px;
  display: flex; justify-content: space-between; gap: 20px; pointer-events: none;
}
.a-hp { width: 42%; font-size: 0.82rem; color: var(--ink); text-shadow: 0 1px 3px #000; }
.a-hp.right { text-align: right; }
.a-hpbar { height: 10px; background: rgba(0,0,0,0.5); border-radius: 5px; overflow: hidden; margin-top: 3px; }
.a-hpbar > div { height: 100%; width: 100%; background: var(--good); border-radius: 5px; transition: width 0.2s; }
.a-hpbar > div.low { background: var(--danger); }
.a-stick {
  position: absolute; left: 16px; bottom: 16px; width: 110px; height: 110px;
  border: 2px solid rgba(233,238,232,0.25); border-radius: 50%;
  background: rgba(0,0,0,0.25); touch-action: none;
}
.a-thumb {
  position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px;
  background: rgba(226,166,61,0.75); border-radius: 50%;
}
.a-btns { position: absolute; right: 14px; bottom: 16px; display: flex; gap: 10px; }
.a-btn {
  position: relative; width: 64px; height: 64px; border-radius: 50%; overflow: hidden;
  background: rgba(0,0,0,0.45); border: 2px solid rgba(233,238,232,0.3); color: var(--ink);
  font-size: 1.3rem; display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.a-btn small { font-size: 0.55rem; color: var(--muted); }
.a-btn .a-cd {
  position: absolute; left: 0; bottom: 0; width: 100%; height: 0%;
  background: rgba(0,0,0,0.6); pointer-events: none;
}
.a-btn.ult { border-color: var(--amber-dim); }
.a-btn.ult.ready { border-color: var(--amber); animation: chestPulse 1.2s ease-in-out infinite; }
.a-keys { text-align: center; color: var(--muted); font-size: 0.75rem; margin-top: 8px; }
@media (pointer: fine) and (min-width: 900px) { .a-stick { opacity: 0.35; } }

/* ── Overlay & Loot ── */
.overlay {
  position: fixed; inset: 0; background: rgba(10,14,12,0.75); z-index: 60;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.overlay-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 24px; max-width: 560px; width: 100%; max-height: 85vh; overflow-y: auto; text-align: center;
}
.loot-card { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.loot-chest { font-size: 5rem; cursor: pointer; animation: chestShake 0.7s ease-in-out infinite; }
.loot-chest.open { animation: chestOpen 0.45s ease-out forwards; }
@keyframes chestShake {
  0%, 100% { transform: rotate(0); }
  20% { transform: rotate(-6deg); } 40% { transform: rotate(6deg); }
  60% { transform: rotate(-3deg); } 80% { transform: rotate(3deg); }
}
@keyframes chestOpen {
  40% { transform: scale(1.3) rotate(0); opacity: 1; }
  100% { transform: scale(2.2); opacity: 0; }
}
.loot-label { font-size: 1.1rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.loot-amount { font-size: 2.6rem; font-weight: 800; color: var(--amber); animation: lootPop 0.4s ease-out; }
.loot-xp { color: var(--muted); }
@keyframes lootPop { from { transform: scale(0.3); } to { transform: scale(1); } }
.loot-selten .loot-amount { color: #7fc4e0; }
.loot-episch .loot-amount { color: #b08ae0; }
.loot-episch.overlay-card, .loot-card.loot-episch { border-color: #b08ae0; }
.loot-jackpot .loot-amount { color: var(--amber); font-size: 3.2rem; text-shadow: 0 0 24px rgba(226,166,61,0.6); }
.loot-jackpot.loot-card { border-color: var(--amber); box-shadow: 0 0 40px rgba(226,166,61,0.25); }
.loot-hint { color: var(--muted); font-size: 0.85rem; }

/* ── Titel-Badges ── */
.title-badge {
  display: inline-block; background: var(--surface-2); border: 1px solid var(--amber-dim);
  color: var(--amber); border-radius: 20px; padding: 2px 10px; font-size: 0.68rem;
  font-family: "Segoe UI", system-ui, sans-serif; font-weight: 600; letter-spacing: 0.04em;
  vertical-align: middle; text-transform: uppercase;
}
.title-badge.small { font-size: 0.6rem; padding: 1px 7px; }

/* ── Halle des Ruhms / Podium ── */
.podium-card { background: linear-gradient(180deg, #232f28 0%, var(--surface) 60%); }
.week-king {
  background: rgba(226,166,61,0.08); border: 1px solid var(--amber-dim); border-radius: 8px;
  padding: 10px 14px; font-size: 0.92rem; margin-bottom: 16px; text-align: center;
}
.week-king strong { color: var(--amber); }
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 10px; padding: 10px 0 4px; }
.podium-slot { flex: 1; max-width: 220px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 3px; position: relative; }
.podium-slot.empty { visibility: hidden; }
.podium-crown { font-size: 2rem; animation: crownFloat 2.6s ease-in-out infinite; margin-bottom: -8px; z-index: 2; }
@keyframes crownFloat {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-7px) rotate(4deg); }
}
.podium-beast { filter: drop-shadow(0 6px 14px rgba(0,0,0,0.45)); }
.place1 .podium-beast { filter: drop-shadow(0 0 28px rgba(226,166,61,0.35)) drop-shadow(0 6px 14px rgba(0,0,0,0.45)); }
.podium-name { font-size: 1rem; font-weight: 700; }
.place1 .podium-name { font-size: 1.35rem; color: var(--amber); text-shadow: 0 0 18px rgba(226,166,61,0.5); }
.podium-title { color: var(--amber); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.06em; }
.podium-stats { color: var(--muted); font-size: 0.74rem; }
.podium-base { width: 90%; border-radius: 6px 6px 0 0; margin-top: 8px; }
.podium-base.b1 { height: 64px; background: linear-gradient(180deg, #e8c34e, #8a6a2e); box-shadow: 0 0 24px rgba(226,166,61,0.3); }
.podium-base.b2 { height: 40px; background: linear-gradient(180deg, #b8c0c8, #6b757f); }
.podium-base.b3 { height: 28px; background: linear-gradient(180deg, #c08a5a, #7a5232); }
.podium-slot.me .podium-name::after { content: " (du)"; font-size: 0.7em; color: var(--muted); }
@media (max-width: 600px) {
  .podium { gap: 4px; }
  .place1 .podium-name { font-size: 1.05rem; }
}

/* ── Prüfung ── */
.trial-card { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; border-color: var(--amber-dim); }
.trial-card .trial-info { flex: 1; min-width: 240px; }
.trial-btn { white-space: nowrap; }
.trial-btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ── Arena-HUD-Mitte ── */
.a-center { flex: 1; text-align: center; color: var(--ink); font-size: 0.85rem; text-shadow: 0 1px 3px #000; }

@media (prefers-reduced-motion: reduce) {
  .xp-bar > div, .hp-bar > div, #toast { transition: none; }
  .char-idle, .cr-flame, .chest-mini, .chest-big, .loot-chest, .a-btn.ult.ready, .quest .q-claim, .podium-crown { animation: none; }
}
