.scene-game { padding-top: 14px; }

.game-hud {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.icon-btn {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  padding: 0; border-radius: 12px;
  font-size: 1.1rem;
}
.hud-title {
  display: flex; flex-direction: column; gap: 2px;
}
.hud-title span:first-child { color: var(--gold); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; }
.hud-title span:last-child { font-size: 1.1rem; font-weight: 700; }
.hud-stats {
  display: flex; gap: 10px;
  margin-left: auto;
}
.hud-stats div {
  min-width: 76px; text-align: center;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}
.hud-stats span { display: block; color: var(--muted); font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.08em; }
.hud-stats strong { font-size: 1.15rem; }

.challenge-banner {
  display: flex; justify-content: space-between;
  padding: 10px 14px;
  margin-bottom: 12px;
  border: 1px solid rgba(255, 89, 125, 0.45);
  background: rgba(255, 89, 125, 0.1);
  border-radius: var(--radius-sm);
  color: var(--red);
}
.challenge-banner strong { color: var(--text); }

.game-stage {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 18px;
  flex: 1;
  min-height: 0;
}

.board {
  aspect-ratio: 1 / 1;
  max-height: calc(100vh - 190px);
  margin: 0 auto;
  display: grid;
  gap: 2px;
  background: rgba(0,0,0,0.35);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px;
  touch-action: manipulation;
  outline: none;
}
.tile {
  position: relative;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  background-size: var(--bg-size) var(--bg-size);
  background-position: var(--bg-pos);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.12s ease, outline-color 0.12s ease;
  min-width: 0;
}
.tile:hover { transform: scale(1.018); filter: brightness(1.08); }
.tile.selected { outline: 3px solid var(--gold); outline-offset: -3px; }
.tile.locked::after {
  content: "✓";
  position: absolute; right: 5px; top: 3px;
  color: var(--green); font-weight: 900;
  text-shadow: 0 2px 8px #000;
}
.tile.pop { animation: pop 0.24s ease; }
.tile.shake { animation: shake 0.3s ease; }
.tile.hint-glow { animation: hint-pulse 1s ease infinite alternate; }

@keyframes pop { 50% { transform: scale(1.08); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
@keyframes hint-pulse { from { box-shadow: inset 0 0 0 rgba(248,201,90,0); } to { box-shadow: inset 0 0 18px rgba(248,201,90,0.35); } }

.game-side {
  display: flex; flex-direction: column; gap: 12px;
  padding: 16px;
  max-height: calc(100vh - 160px);
  overflow-y: auto;
}
.preview {
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background-size: cover; background-position: center;
  position: relative;
}
.preview.peek { animation: glow 1.4s ease infinite alternate; }
.preview .preview-overlay {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  background: rgba(0,0,0,0.55);
  color: var(--muted);
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
}
@keyframes glow { from { box-shadow: 0 0 0 rgba(248,201,90,0); } to { box-shadow: 0 0 24px rgba(248,201,90,0.35); } }

.side-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.side-actions button { padding: 0.55rem 0.4rem; font-size: 0.85rem; }
.mode-tip { color: var(--muted); font-size: 0.85rem; line-height: 1.45; margin: 0; }

.result {
  border: 1px solid rgba(85,240,178,0.35);
  background: rgba(85,240,178,0.08);
  padding: 14px; border-radius: var(--radius-sm);
}
.result h3 { margin: 0 0 8px; color: var(--green); font-size: 1.25rem; }
.result-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

.leaderboard h4 { margin: 0 0 8px; color: var(--gold); }
.leaderboard ol { margin: 0; padding-left: 22px; color: var(--muted); font-size: 0.85rem; }
.leaderboard li { padding: 4px 0; }

@media (max-width: 1000px) {
  .game-stage { grid-template-columns: 1fr; }
  .game-side { max-height: none; }
  .board { max-height: none; width: 100%; }
}
@media (max-width: 600px) {
  .hud-stats { width: 100%; margin-left: 0; justify-content: space-between; }
  .hud-stats div { min-width: 60px; flex: 1; }
  .side-actions { grid-template-columns: 1fr; }
}
