/* Game page styles */
.game-page {
  padding: 32px 0 64px;
  min-height: calc(100vh - 68px);
}

.game-header {
  text-align: center;
  margin-bottom: 28px;
}

.game-header h1 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin-bottom: 8px;
}

.game-header p {
  color: var(--muted);
  font-size: 0.95rem;
}

.game-panel {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 24px;
  max-width: 640px;
  margin: 0 auto;
}

.game-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.game-stat {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
}

.game-stat-label {
  color: var(--muted);
  font-weight: 500;
}

.game-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.btn-sm {
  padding: 8px 18px;
  font-size: 0.85rem;
  border-radius: 50px;
}

.btn-secondary {
  background: var(--purple-light);
  color: var(--purple);
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-family: var(--font);
  transition: background 0.2s;
}

.btn-secondary:hover { background: #ddd6fe; }

.game-board-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 320px;
}

/* Match-3 */
.match3-board {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
  width: 100%;
  max-width: 400px;
  aspect-ratio: 1;
  user-select: none;
}

.match3-cell {
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  transition: transform 0.15s, box-shadow 0.15s;
  aspect-ratio: 1;
}

.match3-cell:hover { transform: scale(1.08); }
.match3-cell.selected { box-shadow: 0 0 0 3px var(--purple); transform: scale(1.1); }

.match3-cell.type-0 { background: #ede9fe; }
.match3-cell.type-1 { background: #e0f7f5; }
.match3-cell.type-2 { background: #fff3e0; }
.match3-cell.type-3 { background: #ffe0e0; }
.match3-cell.type-4 { background: #e8f5e9; }

/* Wheel */
.wheel-wrap {
  position: relative;
  width: 300px;
  height: 300px;
  margin: 0 auto;
}

.wheel-canvas {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  transition: transform 4s cubic-bezier(0.17, 0.67, 0.12, 0.99);
}

.wheel-pointer {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 14px solid transparent;
  border-right: 14px solid transparent;
  border-top: 24px solid var(--coral);
  z-index: 2;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.wheel-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  background: var(--white);
  border-radius: 50%;
  border: 3px solid var(--purple);
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.wheel-result {
  text-align: center;
  margin-top: 20px;
  font-size: 1rem;
  color: var(--ink-soft);
  min-height: 28px;
}

.wheel-result strong { color: var(--purple); }

/* Minesweeper */
.mine-board {
  display: inline-grid;
  gap: 2px;
  background: var(--border);
  border-radius: 8px;
  padding: 4px;
}

.mine-cell {
  width: 32px;
  height: 32px;
  background: #c0b8d8;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 700;
  font-family: var(--font);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.mine-cell:hover:not(.revealed):not(.flagged) {
  background: #d0c8e8;
}

.mine-cell.revealed {
  background: var(--bg);
  cursor: default;
}

.mine-cell.flagged {
  background: var(--bg);
}

.mine-cell.flagged img {
  width: 18px;
  height: 18px;
}

.mine-cell.mine-hit { background: #ffcdd2; }

.mine-cell.mine-hit img {
  width: 18px;
  height: 18px;
}

.match3-cell img {
  width: 70%;
  height: 70%;
  object-fit: contain;
  pointer-events: none;
}

.wheel-center img {
  width: 28px;
  height: 28px;
}

.mine-cell.n1 { color: #1565c0; }
.mine-cell.n2 { color: #2e7d32; }
.mine-cell.n3 { color: #c62828; }
.mine-cell.n4 { color: #6a1b9a; }
.mine-cell.n5 { color: #e65100; }
.mine-cell.n6 { color: #00838f; }
.mine-cell.n7 { color: #37474f; }
.mine-cell.n8 { color: #546e7a; }

/* Connect 4 */
.connect-board {
  display: flex;
  gap: 8px;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  background: var(--purple);
  padding: 12px;
  border-radius: 12px;
  box-sizing: border-box;
}

.connect-col {
  flex: 1;
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  min-width: 0;
  cursor: pointer;
}

.connect-slot {
  width: 100%;
  height: 48px;
  background: var(--bg);
  border-radius: 50%;
  transition: background 0.2s;
  flex-shrink: 0;
}

.connect-slot.p1 { background: var(--coral); box-shadow: inset 0 -3px 0 rgba(0,0,0,0.15); }
.connect-slot.p2 { background: var(--teal); box-shadow: inset 0 -3px 0 rgba(0,0,0,0.15); }

.connect-slot.hover-preview.p1 { background: rgba(255, 107, 107, 0.4); }
.connect-slot.hover-preview.p2 { background: rgba(46, 196, 182, 0.4); }

/* Memory cards */
.memory-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
}

.memory-card {
  aspect-ratio: 1;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--purple-light);
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
  font-family: var(--font);
}

.memory-card:hover:not(.matched) { transform: scale(1.04); box-shadow: var(--shadow); }

.memory-card.flipped {
  background: var(--white);
  border-color: var(--purple);
}

.memory-card.matched {
  background: var(--teal-light);
  border-color: var(--teal);
  cursor: default;
  opacity: 0.85;
}

.memory-card img {
  width: 72%;
  height: 72%;
  object-fit: contain;
  pointer-events: none;
}

.memory-back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.memory-back img {
  width: 50%;
  height: 50%;
  opacity: 0.7;
}

.game-message {
  text-align: center;
  margin-top: 16px;
  padding: 12px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  display: none;
}

.game-message.show { display: block; }
.game-message.win { background: var(--teal-light); color: var(--teal-dark); }
.game-message.lose { background: #ffe0e0; color: #c62828; }
.game-message.info { background: var(--purple-light); color: var(--purple-dark); }

.game-back {
  text-align: center;
  margin-top: 28px;
}

@media (max-width: 480px) {
  .mine-cell { width: 28px; height: 28px; font-size: 0.75rem; }
  .match3-board { max-width: 320px; }
  .match3-cell { font-size: 1.1rem; }
  .connect-slot { height: 36px; }
  .memory-board { max-width: 320px; gap: 8px; }
}
