/* =====================================================
   RUN MAHONNIE'S RUN – style.css  v4.0
   ===================================================== */

:root {
  --orange:  #ff6b00;
  --orange2: #ff9a2e;
  --red:     #e8001e;
  --yellow:  #ffe800;
  --dark:    #1a0a00;
  --dark2:   #2d1200;
  --cream:   #fff4e0;
  --green:   #00e676;

  --font-pixel: 'Press Start 2P', monospace;
  --font-brand: 'Fredoka One', cursive;
  --font-body:  'Nunito', sans-serif;
}

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

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: var(--dark);
  font-family: var(--font-body);
  color: var(--cream);
}

/* ── SCREENS ─────────────────────────────────────── */
.screen {
  position: fixed; inset: 0;
  display: flex; flex-direction: column;
  align-items: center;
  justify-content: flex-start;   /* top-down en vez de center → nunca queda cortado */
  gap: 11px;
  padding: 22px 16px 28px;
  opacity: 0; pointer-events: none;
  transition: opacity .35s ease;
  overflow-y: auto;
  z-index: 10;
  -webkit-overflow-scrolling: touch;
}
/* Centrado vertical solo en pantallas con suficiente espacio */
@media (min-height: 700px) {
  .screen { justify-content: center; }
}
.screen.active { opacity: 1; pointer-events: all; }

/* ── STARS BG ────────────────────────────────────── */
.stars-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(255,107,0,.18) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 80%, rgba(232,0,30,.12) 0%, transparent 60%),
    var(--dark);
  z-index: -1;
}
.win-bg {
  background:
    radial-gradient(ellipse at 50% 30%, rgba(255,232,0,.22) 0%, transparent 60%),
    radial-gradient(ellipse at 20% 80%, rgba(0,230,118,.10) 0%, transparent 60%),
    var(--dark);
}

/* ── LOGO ────────────────────────────────────────── */
/* El logo Mahonnie's es un banner horizontal 1080x406.
   Se muestra completo (sin recorte) con object-fit:contain */
.logo-wrap {
  text-align: center;
  flex-shrink: 0;
  width: 100%;
  max-width: 340px;
}
.logo-img {
  width: 100%;
  max-width: 320px;
  height: auto;
  border-radius: 18px;
  border: 3px solid var(--orange);
  box-shadow: 0 0 28px rgba(255,107,0,.55);
  object-fit: contain;
  background: #1a0a00;
  display: block;
  margin: 0 auto;
}
.logo-img-sm {
  max-width: 210px;
  border-radius: 12px;
}

/* ── GAME TITLE ──────────────────────────────────── */
.game-title {
  font-family: var(--font-pixel);
  font-size: clamp(14px, 4.2vw, 22px);
  text-align: center;
  line-height: 1.65;
  letter-spacing: 2px;
  text-shadow: 3px 3px 0 var(--red), 5px 5px 0 rgba(0,0,0,.45);
}
.title-run   { color: var(--yellow); display: block; }
.title-brand { color: var(--orange); display: block; font-size: 1.30em; }

.game-sub {
  font-family: var(--font-brand);
  font-size: 19px;
  color: var(--orange2);
  text-align: center;
}

/* ── MISSION PANEL ───────────────────────────────── */
.mission-panel {
  background: rgba(255,107,0,.13);
  border: 2px solid rgba(255,107,0,.45);
  border-radius: 18px;
  padding: 14px 22px;
  text-align: center;
  max-width: 320px;
  width: 100%;
}
.mission-icon { font-size: 32px; margin-bottom: 6px; }
.mission-text {
  font-size: 15px;
  line-height: 1.5;
  color: var(--cream);
  margin-bottom: 6px;
}
.mission-text strong { color: var(--yellow); font-size: 17px; }
.mission-info {
  font-size: 14px;
  color: var(--orange2);
  margin-top: 4px;
}
.mission-info strong { color: var(--green); }

/* ── BUTTONS ─────────────────────────────────────── */
.btn-primary {
  font-family: var(--font-pixel);
  font-size: clamp(11px, 3vw, 13px);
  color: var(--dark);
  background: linear-gradient(135deg, var(--yellow), var(--orange));
  border: none; border-radius: 50px;
  padding: 14px 40px;
  cursor: pointer;
  box-shadow: 0 4px 0 #7a3800, 0 8px 20px rgba(255,107,0,.4);
  transition: transform .1s, box-shadow .1s;
  letter-spacing: 1px;
  flex-shrink: 0;
}
.btn-primary:active { transform: translateY(4px); box-shadow: 0 0 0 #7a3800; }

.btn-secondary {
  font-family: var(--font-pixel);
  font-size: 10px;
  color: var(--cream);
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,107,0,.4);
  border-radius: 50px;
  padding: 12px 28px;
  cursor: pointer;
  transition: background .15s;
}
.btn-secondary:hover { background: rgba(255,107,0,.18); }

.pulse { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse {
  0%,100% { transform: scale(1); box-shadow: 0 4px 0 #7a3800, 0 8px 20px rgba(255,107,0,.4); }
  50%      { transform: scale(1.05); box-shadow: 0 4px 0 #7a3800, 0 12px 32px rgba(255,107,0,.7); }
}

/* ── SOCIAL LINKS ────────────────────────────────── */
.social-links {
  display: flex; gap: 10px; flex-wrap: wrap; justify-content: center;
}
.btn-social {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 11px 18px;
  border-radius: 50px;
  font-family: var(--font-body);
  font-weight: 700; font-size: 14px;
  text-decoration: none;
  transition: transform .15s, opacity .15s;
  white-space: nowrap;
}
.btn-social:hover { transform: scale(1.05); }
.btn-whatsapp { background: #25d366; color: #fff; }
.btn-maps     { background: #4285f4; color: #fff; }
.btn-wide     { width: 100%; max-width: 320px; justify-content: center; }

/* ── VISIT COUNTER ───────────────────────────────── */
.visit-counter {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,107,0,.28);
  border-radius: 50px;
  padding: 7px 18px;
  font-size: 13px;
  color: var(--cream);
}
.visit-icon { font-size: 16px; }
.visit-label { color: var(--orange2); font-weight: 700; }
.visit-num {
  font-family: var(--font-pixel);
  font-size: 12px;
  color: var(--yellow);
  text-shadow: 0 0 8px rgba(255,232,0,.5);
  min-width: 36px;
  text-align: right;
}

/* ── CONTROL HINT ────────────────────────────────── */
.control-hint {
  font-family: var(--font-pixel);
  font-size: 9px;
  color: rgba(255,255,255,.32);
  text-align: center;
  letter-spacing: 1px;
}

/* ── CANVAS (full screen) ────────────────────────── */
#game-canvas {
  display: block;
  position: fixed; top: 0; left: 0;
  width: 100vw; height: 100vh;
  touch-action: none;
}

/* ── JUMP HINT ───────────────────────────────────── */
.jump-hint {
  position: fixed;
  bottom: 28px; left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-pixel);
  font-size: 9px;
  color: rgba(255,255,255,.5);
  letter-spacing: 1px;
  pointer-events: none;
  white-space: nowrap;
  animation: fadeHint 3.5s forwards;
}
@keyframes fadeHint { 0%,55%{opacity:1} 100%{opacity:0} }

/* ── GAME OVER ───────────────────────────────────── */
.go-emoji { font-size: 56px; animation: shake .4s ease; }
@keyframes shake {
  0%,100%{transform:translateX(0)} 25%{transform:translateX(-8px)} 75%{transform:translateX(8px)}
}
.go-title {
  font-family: var(--font-pixel);
  font-size: clamp(14px, 4vw, 20px);
  color: var(--red);
  text-shadow: 3px 3px 0 #600;
  text-align: center;
}
.go-sub { font-size: 14px; color: var(--orange2); text-align: center; }
.go-encourage {
  font-size: 13px; color: var(--cream);
  text-align: center; max-width: 300px;
  opacity: .8;
}

.result-box {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,107,0,.32);
  border-radius: 16px;
  padding: 14px 28px;
  width: 100%; max-width: 320px;
}
.result-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 0; font-size: 14px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.result-row:last-child { border-bottom: none; }
.result-row.goal { color: var(--yellow); }
.result-dist {
  font-family: var(--font-pixel);
  font-size: 15px;
  color: var(--yellow);
}

/* ── PROGRESS BAR ────────────────────────────────── */
.progress-wrap {
  width: 100%; max-width: 320px;
  display: flex; align-items: center; gap: 10px;
}
.progress-bar {
  flex: 1; height: 14px;
  background: rgba(255,255,255,.1);
  border-radius: 7px;
  border: 1px solid rgba(255,107,0,.3);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--orange), var(--yellow));
  border-radius: 7px;
  transition: width .6s ease;
  width: 0%;
}
.progress-label {
  font-family: var(--font-pixel);
  font-size: 10px;
  color: var(--yellow);
  min-width: 34px;
  text-align: right;
}

/* ── WIN SCREEN ──────────────────────────────────── */
.win-emoji {
  font-size: 64px;
  animation: bounceIn .6s ease;
}
@keyframes bounceIn {
  0%  { transform: scale(0.4); opacity: 0; }
  70% { transform: scale(1.15); }
  100%{ transform: scale(1); opacity: 1; }
}
.win-title {
  font-family: var(--font-pixel);
  font-size: clamp(16px, 4.5vw, 24px);
  color: var(--yellow);
  text-shadow: 3px 3px 0 var(--orange), 6px 6px 0 rgba(0,0,0,.4);
  text-align: center;
}
.win-sub {
  font-size: 15px; color: var(--cream);
  text-align: center;
}
.win-sub strong { color: var(--yellow); }

/* ── RESULT BOX ───────────────────────────────────── */
.result-box {
  background: linear-gradient(135deg, rgba(255,107,0,.18), rgba(255,232,0,.12));
  border: 2px solid var(--orange);
  border-radius: 20px;
  padding: 18px 24px;
  text-align: center;
  width: 100%; max-width: 320px;
  box-shadow: 0 0 24px rgba(255,107,0,.35);
}
.result-label {
  font-size: 13px;
  color: var(--orange2);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.result-value {
  font-family: var(--font-pixel);
  font-size: clamp(18px, 5vw, 26px);
  color: var(--yellow);
  letter-spacing: 4px;
  text-shadow: 0 0 16px rgba(255,232,0,.7);
  margin: 8px 0;
  padding: 10px;
  background: rgba(0,0,0,.3);
  border-radius: 10px;
  border: 1px dashed rgba(255,232,0,.4);
}
.result-desc {
  font-size: 13px;
  color: var(--cream);
  line-height: 1.6;
  margin: 8px 0;
}
.result-desc strong { color: var(--green); }

.btn-continue {
  font-family: var(--font-pixel);
  font-size: 10px;
  color: var(--yellow);
  background: rgba(255,232,0,.12);
  border: 2px solid var(--yellow);
  border-radius: 50px;
  padding: 12px 28px;
  cursor: pointer;
  letter-spacing: 1px;
  transition: background .15s, transform .1s;
  animation: pulse-green 2s ease-in-out infinite;
}
.btn-continue:active { transform: scale(0.97); }
@keyframes pulse-green {
  0%,100%{ box-shadow: 0 0 6px rgba(255,232,0,.3); }
  50%    { box-shadow: 0 0 18px rgba(255,232,0,.7); }
}

/* ── RESPONSIVE ──────────────────────────────────── */
@media (max-height: 640px) {
  .screen { gap: 8px; padding: 12px 14px 16px; }
  .logo-img { width: 80px; height: 80px; border-radius: 16px; }
  .logo-img-sm { width: 60px; height: 60px; }
  .mission-panel { padding: 10px 16px; }
  .win-emoji, .go-emoji { font-size: 40px; }
  .result-box { padding: 12px 16px; }
}
