* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; font-family: "Trebuchet MS", "Segoe UI", system-ui, sans-serif; }
#game-canvas { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }

#hud { position: fixed; inset: 0; pointer-events: none; color: #fdf6e3; }
#hud-top { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px; }
.hud-chip {
  background: rgba(16, 42, 52, 0.72);
  border: 1px solid rgba(255, 210, 122, 0.45);
  border-radius: 999px; padding: 6px 14px; font-size: 13px;
  letter-spacing: 0.4px;
}
.hud-chip b { color: #ffd27a; font-size: 15px; }

#prompt {
  position: absolute; left: 50%; top: 14%; transform: translateX(-50%);
  max-width: 92%; text-align: center;
  font-size: clamp(15px, 2.6vw, 22px); font-weight: 600;
  color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,0.7);
  background: rgba(16,42,52,0.55); border-radius: 12px; padding: 6px 14px;
}
#prompt:empty { background: transparent; padding: 6px 0; }

#dock-hint {
  display: none; position: absolute; left: 50%; bottom: 12%; transform: translateX(-50%);
  background: rgba(184, 69, 46, 0.85); border-radius: 10px; padding: 8px 16px;
  font-size: 14px; white-space: nowrap;
}

#meters { display: none; position: absolute; left: 50%; bottom: 22%; transform: translateX(-50%);
  width: min(340px, 78vw); }
.meter-label { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; margin: 4px 0 2px; text-shadow: 0 1px 4px #000; }
.meter { height: 14px; border-radius: 8px; background: rgba(0,0,0,0.55); overflow: hidden; border: 1px solid rgba(255,255,255,0.35); }
#tension-fill { height: 100%; width: 0%;
  background: linear-gradient(90deg, #59d8a3 0%, #ffd27a 55%, #e8543f 82%); }
#reel-fill { height: 100%; width: 0%; background: linear-gradient(90deg, #6fa8ff, #e2c8ff); }

#pause-note { display: none; position: absolute; inset: 30% auto auto 50%; transform: translateX(-50%);
  font-size: 28px; letter-spacing: 3px; }

/* ---------- touch controls ---------- */
#touch-controls { position: fixed; inset: auto 0 0 0; pointer-events: none; display: flex;
  justify-content: space-between; align-items: flex-end; padding: 14px; }
#stick { pointer-events: auto; width: 118px; height: 118px; border-radius: 50%;
  background: rgba(16,42,52,0.45); border: 2px solid rgba(255,210,122,0.5);
  display: flex; align-items: center; justify-content: center; touch-action: none; }
#knob { width: 52px; height: 52px; border-radius: 50%;
  background: rgba(253,246,227,0.75); border: 2px solid #ffd27a; }
#touch-buttons { pointer-events: auto; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
#touch-buttons button {
  pointer-events: auto; font-family: inherit; font-weight: 700;
  color: #fdf6e3; background: rgba(16,42,52,0.7);
  border: 2px solid rgba(255,210,122,0.55); border-radius: 14px;
  padding: 12px 16px; font-size: 14px; letter-spacing: 1px; touch-action: none;
}
#touch-buttons button:active { background: rgba(184,69,46,0.8); }
#btn-engine, #btn-cargo, #btn-sonar { font-size: 11px !important; line-height: 1.2; }
@media (hover: hover) and (pointer: fine) {
  #stick { opacity: 0.35; }   /* desktop: shown faintly, fully usable with a mouse too */
}
@media (min-width: 900px) { #touch-controls { display: none; } }

/* ---------- overlays ---------- */
.overlay { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 30%, rgba(24,58,74,0.75), rgba(6,18,26,0.92));
  z-index: 10; }
.panel { max-width: 640px; margin: 16px; padding: 26px 30px; text-align: center; color: #fdf6e3;
  background: rgba(16,42,52,0.82); border: 1px solid rgba(255,210,122,0.5); border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5); }
.panel h1 { font-size: clamp(28px, 6vw, 44px); color: #ffd27a; letter-spacing: 2px; }
.tagline { font-style: italic; margin: 8px 0 14px; color: #bfe8ee; }
.howto { list-style: none; text-align: left; font-size: 14px; line-height: 1.55; }
.howto li { margin: 8px 0; }
.howto b { color: #ffd27a; }
.overlay button { margin-top: 16px; font-family: inherit; font-size: 19px; font-weight: 800;
  letter-spacing: 1px; color: #102a34; background: linear-gradient(180deg, #ffd27a, #e8935f);
  border: none; border-radius: 999px; padding: 13px 38px; cursor: pointer; }
.overlay button:hover { filter: brightness(1.1); }
