/* ========================================
   Desert Drop — Gem Stack
   Game-specific styles
   ======================================== */

/* Root Variables */
:root {
  --teal: #00bfa5;
  --bg: #0b0f12;
  --surface: #0f1419;
  --text: #d9e1e8;
  --muted: #92a1ad;
}

/* Base Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
}

/* Header */
.site-header {
  background: rgba(11, 15, 18, 0.95);
  backdrop-filter: blur(6px);
  padding: 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.brand {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--teal);
  text-decoration: none;
}

.site-nav {
  display: flex;
  gap: 1.5rem;
}

.site-nav a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.site-nav a:hover {
  color: var(--teal);
}

/* Game Container */
.game-wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1rem;
  text-align: center;
}

.game-wrap h1 {
  font-size: 2rem;
  margin: 0 0 1.5rem;
  color: var(--teal);
  text-shadow: 0 2px 4px rgba(0, 191, 165, 0.3);
}

/* Controls */
.controls {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.btn.touch[data-control="down"],
.btn.touch[data-control="drop"] {
  grid-column: span 1;
}

/* How to Play */
.howto {
  max-width: 600px;
  margin: 2rem auto;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid rgba(0, 191, 165, 0.2);
  border-radius: 12px;
}

.howto summary {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  user-select: none;
  list-style: none;
  padding: 0.5rem 0;
}

.howto summary::-webkit-details-marker {
  display: none;
}

.howto summary::before {
  content: '▶ ';
  color: var(--teal);
  display: inline-block;
  transition: transform 0.2s;
}

.howto details[open] summary::before {
  transform: rotate(90deg);
}

.howto-body {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--muted);
  text-align: left;
}

.howto-body p {
  margin: 0 0 1rem;
}

.howto-body ul {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
}

.howto-body li {
  margin: 0.5rem 0;
  padding-left: 1.5rem;
  position: relative;
}

.howto-body li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--teal);
}

.howto-body kbd {
  background: rgba(0, 191, 165, 0.1);
  border: 1px solid var(--teal);
  padding: 0.2em 0.5em;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.9em;
  color: var(--teal);
}

/* Desktop: Hide touch controls */
@media (min-width: 720px) {
  .controls.on-screen {
    display: none;
  }
}

/* Mobile adjustments */
@media (max-width: 720px) {
  .game-wrap {
    padding: 1rem 0.5rem;
  }
  
  .game-wrap h1 {
    font-size: 1.5rem;
  }
  
  .canvas-shell {
    max-width: 100%;
    margin: 0 0.5rem 1.5rem;
  }
  
  .btn {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
  }
  
  .hud {
    gap: 0.5rem;
  }
  
  .pill {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
  }
} {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  border: 2px solid var(--teal);
  background: var(--surface);
  color: var(--teal);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-block;
}

.btn:hover {
  background: var(--teal);
  color: var(--bg);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 191, 165, 0.4);
}

.btn:active {
  transform: translateY(0);
}

.btn.secondary {
  border-color: var(--muted);
  color: var(--muted);
}

.btn.secondary:hover {
  background: var(--muted);
  color: var(--bg);
}

/* HUD */
.hud {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.pill {
  padding: 0.5rem 1rem;
  background: var(--surface);
  border: 1px solid rgba(0, 191, 165, 0.3);
  border-radius: 20px;
  font-size: 0.9rem;
  color: var(--muted);
}

.pill span {
  color: var(--teal);
  font-weight: 700;
  margin-left: 0.5rem;
}

/* Canvas Container */
.canvas-shell {
  width: 100%;
  max-width: 600px;
  margin: 0 auto 1.5rem;
  background: var(--surface);
  border: 2px solid rgba(0, 191, 165, 0.2);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

#gameCanvas {
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 3;
  display: block;
}

/* Touch Controls */
.controls.on-screen {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  max-width: 400px;
  margin: 0 auto 1.5rem;
}

.btn.touch {
  min-height: 56px;
  font-size: 1.5rem;
  padding: 0.5rem;
}

.btn
