/**
 * Snake Arena Stylesheet - Popyca Games
 *
 * Warm cream, slate, and terracotta visual aesthetic.
 * Responsive HTML5 Canvas board with touch D-pad for mobile.
 */

:root {
  --snake-board-bg: #ece5d8;
  --snake-grid-line: rgba(0, 0, 0, 0.03);
  --snake-head-color: #e26938;
  --snake-body-color: #8c7a65;
  --snake-apple-color: #ef4444;

  --snake-canvas-size: min(88vw, 420px);
}

@media (min-width: 600px) {
  :root {
    --snake-canvas-size: 420px;
  }
}

/* Stage Container */
.snake-stage-container {
  width: 100%;
  max-width: 480px;
  background: var(--snake-board-bg);
  border-radius: 14px;
  padding: 14px;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.08), 0 6px 16px rgba(0, 0, 0, 0.05);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  touch-action: none;
}

/* Canvas Board Wrapper */
.snake-canvas-wrapper {
  position: relative;
  width: var(--snake-canvas-size);
  height: var(--snake-canvas-size);
  background: #fdfbf7;
  border: 2px solid var(--color-border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.04);
}

#snake-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Mobile Touch D-Pad Controls */
.snake-dpad-container {
  display: none;
  margin-top: 16px;
  width: 180px;
  height: 180px;
  position: relative;
}

@media (max-width: 768px) {
  .snake-dpad-container {
    display: block;
  }
}

.dpad-btn {
  position: absolute;
  width: 54px;
  height: 54px;
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-ink);
  font-size: 20px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  transition: transform 0.08s ease, background-color 0.08s ease;
}

.dpad-btn:active {
  background: #ede6dc;
  transform: scale(0.92);
}

.dpad-up    { top: 0; left: 63px; }
.dpad-down  { bottom: 0; left: 63px; }
.dpad-left  { top: 63px; left: 0; }
.dpad-right { top: 63px; right: 0; }
.dpad-center {
  position: absolute;
  top: 63px;
  left: 63px;
  width: 54px;
  height: 54px;
  background: rgba(0, 0, 0, 0.03);
  border-radius: 8px;
}
