/* Schere, Stein, Papier (A.12.0.0): Spielstand oben, zwei Glas-Münzen (Du / ZOK) wackeln beim
   „Schnick, Schnack, Schnuck“ und drehen sich um; unten die Zeichen zum Antippen. */

.buehne-ssp {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 8px 14px 22px;
}

/* ---------- Spielstand ---------- */
.ssp-stand { display: flex; align-items: center; gap: 18px; }
.ssp-stand .seite { display: grid; justify-items: center; min-width: 64px; }
.ssp-stand small { font-weight: 650; color: var(--tusche-weich); text-transform: uppercase; letter-spacing: .08em; font-size: .75rem; }
.ssp-stand b { font-size: 2.4rem; font-weight: 750; line-height: 1; letter-spacing: -.03em; }
.ssp-stand .du b { color: #7c3aed; }
.ssp-stand .zok b { color: #db2777; }
.ssp-ziel { padding: 4px 12px; border-radius: 999px; background: var(--flaeche); box-shadow: var(--schatten-klein); font-weight: 600; font-size: .85rem; color: var(--tusche-weich); }

/* ---------- Arena ---------- */
.ssp-arena { display: flex; align-items: center; justify-content: center; gap: clamp(10px, 4vw, 34px); }
.ssp-hand {
  --g: min(29vw, 200px);
  position: relative;
  display: grid;
  place-items: center;
  width: var(--g);
  height: var(--g);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, rgba(255, 255, 255, .95), rgba(255, 255, 255, .55) 70%);
  -webkit-backdrop-filter: var(--glas-blur);
  backdrop-filter: var(--glas-blur);
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .9), 0 16px 34px rgba(80, 60, 160, .18);
}
.ssp-hand.du { box-shadow: inset 0 0 0 3px rgba(139, 92, 246, .45), 0 16px 34px rgba(139, 92, 246, .2); }
.ssp-hand.zok { box-shadow: inset 0 0 0 3px rgba(236, 72, 153, .45), 0 16px 34px rgba(236, 72, 153, .2); }
.ssp-hand svg { width: 72%; height: 72%; }
.ssp-hand::after {
  content: attr(data-titel);
  position: absolute;
  bottom: -26px;
  font-weight: 650;
  font-size: .95rem;
  color: var(--tusche-weich);
  white-space: nowrap;
}
.ssp-hand.wackelt { animation: ssp-wackeln .38s ease-in-out 3; }
.ssp-hand.wackelt::after { content: ""; }
@keyframes ssp-wackeln { 40% { transform: translateY(-22px) rotate(-6deg); } }
.ssp-hand.auf { animation: ssp-auf .45s cubic-bezier(.2, 1.5, .4, 1) both; }
@keyframes ssp-auf { from { transform: rotateY(90deg) scale(.85); } }
.ssp-hand.sieg { box-shadow: inset 0 0 0 4px #f59e0b, 0 0 0 10px rgba(245, 158, 11, .18), 0 18px 40px rgba(245, 158, 11, .35); }
.ssp-hand.raus { opacity: .5; filter: grayscale(.6); }
.ssp-vs {
  min-width: 4.2em;
  text-align: center;
  font-weight: 750;
  font-size: 1.15rem;
  color: var(--tusche-weich);
}
.ssp-vs.ruft { animation: ssp-ruf .38s ease-out; color: #db2777; }
@keyframes ssp-ruf { from { transform: scale(1.5); } }

.ssp-ergebnis { margin: 22px 0 0; min-height: 2.6em; max-width: 30em; font-weight: 650; font-size: 1.1rem; text-align: center; text-wrap: balance; }
.ssp-ergebnis[data-sieger="du"], .ssp-ergebnis[data-sieger="spiel-du"] { color: #6d28d9; }
.ssp-ergebnis[data-sieger="zok"], .ssp-ergebnis[data-sieger="spiel-zok"] { color: #be185d; }
.ssp-ergebnis[data-sieger^="spiel"] { font-size: 1.3rem; }

/* ---------- Wahl ---------- */
.ssp-wahl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; width: min(100%, 520px); }
.ssp-wahl[data-anzahl="4"] { grid-template-columns: repeat(4, minmax(0, 1fr)); width: min(100%, 640px); }
.ssp-knopf {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 12px 6px 10px;
  border: 0;
  border-radius: 22px;
  background: var(--flaeche);
  -webkit-backdrop-filter: var(--glas-blur);
  backdrop-filter: var(--glas-blur);
  box-shadow: var(--schatten-klein);
  color: var(--tusche);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  transition: transform .12s;
}
.ssp-knopf svg { width: min(18vw, 74px); height: min(18vw, 74px); }
.ssp-knopf:not(:disabled):hover { background: rgba(255, 255, 255, .85); }
.ssp-knopf:active { transform: scale(.95); }
.ssp-knopf:focus-visible { outline: 2px solid var(--akzent); outline-offset: 2px; }
.ssp-knopf[aria-pressed="true"] { box-shadow: inset 0 0 0 2px #8b5cf6, var(--schatten-klein); }
.ssp-knopf kbd {
  position: absolute;
  top: 8px;
  right: 10px;
  display: none;
  font: inherit;
  font-size: .72rem;
  color: var(--tusche-weich);
}
@media (hover: hover) and (pointer: fine) { .ssp-knopf kbd { display: block; } }
.ssp-wahl.gesperrt { pointer-events: none; opacity: .7; }

.ssp-hinweis { margin: 0; font-weight: 550; color: var(--tusche-weich); text-align: center; }

/* ---------- letzte Runden ---------- */
.ssp-runden { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.ssp-runden li {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--flaeche);
  box-shadow: var(--schatten-klein);
  font-weight: 700;
  color: var(--tusche-weich);
}
.ssp-runden svg { width: 24px; height: 24px; }
.ssp-runden li[data-sieger="du"] { box-shadow: inset 0 0 0 2px rgba(139, 92, 246, .5); }
.ssp-runden li[data-sieger="zok"] { box-shadow: inset 0 0 0 2px rgba(236, 72, 153, .5); }

@media (min-width: 980px) {
  .buehne-ssp { min-height: calc(100dvh - 140px); justify-content: center; }
}
@media (orientation: landscape) and (max-height: 540px) and (min-width: 480px) {
  .ssp-hand { --g: min(30dvh, 140px); }
  .ssp-knopf svg { width: 44px; height: 44px; }
  .ssp-ergebnis { margin-top: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .ssp-hand, .ssp-vs { animation: none !important; }
}

/* Handy quer (A.14.4.0): links Stand, Münzen und Ergebnis, rechts die Zeichen — vorher nie beides zugleich im Bild. */
@media (orientation: landscape) and (max-height: 540px) and (min-width: 480px) {
  .buehne-ssp {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-content: center;
    align-items: center;
    justify-items: center;
    column-gap: 20px;
    row-gap: 6px;
    min-height: 0;
    padding: 0 14px 8px;
  }
  .ssp-stand { grid-column: 1; grid-row: 1; }
  .ssp-arena { grid-column: 1; grid-row: 2; }
  .ssp-hand { --g: min(25dvh, 110px); }
  .ssp-ergebnis { grid-column: 1; grid-row: 3; margin-top: 22px; min-height: 0; font-size: 1rem; }
  .ssp-wahl, .ssp-wahl[data-anzahl="4"] { grid-column: 2; grid-row: 1 / span 2; width: 100%; }
  #neuesSpiel { grid-column: 2; grid-row: 3; }
  .ssp-hinweis { grid-column: 2; grid-row: 4; font-size: .9rem; }
  .ssp-runden { grid-column: 1 / -1; grid-row: 5; }
}

/* ---------- Zu zweit (A.21.0.0) ---------- */
.ssp-namen { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.ssp-namen[hidden] { display: none; }
.ssp-namen label { display: grid; gap: 4px; font-weight: 650; font-size: .85rem; color: var(--tusche-weich); }
.ssp-hand.bereit::before {
  content: "✓";
  position: absolute;
  top: 6%;
  right: 8%;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #16a34a;
  color: #fff;
  font-weight: 800;
}

/* ---------- Im gemeinsamen Raum (A.21.0.0): Spielerkarten statt Du gegen ZOK ---------- */
.ssp-gemeinsam { display: none; }
.im-raum .ssp-gemeinsam { display: grid; justify-items: center; gap: 8px; width: 100%; }
.im-raum .ssp-stand, .im-raum .ssp-arena, .im-raum #neuesSpiel, .im-raum .ssp-runden { display: none !important; }
.ssp-runde-raum { margin: 0; padding: 4px 12px; border-radius: 999px; background: var(--flaeche); box-shadow: var(--schatten-klein); font-weight: 600; font-size: .85rem; color: var(--tusche-weich); }
.ssp-spieler { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px 12px; width: min(100%, 720px); }
.ssp-spieler-karte { display: grid; justify-items: center; gap: 2px; min-width: 0; text-align: center; }
.ssp-spieler .ssp-hand { --g: min(29vw, 170px); }
.ssp-spieler[data-anzahl="3"] .ssp-hand { --g: min(26vw, 150px); }
.ssp-spieler[data-anzahl="4"] .ssp-hand, .ssp-spieler[data-anzahl="5"] .ssp-hand { --g: min(19vw, 120px); }
.ssp-spieler .ssp-hand::after { content: none; }
.ssp-spieler-karte b { max-width: 11em; margin-top: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1rem; }
.ssp-spieler-karte.ich b { color: #6d28d9; }
.ssp-spieler-punkte { font-weight: 750; font-size: 1.05rem; }
.ssp-spieler-karte small { color: var(--tusche-weich); font-size: .82rem; }
.ssp-spieler-karte.bereit .ssp-hand { box-shadow: inset 0 0 0 3px rgba(22, 163, 74, .55), 0 14px 30px rgba(22, 163, 74, .18); }
.ssp-spieler-karte.meins .ssp-hand { box-shadow: inset 0 0 0 3px rgba(139, 92, 246, .6), 0 14px 30px rgba(139, 92, 246, .2); }
.ssp-spieler-karte.sieg .ssp-hand { box-shadow: inset 0 0 0 4px #f59e0b, 0 0 0 8px rgba(245, 158, 11, .18), 0 16px 34px rgba(245, 158, 11, .32); }
.ssp-spieler-karte.raus .ssp-hand, .ssp-spieler-karte.aussen .ssp-hand { opacity: .5; filter: grayscale(.6); }
.ssp-ruf-raum { margin: 0; min-height: 1.4em; font-weight: 750; font-size: 1.15rem; color: #db2777; }
.ssp-ruf-raum.ruft { animation: ssp-ruf .38s ease-out; }
.ssp-raum-knoepfe { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.ssp-raum-knoepfe:empty { display: none; }
.im-raum .ssp-ergebnis { margin-top: 0; }
@media (orientation: landscape) and (max-height: 540px) and (min-width: 480px) {
  .im-raum .ssp-gemeinsam { grid-column: 1; grid-row: 1 / span 2; }
  .ssp-spieler .ssp-hand, .ssp-spieler[data-anzahl] .ssp-hand { --g: min(22dvh, 96px); }
}

/* Dunkelmodus „Graphit“ (A.23.3.0, Grundlage in css/basis.css) */
[data-thema="dunkel"] .ssp-hand { background: radial-gradient(circle at 35% 28%, #3a3a3a, #232323 70%); }
[data-thema="dunkel"] .ssp-knopf:not(:disabled):hover { background: var(--g-flaeche-hoch); }
