* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; background: #07101f;
  font-family: ui-sans-serif, system-ui, "Segoe UI", Roboto, sans-serif; color: #f2ead8; }
#app canvas { display: block; }

#hud { position: fixed; top: 12px; left: 12px; right: 12px; pointer-events: none; z-index: 5;
  display: flex; flex-direction: column; gap: 6px; max-width: 340px; }
.bar-row { display: flex; align-items: center; gap: 8px; }
.lbl { font-size: 11px; letter-spacing: 1px; width: 36px; opacity: 0.85; }
.bar { flex: 1; height: 12px; background: rgba(0,0,0,0.55); border: 1px solid rgba(255,220,150,0.35);
  border-radius: 6px; overflow: hidden; }
.bar div { height: 100%; border-radius: 6px; transition: width 0.2s; }
#hp-fill { width: 100%; background: linear-gradient(90deg, #d84343, #ff8a5c); }
#fuel-fill { width: 85%; background: linear-gradient(90deg, #b3541e, #ffc14d, #ffe9a8); }
#counters { display: flex; flex-wrap: wrap; gap: 10px; font-size: 13px;
  background: rgba(0,0,0,0.45); padding: 6px 10px; border-radius: 8px; width: fit-content; }
#counters b { color: #ffcf7a; }
#phase { font-size: 12px; background: rgba(0,0,0,0.45); padding: 5px 10px;
  border-radius: 8px; width: fit-content; color: #ffd9a0; }
#toast { position: fixed; left: 50%; top: 14%; transform: translateX(-50%);
  background: rgba(10,8,4,0.75); border: 1px solid rgba(255,190,90,0.5); color: #ffe2ab;
  padding: 8px 16px; border-radius: 10px; font-size: 14px; opacity: 0; transition: opacity 0.35s;
  pointer-events: none; z-index: 8; white-space: nowrap; max-width: 92vw; }
#vignette { position: fixed; inset: 0; pointer-events: none; z-index: 4; opacity: 0;
  background: radial-gradient(ellipse at center, transparent 45%, rgba(2,2,10,0.95) 100%);
  transition: opacity 0.5s; }
#flash { position: fixed; inset: 0; background: #ff2222; opacity: 0; pointer-events: none; z-index: 6; }

#touch-controls { position: fixed; inset: auto 0 0 0; z-index: 7; pointer-events: none;
  display: flex; justify-content: space-between; align-items: flex-end; padding: 16px; }
#stick { pointer-events: auto; width: 116px; height: 116px; border-radius: 50%;
  background: rgba(20,26,40,0.45); border: 2px solid rgba(255,210,140,0.4); touch-action: none; }
#stick-knob { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px;
  border-radius: 50%; background: rgba(255,200,120,0.55); border: 2px solid rgba(255,230,180,0.8); }
#touch-actions { pointer-events: auto; display: flex; flex-direction: column; gap: 12px; }
#touch-actions button { width: 92px; height: 64px; border-radius: 14px; font-size: 13px;
  font-weight: 700; color: #2b1c08; background: linear-gradient(180deg, #ffcf7a, #e89b3c);
  border: 2px solid #ffe6b8; cursor: pointer; touch-action: none; }
#touch-actions button:active { transform: scale(0.94); }

.overlay { position: fixed; inset: 0; z-index: 10; display: flex; align-items: center;
  justify-content: center; background: radial-gradient(ellipse at 50% 40%, rgba(30,18,8,0.72), rgba(4,6,16,0.92)); }
#overlay-end { display: none; }
.panel { max-width: 520px; width: calc(100% - 40px); padding: 28px 30px; text-align: center;
  background: rgba(12,10,20,0.82); border: 1px solid rgba(255,190,90,0.35); border-radius: 18px;
  box-shadow: 0 20px 80px rgba(0,0,0,0.6); }
.panel h1 { font-size: clamp(30px, 7vw, 44px); letter-spacing: 2px; color: #ffb45e;
  text-shadow: 0 0 24px rgba(255,150,50,0.55); margin-bottom: 6px; }
.panel .tag { color: #d9c9a5; font-size: 15px; margin-bottom: 16px; }
.howto { list-style: none; text-align: left; font-size: 13.5px; line-height: 1.7; margin-bottom: 20px;
  color: #cbbfa4; }
.howto b { color: #ffd28a; }
.big-btn { display: inline-block; padding: 14px 34px; border-radius: 999px; text-decoration: none;
  font-weight: 800; font-size: 17px; color: #211404; letter-spacing: 1px;
  background: linear-gradient(180deg, #ffd28a, #ff9b3d); box-shadow: 0 0 32px rgba(255,150,60,0.5); }
.big-btn:hover { filter: brightness(1.12); }
@media (max-width: 500px) {
  #hud { max-width: 62vw; }
  .panel { padding: 20px 18px; }
  .howto { font-size: 12px; }
}
