/* Anmelde- und Konto-Seite im Look von SchweinehaseKart: Waldgrün, Low-Poly-Tannen, weiße Kapseln, runde fette Schrift */
:root {
  --wald1: #1a4224; --wald2: #0d2417; --wald3: #123320;
  --weiss: #ffffff; --text: #0f2917; --muted: rgba(255, 255, 255, 0.62);
  --glas: rgba(255, 255, 255, 0.09); --glas2: rgba(255, 255, 255, 0.16); --rand: rgba(255, 255, 255, 0.18);
  --himmel: #87ceeb; --sonne: #ffd04a; --sand: #dfc89e; --rot: #ff6b6b; --gruen: #8be08f;
  --rund: 'Nunito', ui-rounded, 'SF Pro Rounded', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--rund); color: var(--weiss); font-size: 15px; line-height: 1.45; font-weight: 600;
  background:
    url('/img/wald.svg') bottom center / 1600px auto repeat-x fixed,
    radial-gradient(ellipse at 50% -10%, #2a6a3a 0%, transparent 60%) fixed,
    linear-gradient(180deg, var(--wald1), var(--wald2)) fixed;
  padding: 28px max(16px, env(safe-area-inset-right)) 200px max(16px, env(safe-area-inset-left));
  -webkit-tap-highlight-color: transparent;
}
.wrap { max-width: 480px; margin: 0 auto; display: grid; gap: 18px; }

/* Titel wie im Startbildschirm des Spiels */
.titel { display: grid; justify-items: center; gap: 2px; text-align: center; margin-top: 4px; }
.titel img { width: 112px; height: 112px; border-radius: 26px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45), 0 0 0 4px rgba(255, 255, 255, 0.9); margin-bottom: 12px; }
.titel .gross { font-size: clamp(30px, 9vw, 42px); font-weight: 900; letter-spacing: 0.09em; line-height: 1; }
.titel .klein { font-size: 17px; font-weight: 800; letter-spacing: 0.55em; padding-left: 0.55em; color: rgba(255, 255, 255, 0.55); }
.titel.klein-titel { grid-template-columns: auto auto; align-items: center; gap: 0 12px; justify-content: start; text-align: left; margin: 0; }
.titel.klein-titel img { width: 58px; height: 58px; border-radius: 15px; margin: 0; grid-row: span 2; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4), 0 0 0 3px rgba(255, 255, 255, 0.9); }
.titel.klein-titel .gross { font-size: 22px; }
.titel.klein-titel .klein { font-size: 12px; padding-left: 0; letter-spacing: 0.2em; color: var(--himmel); }

.panel {
  background: rgba(10, 30, 18, 0.72); border: 1px solid var(--rand); border-radius: 26px;
  padding: 20px 20px 22px; box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
h1, h2 { font-weight: 900; letter-spacing: 0.08em; }
h1 { font-size: 26px; margin: 0 0 6px; }
h2 { font-size: 18px; margin: 0 0 10px; }
p { margin: 6px 0; }
.muted { color: var(--muted); font-size: 13.5px; font-weight: 600; }

/* Reiter als Segment-Kapseln */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; background: rgba(255, 255, 255, 0.07); padding: 5px; border-radius: 999px; }
.tabs button {
  flex: 1 1 auto; font: 800 12.5px/1 var(--rund); letter-spacing: 0.1em; color: rgba(255, 255, 255, 0.75);
  border: 0; background: transparent; padding: 10px 12px; border-radius: 999px; cursor: pointer; white-space: nowrap;
}
.tabs button.on { background: var(--weiss); color: var(--text); box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25); }

form { display: grid; gap: 12px; }
label { display: grid; gap: 5px; font-weight: 800; font-size: 11.5px; letter-spacing: 0.14em; color: rgba(255, 255, 255, 0.6); }
input {
  font: 700 17px var(--rund); padding: 12px 16px; border: 2px solid transparent; border-radius: 16px;
  background: rgba(255, 255, 255, 0.95); color: var(--text); width: 100%; letter-spacing: 0;
}
input:focus { outline: none; border-color: var(--himmel); box-shadow: 0 0 0 4px rgba(135, 206, 235, 0.35); }
button:focus-visible, a:focus-visible { outline: 3px solid var(--himmel); outline-offset: 3px; }
label.check { display: flex; gap: 10px; align-items: center; font-size: 14px; letter-spacing: 0; color: var(--weiss); }
label.check input { width: 22px; height: 22px; accent-color: var(--himmel); }

/* Kapsel-Buttons wie "RENNEN STARTEN" */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none;
  font: 900 15px/1 var(--rund); letter-spacing: 0.14em; color: var(--weiss); background: var(--glas2);
  border: 0; border-radius: 999px; padding: 13px 22px; cursor: pointer; transition: transform 0.08s, filter 0.15s;
}
.btn:hover { filter: brightness(1.12); }
.btn.main { background: var(--weiss); color: var(--text); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3); }
form .btn.main { width: 100%; font-size: 18px; padding: 17px 22px; }
.btn.danger { background: var(--rot); color: #fff; }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: default; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.msg { min-height: 1.2em; font-size: 14px; font-weight: 800; margin: 0; }
.msg.err { color: #ffb3b3; }
.msg.ok { color: var(--gruen); }
.codes {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; font: 700 17px ui-monospace, Menlo, Consolas, monospace;
  background: rgba(255, 255, 255, 0.95); color: var(--text); border-radius: 16px; padding: 12px 16px;
}
.qr { width: 220px; max-width: 100%; background: #fff; border-radius: 16px; padding: 10px; }
.qr svg { display: block; width: 100%; height: auto; }
.secret { font-family: ui-monospace, Menlo, Consolas, monospace; word-break: break-all; background: rgba(255, 255, 255, 0.95); color: var(--text); padding: 6px 10px; border-radius: 10px; }
.badge { display: inline-block; font-size: 10.5px; font-weight: 900; letter-spacing: 0.1em; padding: 2px 8px; border-radius: 999px; background: var(--gruen); color: var(--text); }
.badge.off { background: rgba(255, 255, 255, 0.2); color: var(--weiss); }
.warn { border-radius: 16px; background: rgba(255, 208, 74, 0.16); border: 1px solid rgba(255, 208, 74, 0.6); padding: 10px 14px; font-weight: 700; color: #ffe9a8; }
hr { border: 0; border-top: 1px solid var(--rand); margin: 8px 0; }
a { color: var(--himmel); }
[hidden] { display: none !important; }
@media (max-width: 420px) { .codes { grid-template-columns: 1fr; } .tabs button { font-size: 11px; padding: 9px 8px; letter-spacing: 0.06em; } }

/* ---- Konto-Seite ---- */
.wrap.acct { max-width: 960px; gap: 16px; }
.acct-head { display: grid; grid-template-columns: 1fr auto; gap: 10px 18px; align-items: center; padding: 14px 18px; }
.acct-title h1 { font-size: 22px; margin: 0; line-height: 1.1; }
.acct-title p { margin: 4px 0 0; }
.acct-head .warn { grid-column: 1 / -1; margin: 4px 0 0; }
.acct-body { display: grid; grid-template-columns: 230px 1fr; gap: 16px; align-items: start; }
.acct-tabs { flex-direction: column; margin: 0; position: sticky; top: 12px; border-radius: 22px; padding: 6px; }
.acct-tabs button { text-align: left; display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 12px 14px; border-radius: 16px; }
.acct-pane { min-width: 0; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; }
.tfa-setup { display: grid; grid-template-columns: 220px 1fr; gap: 16px; align-items: start; margin-top: 12px; }
.tfa-steps { min-width: 0; display: grid; gap: 6px; }
@media (max-width: 760px) {
  .acct-head { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .acct-head .titel.klein-titel { justify-content: center; }
  .acct-body { grid-template-columns: 1fr; }
  .acct-tabs { flex-direction: row; flex-wrap: nowrap; overflow-x: auto; position: static; border-radius: 999px; }
  .acct-tabs button { flex: 0 0 auto; border-radius: 999px; }
  .tfa-setup { grid-template-columns: 1fr; justify-items: center; }
  .tfa-steps { justify-items: stretch; width: 100%; }
}

/* Einladungscodes (nur Admins; bei offener Registrierung nicht nötig) */
.inv-list { display: grid; gap: 6px; margin: 8px 0; }
.inv-row { display: grid; grid-template-columns: auto auto 1fr auto; gap: 6px 12px; align-items: center; border-radius: 14px; padding: 8px 12px; background: var(--glas2); }
.inv-row.used { opacity: 0.55; }
.inv-row.used code { text-decoration: line-through; }
.inv-row code { font: 700 16px ui-monospace, Menlo, Consolas, monospace; }
.inv-acts { display: flex; gap: 6px; }
.btn.small { font-size: 12px; padding: 8px 14px; }
textarea { font: 15px ui-monospace, Menlo, Consolas, monospace; padding: 10px 12px; border: 0; border-radius: 14px; width: 100%; }
details summary { cursor: pointer; margin: 8px 0; }
@media (max-width: 560px) { .inv-row { grid-template-columns: 1fr auto; } .inv-row .muted, .inv-acts { grid-column: 1 / -1; } }

/* Statistik (nur Admins) */
.st-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin: 8px 0 14px; }
.st-tile { border-radius: 16px; background: var(--glas2); padding: 8px 12px; display: grid; }
.st-tile b { font-size: 28px; line-height: 1.1; font-weight: 900; }
.st-tile span { font-size: 13px; letter-spacing: 0.08em; }
.st-tile small { font-size: 12px; color: var(--muted); min-height: 1em; }
.st-chart { display: grid; grid-template-columns: repeat(30, 1fr); gap: 3px; align-items: end; height: 150px; border-radius: 16px; background: var(--glas); padding: 8px 8px 0; margin: 6px 0 14px; }
.st-bar { display: grid; grid-template-rows: auto 1fr auto; height: 100%; align-items: end; text-align: center; min-width: 0; }
.st-bar i { display: block; background: var(--himmel); border-radius: 4px 4px 0 0; min-height: 2px; }
.st-bar em { font-style: normal; font-size: 11px; }
.st-bar small { font-size: 10px; color: var(--muted); height: 14px; white-space: nowrap; overflow: visible; }
.st-table-wrap { overflow-x: auto; border-radius: 16px; background: var(--glas); margin: 6px 0 10px; }
.st-table { border-collapse: collapse; width: 100%; font-size: 14px; }
.st-table th { text-align: left; background: rgba(255, 255, 255, 0.12); padding: 7px 10px; font-weight: 800; white-space: nowrap; }
.st-table td { padding: 6px 10px; border-top: 1px solid var(--rand); white-space: nowrap; }
.st-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.st-table tr.new td:first-child::after { content: ' NEU'; font-size: 11px; color: var(--sonne); font-weight: 900; }
