/* ── Pairs — Memory im Zauberwald (Grundlage games/solitaire/css/spiel.css: Schriften, Startbildschirm, Karten-Boxen) ─────────
   WAS: Leiste (Spieler-Chips, Status, Knöpfe), Tisch als Moos-Lichtung mit Feld aus quadratischen Karten (--k aus js/main.js),
        CSS-3D-Wenden (.karte.offen dreht .innen um 180°), Austeilen-Animation, Funken bei Paaren, gefundene Paare golden und blass.
   Hintergrundbild Zauberwald (img/hg-*.webp, Krea 2). Farben in :root. */
@font-face { font-family: 'Playfair Display'; font-weight: 700; font-display: swap; src: url('https://fonts.hirsing.eu/playfair-dispplay-v40-latin/playfair-display-v40-latin-700.woff2') format('woff2'); }
@font-face { font-family: 'Lato'; font-weight: 400; font-display: swap; src: url('https://fonts.hirsing.eu/lato-v25-latin/lato-v25-latin-regular.woff2') format('woff2'); }
@font-face { font-family: 'Lato'; font-weight: 700; font-display: swap; src: url('https://fonts.hirsing.eu/lato-v25-latin/lato-v25-latin-700.woff2') format('woff2'); }
:root {
  --moos: #1f4a2c; --gold: #d8b25c; --gold-hell: #f6dc9a; --text: #f6ecd8; --leise: #c9b98f;
  --titel: 'Playfair Display', Georgia, serif; --sans: 'Lato', system-ui, sans-serif;
  --oben: max(10px, env(safe-area-inset-top)); --unten: max(10px, env(safe-area-inset-bottom)); --rand: max(10px, env(safe-area-inset-left));
  --glas: rgba(20, 12, 6, 0.7);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body { font-family: var(--sans); color: var(--text); user-select: none; -webkit-user-select: none; background: #0b0704; }
button { font: inherit; color: inherit; cursor: pointer; }
.versteckt { display: none !important; }
/* Hintergrundbild Salon (Micha 30.10.: jedes Startbild mit Illustration); im Spiel dunkler, der Tisch steht vorn */
body::before { content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(180deg, rgba(10, 6, 3, 0.2), rgba(10, 6, 3, 0.55)), url('../img/hg-quer.webp') center / cover no-repeat; transition: opacity .6s, filter .6s; }
body:not(.im-menue)::before { opacity: 0.55; filter: blur(2px); }
@media (max-aspect-ratio: 9/10) { body::before { background-image: linear-gradient(180deg, rgba(10, 6, 3, 0.25), rgba(10, 6, 3, 0.6)), url('../img/hg-hoch.webp'); } }

/* ── Raum ── */
.raum { position: fixed; inset: var(--oben) var(--rand) var(--unten); display: flex; flex-direction: column; gap: 8px; }
.leiste { display: flex; align-items: center; gap: 10px; padding-left: 150px; min-height: 44px; flex-wrap: wrap; }
.spielerleiste { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 999px; background: var(--glas); border: 1px solid rgba(216, 178, 92, 0.3); color: var(--leise); font-weight: 700; transition: box-shadow .3s, color .3s; }
.chip b { font: 700 18px var(--titel); color: var(--gold-hell); }
.chip.dran { color: var(--text); box-shadow: 0 0 0 2px var(--gold), 0 0 18px rgba(246, 220, 154, 0.6); }
.status { flex: 1; text-align: center; font-family: var(--titel); font-style: italic; font-size: 18px; color: var(--text); }
.knoepfe { display: flex; gap: 6px; }
.rund { width: 42px; height: 42px; display: grid; place-items: center; padding: 0; border-radius: 50%; border: 1px solid rgba(246, 220, 154, 0.4); background: var(--glas); color: var(--gold-hell); }
.rund svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.rund .strich-aus { display: none; } .rund.aus .strich-aus { display: inline; } .rund.aus .welle { display: none; }
body.im-menue .leiste { visibility: hidden; }

/* ── Tisch: Moos-Lichtung, Feld mittig ── */
.tisch { position: relative; flex: 1; display: grid; place-items: center; border-radius: 28px; overflow: hidden;
  background: radial-gradient(ellipse 70% 65% at 50% 45%, rgba(40, 90, 50, 0.22), rgba(10, 30, 16, 0.5) 75%);   /* durchscheinend: der Zauberwald (Hintergrundbild) bleibt sichtbar */
  box-shadow: inset 0 0 0 1px rgba(216, 178, 92, 0.35), inset 0 0 80px rgba(0, 0, 0, 0.5); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }
.feld { position: relative; display: grid; grid-template-columns: repeat(var(--sp), var(--k)); grid-auto-rows: var(--k); gap: 8px; perspective: 900px; }
.karte { position: relative; width: var(--k); height: var(--k); padding: 0; border: 0; background: none; cursor: pointer; animation: austeilen .5s cubic-bezier(.2,.8,.25,1) backwards; }
@keyframes austeilen { from { transform: translateY(-40px) scale(.6) rotate(-8deg); opacity: 0; } }
.innen { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .45s cubic-bezier(.2,.8,.25,1); }
.karte.offen .innen { transform: rotateY(180deg); }
.hinten, .vorn { position: absolute; inset: 0; border-radius: 12%; backface-visibility: hidden; -webkit-backface-visibility: hidden; overflow: hidden;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.45), 0 1px 0 rgba(255, 255, 255, 0.15) inset; }
.hinten { background: url('../img/ruecken.svg') center / cover; }
.vorn { transform: rotateY(180deg); background: #f4ead2; border: 3px solid #d8b25c; }
.vorn img { width: 100%; height: 100%; object-fit: cover; display: block; }
.karte:not(.offen):hover .innen { transform: translateY(-3px) rotateX(6deg); }
.karte.weg { cursor: default; } .karte.weg .vorn { border-color: #f6dc9a; box-shadow: 0 0 16px rgba(246, 220, 154, 0.8); animation: gefunden .8s ease-out forwards; }
@keyframes gefunden { 50% { transform: rotateY(180deg) scale(1.12); } to { transform: rotateY(180deg) scale(0.92); opacity: 0.55; filter: saturate(0.7); } }
.funke { position: absolute; width: 7px; height: 7px; border-radius: 50%; pointer-events: none; z-index: 5; background: radial-gradient(circle, #fff, var(--gold-hell) 40%, transparent 70%); animation: funke .9s ease-out forwards; }
@keyframes funke { to { transform: translate(var(--dx), var(--dy)) scale(0.2); opacity: 0; } }
/* Im Startbildschirm rückt der Tisch nach rechts und wird kleiner (wie Solitaire) */
.tisch { transition: transform .6s cubic-bezier(.2,.8,.25,1); transform-origin: 100% 50%; }
body.im-menue .tisch { transform: scale(0.7) translateX(6%); }
body:not(.im-menue) .tisch { transition: none; }
@media (max-width: 760px), (max-aspect-ratio: 4/5) { .tisch { transform-origin: 50% 0; } body.im-menue .tisch { transform: scale(0.75); opacity: .6; } }

/* ── Startbildschirm (Norm sb-*) ── */
.ebene { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 20; }
.sb { justify-content: flex-start; padding-top: 60px; padding-left: clamp(16px, 7vw, 110px);   /* oben Platz für die GameZone-Pille */ background: linear-gradient(90deg, rgba(10, 6, 3, 0.92), rgba(10, 6, 3, 0.7) 40%, rgba(10, 6, 3, 0.05) 74%); }
.sb-karte { width: min(500px, calc(100% + 40px)); max-height: 100%; overflow-y: auto; padding: 8px 24px 24px; margin: 0 -20px; scrollbar-width: none; }
.sb-vortitel { font-size: 12px; letter-spacing: 0.3em; text-transform: uppercase; color: var(--gold); }
.sb-titel { margin: 4px 0 0; font-family: var(--titel); font-weight: 700; font-size: clamp(56px, 7.5vw, 104px); line-height: 1;
  background: linear-gradient(180deg, #fff3cf, var(--gold-hell) 45%, var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 4px 18px rgba(0, 0, 0, 0.5)); }
.sb-unterzeile { margin: 10px 0 22px; color: var(--leise); font-family: var(--titel); font-style: italic; font-size: 17px; }
.sb-start { width: 100%; margin: 4px 0 14px; padding: 14px; border: 0; border-radius: 999px; font-family: var(--titel); font-weight: 700; font-size: 26px; color: #2a1404;
  background: linear-gradient(180deg, #fff1c8, var(--gold-hell) 40%, var(--gold)); box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45); }
.sb-hilfe { border: 1px solid rgba(216, 178, 92, 0.25); border-radius: 14px; padding: 10px 14px; font-size: 14px; color: var(--leise); background: rgba(255, 240, 210, 0.04); }
.sb-hilfe summary { color: var(--text); font-weight: 700; cursor: pointer; }
.sb-hilfe p { margin: 8px 0 0; line-height: 1.5; }
.sb-hilfe h2, .sb-hilfe h3, .sb-hilfe h4 { color: var(--text); }
.sb-sprache { margin-top: 12px; background: none; border: 1px solid rgba(216, 178, 92, 0.35); border-radius: 999px; padding: 6px 14px; color: var(--leise); font-size: 13px; }
#ende, #pause { background: rgba(8, 4, 2, 0.55); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.karte-box { width: min(420px, 100%); padding: 24px 26px; text-align: center; border-radius: 18px; background: radial-gradient(ellipse at 50% 0%, #2c4a2a, #0c1a10);
  border: 1px solid rgba(246, 220, 154, 0.45); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6); }
.karte-box h2 { margin: 0 0 10px; font-family: var(--titel); font-size: 38px; color: var(--gold-hell); }
.karte-box p { margin: 6px 0; color: var(--leise); } .karte-box a { color: var(--gold-hell); } .karte-box .rekord { color: var(--gold-hell); font-weight: 700; }
.knopf-gross { display: block; width: 100%; margin-top: 16px; padding: 12px; border: 0; border-radius: 999px; font-family: var(--titel); font-weight: 700; font-size: 22px; color: #2a1404; background: linear-gradient(180deg, var(--gold-hell), var(--gold)); }
.knopf-leise { display: block; width: 100%; margin-top: 8px; padding: 9px; border: 1px solid rgba(246, 220, 154, 0.3); border-radius: 999px; background: none; color: var(--leise); }
.meldung { position: fixed; left: 50%; bottom: 8%; transform: translate(-50%, 10px); padding: 8px 20px; border-radius: 999px; z-index: 30; pointer-events: none;
  background: var(--glas); border: 1px solid rgba(216, 178, 92, 0.4); color: var(--gold-hell); opacity: 0; transition: opacity .25s, transform .25s; }
.meldung.an { opacity: 1; transform: translate(-50%, 0); }

/* ── Handy ── */
@media (max-width: 760px), (max-aspect-ratio: 4/5) {
  .leiste { padding-left: 0; padding-top: 48px; flex-wrap: wrap; } .wert { min-width: 52px; padding: 3px 7px; } .wert b { font-size: 15px; }
  .rund { width: 38px; height: 38px; } .knopf { padding: 7px 12px; font-size: 13px; }
  .tisch { border-width: 6px; }
  .sb { justify-content: center; align-items: flex-end; padding: 16px; background: linear-gradient(180deg, rgba(10, 6, 3, 0.2), rgba(10, 6, 3, 0.95) 45%); }
  .sb-titel { font-size: 60px; }
}
@media (prefers-reduced-motion: reduce) { .knopf, .karte.wackeln, .funke { animation: none; } }
.rangliste { margin: 8px 0; padding: 0 0 0 20px; text-align: left; color: var(--leise); } .rangliste .sieger { color: var(--gold-hell); font-weight: 700; }
.sb-namen { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; } .sb-namen input { min-width: 0; padding: 9px 14px; border: 1px solid rgba(216, 178, 92, 0.3); border-radius: 999px; background: rgba(255, 240, 210, 0.06); color: var(--text); font: inherit; font-weight: 700; }
.sb-gruppe { margin: 0 0 12px; } .sb-label { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--gold-hell); margin-bottom: 6px; opacity: 0.85; }
.sb-wahl { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: rgba(255, 240, 210, 0.05); border: 1px solid rgba(216, 178, 92, 0.3); }
.sb-wahl button { flex: 1; min-height: 36px; border: 0; border-radius: 999px; background: transparent; color: var(--leise); font-weight: 700; }
.sb-wahl button.an { background: linear-gradient(180deg, var(--gold-hell), var(--gold)); color: #2a1404; }
@media (max-width: 760px), (max-aspect-ratio: 4/5) { .leiste { padding-left: 0; padding-top: 48px; } .status { flex-basis: 100%; order: 3; font-size: 15px; } .feld { gap: 5px; } }
@media (prefers-reduced-motion: reduce) { .karte, .innen, .funke, .karte.weg .vorn { animation: none; transition: none; } }
