/* ── Farbfolge-spezifisch ── */

:root {
  --g: #9fd7b3;
  --r: #f2b3a8;
  --y: #f3dea0;
  --b: #9dc5e8;
}

.hero {
  background: linear-gradient(145deg, #3a6b50, #1e3f2f);
}

/* ── Game layout ── */
.gameWrap {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  grid-template-rows: minmax(0, 1fr);
  gap: clamp(12px, 2vw, 18px);
  position: relative;
}

/* Pad area: flex column – meta header + fill */
.padArea {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fff;
  padding: 12px;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

.padMeta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
  margin-bottom: 10px;
  flex: 0 0 auto;
}

.padMeta strong { color: var(--text); }

.padFill {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.padGrid {
  --pad: 100px;
  display: grid;
  grid-template-columns: repeat(2, var(--pad));
  grid-template-rows: repeat(2, var(--pad));
  gap: clamp(10px, 2vw, 16px);
}

.pad {
  width: var(--pad);
  height: var(--pad);
  border-radius: clamp(12px, 1.8vw, 18px);
  border: 1px solid rgba(0,0,0,0.12);
  box-shadow: inset 0 -14px 26px rgba(0,0,0,0.08);
  cursor: pointer;
  transition: box-shadow 0.12s ease, transform 0.06s ease, opacity 0.12s ease;
  position: relative;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
}

.pad:active { transform: scale(0.97); }
.pad.disabled { cursor: not-allowed; opacity: 0.65; }

.pad::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(620px 420px at 25% 18%, rgba(255,255,255,0.55), rgba(255,255,255,0) 58%);
  opacity: 0.6;
  pointer-events: none;
}

.green  { background: var(--g); }
.red    { background: var(--r); }
.yellow { background: var(--y); }
.blue   { background: var(--b); }

.lit-user {
  box-shadow:
    inset 0 0 0 3px rgba(0,0,0,0.65),
    inset 0 -14px 26px rgba(0,0,0,0.08),
    0 18px 40px rgba(0,0,0,0.14);
}

.lit-play {
  opacity: 1 !important;
  box-shadow:
    inset 0 0 0 4px #000,
    inset 0 -14px 26px rgba(0,0,0,0.06),
    0 22px 52px rgba(0,0,0,0.18),
    0 0 24px rgba(0,0,0,0.1);
}

.pad.disabled.lit-play { opacity: 1 !important; }

/* ── Side panel ── */
.side {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 12px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.side .infoBox {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fafafa;
  padding: 10px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.35;
  flex: 0 0 auto;
}

.side .infoBox strong { color: var(--text); }

/* Spieler-Kästchen (mit Rahmen) */
.playerBox {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fafafa;
  padding: 10px;
  flex: 0 0 auto;
}

.playerBox + .playerBox { margin-top: 8px; }

.playerBoxName {
  font-size: 12px;
  font-weight: 850;
  color: var(--text);
  margin-bottom: 6px;
}

/* Zwei-Spalten-Layout innerhalb des Kästchens (kein Rahmen) */
.playerMeta {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.playerMetaLabel {
  font-size: 11px;
  font-weight: 850;
  color: var(--muted);
  line-height: 1.2;
}

.playerMetaVal {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-top: 3px;
}

.playerMetaRight {
  text-align: right;
}

/* Sound row: label links, toggle rechts */
.soundRow {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fafafa;
  padding: 10px;
  font-size: 12px;
  font-weight: 850;
  color: var(--muted);
  flex: 0 0 auto;
}

/* Sound + Button am unteren Rand */
.sideBottom {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 0 0 auto;
  padding-bottom: env(safe-area-inset-bottom);
}

.sideBottom button {
  width: 100%;
  background: #e8efea !important;
  color: #183424 !important;
  border-color: var(--border) !important;
}

/* PVP state */
.playerBox.eliminated { opacity: 0.35; }
.playerBox.activeTurn { background: #f0faf4; border-color: #7aab8c; }
.playerBox.activeTurn .playerBoxName { color: #2d7a4f; }

/* Leben + Replay: zwei halbe Kästchen nebeneinander */
.halfRow {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.halfBlock {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.replayHeader {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Replay counter disabled */
#replayCountBlock.disabled { opacity: 0.4; pointer-events: none; }

/* "Unbegrenzt" label in small counter */
.hCounterVal.textVal {
  font-size: 11px;
  font-family: inherit;
  font-weight: 850;
  min-width: auto;
  white-space: nowrap;
}

/* Coin-toss overlay */
.coinOverlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.9);
  border-radius: 18px;
  backdrop-filter: blur(4px);
}

.coinBox { text-align: center; }

.coinEmoji {
  font-size: 52px;
  animation: coinSpin 0.6s linear infinite;
  display: block;
  margin-bottom: 14px;
}

.coinText {
  font-family: var(--brand-font);
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 400;
  color: var(--text);
}

@keyframes coinSpin {
  0%   { transform: rotateY(0deg); }
  100% { transform: rotateY(360deg); }
}

/* ── Responsive ── */
@media (max-width: 860px) {
  .gameWrap {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(200px, 1fr) auto;
  }
  .side { overflow: visible; }
}
