/* ---- Game Design System: shared.css ---- */

/* Box-sizing reset */
.game-shared *,
.game-shared *::before,
.game-shared *::after {
  box-sizing: border-box;
}

/* Variables & base container */
.game-shared {
  --bg: #FAFAF8;
  --surface: #FFFFFF;
  --board-bg: #F0F0ED;
  --text: #6B6B70;
  --text-bright: #2D2D2D;
  --accent: #DD4C4F;
  --accent-hover: #C43E41;
  --teal: #2BA890;
  --gold: #D4A83A;
  --muted: #E8E8E6;
  --muted-light: #C8C8C4;
  --radius: 14px;
  --radius-sm: 10px;

  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  user-select: none;
  -webkit-user-select: none;
  padding: 16px 20px;
}

/* ---- Typography ---- */

.game-shared h1,
.game-shared h2,
.game-shared h3 {
  font-family: 'Fredoka', sans-serif;
  color: var(--text-bright);
  margin: 0;
}

.game-shared h1 {
  font-size: 2rem;
  font-weight: 700;
}

/* ---- Button System ---- */

.game-shared .game-btn {
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 10px 24px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
  line-height: 1;
}

.game-shared .game-btn:active {
  transform: scale(0.96);
}

.game-shared .game-btn-primary {
  background: var(--accent);
  color: #fff;
}

.game-shared .game-btn-primary:hover {
  background: var(--accent-hover);
}

.game-shared .game-btn-secondary {
  background: var(--muted);
  color: var(--text);
}

.game-shared .game-btn-secondary:hover {
  background: var(--muted-light);
}

.game-shared .game-btn-teal {
  background: linear-gradient(135deg, #2BA890, #28C4A0);
  color: #fff;
}

.game-shared .game-btn-teal:hover {
  background: linear-gradient(135deg, #249680, #22B090);
}

.game-shared .game-btn-accent {
  background: linear-gradient(135deg, #D4A83A, #E0B84A);
  color: #fff;
}

.game-shared .game-btn-accent:hover {
  background: linear-gradient(135deg, #BF962F, #CCA540);
}

/* ---- Game Header ---- */

.game-shared .game-header {
  text-align: center;
  padding: 4px 0 8px;
  width: 100%;
}

.game-shared .game-subtitle {
  font-size: 0.85rem;
  color: var(--muted-light);
  margin: 4px 0 0;
}

/* ---- Game Title Row & Fullscreen Button ---- */

.game-shared .game-title-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
}

.game-shared .bear-game-fullscreen-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--muted);
  border-radius: 8px;
  background: transparent;
  color: var(--muted-light);
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.game-shared .bear-game-fullscreen-btn:hover {
  color: var(--text-bright);
  border-color: var(--muted-light);
}

/* ---- Stats Bar ---- */

.game-shared .game-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
}

.game-shared .game-stat {
  text-align: center;
}

.game-shared .game-stat-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted-light);
}

.game-shared .game-stat-value {
  font-family: 'Fredoka', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--gold);
}

/* ---- Board Container ---- */

.game-shared .game-board-container {
  background: var(--board-bg);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.04);
}

/* ---- Overlay System ---- */

.game-shared .game-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.game-shared .game-overlay--visible {
  opacity: 1;
  pointer-events: auto;
}

.game-shared .game-overlay-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 32px 28px;
  text-align: center;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
  animation: game-overlay-pop 0.3s ease forwards;
  max-width: 340px;
  width: 90%;
}

@keyframes game-overlay-pop {
  0% { transform: scale(0.85); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* ---- Controls Row ---- */

.game-shared .game-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ---- Hint Text ---- */

.game-shared .game-hint {
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted-light);
}

/* ---- Responsive ---- */

@media screen and (max-width: 480px) {
  .game-shared h1 {
    font-size: 1.5rem;
  }

  .game-shared .game-btn {
    padding: 8px 18px;
    font-size: 0.88rem;
  }

  .game-shared .game-overlay-card {
    padding: 24px 20px;
  }
}
