/* ===========================================================
   Dolanan — shared in-game UI (boards, status bars, turn pills)
   =========================================================== */

.game-shell {
  max-width: 720px;
  margin: 0 auto;
  padding-bottom: 8px;
}

.game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 0 10px;
  flex-wrap: wrap;
}

.lang-toggle {
  padding: 4px 10px;
  min-height: 32px;
  font-size: 12px;
}

/* Small utility buttons that sit in the game header next to the lang seg. */
.fx-mute, .howto-btn, .theme-btn {
  padding: 0;
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  border-radius: 50%;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--card-2);
  border: 1px solid var(--border);
  color: var(--text);
}

.howto-btn { font-weight: 800; }

.game-head-tools {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

/* How-to modal styling */
.howto-card { max-width: 480px; text-align: left; }
.howto-body {
  max-height: 60vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 4px 4px 8px;
  font-size: 14px;
  line-height: 1.5;
}
.howto-body h3 {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin: 12px 0 4px;
}
.howto-body ul { padding-left: 20px; margin: 4px 0; }
.howto-body li { margin: 2px 0; }
.howto-body p { margin: 4px 0; }

/* Tight mobile: shrink chrome to maximize game area. */
@media (max-width: 480px) {
  .back-link { margin: 2px 0; padding: 2px 6px; font-size: 13px; min-height: 28px; }
  .game-title { font-size: 18px !important; line-height: 1.1; }
  .game-subtitle { display: none; }
  .game-header { padding: 0 0 4px; }
  .turn-pill { font-size: 12px; padding: 4px 8px; }
  .status-banner { padding: 6px 10px; margin-top: 6px; font-size: 13px; }
  .btn { padding: 6px 12px; min-height: 36px; font-size: 13px; }
}

.game-title {
  font-size: clamp(22px, 5vw, 28px);
  font-weight: 700;
  margin: 0;
}

.game-subtitle {
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 2px;
}

/* Turn indicator pill */
.turn-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  box-shadow: var(--shadow-sm);
}


.turn-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
}

.turn-dot.red {
  background: #ef4444;
}
.turn-dot.yellow {
  background: #f59e0b;
}
.turn-dot.green {
  background: #10b981;
}
.turn-dot.blue {
  background: #3b82f6;
}
.turn-dot.white {
  background: #f8fafc;
  border: 1px solid var(--secondary);
}
.turn-dot.black {
  background: #0f172a;
}

/* Game board container */
.board-wrap {
  display: flex;
  justify-content: center;
  padding: 4px;
}

/* Square grid board — the gap between cells is the board's own background.
   Use --border (not --bg-2) so that in dark mode cells are distinguishable. */
.board {
  display: grid;
  gap: 2px;
  background: var(--border);
  padding: 6px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  user-select: none;
  touch-action: manipulation;
}

.cell {
  background: var(--card);
  border: none;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(28px, 8vw, 44px);
  font-weight: 700;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.15s ease-out;
}

.cell:hover:not(:disabled) {
  background: var(--bg-2);
}

.cell:disabled {
  cursor: default;
}

.cell.win {
  background: linear-gradient(135deg, #bbf7d0, #6ee7b7);
  color: var(--text);
}

/* Score strip */
.score-strip {
  display: flex;
  justify-content: space-around;
  gap: 8px;
  padding: 12px;
  margin: 12px 0;
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.score-strip .score {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.score-strip .label {
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.score-strip .value {
  font-size: 22px;
  font-weight: 700;
}

/* Status banner */
.status-banner {
  padding: 12px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
  font-weight: 600;
  margin-top: 12px;
}

.status-banner.win {
  background: linear-gradient(135deg, #bbf7d0, #d1fae5);
  border-color: #6ee7b7;
}

.status-banner.draw {
  background: var(--card-2);
}

/* Responsive board sizing */
@media (max-width: 380px) {
  .cell {
    font-size: 26px;
  }
}
