/* ── Solitaire — Samttisch im Flussdampfer-Salon ────────────────────────────────────────────────────────────────────
   WAS: Tisch als smaragdgrüner Samt mit Mahagoni-Rand und Goldeinlage, Karten (CC0-SVG) mit warmem Papierton, weichem Schatten und
        Goldkante, eigene Rückseite (img/ruecken.svg). Karten liegen absolut in ihren Plätzen (js/main.js setzt left/top, FLIP-Flug).
        Hintergrundbild Salon (img/hg-*.webp, Krea 2) hinter allem, im Spiel abgedunkelt. Startbildschirm-Norm sb-*.
   ÄNDERN: Farben in :root. Kartengröße kommt aus js/main.js (--kb, --kh am Tisch). Oben links bleibt Platz für die GameZone-Pille.
        Schriften von fonts.hirsing.eu: Playfair Display (Titel), Lato (Bedienung). */
@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 {
  --samt: #0f5a36; --samt-dunkel: #06301c; --holz: #4a1d0e; --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: Leiste oben, Tisch darunter ── */
.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; }
.hud { display: flex; gap: 6px; }
.wert { min-width: 64px; padding: 4px 10px; border-radius: 12px; text-align: center; background: var(--glas); border: 1px solid rgba(216, 178, 92, 0.3); }
.wert span { display: block; font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--leise); }
.wert b { font: 700 18px var(--sans); color: var(--gold-hell); }
.knoepfe { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.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:disabled { opacity: 0.35; cursor: default; }
.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; }
.knopf { padding: 9px 16px; border: 0; border-radius: 999px; font-weight: 700; color: #2a1404; background: linear-gradient(180deg, var(--gold-hell), var(--gold)); box-shadow: 0 0 18px rgba(246, 220, 154, 0.5); animation: atmen 1.2s ease-in-out infinite alternate; }
@keyframes atmen { to { box-shadow: 0 0 30px rgba(246, 220, 154, 0.9); } }
body.im-menue .leiste { visibility: hidden; }

/* ── Tisch: Samt mit Mahagoni-Rand und Goldeinlage ── */
.tisch { position: relative; flex: 1; border-radius: 26px; overflow: hidden; touch-action: none;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .22 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E"),
    radial-gradient(ellipse 75% 70% at 50% 40%, #17804d 0%, var(--samt) 45%, var(--samt-dunkel) 100%);
  border: 14px solid #4a1d0e; border-radius: 34px;   /* Mahagoni-Rand, abgerundet wie im Zielbild (solitaire-ziel-*) */
  box-shadow: inset 0 0 0 2px var(--gold), inset 0 0 80px rgba(0, 0, 0, 0.6), 0 0 0 2px #2a0f06, 0 0 0 5px #7a3418, 0 24px 60px rgba(0, 0, 0, 0.6); }
/* Im Startbildschirm rückt der Tisch kleiner nach rechts — der Salon (Hintergrundbild) bleibt ringsum sichtbar */
.tisch { transition: transform .6s cubic-bezier(.2,.8,.25,1); transform-origin: 100% 50%; }
body.im-menue .tisch { transform: scale(0.62) translateX(4%); }
body:not(.im-menue) .tisch { transition: none; }   /* beim Austeilen sofort volle Größe — die Kartenflüge messen die Lage (FLIP) */
@media (max-width: 760px), (max-aspect-ratio: 4/5) { .tisch { transform-origin: 50% 0; } body.im-menue .tisch { transform: scale(0.7) translateY(4%); } }
/* warmes Licht der Messinglampe: heller Kegel oben links, Ränder dunkel */
.tisch::after { content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 800;
  background: radial-gradient(ellipse 55% 50% at 22% 12%, rgba(255, 196, 110, 0.16), transparent 70%), radial-gradient(ellipse 90% 85% at 50% 45%, transparent 60%, rgba(0, 0, 0, 0.35)); }
.platz { position: absolute; width: var(--kb); height: var(--kh); border-radius: calc(var(--kb) * 0.07); isolation: isolate; }   /* eigene Ebene: Platzmarken (::before/::after, z −1) bleiben unter den Karten */
.platz::before { content: ''; position: absolute; inset: 0; z-index: -1; border-radius: inherit; border: 2px solid rgba(246, 220, 154, 0.28); background: rgba(0, 0, 0, 0.12); }
.platz.ablage::after { content: 'A'; position: absolute; inset: 0; z-index: -1; display: grid; place-items: center; font: 700 calc(var(--kb) * 0.4) var(--titel); color: rgba(246, 220, 154, 0.22); }
.platz.stapel { cursor: pointer; }
.platz.stapel.nachfuellen::after { content: '↻'; position: absolute; inset: 0; z-index: -1; display: grid; place-items: center; font-size: calc(var(--kb) * 0.5); color: rgba(246, 220, 154, 0.6); }
.platz.ziel::before { border-color: var(--gold-hell); box-shadow: 0 0 22px rgba(246, 220, 154, 0.7); background: rgba(246, 220, 154, 0.1); }
.platz.hinweis-an::before, .karte.hinweis-an { animation: hinweis 0.45s ease-in-out 3 alternate; }
@keyframes hinweis { to { box-shadow: 0 0 0 3px var(--gold-hell), 0 0 28px rgba(246, 220, 154, 0.9); } }

/* ── Karten ── */
.karte { position: absolute; width: var(--kb); height: var(--kh); border-radius: calc(var(--kb) * 0.07); cursor: default;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.45), 0 4px 10px rgba(0, 0, 0, 0.25); will-change: transform; }
.karte img { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: inherit; display: block; pointer-events: none; }
.karte .vorn { filter: sepia(0.22) saturate(1.15) brightness(0.97); box-shadow: inset 0 0 0 1px rgba(160, 120, 50, 0.6); background: #f8f1df; }
.karte .hinten, .karte.offen .vorn { visibility: visible; } .karte .vorn, .karte.offen .hinten { visibility: hidden; }
.karte.offen { cursor: grab; }
.karte.offen::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;   /* Goldkante + Glanz */
  box-shadow: inset 0 0 0 1.5px rgba(216, 178, 92, 0.75); background: linear-gradient(135deg, rgba(255, 255, 255, 0.22), transparent 35%); }
.karte.fliegt { z-index: 500 !important; box-shadow: 0 0 18px rgba(255, 200, 100, 0.75), 0 0 40px rgba(255, 170, 60, 0.4), 0 8px 20px rgba(0, 0, 0, 0.4); }   /* goldene Spur im Flug (Zielbild) */
.karte.gezogen { z-index: 1000 !important; cursor: grabbing; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5), 0 0 0 2px rgba(246, 220, 154, 0.6); }
.karte.wackeln { animation: wackeln .3s; }
@keyframes wackeln { 25% { translate: -4px 0; } 75% { translate: 4px 0; } }
.funke { position: absolute; width: 6px; height: 6px; border-radius: 50%; pointer-events: none; z-index: 900;
  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; } }
#kaskade { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 15; pointer-events: none; display: none; }
#kaskade.an { display: block; }

/* ── 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-left: clamp(16px, 7vw, 110px); 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; } }
