@font-face { font-family: "Bungee"; src: url("/static/fonts/bungee.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Atkinson"; src: url("/static/fonts/atkinson-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Atkinson"; src: url("/static/fonts/atkinson-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --samt: #1d1a38;      /* Grund: Samtvorhang der Spielhalle */
  --samt-2: #29254f;    /* Flächen */
  --samt-3: #3a3570;    /* Linien, Eingabefelder */
  --licht: #f3f0ff;     /* Text */
  --matt: #aaa4cf;      /* Nebentext */
  --birne: #ffd23f;     /* Glühbirnen-Gelb, einziger Akzent */
  --gut: #63d9a8;
  --warn: #ff7a6b;
  --r-klein: 6px;
  --r-gross: 14px;
  --schrift: "Atkinson", system-ui, sans-serif;
  --schild: "Bungee", "Atkinson", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh;
  background: var(--samt);
  color: var(--licht);
  font: 400 1.0625rem/1.55 var(--schrift);
}
[hidden] { display: none !important; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--birne); outline-offset: 3px; border-radius: 4px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Kopf ---------- */
.kopf {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1rem clamp(1rem, 4vw, 3rem);
  border-bottom: 1px solid var(--samt-3);
}
.marke { font-family: var(--schild); font-size: 1.35rem; color: var(--birne); text-decoration: none; letter-spacing: .02em; }
.nav { display: flex; gap: .25rem; flex-wrap: wrap; justify-content: flex-end; }
.nav a { text-decoration: none; padding: .4rem .8rem; border-radius: 999px; color: var(--matt); }
.nav a:hover { color: var(--licht); }
.nav a[aria-current="page"] { color: var(--samt); background: var(--licht); }

main:focus, main:focus-visible { outline: none; }
main { padding: clamp(1.5rem, 5vw, 3.5rem) clamp(1rem, 4vw, 3rem) 4rem; max-width: 72rem; margin: 0 auto; outline: none; }

.seitentitel { font-family: var(--schild); font-weight: 400; font-size: clamp(1.8rem, 4.5vw, 2.8rem); line-height: 1.1; margin: 0 0 2rem; }

/* ---------- Einlass (Anmelden) ---------- */
.einlass { max-width: 30rem; margin: clamp(1rem, 6vh, 4rem) auto 0; text-align: center; }
.schild {
  font-family: var(--schild); font-weight: 400; color: var(--birne); margin: 0;
  font-size: clamp(2.6rem, 11vw, 4.6rem); line-height: 1;
  text-shadow: 0 0 18px rgba(255, 210, 63, .35);
}
.birnen {
  height: 14px; margin: 1.1rem auto 2.2rem; width: min(100%, 22rem);
  background: radial-gradient(circle, var(--birne) 0 3.5px, transparent 4.5px) 0 50% / 22px 14px repeat-x;
  animation: lauflicht 1.6s steps(2) infinite;
}
@keyframes lauflicht { 50% { background-position: 11px 50%; } }
@media (prefers-reduced-motion: reduce) { .birnen { animation: none; } }
.einlass-text { color: var(--matt); margin: 0 auto 2rem; max-width: 26rem; }
.einlass .karte { text-align: left; }

/* ---------- Karten & Formulare ---------- */
.karte { background: var(--samt-2); border-radius: var(--r-gross); padding: clamp(1.1rem, 3vw, 1.75rem); margin-bottom: 1.5rem; }
.karte h2 { margin: 0 0 1rem; font-size: 1.2rem; }
.karte h3 { margin: 1.5rem 0 .75rem; font-size: 1rem; }
label { display: block; margin-bottom: .9rem; font-weight: 700; font-size: .95rem; }
input[type=checkbox] { accent-color: var(--birne); width: 1.15rem; height: 1.15rem; }
input:not([type=checkbox]), select {
  display: block; width: 100%; margin-top: .35rem;
  font: inherit; font-weight: 400; color: var(--licht);
  background: var(--samt); border: 1px solid var(--samt-3); border-radius: var(--r-klein);
  padding: .65rem .75rem;
}
input:focus, select:focus { border-color: var(--birne); outline: none; box-shadow: 0 0 0 2px rgba(255, 210, 63, .35); }
.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font: 700 1rem/1 var(--schrift); text-decoration: none; cursor: pointer;
  background: var(--birne); color: var(--samt); border: 0; border-radius: var(--r-klein);
  padding: .8rem 1.3rem; min-height: 44px;
}
.knopf:hover { filter: brightness(1.08); }
.knopf:disabled { opacity: .55; cursor: progress; }
.knopf.leise { background: transparent; color: var(--licht); box-shadow: inset 0 0 0 1px var(--samt-3); }
.knopf.leise:hover { box-shadow: inset 0 0 0 1px var(--matt); }
.knopf.klein { padding: .45rem .7rem; min-height: 34px; font-size: .9rem; }
.knopf.gefahr { background: transparent; color: var(--warn); box-shadow: inset 0 0 0 1px currentColor; }
form .knopf[type="submit"] { width: 100%; margin-top: .3rem; }
.inline-form .knopf[type="submit"] { width: auto; }
.meldung { min-height: 1.4em; margin: .2rem 0 .6rem; color: var(--warn); font-size: .95rem; }
.meldung.ok { color: var(--gut); }
.hinweis { color: var(--matt); font-size: .95rem; margin: -.3rem 0 .6rem; }

.umschalter { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--samt); border-radius: var(--r-klein); padding: 4px; margin-bottom: 1.25rem; }
.umschalter button { font: 700 .95rem var(--schrift); background: none; border: 0; color: var(--matt); padding: .6rem; border-radius: 4px; cursor: pointer; }
.umschalter button[aria-selected="true"] { background: var(--samt-3); color: var(--licht); }

/* ---------- Spielesammlung ---------- */
.regal { list-style: none; margin: 0; padding: 0; display: grid; gap: clamp(1.5rem, 4vw, 2.5rem); }
.spiel {
  --farbe: var(--birne);
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 0;
  background: var(--samt-2); border-radius: var(--r-gross); overflow: hidden;
  border-left: 6px solid var(--farbe);
}
.spiel-bild { position: relative; display: block; aspect-ratio: 16 / 10; background: color-mix(in srgb, var(--farbe) 30%, var(--samt)); }
.spiel-bild img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.spiel-bild img.ganz { object-fit: contain; padding: 4%; }
.spiel-bild img[hidden] + .spiel-initial { display: grid; }
.spiel-initial {
  display: none; position: absolute; inset: 0; place-items: center;
  font-family: var(--schild); font-size: clamp(4rem, 12vw, 8rem); color: var(--farbe); opacity: .9;
}
.spiel-text { padding: clamp(1.1rem, 3vw, 2rem); display: flex; flex-direction: column; gap: .6rem; min-width: 0; }
.spiel-name {
  font-family: var(--schild); font-weight: 400; color: var(--farbe); margin: 0;
  font-size: clamp(1.9rem, 4.6vw, 3.2rem); line-height: 1; overflow-wrap: anywhere;
}
.spiel-beschreibung { margin: 0; max-width: 46ch; }
.spiel-meta { margin: 0; color: var(--matt); font-size: .95rem; }
.spiel-aktion { margin-top: auto; padding-top: .6rem; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.spiel .spielen { background: var(--farbe); }
.spiel-status { color: var(--matt); font-size: .95rem; }
.spiel-status[hidden] { display: none; }
.spiel-status.an::before { content: ""; display: inline-block; width: .55rem; height: .55rem; border-radius: 50%; background: var(--gut); margin-right: .45rem; vertical-align: .05em; animation: puls 1.6s ease-out infinite; }
@keyframes puls { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--gut) 70%, transparent); } 70% { box-shadow: 0 0 0 .5rem transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@media (prefers-reduced-motion: reduce) { .spiel-status.an::before { animation: none; } }
.leer { color: var(--matt); }
.marke-beta { font: 700 .8rem var(--schrift); color: var(--samt); background: var(--matt); border-radius: 999px; padding: .15rem .55rem; margin-left: .5rem; vertical-align: .6em; }

@media (max-width: 480px) {
  .kopf { padding: .75rem 1rem; }
  .marke { font-size: 1.1rem; }
  .nav a { padding: .35rem .6rem; }
}
@media (max-width: 760px) {
  .spiel { grid-template-columns: 1fr; border-left: 0; border-top: 6px solid var(--farbe); }
}

/* ---------- Konto ---------- */
.schmal { max-width: 32rem; }
.konto-info { color: var(--matt); margin: -1rem 0 1.5rem; }

/* ---------- Admin ---------- */
.zeile-kopf { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.zeile-kopf h2 { margin: 0; }
.schalter { display: flex; align-items: center; gap: .5rem; margin: 0; font-weight: 400; color: var(--matt); }
.schalter input { width: 1.15rem; height: 1.15rem; margin: 0; accent-color: var(--birne); }
.tabelle-rahmen { overflow-x: auto; }
.tabelle { width: 100%; border-collapse: collapse; font-size: .95rem; }
.tabelle th { text-align: left; color: var(--matt); font-weight: 700; padding: .5rem .6rem; border-bottom: 1px solid var(--samt-3); white-space: nowrap; }
.tabelle td { padding: .55rem .6rem; border-bottom: 1px solid var(--samt-3); vertical-align: middle; }
.tabelle select, .tabelle input { margin: 0; width: auto; padding: .35rem .5rem; }
.tabelle .aktionen { display: flex; gap: .4rem; flex-wrap: wrap; justify-content: flex-end; }
.status-wartet { color: var(--birne); font-weight: 700; }
.status-gesperrt { color: var(--warn); }
.ich { color: var(--matt); font-weight: 400; }
.inline-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 0 1rem; align-items: end; border-top: 1px solid var(--samt-3); margin-top: 1rem; }
.inline-form h3, .inline-form .meldung { grid-column: 1 / -1; }
.inline-form .knopf { margin-bottom: .9rem; }
.protokoll { background: var(--samt); border-radius: var(--r-klein); padding: 1rem; max-height: 22rem; overflow: auto; font-size: .82rem; line-height: 1.45; white-space: pre-wrap; margin: 1rem 0 0; }

/* ---------- Avatar (rundes Spielerfoto) ---------- */
.avatar { display: inline-grid; place-items: center; border-radius: 50%; overflow: hidden; flex: none;
  background: var(--samt-3); color: var(--birne); font-family: var(--schild); }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.klein { width: 1.75rem; height: 1.75rem; font-size: .85rem; }
.avatar.gross { width: clamp(5rem, 18vw, 7rem); height: clamp(5rem, 18vw, 7rem); font-size: clamp(2.2rem, 8vw, 3rem); box-shadow: 0 0 0 3px var(--birne); }
.nav a.nav-ich { display: inline-flex; align-items: center; gap: .5rem; padding-left: .35rem; }
.konto-kopf { display: flex; align-items: center; gap: 1.25rem; margin-bottom: 2rem; }
.konto-kopf .seitentitel { margin: 0; overflow-wrap: anywhere; }
.konto-kopf .konto-info { margin: .35rem 0 0; }
.foto-knoepfe { display: flex; gap: .75rem; flex-wrap: wrap; margin-bottom: .5rem; }
.datei-knopf { margin: 0; }
.datei-knopf input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.datei-knopf:focus-within { outline: 3px solid var(--licht); outline-offset: 3px; }
.anleitung ul { margin: 0; padding-left: 1.2rem; display: grid; gap: .45rem; max-width: 70ch; }
.anleitung code, .tabelle code { font-size: .9em; background: var(--samt); padding: .1rem .35rem; border-radius: 4px; }
.tabelle a { color: var(--licht); }

/* ---------- Statistik ---------- */
.statistik { max-width: 60rem; }
.stat-spiel { border-top: 6px solid var(--farbe, var(--birne)); }
.kacheln { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: .75rem; margin-bottom: 1.25rem; }
.kachel { background: var(--samt); border-radius: var(--r-klein); padding: .8rem .9rem; display: grid; gap: .15rem; }
.kachel b { font-family: var(--schild); font-size: 1.45rem; font-weight: 400; color: var(--birne); line-height: 1.1; }
.kachel span { color: var(--matt); font-size: .88rem; }
.stat-zweit dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .35rem 1.5rem; margin: 0 0 .5rem; }
.stat-zweit dl div { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--samt-3); padding: .35rem 0; }
.stat-zweit dt { color: var(--matt); font-size: .9rem; }
.stat-zweit dd { font-weight: 700; margin: 0; text-align: right; }
.tabelle.rang td:first-child { color: var(--matt); width: 2.5rem; }
.tabelle.rang tr.ich-zeile td { color: var(--birne); font-weight: 700; }
.statistik > .hinweis { margin-bottom: 1.5rem; }
.unterlink { text-align: center; margin: .9rem 0 0; }
.textlink { background: none; border: 0; padding: .2rem .4rem; font: inherit; font-size: .85rem; color: var(--licht); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.textlink:hover { opacity: .8; }
.umschalter[hidden] { display: none; }
