/* =================================================================
   Kartenspiele — Klassischer grüner Filz · Albert Sans
   ================================================================= */

@font-face {
  font-family: 'Albert Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/AlbertSans-Regular.woff2') format('woff2');
}
@font-face {
  font-family: 'Albert Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/AlbertSans-Medium.woff2') format('woff2');
}
@font-face {
  font-family: 'Albert Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/AlbertSans-SemiBold.woff2') format('woff2');
}
@font-face {
  font-family: 'Albert Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/AlbertSans-Bold.woff2') format('woff2');
}

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --felt-dark:    #0a4720;
  --felt:         #0e5a2c;
  --felt-light:   #14753a;
  --gold:         #c9a85c;
  --gold-bright:  #e5c87a;
  --gold-soft:    rgba(201, 168, 92, 0.25);
  --cream:        #f5e6b8;
  --text:         #f5e6b8;
  --text-dim:     #b8d4b8;
  --text-soft:    #88a888;
  --card-bg:      #fbf7ec;
  --card-bg-edge: #f4ecd6;
  --card-shadow:  0 2px 5px rgba(0, 0, 0, 0.30), 0 0 0 0.5px rgba(0,0,0,0.10);
  --card-shadow-lift: 0 8px 18px rgba(0, 0, 0, 0.45), 0 0 0 0.5px rgba(0,0,0,0.10);
  --red:          #b8231c;
  --red-soft:     #d65046;
  --black:        #1a1a1a;
  --radius:       8px;
  --radius-lg:    14px;
  --border-card:  1px solid rgba(180, 150, 90, 0.35);
  --serif:        'Albert Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --sans:         'Albert Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --gap:          8px;
  --safe-top:     env(safe-area-inset-top, 0);
  --safe-bottom:  env(safe-area-inset-bottom, 0);
}

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--felt);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  overscroll-behavior: none;
}

body {
  background:
    radial-gradient(ellipse at center, var(--felt-light) 0%, var(--felt) 50%, var(--felt-dark) 100%);
  padding-top: var(--safe-top);
  padding-bottom: var(--safe-bottom);
}

#app {
  position: relative;
  width: 100%;
  height: 100%;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* =================================================================
   Bildschirme (Screens)
   ================================================================= */

.screen {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  overflow: hidden;
}
.screen.active { display: flex; }

/* =================================================================
   HAUPTMENÜ
   ================================================================= */

#screen-menu {
  align-items: center;
  justify-content: flex-start;
  padding: 32px 20px;
  overflow-y: auto;
}

.menu-header {
  text-align: center;
  margin-bottom: 36px;
  margin-top: 24px;
}

.brand {
  font-family: var(--serif);
  font-size: clamp(36px, 8vw, 56px);
  font-weight: 500;
  color: var(--gold-bright);
  letter-spacing: 1px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
.brand::after {
  content: '';
  display: block;
  width: 60px;
  height: 1px;
  background: var(--gold);
  margin: 12px auto 0;
}

.subtitle {
  font-family: var(--serif);
  font-style: italic;
  color: var(--text-dim);
  margin-top: 14px;
  font-size: 15px;
}

.game-list {
  width: 100%;
  max-width: 460px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.game-card {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  background: var(--felt-dark);
  border: 1px solid var(--gold);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  text-align: left;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.game-card:hover, .game-card:focus-visible {
  background: #0c5326;
  border-color: var(--gold-bright);
  transform: translateY(-1px);
}
.game-card:active {
  transform: translateY(0);
}

.game-icon {
  width: 52px;
  height: 64px;
  background: var(--card-bg);
  border-radius: var(--radius);
  border: var(--border-card);
  box-shadow: var(--card-shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-size: 22px;
  position: relative;
  flex-shrink: 0;
}
.game-icon .suit-red { color: var(--red); }
.game-icon .suit-black { color: var(--black); }
.game-icon span:first-child {
  position: absolute;
  top: 6px;
  left: 6px;
  font-size: 16px;
}
.game-icon span:last-child {
  position: absolute;
  bottom: 6px;
  right: 6px;
  font-size: 16px;
  transform: rotate(180deg);
}

.game-info { flex: 1; }
.game-title {
  font-family: var(--serif);
  font-size: 19px;
  color: var(--cream);
  margin-bottom: 2px;
}
.game-desc {
  font-size: 13px;
  color: var(--text-dim);
}
.game-arrow {
  font-size: 28px;
  color: var(--gold);
  font-weight: 300;
  line-height: 1;
}

.menu-footer {
  margin-top: auto;
  padding-top: 32px;
  display: flex;
  gap: 16px;
  justify-content: center;
}
.menu-link {
  padding: 10px 18px;
  font-size: 13px;
  color: var(--text-dim);
  border: 1px solid rgba(201, 168, 92, 0.4);
  border-radius: 20px;
  transition: all 0.15s;
}
.menu-link:hover {
  color: var(--cream);
  border-color: var(--gold);
}

/* =================================================================
   GAME HEADER
   ================================================================= */

.game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--felt-dark);
  border-bottom: 1px solid rgba(201, 168, 92, 0.3);
  flex-shrink: 0;
  min-height: 50px;
}
.game-header h2 {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 500;
  color: var(--gold-bright);
  letter-spacing: 0.5px;
}
.btn-back {
  width: 36px;
  height: 36px;
  font-size: 28px;
  color: var(--gold);
  line-height: 1;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.btn-back:hover { background: rgba(201, 168, 92, 0.15); }
.header-spacer { width: 36px; }

.game-actions {
  display: flex;
  gap: 4px;
}
.btn-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  transition: background 0.15s;
}
.btn-icon:hover { background: rgba(201, 168, 92, 0.15); }
.btn-icon:active { background: rgba(201, 168, 92, 0.25); }
.btn-icon:disabled { color: var(--text-soft); cursor: default; }
.btn-icon:disabled:hover { background: none; }

/* =================================================================
   GAME INFO BAR
   ================================================================= */

.game-info-bar {
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 6px 14px;
  background: rgba(0, 0, 0, 0.18);
  font-family: var(--serif);
  font-size: 13px;
  color: var(--cream);
  flex-shrink: 0;
}
.info-item {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.info-label {
  color: var(--text-soft);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* =================================================================
   SPIELBRETT
   ================================================================= */

.game-board {
  flex: 1;
  overflow: hidden;
  padding: 12px 8px;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* Klondike-Layout */
.board-klondike {
  --cols: 7;
  --gap: 6px;
  --fan: 22%;        /* face-up overlap */
  --fan-down: 11%;   /* face-down overlap */
  height: 100%;
  display: flex;
  flex-direction: column;
}
.board-klondike .top-row {
  display: grid;
  grid-template-columns: repeat(var(--cols), 1fr);
  gap: var(--gap);
  margin-bottom: 14px;
}
.board-klondike .tableau-row {
  display: grid;
  grid-template-columns: repeat(var(--cols), 1fr);
  gap: var(--gap);
  flex: 1;
  align-items: start;
}

/* Spider-Layout */
.board-spider {
  --cols: 10;
  --gap: 4px;
  --fan: 22%;
  --fan-down: 11%;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.board-spider .top-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 14px;
  gap: 6px;
}
.board-spider .top-row .stock-stack {
  width: calc((100% - var(--gap) * 9) / 10);
  position: relative;
}
.board-spider .tableau-row {
  display: grid;
  grid-template-columns: repeat(var(--cols), 1fr);
  gap: var(--gap);
  flex: 1;
  align-items: start;
}
.board-spider .foundations-mini {
  display: flex;
  gap: 4px;
  align-items: center;
  margin-right: auto;
  padding-left: 4px;
}
.board-spider .foundations-mini .pile-spot {
  width: 26px;
  height: 32px;
}

/* FreeCell-Layout */
.board-freecell {
  --cols: 8;
  --gap: 6px;
  --fan: 22%;
  --fan-down: 11%;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.board-freecell .top-row {
  display: grid;
  grid-template-columns: repeat(var(--cols), 1fr);
  gap: var(--gap);
  margin-bottom: 14px;
}
.board-freecell .tableau-row {
  display: grid;
  grid-template-columns: repeat(var(--cols), 1fr);
  gap: var(--gap);
  flex: 1;
  align-items: start;
}

/* =================================================================
   STAPEL (Pile)
   ================================================================= */

.pile {
  position: relative;
  aspect-ratio: 5 / 7;
  border-radius: var(--radius);
}
.pile-spot {
  position: relative;
  aspect-ratio: 5 / 7;
  border: 1.5px dashed rgba(201, 168, 92, 0.35);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.12);
}
.pile-spot.foundation::before {
  content: attr(data-suit);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-size: 32px;
  color: rgba(201, 168, 92, 0.25);
}
.pile-spot.freecell::before {
  content: '○';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: rgba(201, 168, 92, 0.3);
}
.pile-spot.stock::before {
  content: '↻';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: rgba(201, 168, 92, 0.35);
}
.pile-spot.empty-allowed { cursor: pointer; }
.pile-spot.drop-valid {
  border-color: var(--gold-bright);
  background: rgba(229, 200, 122, 0.15);
}
.pile-spot.drop-hover {
  border-color: var(--gold-bright);
  background: rgba(229, 200, 122, 0.25);
  box-shadow: inset 0 0 0 2px var(--gold-bright);
}

/* Tableau-Spalten haben keinen Aspect-Ratio, da sie sich nach unten ausdehnen */
.tableau-pile {
  position: relative;
  aspect-ratio: unset;
  min-height: 100%;
}
.tableau-pile .pile-spot {
  position: absolute;
  inset: 0;
  height: auto;
  aspect-ratio: 5 / 7;
}

/* =================================================================
   KARTE
   ================================================================= */

.card {
  position: absolute;
  width: 100%;
  aspect-ratio: 5 / 7;
  background:
    radial-gradient(circle at 30% 25%, #ffffff 0%, var(--card-bg) 55%, var(--card-bg-edge) 100%);
  border: var(--border-card);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  font-family: var(--sans);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, top 0.22s ease, left 0.22s ease;
  will-change: transform;
  touch-action: none;
  overflow: hidden;
}
.card.face-up::before {
  content: '';
  position: absolute;
  inset: 2px;
  border-radius: calc(var(--radius) - 2px);
  border: 0.5px solid rgba(160, 130, 70, 0.18);
  pointer-events: none;
}

.card.dragging {
  z-index: 1000;
  transition: none;
  box-shadow: var(--card-shadow-lift);
  transform: scale(1.04);
  /* Wichtig: Pointer-Events durchlassen, damit das Ziel darunter erkannt wird */
  pointer-events: none;
}

/* Gültige Drop-Ziele hervorheben, sobald eine Karte selektiert ist */
.pile-spot.drop-valid,
.tableau-pile.drop-valid > .pile-spot {
  border-color: var(--gold-bright);
  background: rgba(229, 200, 122, 0.18);
  box-shadow: inset 0 0 0 1px rgba(229, 200, 122, 0.5);
}
.tableau-pile.drop-valid .card:last-child {
  box-shadow: 0 0 0 2px rgba(229, 200, 122, 0.6), var(--card-shadow);
}

.card.selected {
  box-shadow: 0 0 0 2px var(--gold-bright), var(--card-shadow-lift);
  transform: translateY(-3px);
  z-index: 100;
}

.card.hint-source {
  animation: pulse-source 1.4s ease-out;
}
.card.hint-target {
  animation: pulse-target 1.4s ease-out;
}
@keyframes pulse-source {
  0%, 100% { box-shadow: var(--card-shadow); }
  50% { box-shadow: 0 0 0 3px var(--gold-bright), var(--card-shadow-lift); }
}
@keyframes pulse-target {
  0%, 100% { box-shadow: var(--card-shadow); }
  50% { box-shadow: 0 0 0 3px #58e0a8, var(--card-shadow-lift); }
}

.card.flip-anim { animation: flip 0.3s ease; }
@keyframes flip {
  0%   { transform: rotateY(0deg); }
  50%  { transform: rotateY(90deg); }
  100% { transform: rotateY(0deg); }
}

.card.face-up {
  background: var(--card-bg);
}

.card.face-down {
  background:
    repeating-linear-gradient(45deg,  #6b1818 0, #6b1818 8px, #7d2020 8px, #7d2020 16px),
    radial-gradient(circle at center, #7d2020, #5a1414);
  border-color: #3a0e0e;
}
.card.face-down::after {
  content: '';
  position: absolute;
  inset: 6%;
  border-radius: 4px;
  border: 1.5px solid rgba(229, 200, 122, 0.7);
  background:
    radial-gradient(circle at center, rgba(229, 200, 122, 0.22) 0%, transparent 55%);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.25);
}
.card.face-down::before {
  content: '';
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%) rotate(45deg);
  width: 28%;
  height: 28%;
  background: rgba(229, 200, 122, 0.18);
  border: 1.5px solid rgba(229, 200, 122, 0.7);
  border-radius: 2px;
  pointer-events: none;
}

/* Karten-Inhalt — etwas größer und klarer */
.card-corner {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
  font-weight: 600;
  letter-spacing: -0.5px;
}
.card-corner.tl {
  top: 5%;
  left: 7%;
}
.card-corner.br {
  bottom: 5%;
  right: 7%;
  transform: rotate(180deg);
}
.card-corner .rank {
  font-size: 26cqw;
  font-weight: 700;
  letter-spacing: -1px;
}
.card-corner .suit {
  font-size: 22cqw;
  margin-top: 1px;
  line-height: 1;
}

.card-center {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 56cqw;
  line-height: 1;
  font-weight: 500;
}

.card-center.face-card {
  font-size: 36cqw;
  font-family: var(--sans);
  font-weight: 700;
  letter-spacing: -2px;
  flex-direction: column;
  gap: 2cqw;
}
.card-center.face-card .face-letter {
  font-size: 38cqw;
}
.card-center.face-card .face-suit {
  font-size: 22cqw;
  margin-top: -4cqw;
}

.card.red { color: var(--red); }
.card.black { color: var(--black); }

.card { container-type: inline-size; }

/* Auf Mobile noch ein Tick größer, damit Motive klar lesbar bleiben */
@media (max-width: 600px) {
  .card-corner .rank { font-size: 32cqw; }
  .card-corner .suit { font-size: 26cqw; }
  .card-center { font-size: 62cqw; }
  .card-center.face-card .face-letter { font-size: 44cqw; }
  .card-center.face-card .face-suit { font-size: 26cqw; }
}

/* =================================================================
   DIFFICULTY SCREEN
   ================================================================= */

#screen-spider-difficulty,
#screen-klondike-mode {
  align-items: center;
  justify-content: flex-start;
  padding: 0;
}
.difficulty-list {
  width: 100%;
  max-width: 460px;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: auto 0;          /* vertikal mittig im verbleibenden Platz */
}
#screen-spider-difficulty,
#screen-klondike-mode {
  display: none;            /* fortgesetzt für .active */
}
#screen-spider-difficulty.active,
#screen-klondike-mode.active {
  display: flex;
  flex-direction: column;
}
.difficulty-hint {
  font-family: var(--serif);
  color: var(--text-dim);
  font-style: italic;
  text-align: center;
  margin-bottom: 8px;
}
.difficulty-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--felt-dark);
  border: 1px solid var(--gold);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  text-align: left;
  transition: all 0.15s;
}
.difficulty-card:hover {
  background: #0c5326;
  border-color: var(--gold-bright);
  transform: translateY(-1px);
}
.difficulty-suits {
  font-family: var(--serif);
  font-size: 28px;
  background: var(--card-bg);
  padding: 10px 14px;
  border-radius: var(--radius);
  border: var(--border-card);
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.difficulty-suits .suit-red { color: var(--red); }
.difficulty-suits .suit-black { color: var(--black); }
.difficulty-title {
  font-family: var(--serif);
  font-size: 19px;
  color: var(--cream);
  margin-bottom: 2px;
}
.difficulty-desc {
  font-size: 13px;
  color: var(--text-dim);
}

.setting-note {
  text-align: center;
  margin-top: 12px;
  color: var(--text-soft);
  font-style: italic;
  font-family: var(--serif);
}

/* =================================================================
   STATS
   ================================================================= */

.stats-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}
.stats-game {
  background: var(--felt-dark);
  border: 1px solid rgba(201, 168, 92, 0.4);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin-bottom: 14px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}
.stats-game h3 {
  font-family: var(--serif);
  color: var(--gold-bright);
  font-size: 17px;
  margin-bottom: 12px;
  font-weight: 500;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 12px;
}
.stat-item {
  text-align: center;
}
.stat-value {
  font-family: var(--serif);
  font-size: 22px;
  color: var(--cream);
  display: block;
}
.stat-label {
  font-size: 11px;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* =================================================================
   ABOUT
   ================================================================= */

.about-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px 20px;
  max-width: 600px;
  width: 100%;
  margin: 0 auto;
}
.about-content h3 {
  font-family: var(--serif);
  color: var(--gold-bright);
  font-size: 17px;
  margin-top: 24px;
  margin-bottom: 8px;
  font-weight: 500;
}
.about-content h3:first-child { margin-top: 0; }
.about-content p {
  color: var(--text-dim);
  line-height: 1.6;
  font-size: 14px;
}

/* =================================================================
   MODALE
   ================================================================= */

.modal {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
}
.modal.active { display: flex; animation: fadein 0.3s ease; }
@keyframes fadein {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background: var(--felt-dark);
  border: 1px solid var(--gold);
  border-radius: var(--radius-lg);
  padding: 30px 28px;
  max-width: 380px;
  width: 100%;
  text-align: center;
  animation: scaleIn 0.3s ease;
}
@keyframes scaleIn {
  from { transform: scale(0.85); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-stars {
  color: var(--gold-bright);
  font-size: 28px;
  letter-spacing: 8px;
  margin-bottom: 8px;
}
.modal-content h2 {
  font-family: var(--serif);
  color: var(--gold-bright);
  font-size: 28px;
  font-weight: 500;
  margin-bottom: 12px;
}
.modal-content p {
  color: var(--text-dim);
  margin-bottom: 20px;
}
.win-stats {
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 24px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.win-stat .stat-value {
  font-size: 18px;
}
.modal-actions {
  display: flex;
  gap: 10px;
  flex-direction: column;
}
.btn-primary, .btn-secondary {
  padding: 12px 24px;
  border-radius: var(--radius);
  font-family: var(--serif);
  font-size: 15px;
  transition: all 0.15s;
}
.btn-primary {
  background: var(--gold);
  color: var(--felt-dark);
  font-weight: 500;
}
.btn-primary:hover { background: var(--gold-bright); }
.btn-secondary {
  background: transparent;
  color: var(--cream);
  border: 1px solid var(--gold);
}
.btn-secondary:hover { background: rgba(201, 168, 92, 0.15); }

/* =================================================================
   TOAST
   ================================================================= */

.toast {
  position: absolute;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(100px);
  background: var(--felt-dark);
  border: 1px solid var(--gold);
  border-radius: 24px;
  padding: 10px 20px;
  color: var(--cream);
  font-size: 13px;
  font-family: var(--serif);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 3000;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* =================================================================
   RESPONSIVE
   ================================================================= */

/* Desktop: mehr Padding und größere maximale Boards */
@media (min-width: 760px) {
  .game-board {
    padding: 18px 24px;
  }
  .board-klondike { --gap: 10px; }
  .board-freecell { --gap: 10px; }
  .board-spider { --gap: 8px; }

  .game-header { padding: 12px 24px; }
  .game-info-bar { font-size: 14px; padding: 8px 24px; }
}

@media (min-width: 1100px) {
  .game-board {
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
  }
}


/* Hint-Animation für leere Stapel */
.pile-spot.hint-target {
  animation: pulse-target 1.4s ease-out;
}

/* Verstecke Score bei Spider/FreeCell falls gewünscht */
.hide-score #game-score-wrap { display: none; }

/* =================================================================
   INSTALL-BANNER (PWA)
   ================================================================= */

.install-banner {
  width: 100%;
  max-width: 460px;
  margin: 22px auto 0;
  background: var(--felt-dark);
  border: 1px solid var(--gold);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  animation: slide-up 0.4s ease;
}
@keyframes slide-up {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.install-banner[hidden] { display: none; }

.install-banner-inner {
  display: flex;
  align-items: center;
  gap: 12px;
}
.install-icon {
  color: var(--gold-bright);
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(229, 200, 122, 0.10);
  border: 1px solid rgba(229, 200, 122, 0.3);
  border-radius: 10px;
}
.install-text {
  flex: 1;
  min-width: 0;
}
.install-title {
  color: var(--cream);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 1px;
}
.install-desc {
  color: var(--text-dim);
  font-size: 11.5px;
  line-height: 1.35;
}
.install-action {
  background: var(--gold);
  color: var(--felt-dark);
  font-weight: 600;
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 18px;
  white-space: nowrap;
  transition: background 0.15s;
  flex-shrink: 0;
}
.install-action:hover { background: var(--gold-bright); }
.install-dismiss {
  color: var(--text-soft);
  font-size: 22px;
  line-height: 1;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}
.install-dismiss:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--cream);
}

/* iOS-Anleitung-Modal */
.ios-install-modal { max-width: 420px; text-align: left; }
.ios-install-modal h2 { text-align: center; }
.ios-install-intro {
  margin-bottom: 18px;
  text-align: center;
}
.ios-steps {
  list-style: none;
  padding: 0;
  margin: 0 0 22px 0;
}
.ios-steps li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 0.5px solid rgba(201, 168, 92, 0.18);
  color: var(--cream);
  font-size: 14px;
  line-height: 1.45;
}
.ios-steps li:last-child { border-bottom: none; }
.step-num {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  background: var(--gold);
  color: var(--felt-dark);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
}
.share-icon-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: 1px solid rgba(201, 168, 92, 0.5);
  border-radius: 6px;
  background: rgba(229, 200, 122, 0.08);
  color: var(--gold-bright);
  margin: 0 2px;
  vertical-align: -7px;
}
