/* slapvevo.de – Abendhaus-Design */

:root {
  --night: #1d1644;      /* Hintergrund, Abendhimmel */
  --dusk: #2a2160;       /* Flächen */
  --dusk-2: #382c80;     /* erhöhte Flächen, Fassade */
  --paper: #f4f0ff;      /* Text */
  --muted: #b8afe0;      /* Nebentext */
  --coral: #ff7a63;      /* Social */
  --mint: #4fe0b0;       /* Gaming */
  --lilac: #b9a6ff;      /* Hideout */
  --yellow: #ffd23f;     /* Arena, Fensterlicht */
  --danger: #ff8f8f;

  --font: ui-rounded, "SF Pro Rounded", "Nunito", "Arial Rounded MT Bold", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius-s: 6px;
  --radius-l: 18px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--night);
  color: var(--paper);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.55;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--yellow); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; border-radius: 4px; }

.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }

/* ---------- Kopfzeile ---------- */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding-block: 20px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--paper); text-decoration: none; font-weight: 800; font-size: 1.2rem; letter-spacing: -0.01em; }
.brand svg { width: 34px; height: 34px; }
.top-actions { display: flex; gap: 8px; align-items: center; }

/* ---------- Buttons ---------- */
.btn {
  --bg: var(--yellow); --fg: var(--night);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 20px;
  background: var(--bg); color: var(--fg);
  border: 0; border-radius: var(--radius-s);
  font: inherit; font-weight: 800; font-size: 1rem;
  text-decoration: none; cursor: pointer;
  box-shadow: 0 4px 0 color-mix(in srgb, var(--bg) 55%, #000);
  transition: transform .08s, box-shadow .08s;
}
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 color-mix(in srgb, var(--bg) 55%, #000); }
.btn-quiet { --bg: var(--dusk-2); --fg: var(--paper); }
.btn-text { background: none; box-shadow: none; color: var(--paper); padding: 0 12px; }
.btn-text:active { transform: none; box-shadow: none; }
.btn[disabled] { opacity: .6; cursor: progress; }

/* ---------- Startseite: Hero ---------- */
.hero {
  display: grid; grid-template-columns: 1.05fr 1fr; align-items: center; gap: 32px;
  padding-block: 24px 16px;
}
.hero h1 {
  font-size: clamp(2.6rem, 6.4vw, 5rem);
  line-height: .98; letter-spacing: -0.035em; font-weight: 900;
  margin: 0 0 20px;
  text-wrap: balance;
}
.hero p { font-size: 1.2rem; color: var(--muted); max-width: 30ch; margin: 0 0 28px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero .hero-note { margin: 18px 0 0; font-size: .95rem; color: var(--muted); }

/* ---------- Das Haus ---------- */
.house-stage { position: relative; }
.house { width: 100%; max-width: 480px; margin-inline: auto; overflow: visible; }
.house .stars rect { fill: var(--muted); opacity: .5; }
.house .shadow { fill: #000; opacity: .25; }
.house .roof { fill: #4a3ba3; }
.house .roof-edge { fill: #5d4cc0; }
.house .roof-edge-dark { fill: #31266f; }
.house .wall-left { fill: var(--dusk-2); }
.house .wall-right { fill: #2b2167; }
.house .floor-line { fill: #000; opacity: .18; }
.house .door { fill: #7b4b2a; }
.house .door-dark { fill: #5a3620; }
.house .blink { fill: var(--coral); }
.house-room .glass { fill: var(--room); }
.house-room .glow { fill: var(--room); opacity: 0; transition: opacity .15s; }
.house-room .shine { fill: #fff; opacity: .55; }
.house-room .mullion, .house-room .sill { fill: #1d1644; }
.house-room .sign { fill: var(--room); }
.house-room .sign-text { fill: var(--night); font: 800 12.5px var(--font); }
.house-room:hover .glow, .house-room:focus-visible .glow { opacity: .35; }
.house-room:focus-visible { outline: none; }
.house-room:focus-visible .glass { stroke: var(--paper); stroke-width: 4px; }

/* Der eine Moment: abends gehen nacheinander die Lichter an */
@media (prefers-reduced-motion: no-preference) {
  .house-room .glass, .house-room .shine { animation: light-on .5s steps(3, end) both; animation-delay: calc(.45s + var(--i) * .32s); }
  .house .blink { animation: blink 2.4s steps(1, end) infinite 2s; }
}
@keyframes light-on { from { fill: #1d1644; opacity: .9; } }
@keyframes blink { 50% { opacity: .15; } }

/* ---------- Räume (Liste) ---------- */
.section-title { font-size: clamp(1.6rem, 3vw, 2.2rem); letter-spacing: -0.02em; font-weight: 900; margin: 0 0 8px; }
.section-lead { color: var(--muted); margin: 0 0 32px; max-width: 52ch; }
.rooms { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 2px; background: var(--night); }
.room {
  display: grid; grid-template-columns: 56px 1fr; gap: 16px; align-items: start;
  padding: 24px; background: var(--dusk);
}
.rooms .room:first-child { border-top-left-radius: var(--radius-l); }
.rooms .room:nth-child(2) { border-top-right-radius: var(--radius-l); }
.rooms .room:nth-child(3) { border-bottom-left-radius: var(--radius-l); }
.rooms .room:last-child { border-bottom-right-radius: var(--radius-l); }
.room-window {
  width: 56px; height: 44px; border-radius: 3px; background: var(--room);
  background-image: linear-gradient(var(--night), var(--night)), linear-gradient(var(--night), var(--night));
  background-size: 4px 100%, 100% 4px; background-position: center; background-repeat: no-repeat;
}
.room h3 { margin: 0 0 4px; font-size: 1.3rem; letter-spacing: -0.01em; }
.room p { margin: 0; color: var(--muted); }
.room a { color: inherit; text-decoration: none; }
.room a:hover h3 { text-decoration: underline; text-decoration-color: var(--room); text-decoration-thickness: 3px; }

.home-rooms { padding-block: 24px 80px; }

/* ---------- Fußzeile ---------- */
.foot { border-top: 2px solid var(--dusk); padding-block: 28px 40px; color: var(--muted); font-size: .95rem; }
.foot .wrap { display: flex; flex-wrap: wrap; gap: 12px 28px; justify-content: space-between; }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.foot a { color: var(--paper); }

/* ---------- Anmelde-Dialog ---------- */
dialog.auth {
  width: min(440px, 100% - 32px); padding: 0; border: 0; border-radius: var(--radius-l);
  background: var(--dusk); color: var(--paper);
  box-shadow: 0 30px 80px rgba(0,0,0,.5);
}
dialog.auth::backdrop { background: rgba(13, 9, 36, .72); }
.auth-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 18px 0 24px; }
.tabs { display: flex; gap: 4px; background: var(--night); padding: 4px; border-radius: 10px; }
.tab { font: inherit; font-weight: 800; color: var(--muted); background: none; border: 0; padding: 8px 14px; border-radius: 7px; cursor: pointer; }
.tab[aria-selected="true"] { background: var(--dusk-2); color: var(--paper); }
.close { font: inherit; font-size: 1.6rem; line-height: 1; color: var(--muted); background: none; border: 0; width: 40px; height: 40px; border-radius: 8px; cursor: pointer; }
.close:hover { color: var(--paper); background: var(--dusk-2); }
.auth form { padding: 20px 24px 24px; display: grid; gap: 14px; }
.auth h2 { margin: 0; font-size: 1.6rem; letter-spacing: -0.02em; }
.auth .hint { margin: -6px 0 2px; color: var(--muted); font-size: .95rem; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 700; font-size: .95rem; }
.field input {
  font: inherit; color: var(--paper); background: var(--night);
  border: 2px solid var(--dusk-2); border-radius: var(--radius-s);
  min-height: 46px; padding: 0 12px;
}
.field input:focus { border-color: var(--yellow); outline: none; }
.field input[aria-invalid="true"] { border-color: var(--danger); }
.field small { color: var(--muted); font-size: .85rem; }
.check { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; font-size: .95rem; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--yellow); }
.form-error { margin: 0; color: var(--danger); font-weight: 700; min-height: 0; }
.form-error:empty { display: none; }
.auth .btn { width: 100%; }

/* ---------- Innenbereich ---------- */
.app-hello { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: center; padding-block: 16px 48px; }
.app-hello h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); line-height: 1; letter-spacing: -0.03em; margin: 0 0 14px; font-weight: 900; }
.app-hello p { color: var(--muted); margin: 0; max-width: 34ch; font-size: 1.15rem; }
.user-chip { color: var(--muted); font-weight: 700; }

.room-page { padding-block: 24px 80px; }
.back { display: inline-block; color: var(--muted); text-decoration: none; font-weight: 700; margin-bottom: 24px; }
.back:hover { color: var(--paper); }
.room-hero { display: flex; align-items: center; gap: 20px; margin-bottom: 36px; }
.room-hero .room-window { width: 84px; height: 66px; flex: none; }
.room-hero h1 { margin: 0; font-size: clamp(2.4rem, 6vw, 4rem); letter-spacing: -0.03em; line-height: 1; font-weight: 900; }
.room-hero p { margin: 6px 0 0; color: var(--muted); font-size: 1.15rem; }
.empty {
  border: 2px dashed var(--dusk-2); border-radius: var(--radius-l);
  padding: 40px 28px; max-width: 640px;
}
.empty h2 { margin: 0 0 8px; font-size: 1.35rem; }
.empty p { margin: 0; color: var(--muted); }

/* ---------- Textseiten (Impressum etc.) ---------- */
.prose { max-width: 68ch; padding-block: 16px 80px; }
.prose h1 { font-size: clamp(2rem, 5vw, 3rem); letter-spacing: -0.03em; margin: 0 0 24px; line-height: 1.05; }
.prose h2 { font-size: 1.3rem; margin: 36px 0 8px; }
.prose p, .prose li { color: #dcd5f7; }
.todo { background: color-mix(in srgb, var(--yellow) 18%, transparent); border-left: 4px solid var(--yellow); padding: 10px 14px; border-radius: 4px; color: var(--paper); }

/* ---------- 404 ---------- */
.lost { padding-block: 60px 100px; max-width: 560px; }
.lost h1 { font-size: clamp(2.4rem, 6vw, 4rem); letter-spacing: -0.03em; line-height: 1; margin: 0 0 16px; }
.lost p { color: var(--muted); margin: 0 0 28px; font-size: 1.15rem; }

/* ---------- Handy ---------- */
@media (max-width: 820px) {
  .hero, .app-hello { grid-template-columns: 1fr; gap: 8px; }
  .hero { padding-top: 8px; }
  .hero .house-stage, .app-hello .house-stage { order: -1; }
  .house { max-width: 340px; }
  .rooms { grid-template-columns: 1fr; }
  .rooms .room { border-radius: 0 !important; }
  .rooms .room:first-child { border-radius: var(--radius-l) var(--radius-l) 0 0 !important; }
  .rooms .room:last-child { border-radius: 0 0 var(--radius-l) var(--radius-l) !important; }
  .top-actions .btn-text { display: none; }
}

/* ---------- Dialog: Extras ---------- */
.link-btn {
  font: inherit; font-size: .95rem; font-weight: 700; color: var(--muted);
  background: none; border: 0; padding: 4px; justify-self: center; cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px;
}
.link-btn:hover { color: var(--paper); }
.done { padding: 12px 24px 28px; display: grid; gap: 12px; }
.done h2 { margin: 0; font-size: 1.6rem; letter-spacing: -0.02em; }
.done p { margin: 0; }
.done .hint { margin: 0; }
.done:focus { outline: none; }
.done-icon { width: 64px; height: 46px; margin-bottom: 4px; }
.notice {
  background: color-mix(in srgb, var(--mint) 18%, transparent); border-left: 4px solid var(--mint);
  padding: 12px 16px; border-radius: 4px; margin: 0 0 20px; max-width: 46ch;
}
.panel { background: var(--dusk); border-radius: var(--radius-l); padding: 28px; max-width: 440px; display: grid; gap: 14px; }
.panel h1 { margin: 0; font-size: clamp(1.8rem, 4vw, 2.4rem); letter-spacing: -0.03em; line-height: 1.05; }
.panel p { margin: 0; color: var(--muted); }
.single { padding-block: 24px 80px; }
.panel .form-error, .app-hello .form-error { color: var(--danger); }
.app-hello .notice { margin: 0 0 24px; color: var(--paper); }

/* ---------- Spiel: Nachtschicht ---------- */
.game { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 28px; align-items: start; }
.game-stage { position: relative; background: #150f36; border-radius: var(--radius-l); padding: 18px 18px 0; overflow: hidden; }
.game-hud { display: flex; align-items: center; gap: 14px; min-height: 36px; margin-bottom: 8px; font-weight: 800; }
.hud-label { color: var(--muted); font-weight: 700; font-size: .9rem; }
.hud-score strong { font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.hud-combo { background: var(--yellow); color: var(--night); border-radius: 4px; padding: 2px 8px; font-size: .95rem; }
.hud-lives { margin-left: auto; display: flex; gap: 6px; }
.heart {
  width: 18px; height: 16px; background: var(--coral);
  clip-path: polygon(0 25%, 25% 0, 50% 20%, 75% 0, 100% 25%, 100% 50%, 50% 100%, 0 50%);
}
.heart.is-lost { background: var(--dusk-2); }

.building { position: relative; width: min(100%, 360px); margin: 0 auto; }
.building-roof { height: 22px; background: #4a3ba3; border-radius: 4px 4px 0 0; position: relative; }
.antenna { position: absolute; right: 22%; bottom: 100%; width: 4px; height: 26px; background: #5d4cc0; }
.antenna::before { content: ""; position: absolute; top: -6px; left: -1px; width: 6px; height: 6px; background: var(--coral); }
.building-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px;
  background: var(--dusk-2); padding: 18px;
}
.building-door { width: 56px; height: 64px; margin: 0 auto; background: #7b4b2a; border: 6px solid var(--dusk-2); border-bottom: 0; box-shadow: 0 0 0 0 transparent; }
.building-door::after { content: ""; display: block; height: 0; }
.building { padding-bottom: 0; }
.building::after { content: ""; display: block; height: 10px; background: #0e0a26; }

.win {
  position: relative; aspect-ratio: 5 / 4; border: 0; padding: 0; cursor: pointer;
  border-radius: 3px; background: #241b57;
  box-shadow: inset 0 0 0 4px #1d1644;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
/* Fensterkreuz */
.win::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(#1d1644, #1d1644) center / 5px 100% no-repeat, linear-gradient(#1d1644, #1d1644) center / 100% 5px no-repeat;
}
.win[data-state="lit"] { background: var(--yellow); box-shadow: inset 0 0 0 4px #1d1644, 0 0 22px rgba(255, 210, 63, .55); }
.win[data-state="off"] { background: #3b2f86; }
.win[data-state="cat"] { background: var(--lilac); box-shadow: inset 0 0 0 4px #1d1644, 0 0 18px rgba(185, 166, 255, .45); }
/* Katzen-Silhouette */
.win[data-state="cat"]::after {
  content: ""; position: absolute; left: 50%; bottom: 8%; width: 42%; height: 58%; transform: translateX(-50%);
  background: #1d1644;
  clip-path: polygon(10% 100%, 10% 35%, 0 0, 30% 22%, 70% 22%, 100% 0, 90% 35%, 90% 100%);
}
.win:focus-visible { outline: 3px solid var(--paper); outline-offset: 2px; }
.win.pop { animation: pop .16s ease-out; }
@keyframes pop { 50% { transform: scale(.92); } }

.complaint {
  position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%) rotate(-6deg);
  margin: 0; padding: 6px 14px; border-radius: 6px;
  background: var(--coral); color: var(--night); font-weight: 900; font-size: 1.4rem;
  opacity: 0; pointer-events: none;
}
.complaint.show { animation: complaint .9s ease-out; }
@keyframes complaint { 0% { opacity: 0; transform: translate(-50%, -30%) rotate(-6deg) scale(.8); } 15% { opacity: 1; transform: translate(-50%, -50%) rotate(-6deg) scale(1.05); } 70% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -70%) rotate(-6deg); } }
.building.shake { animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
@media (prefers-reduced-motion: reduce) {
  .building.shake, .win.pop { animation: none; }
  .complaint.show { animation-duration: 1.2s; }
}

.game-overlay {
  position: absolute; inset: 0; display: grid; place-items: center; padding: 18px;
  background: rgba(13, 9, 36, .82); backdrop-filter: blur(2px);
}
.overlay-card { background: var(--dusk); border-radius: var(--radius-l); padding: 24px; max-width: 380px; display: grid; gap: 12px; }
.overlay-card h2 { margin: 0; font-size: 1.8rem; letter-spacing: -0.02em; }
.overlay-card p { margin: 0; color: var(--muted); }
.game-rules { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: .95rem; }
.game-rules li { display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: center; }
.rule-icon { width: 30px; height: 24px; border-radius: 3px; position: relative; }
.rule-icon.is-lit { background: var(--yellow); }
.rule-icon.is-cat { background: var(--lilac); }
.rule-icon.is-cat::after { content: ""; position: absolute; left: 50%; bottom: 3px; width: 12px; height: 13px; transform: translateX(-50%); background: #1d1644; clip-path: polygon(10% 100%, 10% 35%, 0 0, 30% 22%, 70% 22%, 100% 0, 90% 35%, 90% 100%); }
.rule-icon.is-heart { background: var(--coral); width: 22px; height: 20px; margin-left: 4px; clip-path: polygon(0 25%, 25% 0, 50% 20%, 75% 0, 100% 25%, 100% 50%, 50% 100%, 0 50%); }
.game-best strong, .end-score strong { color: var(--paper); }
.end-score { font-size: 1.2rem; }
.end-score strong { font-size: 2.6rem; font-weight: 900; letter-spacing: -0.03em; }

.leaderboard { background: var(--dusk); border-radius: var(--radius-l); padding: 20px; }
.leaderboard h2 { margin: 0 0 12px; font-size: 1.2rem; }
.leaderboard ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.leaderboard li { display: grid; grid-template-columns: 28px 1fr auto; gap: 8px; padding: 6px 8px; border-radius: 6px; font-variant-numeric: tabular-nums; }
.leaderboard li.is-me { background: var(--dusk-2); }
.lb-rank { color: var(--muted); font-weight: 800; }
.lb-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-score { font-weight: 800; }
.leaderboard li:first-child .lb-rank { color: var(--yellow); }
.leaderboard .lb-empty { display: block; color: var(--muted); padding: 0; }

@media (max-width: 820px) {
  .game { grid-template-columns: 1fr; }
  .game-stage { padding: 14px 12px 0; }
  .building-grid { gap: 10px; padding: 14px; }
}

/* ---------- Spieleübersicht (Gaming) ---------- */
.game-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; max-width: 820px; }
.game-list a {
  display: grid; grid-template-columns: 120px 1fr auto; gap: 20px; align-items: center;
  background: var(--dusk); border-radius: var(--radius-l); padding: 16px 20px 16px 16px;
  color: inherit; text-decoration: none; border: 2px solid transparent;
}
.game-list a:hover, .game-list a:focus-visible { border-color: var(--accent); }
.gl-text { display: grid; gap: 4px; }
.gl-text strong { font-size: 1.35rem; letter-spacing: -0.01em; }
.gl-text span { color: var(--muted); }
.gl-tag { background: var(--night); border-radius: 999px; padding: 4px 12px; font-weight: 800; font-size: .85rem; white-space: nowrap; }
.gl-art { width: 120px; height: 84px; border-radius: 12px; background: #150f36; position: relative; display: block; overflow: hidden; }
.gl-night { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 12px 16px; }
.gl-night i { background: #2b2167; border-radius: 2px; }
.gl-night i.on { background: var(--yellow); box-shadow: 0 0 10px rgba(255,210,63,.6); }
.gl-cards i, .gl-poker i {
  position: absolute; top: 14px; width: 40px; height: 56px; border-radius: 6px; display: grid; place-items: center;
  font-style: normal; font-weight: 900; color: var(--night); box-shadow: 0 3px 0 rgba(0,0,0,.4);
}
.gl-cards .c1 { left: 18px; background: var(--mint); transform: rotate(-10deg); }
.gl-cards .c2 { left: 40px; background: conic-gradient(var(--coral) 0 25%, var(--yellow) 0 50%, var(--mint) 0 75%, #7fb2ff 0); color: var(--paper); }
.gl-cards .c3 { left: 62px; background: var(--coral); transform: rotate(10deg); }
.gl-poker { background: radial-gradient(ellipse, #2d8f6c, #17543f); }
.gl-poker i { background: #fbf8ff; left: 26px; transform: rotate(-8deg); }
.gl-poker i.red { left: 54px; color: #d6334a; transform: rotate(8deg); }
@media (max-width: 600px) {
  .game-list a { grid-template-columns: 84px 1fr; gap: 14px; }
  .gl-art { width: 84px; height: 70px; }
  .gl-tag { grid-column: 2; justify-self: start; }
  .gl-cards i, .gl-poker i { width: 30px; height: 42px; top: 14px; font-size: .8rem; }
  .gl-cards .c1 { left: 8px; } .gl-cards .c2 { left: 27px; } .gl-cards .c3 { left: 46px; }
  .gl-poker i { left: 14px; } .gl-poker i.red { left: 38px; }
}
