* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
  width: 100%; min-height: 100%;
  background: #07070c;
  font-family: "Segoe UI", system-ui, sans-serif;
  overflow: hidden; color: #fff;
}
#game-wrap {
  position: relative;
  width: 960px; height: 600px;
  margin: 24px auto 0;
  box-shadow: 0 0 60px rgba(0,0,0,.85);
  border: 2px solid #1c1c28;
}
canvas#game { display: block; background: #2a2a35; }
.hidden { display: none !important; }

/* ---------- HUD ---------- */
#hud { position: absolute; inset: 0; pointer-events: none; }
#hud-top { position: absolute; top: 12px; left: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.hud-pill {
  background: rgba(10,10,18,.78); border: 1px solid #34344a;
  padding: 6px 12px; border-radius: 20px; font-weight: 700; font-size: 15px;
  backdrop-filter: blur(4px);
}
.hud-pill.chapter { background: #c81e3a; border-color: #ff5a72; }
#mission-box {
  position: absolute; top: 12px; right: 12px; width: 280px;
  background: rgba(10,10,18,.78); border-left: 4px solid #ffd400;
  padding: 10px 14px; border-radius: 6px; backdrop-filter: blur(4px);
}
#mission-title { color: #ffd400; font-weight: 800; font-size: 13px; letter-spacing: 1px; text-transform: uppercase; }
#mission-objective { font-size: 14px; margin-top: 4px; line-height: 1.3; }
#controls-hint {
  position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%);
  font-size: 12px; color: #9a9ab0; background: rgba(10,10,18,.6);
  padding: 4px 14px; border-radius: 14px;
}

/* ---------- Dialogue ---------- */
#dialogue {
  position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%);
  width: 660px; max-width: 92%;
  background: rgba(8,8,14,.95); border: 2px solid #ffd400; border-radius: 10px;
  padding: 16px 20px; z-index: 30;
}
#dlg-name { color: #ffd400; font-weight: 800; font-size: 17px; margin-bottom: 6px; }
#dlg-text { font-size: 16px; line-height: 1.45; min-height: 48px; }
#dlg-next { text-align: right; font-size: 12px; color: #8a8aa0; margin-top: 8px; }

/* ---------- GTA-style intro ---------- */
#intro {
  position: absolute; inset: 0; z-index: 60;
  background: radial-gradient(circle at 50% 35%, #160c28, #05050a 75%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
#intro-card { display: flex; align-items: center; gap: 28px; }
#intro-canvas {
  border: 3px solid #ffd400; border-radius: 8px; background: #06060c;
  box-shadow: 0 0 30px rgba(200,30,58,.4);
}
#intro-text { text-align: left; max-width: 340px; }
#intro-role { color: #ffd400; letter-spacing: 5px; font-size: 16px; font-weight: 700; }
#intro-name { font-size: 56px; font-weight: 900; line-height: 1; margin: 4px 0 12px; text-shadow: 0 0 24px #c81e3a; }
#intro-tag { color: #ff9fb0; font-style: italic; font-size: 18px; line-height: 1.4; }
@keyframes introIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }
#intro-progress { display: flex; gap: 8px; margin-top: 36px; }
#intro-progress span { width: 26px; height: 5px; border-radius: 3px; background: #34344a; }
#intro-progress span.on { background: #ffd400; }
#btn-skip {
  position: absolute; bottom: 24px; right: 24px;
  background: rgba(255,255,255,.1); border: 1px solid #44445a; color: #ccc;
  padding: 8px 20px; border-radius: 20px; cursor: pointer; font-weight: 700;
}
#btn-skip:hover { background: rgba(255,255,255,.2); }

/* ---------- Menu ---------- */
#menu {
  position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 28%, #1a1030, #06060c 72%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  z-index: 50; text-align: center; overflow-y: auto; padding: 20px;
}
#menu h1 { font-size: 80px; letter-spacing: 4px; text-shadow: 0 0 30px #c81e3a; }
#menu h1 span { color: #ffd400; }
#menu h2 { font-size: 28px; color: #ff7a90; margin-top: -8px; font-style: italic; }
#menu .tag { color: #9a9ab0; margin: 10px 0 18px; }
#menu button {
  background: #c81e3a; color: #fff; border: none;
  padding: 13px 38px; font-size: 18px; font-weight: 800;
  border-radius: 30px; cursor: pointer; margin: 6px;
  transition: transform .1s, background .2s;
}
#menu button:hover { background: #ff2e4c; transform: scale(1.04); }
#name-row { margin-bottom: 14px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
#name-row label { font-size: 13px; color: #9a9ab0; letter-spacing: 1px; text-transform: uppercase; }
#name-input {
  background: rgba(255,255,255,.08); border: 2px solid #34344a; color: #fff;
  padding: 10px 18px; font-size: 18px; border-radius: 8px; text-align: center;
  width: 260px; outline: none; transition: border-color .2s;
}
#name-input:focus { border-color: #ffd400; }
#save-note { color: #6cd97a; font-size: 13px; margin-top: 8px; min-height: 16px; }
#profiles { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 4px 0 6px; max-width: 560px; }
.profile-btn {
  background: rgba(255,255,255,.06); border: 1px solid #34344a; color: #cfe;
  padding: 7px 14px; border-radius: 18px; font-size: 13px; cursor: pointer;
}
.profile-btn:hover { border-color: #6cd97a; }
.cast { display: flex; gap: 12px; margin-top: 22px; flex-wrap: wrap; justify-content: center; }
.cast-card {
  background: rgba(255,255,255,.05); border: 1px solid #2a2a3a;
  border-radius: 8px; padding: 10px 16px; min-width: 110px;
}
.cast-card b { display: block; font-size: 15px; }
.cast-card span { font-size: 11px; color: #9a9ab0; }
.cast-card.hero { border-color: #3ad; }
.cast-card.mentor { border-color: #2ec9a0; }
.cast-card.villain { border-color: #c81e3a; }
.cast-card.alina { border-color: #b46cff; }

/* ---------- Banner ---------- */
#banner {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: rgba(4,4,8,.82); z-index: 40; animation: fade .4s ease;
}
#banner-sub { color: #ffd400; letter-spacing: 6px; font-size: 18px; font-weight: 700; }
#banner-title { font-size: 50px; font-weight: 900; text-shadow: 0 0 24px #000; margin-top: 6px; text-align: center; padding: 0 20px; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Game over ---------- */
#gameover {
  position: absolute; inset: 0; background: rgba(40,0,6,.9);
  display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 45;
}
#gameover h1 { font-size: 64px; color: #ff2e4c; letter-spacing: 6px; }
#gameover p { color: #ddd; margin: 10px 0 24px; padding: 0 20px; text-align: center; }
#gameover button {
  background: #fff; color: #111; border: none;
  padding: 12px 34px; font-size: 16px; font-weight: 800; border-radius: 26px; cursor: pointer;
}

/* ---------- Footer ---------- */
#site-footer {
  text-align: center; color: #7a7a90; font-size: 13px;
  padding: 14px 0 20px;
}
#site-footer a { color: #ffd400; text-decoration: none; font-weight: 700; }
#site-footer a:hover { text-decoration: underline; }
