/* doplaythis: Startseite, Spieleübersicht und Admin. */
:root {
  color-scheme: dark;
  --bg: #0a0c13; --panel: #141722; --panel2: #1c2030; --line: rgba(255,255,255,.1); --text: #f2f4f8; --muted: #9aa0b2;
  --lime: #b6ff3c; --cyan: #22d3ee; --red: #ff5d6c; --gold: #ffcc4d; --ink: #0a0c13; --radius: 16px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overscroll-behavior-y: contain; }
button, a, input, select, textarea, label { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
body { margin: 0; min-height: 100vh; min-height: 100dvh; background: radial-gradient(900px 500px at 85% -10%, rgba(34,211,238,.13), transparent), radial-gradient(900px 500px at 5% -5%, rgba(182,255,60,.1), transparent), var(--bg); color: var(--text); font: 16px/1.5 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; }
a { color: var(--cyan); }
h1, h2, h3 { line-height: 1.2; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; margin-bottom: .8rem; }
h3 { font-size: 1rem; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
input, select, textarea { background: #0d0f18; border: 1px solid var(--line); border-radius: 10px; padding: .55rem .7rem; width: 100%; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
input[type=checkbox] { width: 20px; height: 20px; flex: none; accent-color: var(--lime); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 40px; padding: .45rem .95rem; border-radius: 10px; border: 1px solid var(--line); background: var(--panel2); color: var(--text); font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover:not(:disabled) { border-color: rgba(255,255,255,.3); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: linear-gradient(120deg, var(--lime), var(--cyan)); color: var(--ink); border: 0; }
.btn.danger { color: var(--red); border-color: rgba(255,93,108,.45); }
.btn.big { min-height: 52px; padding: .7rem 1.5rem; font-size: 1.05rem; }
.btn.small { min-height: 32px; padding: .2rem .65rem; font-size: .88rem; }
.muted { color: var(--muted); } .small { font-size: .88rem; } .hidden { display: none !important; }
.err { padding: .65rem .9rem; border-radius: 10px; background: rgba(255,93,108,.12); border: 1px solid rgba(255,93,108,.4); }
.note { padding: .65rem .9rem; border-radius: 10px; background: rgba(34,211,238,.1); border: 1px solid rgba(34,211,238,.35); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem; }
.stack { display: grid; gap: 1rem; } .row { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; } .spacer { flex: 1; }
.pill { display: inline-block; padding: .05rem .55rem; border-radius: 999px; background: var(--panel2); font-size: .8rem; font-weight: 600; white-space: nowrap; }
.pill.ok { color: var(--lime); } .pill.warn { color: var(--gold); } .pill.bad { color: var(--red); }

/* Kopfzeile */
.topbar { position: sticky; top: 0; z-index: 10; display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; padding: max(.6rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) .6rem max(1rem, env(safe-area-inset-left)); background: rgba(10,12,19,.88); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: .55rem; color: var(--text); font-weight: 800; letter-spacing: .02em; text-decoration: none; }
.brand img { width: 32px; height: 32px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--panel2); object-fit: cover; }
.wrap { width: min(1120px, 100%); margin: 0 auto; padding: 1.2rem max(1rem, env(safe-area-inset-right)) max(3rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left)); display: grid; gap: 1.2rem; }

/* Startseite */
.landing { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 1.5rem 1rem; text-align: center; }
.landing .inner { width: min(620px, 100%); display: grid; gap: 1.1rem; justify-items: center; }
.landing h1 { font-size: clamp(2.2rem, 7vw, 3.4rem); font-weight: 900; }
.landing h1 b { background: linear-gradient(120deg, var(--lime), var(--cyan)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem; }
.chips span { padding: .2rem .6rem; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); font-size: .88rem; }

/* Spieleübersicht */
.level { display: grid; gap: .15rem; min-width: 130px; font-size: .82rem; }
.bar { height: 6px; border-radius: 3px; background: var(--panel2); overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--lime), var(--cyan)); }
.gamegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .8rem; }
.game { display: grid; grid-template-rows: auto 1fr auto; gap: .4rem; text-align: left; padding: 1rem; border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel); color: var(--text); cursor: pointer; transition: transform .12s, border-color .12s; }
.game:hover:not(:disabled) { transform: translateY(-2px); border-color: var(--cyan); }
.game:disabled { opacity: .5; cursor: not-allowed; }
.game b { font-size: 1.05rem; } .game .emo { font-size: 1.7rem; margin-right: .35rem; vertical-align: -.15em; }
.lobby { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; padding: .7rem .9rem; border-radius: 12px; background: var(--panel2); }
.lobby .who { flex: 1 1 220px; min-width: 0; overflow-wrap: anywhere; }
.toast-layer { position: fixed; left: 50%; bottom: 1.2rem; transform: translateX(-50%); display: grid; gap: .4rem; z-index: 50; width: min(440px, calc(100% - 2rem)); }
.toast { padding: .6rem .9rem; border-radius: 10px; background: #23283a; border: 1px solid var(--line); box-shadow: 0 8px 26px rgba(0,0,0,.45); }
.toast.bad { border-color: var(--red); } .toast.ok { border-color: var(--lime); }

/* Sichtbarkeit neuer Lobbys, Code-Eingabe, Streamermodus */
.seg { display: inline-flex; padding: 3px; gap: 3px; border-radius: 12px; background: var(--panel2); border: 1px solid var(--line); margin-bottom: .45rem; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg span { display: flex; align-items: center; min-height: 40px; padding: .3rem .9rem; border-radius: 9px; font-weight: 600; }
.seg input:checked + span { background: linear-gradient(120deg, var(--lime), var(--cyan)); color: var(--ink); }
.seg input:focus-visible + span { outline: 2px solid var(--cyan); outline-offset: 2px; }
#vishint { margin-bottom: .8rem; }
.codefield { display: grid; gap: .3rem; min-width: min(240px, 100%); }
.codefield input { letter-spacing: .12em; font-size: 16px; }
.btn.active { border-color: var(--red); color: var(--red); }

/* Admin: Tabellen und Kennzahlen */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: .5rem; }
.stats div { background: var(--panel2); border-radius: 10px; padding: .5rem .7rem; }
.stats b { display: block; font-size: 1.1rem; }
table { width: 100%; border-collapse: collapse; } th, td { padding: .45rem .55rem; text-align: left; border-bottom: 1px solid var(--line); } th { color: var(--muted); font-size: .85rem; font-weight: 600; }
.tablewrap { overflow-x: auto; }

/* Admin */
.admin { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 1rem; width: min(1200px, 100%); margin: 0 auto; padding: 1rem; }
.admin nav { display: grid; gap: .25rem; align-content: start; position: sticky; top: 70px; }
.admin nav a { padding: .5rem .7rem; border-radius: 10px; color: var(--text); text-decoration: none; }
.admin nav a.on { background: var(--panel2); font-weight: 700; }
.field { display: grid; gap: .25rem; } .field > span { font-size: .9rem; color: var(--muted); }
.check { display: flex; gap: .6rem; align-items: center; cursor: pointer; }
.formgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .75rem; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: .5rem; }
.thumbs figure { margin: 0; position: relative; } .thumbs img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; display: block; }
.thumbs button { position: absolute; top: 4px; right: 4px; }
.promptrow { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: .4rem; margin-bottom: .4rem; }
@media (max-width: 760px) {
  .admin { grid-template-columns: minmax(0, 1fr); }
  .admin nav { position: static; display: flex; overflow-x: auto; }
  .admin nav a { white-space: nowrap; }
}
@media (pointer: coarse) { .btn.small { min-height: 40px; } input, select, textarea { font-size: 16px; } }
@media (hover: none) { .game:hover:not(:disabled) { transform: none; } }
@media (prefers-reduced-motion: reduce) { .game { transition: none; } .game:hover:not(:disabled) { transform: none; } }
