/* ========================================
   DL SPARATUTTO - 8-bit Retro Styles
   All sizes relative to viewport (vmin)
   ======================================== */

:root {
  --bg-sky: #5c94fc;
  --bg-ground: #c84c0c;
  --bg-ground-dark: #a0380c;
  --text-color: #fcfcfc;
  --accent-green: #4caf50;
  --accent-red: #e53935;
  --accent-yellow: #ffd600;
  --modal-bg: #1a1a2e;
  --modal-border: #fcfcfc;
  --btn-bg: #333;
  --btn-primary-bg: #4caf50;
  --btn-secondary-bg: #555;
  --font-pixel: 'Press Start 2P', monospace;

  /* Responsive sizing based on vmin */
  --fs-xs: 1.9vmin;
  --fs-sm: 2.3vmin;
  --fs-md: 3.1vmin;
  --fs-lg: 3.9vmin;
  --fs-xl: 5.1vmin;
  --pad-sm: 1.5vmin;
  --pad-md: 3vmin;
  --pad-lg: 5vmin;
  --border-thin: 0.4vmin;
  --border-thick: 0.8vmin;
}

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  font-family: var(--font-pixel);
  color: var(--text-color);
  image-rendering: pixelated;
  -ms-interpolation-mode: nearest-neighbor;
  touch-action: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

/* ========================================
   GAME CONTAINER
   ======================================== */

#game-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  touch-action: none;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ========================================
   HUD
   ======================================== */

#hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2.5vmin 4vmin;
  font-size: var(--fs-sm);
  text-shadow: 0.4vmin 0.4vmin 0 #000;
  pointer-events: none;
}

#hud-logo {
  color: var(--accent-red);
  font-size: var(--fs-lg);
  text-shadow: 0.6vmin 0.6vmin 0 #000;
}

.hud-subtitle {
  display: block;
  font-size: 1.2vmin;
  color: var(--accent-yellow);
  text-shadow: 0.3vmin 0.3vmin 0 #000;
  margin-top: 0.5vmin;
  letter-spacing: 0.2vmin;
}

/* ========================================
   CANVAS (16:9 letterboxed)
   ======================================== */

#game-canvas {
  display: block;
  margin: auto;
  max-width: 100vw;
  max-height: 100vh;
  aspect-ratio: 16 / 9;
  image-rendering: pixelated;
  -ms-interpolation-mode: nearest-neighbor;
}

/* ========================================
   OVERLAYS
   ======================================== */

.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.85);
  z-index: 100;
}

.overlay.hidden {
  display: none;
}

/* ========================================
   MODAL BOXES
   ======================================== */

.modal-box {
  background: var(--modal-bg);
  border: var(--border-thick) solid var(--modal-border);
  box-shadow:
    0 0 0 var(--border-thick) #000,
    0 0 0 calc(var(--border-thick) * 2) var(--modal-border),
    0 0 0 calc(var(--border-thick) * 3) #000;
  padding: 5vmin;
  width: 90vw;
  height: 90vh;
  text-align: center;
  line-height: 2;
  font-size: var(--fs-xs);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4vmin;
  align-items: center;
  width: 100%;
}

.modal-col-left {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.modal-col-right {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

@media (max-width: 720px) {
  .modal-box {
    width: 90vw;
    height: 90vh;
    padding: 6vmin 4vmin;
  }
  .modal-grid {
    grid-template-columns: 1fr;
    gap: 3vmin;
  }
}

.modal-box h1 {
  font-size: var(--fs-xl);
  color: var(--accent-red);
  margin-bottom: 4vmin;
  text-shadow: 0.6vmin 0.6vmin 0 #000;
}

.modal-subtitle {
  display: block;
  font-size: 2.3vmin;
  color: var(--accent-yellow);
  text-shadow: 0.3vmin 0.3vmin 0 #000;
  margin-top: 1vmin;
  letter-spacing: 0.3vmin;
}

.modal-box h2 {
  font-size: var(--fs-lg);
  color: var(--accent-red);
  margin-bottom: 3.2vmin;
  text-shadow: 0.4vmin 0.4vmin 0 #000;
}

.start-modal .intro-body {
  color: #ccc;
  margin-bottom: 2.8vmin;
}

.start-modal .intro-controls {
  color: var(--accent-yellow);
  margin-bottom: 5vmin;
}

.start-modal .intro-warning {
  color: #888;
  margin-bottom: 4vmin;
}

.modal-box p {
  margin-bottom: 2.8vmin;
  font-size: var(--fs-xs);
  line-height: 2.2;
}

/* ========================================
   PROTEST MODAL SPECIFICS
   ======================================== */

.protest-modal .death-text {
  color: var(--accent-red);
  font-size: var(--fs-sm);
}

.protest-modal .keyfact {
  color: var(--accent-yellow);
  font-size: var(--fs-sm);
  border: var(--border-thin) dashed var(--accent-yellow);
  padding: 2vmin;
  margin-bottom: 3.2vmin;
}

.keyfact-source {
  display: block;
  margin-top: 1.5vmin;
  font-size: 1.7vmin;
  color: rgba(255, 214, 0, 0.6);
  text-decoration: underline;
}

.keyfact-source:hover {
  color: var(--accent-yellow);
}

.protest-modal .protest-body {
  color: #ccc;
}

/* ========================================
   FOLLOWUP MODAL SPECIFICS
   ======================================== */

.followup-modal .followup-body {
  margin-bottom: 4vmin;
}

.followup-modal .followup-share {
  margin-top: 3.2vmin;
  color: #aaa;
}

/* ========================================
   BUTTONS
   ======================================== */

.pixel-btn {
  display: inline-block;
  font-family: var(--font-pixel);
  font-size: var(--fs-sm);
  padding: 2.8vmin 4.4vmin;
  border: var(--border-thin) solid var(--text-color);
  background: var(--btn-bg);
  color: var(--text-color);
  cursor: pointer;
  text-decoration: none;
  text-transform: uppercase;
  transition: transform 0.05s, background 0.1s;
  line-height: 1.8;
}

.pixel-btn:hover {
  transform: scale(1.05);
  filter: brightness(1.3);
}

.pixel-btn:active {
  transform: scale(0.97);
}

.pixel-btn.btn-primary {
  background: var(--btn-primary-bg);
}

.pixel-btn.btn-secondary {
  background: var(--btn-secondary-bg);
}

.pixel-btn.btn-email {
  background: var(--accent-green);
  display: inline-block;
  margin-bottom: 2vmin;
}

/* ========================================
   MODAL ACTIONS
   ======================================== */

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 2.4vmin;
  justify-content: center;
  margin-top: 4vmin;
}

/* ========================================
   TOUCH CONTROLS (mobile)
   ======================================== */

#touch-controls {
  display: none;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 38vh;
  z-index: 50;
  pointer-events: none;
}

.touch-dpad {
  position: absolute;
  left: 4vw;
  bottom: 18vh;
  display: flex;
  gap: 3vw;
  pointer-events: auto;
}

.touch-btn {
  pointer-events: auto;
  width: 16vw;
  height: 16vw;
  max-width: 72px;
  max-height: 72px;
  background: rgba(0, 0, 0, 0.45);
  border: 0.4vmin solid rgba(255, 255, 255, 0.5);
  color: rgba(255, 255, 255, 0.85);
  font-family: var(--font-pixel);
  font-size: 3.5vmin;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  image-rendering: pixelated;
  border-radius: 0.6vmin;
  transition: background 0.08s;
}

.touch-btn:active,
.touch-btn.active {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.8);
}

.touch-btn-jump {
  position: absolute;
  right: 4vw;
  bottom: 18vh;
  width: 20vw;
  height: 20vw;
  max-width: 88px;
  max-height: 88px;
  font-size: 4vmin;
  border-color: rgba(76, 175, 80, 0.6);
  color: rgba(76, 175, 80, 0.9);
}

.touch-btn-jump:active,
.touch-btn-jump.active {
  background: rgba(76, 175, 80, 0.35);
  border-color: rgba(76, 175, 80, 0.9);
}

/* Show touch controls on touch devices */
@media (hover: none) and (pointer: coarse) {
  #touch-controls {
    display: block;
  }
}

