@font-face {
  font-family: 'Tiro Bangla';
  src: url('fonts/TiroBangla-Regular.ttf') format('truetype');
  font-weight: 400;
}
@font-face {
  font-family: 'Hind Siliguri';
  src: url('fonts/HindSiliguri-Bold.ttf') format('truetype');
  font-weight: 700;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #10131a; }
body { font-family: 'Tiro Bangla', 'Hind Siliguri', system-ui, sans-serif; color: #fff; }
.hidden { display: none !important; }
#game-container, #game-container canvas { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
#hud-top-left { position: absolute; top: 10px; left: 12px; display: flex; gap: 8px; }
#money, #clock {
  background: rgba(10, 14, 22, .72); border: 1px solid rgba(255,255,255,.25);
  border-radius: 10px; padding: 6px 12px; font-size: 17px; font-weight: 700; letter-spacing: .3px;
}
#money { color: #ffd75e; }
#objective {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%);
  background: rgba(10, 14, 22, .72); border: 1px solid rgba(255,255,255,.25);
  border-radius: 10px; padding: 6px 14px; font-size: 15px; text-align: center; max-width: 46vw;
}
#objective-sub { display: block; font-size: 12px; color: #ffd75e; }
#hud-top-right { position: absolute; top: 10px; right: 12px; display: flex; gap: 8px; align-items: flex-start; }
#minimap {
  width: 132px; height: 132px; border-radius: 10px;
  border: 2px solid rgba(255,255,255,.35); background: #1a2233; pointer-events: none;
}
.hud-btn {
  pointer-events: auto; width: 44px; height: 44px; border-radius: 10px;
  background: rgba(10, 14, 22, .72); border: 1px solid rgba(255,255,255,.25);
  color: #fff; font-size: 18px; font-weight: 700; cursor: pointer;
}
#speed {
  position: absolute; bottom: 92px; right: 16px;
  background: rgba(10, 14, 22, .72); border: 1px solid rgba(255,255,255,.25);
  border-radius: 10px; padding: 6px 12px; font-size: 17px; font-weight: 700;
}
#mission-timer {
  position: absolute; top: 56px; left: 50%; transform: translateX(-50%);
  background: rgba(120, 10, 10, .8); border: 1px solid rgba(255,255,255,.35);
  border-radius: 10px; padding: 4px 14px; font-size: 20px; font-weight: 700;
}
#toast {
  position: absolute; bottom: 150px; left: 50%; transform: translateX(-50%);
  background: rgba(10, 14, 22, .85); border: 1px solid rgba(255,255,255,.3);
  border-radius: 10px; padding: 8px 16px; font-size: 15px; white-space: nowrap;
}

/* ---------- Touch controls ---------- */
#touch-ui { position: fixed; inset: 0; pointer-events: none; z-index: 11; }
#joystick {
  position: absolute; width: 120px; height: 120px; border-radius: 50%;
  background: rgba(255,255,255,.10); border: 2px solid rgba(255,255,255,.35);
  display: none;
}
#joystick-knob {
  position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px;
  border-radius: 50%; background: rgba(255,255,255,.55); border: 2px solid rgba(255,255,255,.8);
}
#btn-action {
  pointer-events: auto; position: absolute; bottom: 22px; right: 18px;
  width: 92px; height: 92px; border-radius: 50%;
  background: rgba(255, 190, 40, .92); border: 3px solid #fff; color: #1a1405;
  font-size: 17px; font-weight: 700; font-family: inherit; cursor: pointer;
  box-shadow: 0 4px 18px rgba(0,0,0,.5);
}
#btn-action:active { transform: scale(.94); }

/* ---------- Rotate hint ---------- */
#rotate-hint {
  position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column;
  gap: 14px; align-items: center; justify-content: center; text-align: center;
  background: rgba(8, 10, 16, .88); font-size: 19px; padding: 20px;
}
#rotate-hint button {
  padding: 10px 22px; font-size: 16px; border-radius: 10px; border: none;
  background: #ffbe28; font-family: inherit; font-weight: 700; cursor: pointer;
}

/* ---------- Overlays / menus ---------- */
#start-screen, #pause-screen, #help-screen, #result-screen {
  position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center;
  background: rgba(6, 8, 14, .72); padding: 12px;
}
.panel {
  background: #141a26; border: 1px solid rgba(255,255,255,.18); border-radius: 16px;
  padding: 20px 22px; max-width: 560px; width: 100%; max-height: 94vh; overflow-y: auto;
  text-align: center; box-shadow: 0 12px 50px rgba(0,0,0,.6);
}
.panel h1 { font-size: 40px; line-height: 1.1; }
.panel h2 { font-size: 28px; margin-bottom: 10px; }
.title-bn { color: #ffd75e; }
.title-en { letter-spacing: 6px; font-size: 22px !important; color: #9fd3ff; margin-top: 2px; }
.tagline { color: #c8d2e0; font-size: 15px; margin: 10px 0 16px; }
.menu-buttons { display: flex; flex-direction: column; gap: 10px; margin: 6px 0 12px; }
.big-btn {
  padding: 13px 16px; font-size: 17px; font-family: inherit; border-radius: 12px; cursor: pointer;
  background: #232c40; color: #fff; border: 1px solid rgba(255,255,255,.25);
}
.big-btn.primary { background: #ffbe28; color: #1a1405; border: none; font-weight: 700; }
.big-btn:active { transform: scale(.98); }
.reward { color: #ffd75e; font-weight: 700; }
.big-btn.primary .reward { color: #7a4d00; }
.controls-box {
  display: flex; flex-direction: column; gap: 4px; font-size: 13.5px; color: #b9c4d6;
  background: rgba(255,255,255,.05); border-radius: 10px; padding: 10px; margin-bottom: 10px;
}
.controls-box b { color: #fff; }
.fineprint { font-size: 12.5px; color: #8d99ad; }
#help-screen .panel p { text-align: left; font-size: 15px; color: #d5dce8; margin-bottom: 8px; line-height: 1.45; }
#result-text { font-size: 16px; color: #d5dce8; margin-bottom: 8px; }

@media (max-height: 430px) {
  #minimap { width: 104px; height: 104px; }
  #money, #clock { font-size: 14px; padding: 4px 9px; }
  #objective { font-size: 13px; max-width: 42vw; }
  #btn-action { width: 78px; height: 78px; font-size: 15px; }
  .panel h1 { font-size: 30px; }
}
@media (orientation: portrait) {
  #rotate-hint { display: flex; }
}
