/* ============================================
   CENTRE TECH HEROES - Game Styles
   Brand Colors: Navy #0a1628, Blue #1a4b8c,
   Green #2ecc71, Cyan #00b4d8, White #ffffff
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=Inter:wght@400;600;700&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: #0a0a1a;
  color: #ffffff;
  font-family: 'Inter', sans-serif;
  overflow: hidden;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

#game-container {
  position: relative;
  width: 960px;
  height: 640px;
  background: #0a1628;
  border: 3px solid #1a4b8c;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 0 60px rgba(26, 75, 140, 0.4), 0 0 120px rgba(0, 180, 216, 0.1);
}

/* ---- SCREENS ---- */
.screen {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px;
}
.screen.active {
  display: flex;
}

/* ---- TITLE SCREEN ---- */
#title-screen {
  background: linear-gradient(180deg, #0a1628 0%, #0d2137 50%, #0a1628 100%);
  gap: 20px;
}
#title-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(2px 2px at 100px 50px, rgba(255,255,255,0.3), transparent),
    radial-gradient(2px 2px at 300px 120px, rgba(255,255,255,0.2), transparent),
    radial-gradient(1px 1px at 500px 80px, rgba(255,255,255,0.3), transparent),
    radial-gradient(2px 2px at 700px 200px, rgba(255,255,255,0.15), transparent),
    radial-gradient(1px 1px at 200px 300px, rgba(255,255,255,0.25), transparent),
    radial-gradient(2px 2px at 800px 400px, rgba(255,255,255,0.2), transparent),
    radial-gradient(1px 1px at 400px 500px, rgba(255,255,255,0.3), transparent),
    radial-gradient(2px 2px at 600px 350px, rgba(255,255,255,0.15), transparent),
    radial-gradient(1px 1px at 150px 450px, rgba(255,255,255,0.25), transparent),
    radial-gradient(2px 2px at 850px 100px, rgba(255,255,255,0.2), transparent);
  pointer-events: none;
}

.title-logo {
  text-align: center;
  z-index: 1;
}
.game-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 48px;
  color: #00b4d8;
  text-shadow: 0 0 20px rgba(0, 180, 216, 0.6), 3px 3px 0 #1a4b8c;
  letter-spacing: 4px;
  animation: titlePulse 2s ease-in-out infinite;
}
.game-subtitle {
  font-family: 'Press Start 2P', monospace;
  font-size: 36px;
  color: #2ecc71;
  text-shadow: 0 0 15px rgba(46, 204, 113, 0.5), 2px 2px 0 #1a6b3a;
  margin-top: 8px;
}
.tagline {
  font-size: 14px;
  color: #7eaac4;
  margin-top: 15px;
  letter-spacing: 3px;
  text-transform: uppercase;
}

@keyframes titlePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.85; }
}

.title-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 1;
  margin-top: 10px;
}

.copyright {
  position: absolute;
  bottom: 15px;
  font-size: 11px;
  color: #3a5a7a;
  z-index: 1;
}

/* ---- BUTTONS ---- */
.menu-btn {
  font-family: 'Press Start 2P', monospace;
  font-size: 14px;
  padding: 14px 40px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  background: linear-gradient(180deg, #00b4d8 0%, #0090ad 100%);
  color: #fff;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.3);
  box-shadow: 0 4px 0 #006d85, 0 6px 15px rgba(0, 180, 216, 0.3);
  transition: all 0.1s;
  letter-spacing: 1px;
}
.menu-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 #006d85, 0 8px 20px rgba(0, 180, 216, 0.4);
}
.menu-btn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #006d85, 0 3px 10px rgba(0, 180, 216, 0.2);
}
.menu-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}
.menu-btn.secondary {
  background: linear-gradient(180deg, #2a3f5f 0%, #1a2a40 100%);
  box-shadow: 0 4px 0 #0f1a2a, 0 6px 15px rgba(0,0,0,0.3);
  font-size: 11px;
  padding: 10px 24px;
}
.menu-btn.secondary:hover {
  box-shadow: 0 6px 0 #0f1a2a, 0 8px 20px rgba(0,0,0,0.4);
}
.menu-btn.small {
  font-size: 10px;
  padding: 8px 20px;
}

/* ---- CHARACTER SELECT ---- */
#select-screen {
  background: linear-gradient(180deg, #0a1628, #0d1f33);
  gap: 15px;
  padding: 20px;
}
.screen-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 20px;
  color: #00b4d8;
  text-shadow: 0 0 10px rgba(0,180,216,0.4);
}
.character-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: 100%;
  max-width: 600px;
}
.char-card {
  background: rgba(26, 75, 140, 0.15);
  border: 2px solid #1a3a5c;
  border-radius: 10px;
  padding: 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}
.char-card:hover {
  border-color: #00b4d8;
  background: rgba(0, 180, 216, 0.1);
  transform: translateY(-3px);
}
.char-card.selected {
  border-color: #2ecc71;
  background: rgba(46, 204, 113, 0.1);
  box-shadow: 0 0 20px rgba(46, 204, 113, 0.2);
}
.char-card canvas {
  image-rendering: pixelated;
  width: 64px;
  height: 64px;
}
.char-card .char-card-name {
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  color: #cde;
  margin-top: 6px;
}
.char-card .char-card-role {
  font-size: 10px;
  color: #6a8aaa;
  margin-top: 3px;
}

.char-info {
  text-align: center;
  min-height: 80px;
}
.char-info h3 {
  font-family: 'Press Start 2P', monospace;
  font-size: 14px;
  color: #2ecc71;
}
.char-info p {
  font-size: 12px;
  color: #8ab4d4;
  margin-top: 4px;
}
.char-stats {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-top: 8px;
}
.stat-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.stat-bar .stat-label {
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  color: #5a7a9a;
}
.stat-bar .stat-track {
  width: 60px;
  height: 6px;
  background: #1a2a3a;
  border-radius: 3px;
  overflow: hidden;
}
.stat-bar .stat-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s;
}
.stat-fill.spd { background: #00b4d8; }
.stat-fill.jmp { background: #2ecc71; }
.stat-fill.str { background: #e74c3c; }
.stat-fill.def { background: #f39c12; }

/* ---- HOW TO PLAY ---- */
#howto-screen {
  background: linear-gradient(180deg, #0a1628, #0d1f33);
  gap: 15px;
  overflow-y: auto;
}
.howto-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  max-width: 700px;
  width: 100%;
}
.howto-section {
  background: rgba(26, 75, 140, 0.15);
  border: 1px solid #1a3a5c;
  border-radius: 8px;
  padding: 15px;
}
.howto-section h3 {
  font-family: 'Press Start 2P', monospace;
  font-size: 11px;
  color: #00b4d8;
  margin-bottom: 10px;
}
.howto-section p {
  font-size: 12px;
  color: #8ab4d4;
  line-height: 1.6;
  margin-bottom: 4px;
}
.control-row {
  font-size: 12px;
  color: #8ab4d4;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.key {
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  background: #1a2a40;
  border: 1px solid #2a4a6a;
  border-radius: 4px;
  padding: 4px 8px;
  color: #00b4d8;
  min-width: 120px;
  text-align: center;
}

/* ---- GAME SCREEN ---- */
#game-screen {
  padding: 0;
  flex-direction: column;
}
#game-canvas {
  display: block;
  background: #0a1628;
  image-rendering: pixelated;
}
#game-hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(180deg, rgba(10, 22, 40, 0.95), rgba(10, 22, 40, 0.85));
  padding: 6px 15px;
  border-bottom: 2px solid #1a3a5c;
  width: 100%;
  z-index: 10;
}
.hud-left, .hud-center, .hud-right {
  display: flex;
  align-items: center;
  gap: 15px;
}
.hud-item {
  display: flex;
  align-items: center;
  gap: 6px;
}
.hud-label {
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  color: #5a7a9a;
}
.hud-item span:not(.hud-label):not(.hud-icon) {
  font-family: 'Press Start 2P', monospace;
  font-size: 12px;
  color: #00b4d8;
}
.hud-icon {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  display: inline-block;
}
.hp-bar {
  width: 100px;
  height: 10px;
  background: #1a2a3a;
  border-radius: 5px;
  overflow: hidden;
  border: 1px solid #2a4a6a;
}
.hp-fill {
  height: 100%;
  background: linear-gradient(90deg, #2ecc71, #27ae60);
  border-radius: 5px;
  transition: width 0.3s;
  width: 100%;
}

/* ---- OVERLAYS ---- */
.overlay {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 15px;
  background: rgba(5, 10, 20, 0.92);
  z-index: 100;
  backdrop-filter: blur(4px);
}
.overlay.active {
  display: flex;
}
.overlay h2 {
  font-family: 'Press Start 2P', monospace;
  font-size: 28px;
  color: #00b4d8;
  text-shadow: 0 0 20px rgba(0, 180, 216, 0.5);
}
.overlay p {
  font-size: 14px;
  color: #7eaac4;
  text-align: center;
}
.final-score {
  font-family: 'Press Start 2P', monospace;
  font-size: 16px;
  color: #2ecc71 !important;
}
