:root {
  --accent: #f4a24b;
  --panel: rgba(24, 26, 36, 0.85);
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  height: 100%;
  font-family: 'Bricolage Grotesque', sans-serif;
  background: radial-gradient(circle at 50% 30%, #2a2d3a, #14151d 80%);
  overflow: hidden; user-select: none; touch-action: none;
}
#game-wrap { position: relative; width: 100vw; height: calc(100vh - 34px); overflow: hidden; }
canvas { display: block; background: #14151d; }

/* HUD */
#hud {
  position: absolute; top: 0; left: 0; right: 0;
  padding: 10px 12px; pointer-events: none;
  display: flex; justify-content: space-between; align-items: flex-start; gap: 10px;
}
#hud-left {
  background: var(--panel); border: 1px solid rgba(255,255,255,.1);
  border-radius: 12px; padding: 8px 14px; text-align: left;
}
#clock {
  font-family: 'JetBrains Mono', monospace; font-weight: 700;
  font-size: clamp(20px, 6vw, 30px); color: #fff;
  text-shadow: 0 0 12px rgba(84,160,255,.6); letter-spacing: 1px;
}
#activity {
  font-size: clamp(11px, 3.4vw, 15px); font-weight: 800;
  color: var(--accent); margin-top: 2px;
}
#location {
  font-family: 'JetBrains Mono', monospace; font-size: 9px;
  color: #8fa9c4; font-weight: 700; letter-spacing: 1px; margin-top: 3px;
}
#hud-right { display: flex; flex-direction: column; gap: 6px; }
.meter {
  background: var(--panel); border: 1px solid rgba(255,255,255,.1);
  padding: 6px 10px; border-radius: 10px; min-width: 130px;
}
.m-label {
  font-family: 'JetBrains Mono', monospace; font-size: 9px;
  color: #ccc; font-weight: 700; letter-spacing: 1px; display: block; margin-bottom: 3px;
}
.m-bar { height: 9px; background: rgba(0,0,0,.4); border-radius: 6px; overflow: hidden; }
.m-fill { height: 100%; width: 100%; border-radius: 6px; transition: width .2s linear; }

#prompt {
  position: absolute; bottom: 120px; left: 50%; transform: translateX(-50%);
  background: rgba(244,162,75,.95); color: #3a2410;
  font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: 13px;
  padding: 8px 16px; border-radius: 20px; opacity: 0;
  transition: opacity .15s; pointer-events: none; white-space: nowrap; z-index: 8;
}

#flash {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(.8);
  background: rgba(255,255,255,.96); color: #222;
  font-family: 'JetBrains Mono', monospace; font-weight: 700;
  font-size: clamp(13px, 4vw, 18px); padding: 12px 22px; border-radius: 16px;
  border: 2px solid var(--accent); z-index: 12; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
#flash.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }

/* D-pad */
#dpad {
  position: absolute; bottom: 20px; left: 16px;
  display: flex; flex-direction: column; align-items: center; gap: 6px; z-index: 5;
}
.drow { display: flex; gap: 6px; }
.db {
  width: 54px; height: 54px; border-radius: 14px;
  background: rgba(244,162,75,.9); border: 2px solid #c9762a; color: #3a2410;
  font-size: 20px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 0 #a55e1f;
}
.db:active { transform: translateY(3px); box-shadow: 0 1px 0 #a55e1f; }

#action-btns {
  position: absolute; bottom: 30px; right: 18px;
  display: flex; gap: 10px; z-index: 5;
}
.act {
  width: 68px; height: 68px; border-radius: 50%;
  background: rgba(60,80,110,.92); color: #fff; border: 3px solid #2c3e50;
  font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: 22px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  box-shadow: 0 5px 0 #1b2733; line-height: 1;
}
.act small { font-size: 9px; font-weight: 700; opacity: .8; margin-top: 2px; }
.act:active { transform: translateY(4px); box-shadow: 0 1px 0 #1b2733; }

/* hide dpad/action buttons on desktop, show hint via footer */
@media (hover: hover) and (pointer: fine) {
  #dpad { display: none; }
  #action-btns { display: none; }
}

footer {
  height: 34px; display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: #7d7f8c; background: #0f1016;
  font-family: 'JetBrains Mono', monospace; gap: 6px; text-align: center; padding: 0 10px;
}
footer b { color: var(--accent); }
footer a { color: var(--accent); text-decoration: none; }
footer a:hover { text-decoration: underline; }