* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #2a1e18;
  font-family: 'Special Elite', monospace; user-select: none; -webkit-user-select: none; }
#scene-container { position: fixed; inset: 0; }
.hidden { display: none !important; }

/* ---- Start Screen ---- */
#start-screen { position: fixed; inset: 0; z-index: 50;
  background:
    radial-gradient(circle at 50% 30%, #3a2a1c, #150f0a 90%);
  display: flex; align-items: center; justify-content: center; padding: 16px; }
.blueprint-frame { max-width: 460px; width: 100%; padding: 28px 24px;
  background: #f4ecd6; border: 3px double #3a2a1a;
  box-shadow: 0 0 0 8px #6b4a2a, 0 20px 60px rgba(0,0,0,.6);
  text-align: center; color: #2a1c10;
  animation: fadein .8s ease; }
@keyframes fadein { from { opacity: 0; transform: scale(.95); } to { opacity: 1; } }
.logo-blob { font-size: 46px; margin-bottom: 6px; }
.blueprint-frame h1 { font-family: 'Rye', serif; font-size: 34px; line-height: 1; color: #7a2018; }
.blueprint-frame h1 span { font-size: 40px; color: #a8481a; }
.legend { margin: 18px auto; max-width: 300px; text-align: left;
  font-family: 'Rye', serif; font-size: 15px; }
.legend div { display: flex; justify-content: space-between;
  border-bottom: 1px dotted #7a5a3a; padding: 2px 0; }
.legend b { color: #7a2018; }
.scale { font-size: 11px; letter-spacing: 1px; color: #5a4530; margin-bottom: 18px; }
#start-btn { font-family: 'Rye', serif; font-size: 20px; padding: 12px 26px;
  background: #b22128; color: #fff2d0; border: 2px solid #6a1210; border-radius: 4px;
  cursor: pointer; box-shadow: 0 4px 0 #6a1210; transition: transform .1s; }
#start-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #6a1210; }
.hint { margin-top: 14px; font-size: 12px; color: #5a4530; }

/* ---- HUD ---- */
#hud { position: fixed; inset: 0; z-index: 20; pointer-events: none; }
#topbar { position: absolute; top: 0; left: 0; right: 0; padding: 8px 14px;
  display: flex; justify-content: space-between; align-items: center;
  background: linear-gradient(#000000aa, transparent); }
#topbar .title { font-family: 'Rye', serif; color: #ffd77a; font-size: 17px;
  text-shadow: 0 2px 4px #000; }
#nostalgia { display: flex; align-items: center; gap: 8px; color: #f4ecd6; font-size: 12px; }
.meter { width: 90px; height: 12px; background: #00000066; border: 1px solid #ffd77a; border-radius: 6px; overflow: hidden; }
#meter-fill { height: 100%; width: 0; background: linear-gradient(90deg, #e2d23b, #e28a2b, #b22128);
  transition: width .5s; }

#caption { position: absolute; bottom: 22%; left: 50%; transform: translateX(-50%);
  background: #f4ecd6ee; color: #2a1c10; font-family: 'Rye', serif; font-size: 16px;
  padding: 10px 20px; border: 2px solid #7a2018; border-radius: 4px;
  opacity: 0; transition: opacity .4s; white-space: nowrap; max-width: 90vw; text-align: center; }
#caption.show { opacity: 1; }

#controls-hint { position: absolute; bottom: 10px; left: 12px; color: #f4ecd6bb;
  font-size: 11px; text-shadow: 0 1px 2px #000; }

#mute-btn, #photo-btn { position: absolute; pointer-events: auto; cursor: pointer;
  font-family: 'Special Elite'; background: #00000088; color: #ffd77a;
  border: 1px solid #ffd77a; border-radius: 6px; padding: 8px 12px; font-size: 14px; }
#mute-btn { top: 46px; right: 12px; }
#photo-btn { top: 90px; right: 12px; }

#minimap { position: absolute; bottom: 12px; right: 12px;
  border: 2px solid #7a5a3a; box-shadow: 0 4px 12px #000a; border-radius: 3px;
  width: 150px; height: 120px; }

#polaroid { position: absolute; bottom: 140px; right: 12px; width: 150px;
  border: 6px solid #fff; border-bottom-width: 22px; box-shadow: 0 6px 20px #000b;
  transform: rotate(-3deg); animation: pop .3s ease; }
@keyframes pop { from { transform: rotate(-3deg) scale(.5); } to { transform: rotate(-3deg) scale(1); } }

#flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
#flash.flash-on { animation: flash .25s ease; }
@keyframes flash { 0% { opacity: .9; } 100% { opacity: 0; } }

#remix { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%);
  pointer-events: auto; color: #ffd77a99; font-size: 10px; text-decoration: none; }
#remix:hover { color: #ffd77a; }

/* ---- Touch controls ---- */
#touch-controls { position: fixed; inset: 0; z-index: 15; pointer-events: none; }
#joystick { position: absolute; bottom: 30px; left: 30px; width: 110px; height: 110px;
  background: #ffffff22; border: 2px solid #ffd77a88; border-radius: 50%; pointer-events: auto; }
#stick { position: absolute; top: 50%; left: 50%; width: 46px; height: 46px; margin: -23px;
  background: #ffd77abb; border-radius: 50%; }

#webgl-error { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  color: #f4ecd6; font-size: 18px; padding: 30px; text-align: center; z-index: 99; }