:root {
  --bg-1: #0d0221;
  --bg-2: #170b3b;
  --panel: rgba(24, 16, 56, 0.72);
  --panel-border: rgba(255, 255, 255, 0.12);
  --text: #f2eefc;
  --text-dim: #b6aed6;
  --accent: #ff2e88;
  --accent-2: #7c4dff;
  --accent-3: #29e0c9;
  --p1: #ff4d6d;
  --p2: #4da3ff;
  --p3: #3ee08c;
  --p4: #ffe14d;
  --danger: #ff5252;
  --radius-lg: 26px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --shadow-glow: 0 0 0 1px rgba(255,255,255,0.06), 0 12px 40px rgba(0,0,0,0.45);
  font-size: 16px;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  background: radial-gradient(1200px 800px at 20% -10%, #2c1466 0%, var(--bg-1) 55%), var(--bg-1);
  color: var(--text);
  font-family: 'Rubik', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  height: 100dvh;
  width: 100vw;
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, .brand-text, .btn, .room-code {
  font-family: 'Baloo 2', 'Rubik', sans-serif;
}

#bg-fx {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(36px);
  opacity: 0.4;
  animation: float 18s ease-in-out infinite;
  will-change: transform;
  transform: translateZ(0);
}
.blob-a { width: 420px; height: 420px; background: var(--accent-2); top: -120px; left: -100px; }
.blob-b { width: 380px; height: 380px; background: var(--accent); bottom: -140px; right: -80px; animation-duration: 22s; animation-delay: -4s; }
.blob-c { width: 320px; height: 320px; background: var(--accent-3); top: 40%; left: 60%; animation-duration: 26s; animation-delay: -9s; }
@keyframes float {
  0%, 100% { transform: translate(0,0) scale(1); }
  33% { transform: translate(40px,-30px) scale(1.08); }
  66% { transform: translate(-30px,20px) scale(0.95); }
}
@media (prefers-reduced-motion: reduce) {
  .blob { animation: none; }
}
/* Auf kleineren/mobilen Bildschirmen (das Hauptzielgeraet dieses Spiels) ist
   die dritte, zusaetzliche Blob-Animation reine Kosmetik mit spuerbaren
   Performance-Kosten (Blur + staendiges Neuzeichnen) - hier abschalten. */
@media (max-width: 700px) {
  .blob-c { animation: none; opacity: 0.28; }
}
.grid-floor {
  position: absolute;
  left: -10%; right: -10%; bottom: -10%; height: 50%;
  background-image:
    linear-gradient(rgba(124,77,255,0.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124,77,255,0.18) 1px, transparent 1px);
  background-size: 42px 42px;
  transform: perspective(300px) rotateX(60deg);
  opacity: 0.5;
  mask-image: linear-gradient(to top, black, transparent);
}

#toast-container {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 66px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}
.toast {
  background: rgba(30, 12, 50, 0.95);
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--text);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.92rem;
  box-shadow: var(--shadow-glow);
  animation: toast-in 0.25s ease;
}
.toast.error { border-color: var(--danger); color: #ffd7d7; }
@keyframes toast-in { from { opacity:0; transform: translateY(-10px);} to {opacity:1; transform:none;} }

#conn-banner {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 600;
  background: var(--danger);
  color: #2a0000;
  text-align: center;
  font-weight: 600;
  padding: 6px 10px calc(6px + env(safe-area-inset-top, 0px));
  padding-top: calc(6px + env(safe-area-inset-top, 0px));
}
#conn-banner.hidden { display: none; }

#topbar {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(env(safe-area-inset-top,0px) + 10px) 16px 8px;
  flex: 0 0 auto;
}
#brand { display: flex; align-items: center; gap: 8px; font-weight: 800; letter-spacing: 0.2px; }
.brand-emoji { font-size: 1.4rem; }
.brand-text b { color: var(--accent); }
.icon-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--panel-border);
  color: var(--text);
  border-radius: 50%;
  width: 42px; height: 42px;
  font-size: 1.1rem;
  cursor: pointer;
}
.icon-btn.muted { opacity: 0.5; }

#app {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
}

.screen {
  display: none;
  flex: 1;
  min-height: 0;
  width: 100%;
  align-items: center;
  justify-content: center;
  padding: 8px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
}
.screen.active { display: flex; }

.panel {
  /* Kein backdrop-filter mehr: staendiges Live-Weichzeichnen des animierten
     Hintergrunds hinter JEDEM Panel auf JEDEM Bildschirm war die Hauptursache
     fuer spuerbares Ruckeln, v.a. auf Handys. Stattdessen ein deckenderer,
     statischer Hintergrund - sieht fast identisch aus, kostet aber nichts
     pro Frame. */
  background: rgba(20, 12, 46, 0.92);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-glow);
  padding: 26px;
  width: 100%;
  max-width: 480px;
  max-height: 100%;
  overflow-y: auto;
}
.center-panel { text-align: center; }

.title-hero {
  font-size: clamp(1.8rem, 7vw, 2.6rem);
  margin: 0 0 8px;
  line-height: 1.05;
  font-weight: 800;
}
.title-hero .accent { color: var(--accent); }
.subtitle { color: var(--text-dim); margin: 0 0 20px; font-size: 0.95rem; }

.field-label { display: block; font-size: 0.8rem; color: var(--text-dim); margin: 14px 0 6px; font-weight: 500; }
.text-input {
  width: 100%;
  background: rgba(0,0,0,0.28);
  border: 1px solid var(--panel-border);
  color: var(--text);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font-size: 1.05rem;
  font-family: inherit;
  outline: none;
}
.text-input:focus { border-color: var(--accent-2); }
.code-input { text-align: center; letter-spacing: 0.35em; text-transform: uppercase; font-weight: 700; font-size: 1.4rem; }

.stack-gap { display: flex; flex-direction: column; gap: 12px; margin-top: 18px; }

.btn {
  border: none;
  border-radius: 999px;
  padding: 15px 22px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  color: white;
  transition: transform 0.12s ease, filter 0.12s ease;
  touch-action: manipulation;
}
.btn:active { transform: scale(0.96); }
.btn-lg { padding: 17px 22px; font-size: 1.08rem; }
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 8px 24px rgba(255, 46, 136, 0.35); }
.btn-secondary { background: rgba(255,255,255,0.1); border: 1px solid var(--panel-border); }
.btn-ghost { background: transparent; border: 1px solid var(--panel-border); color: var(--text-dim); padding: 10px 16px; font-size: 0.9rem; }
.btn-solo { background: linear-gradient(135deg, var(--accent-3), #2b9fae); box-shadow: 0 8px 24px rgba(41, 224, 201, 0.25); }
.btn:disabled { opacity: 0.4; cursor: default; }
.btn:hover { filter: brightness(1.08); }

.hint { color: var(--text-dim); font-size: 0.85rem; margin-top: 14px; text-align: center; }
.pulse { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%,100%{opacity:0.6;} 50%{opacity:1;} }

.hidden { display: none !important; }

.join-box { margin-top: 16px; padding-top: 6px; border-top: 1px dashed var(--panel-border); }

/* LOBBY */
.lobby-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 18px; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.7rem; color: var(--text-dim); font-weight: 600; }
.room-code {
  background: rgba(0,0,0,0.3);
  border: 1px dashed var(--accent-3);
  color: var(--accent-3);
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  padding: 6px 18px;
  border-radius: var(--radius-md);
  cursor: pointer;
  margin-top: 4px;
}
.player-slots { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 8px; }
.player-slot {
  border-radius: var(--radius-md);
  padding: 14px 12px;
  min-height: 76px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  border: 1px solid var(--panel-border);
  background: rgba(255,255,255,0.04);
}
.player-slot.filled { background: linear-gradient(135deg, rgba(255,255,255,0.09), rgba(255,255,255,0.02)); }
.player-slot.empty { opacity: 0.4; border-style: dashed; align-items: center; justify-content: center; }
.player-slot .p-name { font-weight: 700; display: flex; align-items: center; gap: 6px; }
.player-slot .p-avatar { width: 12px; height: 12px; border-radius: 50%; box-shadow: 0 0 10px currentColor; flex: none; }
.player-slot .p-score { font-size: 0.78rem; color: var(--text-dim); }
.player-slot .p-crown { font-size: 0.85rem; }

/* SOLO SETUP */
.solo-setup-title { margin: 4px 0 0; font-size: 1.15rem; }
.solo-game-cards { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.solo-game-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--panel-border);
  background: rgba(255,255,255,0.04);
  cursor: pointer;
  text-align: left;
  color: var(--text);
  width: 100%;
}
.solo-game-card .vc-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.68rem; letter-spacing: 0.05em;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  flex: none;
}
.solo-game-card .vc-name { font-weight: 700; margin: 0 0 2px; }
.solo-game-card .vc-desc { font-size: 0.76rem; color: var(--text-dim); }
.solo-game-card.selected { border-color: var(--accent-3); box-shadow: 0 0 0 2px var(--accent-3) inset; }

.chip-row { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.chip-btn {
  flex: 1 1 0;
  min-width: 88px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--panel-border);
  color: var(--text);
  padding: 11px 10px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  touch-action: manipulation;
}
.chip-btn.selected { border-color: var(--accent-3); background: linear-gradient(135deg, rgba(41,224,201,0.28), rgba(124,77,255,0.22)); box-shadow: 0 0 0 1px var(--accent-3) inset; }

/* VOTE */
.vote-header h2 { margin: 0 0 10px; font-size: 1.3rem; }
.timer-bar-wrap { height: 8px; border-radius: 99px; background: rgba(255,255,255,0.1); overflow: hidden; margin-bottom: 16px; }
.timer-bar { height: 100%; width: 100%; background: linear-gradient(90deg, var(--accent-3), var(--accent-2)); transition: width 0.2s linear; }
.vote-cards { display: flex; flex-direction: column; gap: 12px; }
.vote-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--panel-border);
  background: rgba(255,255,255,0.04);
  cursor: pointer;
  text-align: left;
  color: var(--text);
  position: relative;
  overflow: hidden;
}
.vote-card .vc-icon {
  width: 50px; height: 50px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.72rem; letter-spacing: 0.05em;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  flex: none;
}
.vote-card .vc-name { font-weight: 700; margin: 0 0 2px; }
.vote-card .vc-desc { font-size: 0.78rem; color: var(--text-dim); }
.vote-card .vc-votes { margin-left: auto; display: flex; gap: 4px; flex-wrap: wrap; max-width: 60px; justify-content: flex-end; }
.vote-card .vc-vote-dot { width: 10px; height: 10px; border-radius: 50%; box-shadow: 0 0 6px currentColor; }
.vote-card.selected { border-color: var(--accent-3); box-shadow: 0 0 0 2px var(--accent-3) inset; }
.vote-card .vc-bar { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--accent-3); transition: width 0.3s ease; }

/* VOTE RESULT */
.reveal-icon { font-size: 4rem; margin-bottom: 6px; }

/* GAME */
#screen-game { flex-direction: column; padding: 8px 10px calc(8px + env(safe-area-inset-bottom,0px)); align-items: stretch; justify-content: flex-start; gap: 6px; }
#game-hud { flex: 0 0 auto; display: flex; flex-direction: column; gap: 6px; padding: 4px 6px; }
#game-title-wrap { display: flex; justify-content: space-between; align-items: baseline; }
#game-name { font-family: 'Baloo 2', sans-serif; font-weight: 700; font-size: 1.05rem; }
.game-timer-wrap { margin-bottom: 0; }
.game-scoreboard { display: flex; gap: 8px; flex-wrap: wrap; }
.gsb-chip {
  display: flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.07);
  border-radius: 999px;
  padding: 4px 10px 4px 6px;
  font-size: 0.78rem;
  font-weight: 600;
}
.gsb-chip .dot { width: 9px; height: 9px; border-radius: 50%; box-shadow: 0 0 6px currentColor; }
.gsb-chip.dead { opacity: 0.35; text-decoration: line-through; }

.game-turn-indicator {
  text-align: center;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(124, 77, 255, 0.18);
  border: 1px solid rgba(124, 77, 255, 0.4);
  align-self: center;
}
.game-turn-indicator.my-turn { background: rgba(41, 224, 201, 0.22); border-color: var(--accent-3); color: var(--accent-3); }

#canvas-wrap {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
#game-canvas {
  max-width: 100%;
  max-height: 100%;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-glow);
  background: #0b0620;
  touch-action: none;
}
.round-banner {
  position: absolute;
  top: 10px; left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.55);
  border: 1px solid var(--panel-border);
  padding: 6px 16px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9rem;
}

.controls-overlay { flex: 0 0 auto; display: flex; justify-content: center; padding: 6px 0 2px; }

.dpad { position: relative; width: 168px; height: 168px; }
.dpad-btn {
  position: absolute;
  width: 54px; height: 54px;
  border-radius: 14px;
  border: 1px solid var(--panel-border);
  background: rgba(255,255,255,0.09);
  color: var(--text);
  font-size: 1.3rem;
  touch-action: manipulation;
}
.dpad-btn:active { background: var(--accent-2); }
.dpad-up { top: 0; left: 57px; }
.dpad-down { bottom: 0; left: 57px; }
.dpad-left { top: 57px; left: 0; }
.dpad-right { top: 57px; right: 0; }

.joystick-base {
  width: 150px; height: 150px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--panel-border);
  position: relative;
  touch-action: none;
}
.joystick-knob {
  position: absolute;
  width: 62px; height: 62px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}

.controls-colors { flex-wrap: wrap; gap: 10px; max-width: 420px; margin: 0 auto; }
.color-btn {
  width: 64px; height: 64px;
  border-radius: 18px;
  border: 2px solid rgba(255,255,255,0.25);
  touch-action: manipulation;
}
.color-btn:active { transform: scale(0.92); }
.color-btn:disabled { opacity: 0.35; }
.color-btn[data-color="red"] { background: #ff4d6d; }
.color-btn[data-color="blue"] { background: #4da3ff; }
.color-btn[data-color="green"] { background: #3ee08c; }
.color-btn[data-color="yellow"] { background: #ffe14d; }
.color-btn[data-color="purple"] { background: #b073ff; }
.color-btn[data-color="orange"] { background: #ff9a4d; }

/* KARTENHAND (UNO) */
.controls-cards { flex-direction: column; gap: 8px; width: 100%; max-width: 640px; margin: 0 auto; }
.card-hand {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 8px;
  -webkit-overflow-scrolling: touch;
}
.uno-card {
  flex: none;
  width: 52px; height: 76px;
  border-radius: 10px;
  border: 2px solid rgba(255,255,255,0.35);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-weight: 800;
  font-size: 1.15rem;
  color: #fff;
  box-shadow: 0 4px 10px rgba(0,0,0,0.35);
  touch-action: manipulation;
  transition: transform 0.12s ease;
}
.uno-card:active { transform: translateY(-4px); }
.uno-card.disabled { opacity: 0.4; }
.uno-card[data-color="red"] { background: linear-gradient(160deg, #ff6b7f, #c81d3a); }
.uno-card[data-color="blue"] { background: linear-gradient(160deg, #5cb3ff, #1857b0); }
.uno-card[data-color="green"] { background: linear-gradient(160deg, #5eeaa0, #12945a); }
.uno-card[data-color="yellow"] { background: linear-gradient(160deg, #ffe98a, #d19a12); color: #3a2a00; }
.uno-card[data-color="wild"] { background: conic-gradient(#ff4d6d, #ffe14d, #3ee08c, #4da3ff, #ff4d6d); }
.uno-card .uno-card-sym { font-size: 0.68rem; margin-top: 2px; }
.card-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.card-actions .btn { padding: 10px 16px; font-size: 0.88rem; }

.wild-color-picker {
  position: fixed; inset: 0; z-index: 400;
  background: rgba(5, 2, 15, 0.72);
  display: flex; align-items: center; justify-content: center;
}
.wild-color-panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  padding: 22px;
  text-align: center;
}
.wild-color-row { display: flex; gap: 12px; margin-top: 10px; }
.wild-color-btn {
  width: 56px; height: 56px;
  border-radius: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  touch-action: manipulation;
}
.wild-color-btn:active { transform: scale(0.92); }
.wild-color-btn[data-color="red"] { background: #ff4d6d; }
.wild-color-btn[data-color="blue"] { background: #4da3ff; }
.wild-color-btn[data-color="green"] { background: #3ee08c; }
.wild-color-btn[data-color="yellow"] { background: #ffe14d; }

/* TEXTFELD (Bomb Party / Raten) */
.controls-text { gap: 8px; width: 100%; max-width: 420px; margin: 0 auto; }
.controls-text .text-input { flex: 1; margin: 0; }
.controls-text .btn { padding: 12px 18px; }

/* GENERISCHE AUSWAHL-BUTTONS (z.B. Schnick-Schnack-Schnuck) */
.controls-choice3 { gap: 14px; flex-wrap: wrap; }
.choice-btn {
  flex: none;
  width: 78px; height: 78px;
  border-radius: 20px;
  border: 2px solid var(--panel-border);
  background: rgba(255,255,255,0.07);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px;
  font-size: 1.8rem;
  touch-action: manipulation;
}
.choice-btn .choice-label { font-size: 0.65rem; font-weight: 700; color: var(--text-dim); }
.choice-btn:active { transform: scale(0.92); }
.choice-btn.selected { border-color: var(--accent-3); box-shadow: 0 0 0 2px var(--accent-3) inset; }
.choice-btn:disabled { opacity: 0.4; }

/* ZEICHENWERKZEUG */
.controls-draw { gap: 10px; flex-wrap: wrap; align-items: center; }
.draw-color-row { display: flex; gap: 8px; }
.draw-color-btn {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.25);
  touch-action: manipulation;
}
.draw-color-btn.selected { box-shadow: 0 0 0 3px var(--accent-3); }

/* RESULTS */
.results-title { text-align: center; margin: 0 0 18px; }
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 10px; margin-bottom: 20px; min-height: 130px; }
.podium-slot { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 76px; }
.podium-slot .pd-name { font-size: 0.78rem; font-weight: 700; text-align: center; word-break: break-word; }
.podium-slot .pd-score { font-size: 0.72rem; color: var(--text-dim); }
.podium-slot .pd-bar { width: 100%; border-radius: 10px 10px 0 0; background: linear-gradient(180deg, rgba(255,255,255,0.25), rgba(255,255,255,0.05)); display:flex; align-items:flex-start; justify-content:center; padding-top:6px; font-weight:800; }
.podium-slot.rank-1 .pd-bar { height: 110px; background: linear-gradient(180deg, #ffe14d, #b9860a); }
.podium-slot.rank-2 .pd-bar { height: 80px; background: linear-gradient(180deg, #d9d9e6, #8a8a9a); }
.podium-slot.rank-3 .pd-bar { height: 58px; background: linear-gradient(180deg, #ffb27a, #a35a26); }
.podium-slot.rank-4 .pd-bar { height: 38px; background: linear-gradient(180deg, #7a6ea8, #4a4270); }

.score-table { width: 100%; border-collapse: collapse; margin-bottom: 18px; font-size: 0.88rem; }
.score-table td { padding: 8px 4px; border-bottom: 1px solid var(--panel-border); }
.score-table .st-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 8px; box-shadow: 0 0 6px currentColor; }
.score-table .st-total { text-align: right; font-weight: 700; }
.score-table .st-round { text-align: right; color: var(--text-dim); font-size: 0.8rem; }

/* SOLITAIRE */
.solitaire-panel { max-width: 720px; padding: 16px; }
#solitaire-root { position: relative; }
.sol-hud {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap; margin-bottom: 10px;
}
.sol-stat { font-size: 0.85rem; color: var(--text-dim); font-weight: 600; }
.sol-hud-actions { display: flex; gap: 8px; }
.sol-hud-actions .btn { padding: 8px 12px; font-size: 0.8rem; }

.sol-board { position: relative; }
.sol-top-row {
  display: flex; gap: 6px; margin-bottom: 14px;
}
.sol-spacer { flex: 1 1 auto; min-width: 8px; }
.sol-pile {
  position: relative;
  width: 13.5%; max-width: 76px; aspect-ratio: 0.7;
  border: 1px dashed var(--panel-border);
  border-radius: 8px;
  flex: none;
}
.sol-tableau-row { display: flex; gap: 6px; }
.sol-col {
  position: relative;
  width: 13.5%;
  flex: 1 1 0;
}

.sol-card {
  position: absolute;
  top: 0; left: 0;
  width: 100%; aspect-ratio: 0.7;
  border-radius: 7px;
  background: #fff;
  color: #1a1a1a;
  border: 1px solid rgba(0,0,0,0.25);
  box-shadow: 0 2px 6px rgba(0,0,0,0.35);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-weight: 800;
  font-size: clamp(0.6rem, 2.6vw, 0.95rem);
  line-height: 1.1;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
}
.sol-card.red { color: #d21e3d; }
.sol-card.face-down {
  background: repeating-linear-gradient(45deg, #4a3fae, #4a3fae 6px, #5b4fd0 6px, #5b4fd0 12px);
  border-color: rgba(255,255,255,0.3);
}
.sol-card.selected {
  outline: 3px solid var(--accent-3);
  outline-offset: -1px;
  transform: translateY(-3px);
}
.sol-card-suit { font-size: 1.3em; }

.sol-pile-empty {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.25);
  font-size: 1.4rem;
}
.sol-foundation-hint { color: rgba(255,255,255,0.18); }

.sol-win-banner {
  position: absolute; inset: 0;
  background: rgba(10, 4, 30, 0.88);
  border-radius: var(--radius-md);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 1.8rem; font-weight: 800;
  gap: 10px;
  z-index: 50;
}
.sol-win-sub { font-size: 0.9rem; font-weight: 600; color: var(--text-dim); }

@media (min-width: 640px) {
  .player-slots { grid-template-columns: 1fr 1fr 1fr 1fr; }
}

@media (max-height: 620px) {
  .panel { padding: 18px; }
  .title-hero { font-size: 1.6rem; }
}
