* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; background: #05060a; }
body { font-family: Georgia, 'Times New Roman', serif; color: #cfd6e4; }
#game-canvas { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }

#hud {
  position: fixed; top: 0; left: 0; right: 0; display: flex; gap: 18px;
  padding: 10px 16px; pointer-events: none; text-shadow: 0 1px 4px #000;
  background: linear-gradient(rgba(5,6,10,.75), rgba(5,6,10,0));
}
.hud-item { font-size: 15px; letter-spacing: 0.06em; color: #8b96ab; }
.hud-item b { color: #e8d9a0; font-size: 17px; }

#crosshair {
  position: fixed; left: 50%; top: 50%; width: 14px; height: 14px;
  transform: translate(-50%, -50%); border-radius: 50%;
  border: 1px solid rgba(220,225,235,0.55); pointer-events: none;
}
#crosshair.near { border-color: #ffd27a; box-shadow: 0 0 12px 2px rgba(255,190,80,0.45); transform: translate(-50%,-50%) scale(1.35); }

#vignette {
  position: fixed; inset: 0; pointer-events: none; opacity: 0;
  background: radial-gradient(ellipse at center, rgba(0,0,0,0) 30%, rgba(90,0,0,0.55) 85%, rgba(30,0,0,0.85) 100%);
  transition: opacity 0.3s;
}

#message {
  position: fixed; left: 50%; top: 18%; transform: translateX(-50%);
  font-size: 20px; color: #ffe6b0; text-shadow: 0 2px 8px #000;
  opacity: 0; transition: opacity 0.6s; pointer-events: none; text-align: center;
  width: 92%; font-style: italic;
}
#hint {
  position: fixed; left: 50%; top: 58%; transform: translateX(-50%);
  font-size: 15px; color: #c9d2ff; text-shadow: 0 1px 6px #000;
  pointer-events: none; text-align: center; width: 92%;
}

#start-screen, #end-screen {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at center, rgba(10,12,22,0.72), rgba(3,4,8,0.94));
  z-index: 10;
}
.hidden { display: none !important; }
.panel {
  max-width: 560px; width: 92%; padding: 34px 30px; text-align: center;
  background: linear-gradient(#12151f44, #0a0c14cc);
  border: 1px solid #2c3345; border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.7), inset 0 0 40px rgba(70,90,140,0.07);
}
.panel h1 { font-size: 42px; letter-spacing: 0.22em; color: #d7e0f0; text-shadow: 0 0 22px rgba(120,150,220,0.35); }
.panel h2 { font-size: 30px; letter-spacing: 0.14em; margin-bottom: 12px; }
#end-title.win { color: #9fe0a8; text-shadow: 0 0 20px rgba(100,220,130,0.4); }
#end-title.lose { color: #e06a5a; text-shadow: 0 0 20px rgba(220,60,50,0.4); }
.tag { color: #7e8aa2; font-style: italic; margin: 8px 0 18px; }
.howto { list-style: none; text-align: left; font-size: 15px; line-height: 1.6; }
.howto li { margin: 6px 0; padding-left: 14px; border-left: 2px solid #33405c; }
.howto b { color: #e8d9a0; }
.tiny { margin-top: 16px; font-size: 12px; color: #66718a; }
.btn {
  display: inline-block; margin-top: 20px; padding: 13px 30px; font: inherit;
  font-size: 17px; letter-spacing: 0.08em; cursor: pointer;
  color: #0a0c14; background: linear-gradient(#e8d9a0, #c9a86a);
  border: 1px solid #e8d9a0; border-radius: 6px; text-decoration: none;
  box-shadow: 0 0 24px rgba(230,200,120,0.25);
}
.btn.ghost { background: transparent; color: #a8b4cc; border-color: #3c465e; box-shadow: none; margin-left: 10px; }
#end-sub { font-size: 15px; line-height: 1.7; color: #a8b4cc; }
#end-sub b { color: #e8d9a0; }

/* touch controls: hidden on desktop */
#touch-ui { display: none; }
body.touch #touch-ui { display: block; }
#t-joy {
  position: fixed; left: 14px; bottom: 14px; width: 128px; height: 128px;
  border-radius: 50%; border: 1px solid rgba(150,170,210,0.28);
  background: rgba(20,26,40,0.35); touch-action: none; z-index: 9;
}
#t-joy-knob {
  position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px;
  border-radius: 50%; background: rgba(170,190,230,0.35); border: 1px solid rgba(200,215,245,0.5);
}
#t-look { position: fixed; right: 0; top: 15%; width: 55%; height: 70%; touch-action: none; z-index: 8; }
#t-interact, #t-run {
  position: fixed; right: 16px; width: 70px; height: 70px; border-radius: 50%;
  font: inherit; font-size: 16px; color: #e8d9a0; touch-action: none; z-index: 9;
  background: rgba(30,36,54,0.6); border: 1px solid rgba(230,210,150,0.45);
}
#t-interact { bottom: 30px; }
#t-run { bottom: 116px; right: 22px; width: 60px; height: 60px; font-size: 13px; }
#t-run.on { background: rgba(120,90,40,0.6); }
body.touch #hint { top: 63%; }
body.touch #message { top: 12%; }
@media (max-width: 500px) {
  .panel h1 { font-size: 30px; }
  .howto { font-size: 13.5px; }
  .hud-item { font-size: 12px; } .hud-item b { font-size: 14px; }
}
