/* ============================================================
   JOHN LAND – KinitoPET Amusement Park  |  style.css
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=Nunito:wght@400;700;800;900&display=swap');

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

:root {
  --pink:    #ff4da6;
  --yellow:  #ffe94d;
  --cyan:    #4ddfff;
  --purple:  #a64dff;
  --green:   #4dff91;
  --dark:    #050510;
  --mid:     #0d0d2b;
  --panel:   rgba(5,5,25,0.88);
  --border:  #ff4da680;
  --font-px: 'Press Start 2P', monospace;
  --font-nu: 'Nunito', sans-serif;
}

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

/* ── BOOT SCREEN ─────────────────────────────────────────── */
#boot-screen {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--dark);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 1.2s ease;
}
#boot-screen.fade-out { opacity: 0; pointer-events: none; }

#boot-content {
  text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 18px;
}

#kinito-face {
  font-family: var(--font-px);
  font-size: clamp(40px, 8vw, 72px);
  color: var(--yellow);
  animation: blink-face 1.4s infinite;
  text-shadow: 0 0 20px #ffe94d88;
}
@keyframes blink-face {
  0%,90%,100% { opacity: 1; }
  95%         { opacity: 0; }
}

#boot-text {
  font-family: var(--font-px);
  font-size: clamp(10px,2vw,18px);
  color: var(--cyan);
  letter-spacing: 3px;
  text-shadow: 0 0 12px var(--cyan);
}

#boot-msg {
  font-family: var(--font-px);
  font-size: clamp(8px,1.4vw,14px);
  color: var(--pink);
  animation: type-msg 3s steps(28,end) forwards;
  white-space: nowrap; overflow: hidden; width: 0;
  text-shadow: 0 0 8px var(--pink);
}
@keyframes type-msg { to { width: 26ch; } }

#loading-bar-wrap {
  width: clamp(240px,50vw,480px); height: 16px;
  border: 2px solid var(--pink);
  border-radius: 8px; overflow: hidden;
  box-shadow: 0 0 14px var(--pink);
}
#loading-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--pink), var(--yellow), var(--cyan));
  width: 0%;
  transition: width 0.1s linear;
  animation: shimmer 1.2s linear infinite;
  background-size: 200%;
}
@keyframes shimmer {
  0%   { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

#enter-prompt {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  animation: float-in 0.6s ease forwards;
}
@keyframes float-in { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:translateY(0); } }

#enter-prompt span { font-family: var(--font-px); color: #aaa; font-size: 8px; }

#enter-btn {
  font-family: var(--font-px);
  font-size: clamp(10px,1.8vw,16px);
  color: var(--dark);
  background: linear-gradient(135deg, var(--yellow), var(--pink));
  border: none; border-radius: 8px;
  padding: 14px 28px; cursor: pointer;
  box-shadow: 0 0 24px #ff4da6, 0 0 48px #ffe94d66;
  transition: transform 0.15s, box-shadow 0.15s;
}
#enter-btn:hover {
  transform: scale(1.07);
  box-shadow: 0 0 40px var(--pink), 0 0 80px var(--yellow);
}
#enter-btn:active { transform: scale(0.96); }

/* ── THREE.js CANVAS ─────────────────────────────────────── */
#main-canvas {
  position: fixed; inset: 0; z-index: 1;
  display: block; width: 100% !important; height: 100% !important;
}

/* ── HUD ─────────────────────────────────────────────────── */
#hud {
  position: fixed; inset: 0; z-index: 10; pointer-events: none;
}

#hud-top {
  position: absolute; top: 20px; left: 20px;
  display: flex; align-items: flex-start; gap: 12px;
  pointer-events: none;
}

#kinito-badge {
  background: var(--panel);
  border: 2px solid var(--yellow);
  border-radius: 12px; padding: 10px 16px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  box-shadow: 0 0 16px #ffe94d66;
}
#kinito-icon {
  font-family: var(--font-px);
  font-size: 22px; color: var(--yellow);
  animation: blink-face 2s infinite;
}
#kinito-name {
  font-family: var(--font-px); font-size: 7px;
  color: var(--yellow); letter-spacing: 2px;
}

.speech-bubble {
  background: var(--panel);
  border: 2px solid var(--yellow);
  border-radius: 0 12px 12px 12px;
  padding: 10px 16px;
  font-family: var(--font-nu); font-size: clamp(11px,1.4vw,15px);
  color: #fff; max-width: 280px;
  box-shadow: 0 0 14px #ffe94d44;
  line-height: 1.5;
  animation: quote-in 0.5s ease both;
}
@keyframes quote-in { from { opacity:0; transform:scale(0.8); } to { opacity:1; transform:scale(1); } }
.speech-bubble strong { color: var(--yellow); }

#hud-controls {
  position: absolute; bottom: 20px; right: 20px;
  display: flex; gap: 14px;
  font-family: var(--font-nu); font-size: 13px;
  color: rgba(255,255,255,0.6);
  background: var(--panel);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px; padding: 8px 14px;
}

/* ── RIDE POPUP ──────────────────────────────────────────── */
#ride-popup {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%,-50%);
  z-index: 50;
  background: var(--panel);
  border: 2px solid var(--pink);
  border-radius: 16px; padding: 24px 32px;
  min-width: 280px; max-width: 360px; text-align: center;
  box-shadow: 0 0 40px #ff4da6aa, 0 20px 60px rgba(0,0,0,0.7);
  animation: pop-in 0.3s cubic-bezier(0.34,1.56,0.64,1) both;
}
@keyframes pop-in { from { opacity:0; transform:translate(-50%,-50%) scale(0.6); } to { opacity:1; transform:translate(-50%,-50%) scale(1); } }

#ride-popup-title {
  font-family: var(--font-px); font-size: 14px;
  color: var(--yellow); margin-bottom: 12px;
  text-shadow: 0 0 10px var(--yellow);
}
#ride-popup-desc {
  font-family: var(--font-nu); font-size: 14px;
  color: #ddd; margin-bottom: 20px; line-height: 1.6;
}
#ride-popup-btn-row { display: flex; gap: 10px; justify-content: center; }

#ride-action-btn, #ride-close-btn {
  font-family: var(--font-px); font-size: 9px;
  border: none; border-radius: 8px;
  padding: 10px 18px; cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
#ride-action-btn {
  background: linear-gradient(135deg, var(--pink), var(--purple));
  color: #fff; box-shadow: 0 0 14px #ff4da6;
}
#ride-action-btn:hover { transform: scale(1.08); box-shadow: 0 0 28px var(--pink); }
#ride-close-btn {
  background: rgba(255,255,255,0.08);
  color: #aaa;
}
#ride-close-btn:hover { background: rgba(255,255,255,0.16); color: #fff; }

/* ── ROLLERCOASTER RIDE SCREEN ───────────────────────────── */
#coaster-screen {
  position: fixed; inset: 0; z-index: 100;
  background: #000;
}
#coaster-canvas { width: 100%; height: 100%; display: block; }

#coaster-overlay {
  position: absolute; inset: 0; pointer-events: none;
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 20px 28px;
}
#coaster-speed {
  font-family: var(--font-px); font-size: 13px;
  color: var(--cyan); text-shadow: 0 0 10px var(--cyan);
}
#coaster-exit-btn {
  font-family: var(--font-px); font-size: 9px;
  color: #fff; background: var(--panel);
  border: 1px solid var(--pink); border-radius: 8px;
  padding: 8px 14px; cursor: pointer; pointer-events: all;
  transition: background 0.2s;
}
#coaster-exit-btn:hover { background: #ff4da633; }

/* scrollbar */
::-webkit-scrollbar { width: 0; }

/* ── WALK MODE & MOBILE JOYSTICK ─────────────────────────── */
#mode-toggle-btn {
  font-family: var(--font-nu); font-size: 13px; font-weight: bold;
  background: var(--pink); color: #fff;
  border: none; border-radius: 6px; padding: 4px 8px;
  cursor: pointer; pointer-events: auto;
  box-shadow: 0 0 8px var(--pink);
}
#mode-toggle-btn:hover { background: var(--purple); }

#hud-controls span { pointer-events: auto; display: flex; align-items: center; }

#joystick-zone {
  position: absolute; bottom: 20px; left: 20px;
  width: 150px; height: 150px;
  touch-action: none; pointer-events: auto;
  z-index: 20;
}
#joystick-base {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 100px; height: 100px;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid var(--pink);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--pink);
}
#joystick-stick {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 40px; height: 40px;
  background: var(--cyan);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--cyan);
}

#crosshair {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  color: rgba(255, 255, 255, 0.4);
  font-family: var(--font-nu); font-size: 24px; pointer-events: none;
  z-index: 10;
}
