:root {
  --accent: #2f5f8f;
  --accent2: #f0b44c;
}

/* ── Setup ── */
.setup { height: 100%; display: grid; grid-template-columns: 1.15fr .85fr; gap: 12px; }
.hero { border: 1px solid var(--border); border-radius: 18px; padding: 16px; background: linear-gradient(145deg, #c6ad85, #9d835e); color: #fffdf5; }
.heroInner { height: 100%; display: flex; flex-direction: column; gap: 12px; }
.heroTitle { margin: 0; font-family: "CMB", "Segoe UI", system-ui, sans-serif; font-size: clamp(26px, 4vw, 44px); font-weight: 400; text-align: center; }
.heroDesc { margin: 0; font-weight: 750; line-height: 1.4; max-width: 68ch; }
.gameInfo { border: 1px solid rgba(255,255,255,.2); border-radius: 14px; background: rgba(10,24,38,.22); padding: 9px 12px; font-size: 13px; line-height: 1.35; font-weight: 800; text-align: center; }
.gameInfoTitle { font-weight: 950; margin-bottom: 3px; }
.gameInfoText { margin: 0; }

.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.spacer { flex: 1 1 auto; min-height: 12px; }
.startRow { display: flex; justify-content: flex-end; }

/* ── Mode buttons ── */
.modeBtns { display: flex; gap: 6px; }
.modeBtn {
  flex: 1;
  background: #eef2ee;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 4px;
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  backdrop-filter: none;
}
.settings .modeBtn { background: #eef2ee; color: var(--muted); border-color: var(--border); }
.settings .modeBtn:hover { background: #e2ebe2; color: var(--text); filter: none; }
.settings .modeBtn.active { background: var(--btn); color: #fff; border-color: var(--btn); }
.settings .modeBtn.active:hover { filter: none; }

/* ── Category buttons ── */
.catBtns { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.catBtn {
  background: #eef2ee;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 6px;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  backdrop-filter: none;
  text-align: center;
}
.settings .catBtn { background: #eef2ee; color: var(--muted); border-color: var(--border); }
.settings .catBtn:hover { background: #e2ebe2; color: var(--text); filter: none; }
.settings .catBtn.active { background: var(--btn); color: #fff; border-color: var(--btn); }
.settings .catBtn.active:hover { filter: none; }

/* ── Custom word inputs ── */
.customWordsGrid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.customWordInput { width: 100%; }

/* ── Game layout ── */
.game { height: 100%; display: grid; grid-template-columns: 1fr 260px; gap: 12px; }

/* Left panel: no border/background, just transparent */
.playWrap { display: flex; flex-direction: column; min-height: 0; overflow: hidden; gap: 8px; }

/* Hide the meta bar (Solo/2 Spieler + Suchsel läuft) */
.metaTop { display: none; }

.boards { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: 1fr; grid-template-rows: 1fr; overflow: hidden; }

.boardCard {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  gap: 8px;
}

.boardTitle { display: none; }

/* Word tags: 2 rows of 5 */
.wordList { display: flex; flex-direction: column; gap: 4px; flex: 0 0 auto; }
.wordRow  { display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; }
.wordTag { border: 1px solid var(--border); border-radius: 999px; background: #fff; padding: 4px 9px; font-size: 12px; font-weight: 900; color: #173047; }
.wordTag.found { text-decoration: line-through; background: #dcfce7; border-color: #86efac; color: #14532d; }

/* Grid box fills remaining space; JS sizes the letterGrid via ResizeObserver */
.gridBox {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.letterGrid {
  --size: 10;
  display: grid;
  grid-template-columns: repeat(var(--size), 1fr);
  gap: clamp(2px, .5vw, 4px);
  flex-shrink: 0;
  /* width/height set by ResizeObserver in JS */
}

/* Minimal cell design, no hover effect */
.cell {
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 1px solid #e2e8e2;
  border-radius: 6px;
  background: #f8faf8;
  color: #1a2e20;
  font-size: clamp(11px, 1.5vw, 19px);
  font-weight: 900;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: none;
}

/* Override shared.css button hover */
.cell:hover { filter: none; transform: none; }
.cell.current { outline: 2px solid #3b82f6; background: #eff6ff; }
.cell.found { background: #fef3c7; border-color: #f59e0b; color: #78350f; }
.cell:disabled { cursor: not-allowed; opacity: .9; }

/* ── Right side panel ── */
.side {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fff;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  overflow: auto;
}

.side .stat { margin: 0; }

/* Player panel */
.playerPanel {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #f8fafc;
  padding: 10px;
  display: grid;
  gap: 8px;
}

.panelTitle { font-size: 12px; color: var(--muted); font-weight: 900; }

.playerPick {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  text-align: left;
  border-width: 2px;
  background: #fff;
  color: var(--text);
}

/* Score badge — inactive: white circle, dark text */
.playerPick strong {
  min-width: 36px;
  height: 36px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #f1f5f1;
  color: var(--text);
  font-family: "CMB", "Segoe UI", system-ui, sans-serif;
  font-size: 22px;
  font-weight: 400;
  border: 1px solid var(--border);
}

.playerPick.playerOne { border-color: #2563eb; }
.playerPick.playerTwo { border-color: #e11d48; }

/* Active: colored button, score badge stays readable */
.playerPick.playerOne.active { background: #2563eb; color: #fff; }
.playerPick.playerTwo.active { background: #e11d48; color: #fff; }

.playerPick.playerOne.active strong { background: rgba(255,255,255,.22); color: #fff; border-color: rgba(255,255,255,.3); }
.playerPick.playerTwo.active strong { background: rgba(255,255,255,.22); color: #fff; border-color: rgba(255,255,255,.3); }

.playerPick:disabled { background: #e5e7eb; border-color: #cbd5e1; color: #64748b; opacity: 1; }
.playerPick:disabled strong { background: #d1d5db; color: #6b7280; border-color: transparent; }

.msg {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #f8fafc;
  padding: 10px;
  min-height: 64px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.35;
}

.sideButtons { display: grid; gap: 10px; margin-top: auto; }

@media (max-width: 980px) {
  .setup { grid-template-columns: 1fr; }
  .row2 { grid-template-columns: 1fr; }
}

/* Small devices: whole page scrolls */
@media (max-width: 680px) {
  body.suchselGame .stage {
    overflow-y: auto;
    overflow-x: hidden;
  }

  body.suchselGame #gameScreen {
    overflow: visible;
    height: auto;
    min-height: 0;
  }

  body.suchselGame .game {
    grid-template-columns: 1fr;
    height: auto;
  }

  body.suchselGame .side {
    height: auto;
    overflow: visible;
  }
}
