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

html, body {
  width: 100%;
  height: 100%;
  background: #0b0b14;
  overflow: hidden;
  font-family: 'Courier New', Courier, monospace;
}

#game-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0b0b14;
}

#gameCanvas {
  background: #5c94fc;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  border: 4px solid #2b2b3a;
  box-shadow: 0 0 0 2px #000, 0 8px 30px rgba(0,0,0,0.6);
}

/* ---------- HUD ---------- */
#hud {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  pointer-events: none;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 14px 18px;
  font-weight: bold;
  color: #fff;
  text-shadow: 2px 2px 0 #000;
  letter-spacing: 1px;
  z-index: 5;
}

#hud.hidden { display: none; }

#hud-left {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0,0,0,0.35);
  border: 2px solid #ffd76b;
  border-radius: 6px;
  padding: 6px 12px;
}

#coinIcon {
  image-rendering: pixelated;
  width: 20px;
  height: 20px;
}

#coinCount {
  font-size: 16px;
}

#hud-right {
  background: rgba(0,0,0,0.35);
  border: 2px solid #7bd0ff;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 14px;
}

/* ---------- Overlays ---------- */
.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(6, 8, 20, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.overlay.hidden { display: none; }

.panel {
  background: linear-gradient(180deg, #1c2140 0%, #10132a 100%);
  border: 4px solid #ffd76b;
  border-radius: 12px;
  padding: 28px 40px;
  max-width: 560px;
  width: 90%;
  text-align: center;
  color: #fff;
  box-shadow: 0 0 40px rgba(255, 215, 107, 0.25);
}

.panel h1 {
  font-size: 28px;
  letter-spacing: 2px;
  color: #ffd76b;
  text-shadow: 3px 3px 0 #6b4a00;
  margin-bottom: 6px;
}

.subtitle {
  color: #7bd0ff;
  font-size: 13px;
  margin-bottom: 16px;
  letter-spacing: 1px;
}

.story {
  font-size: 13px;
  line-height: 1.6;
  color: #d8d8e8;
  margin-bottom: 18px;
  padding: 0 6px;
}

.controls {
  background: rgba(0,0,0,0.3);
  border: 2px solid #4a5080;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 20px;
  text-align: left;
}

.controls-title {
  font-size: 12px;
  color: #ffd76b;
  letter-spacing: 2px;
  margin-bottom: 8px;
  text-align: center;
}

.control-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding: 3px 0;
  color: #e8e8f0;
}

.key {
  background: #2b2f55;
  border: 1px solid #7bd0ff;
  border-radius: 4px;
  padding: 1px 8px;
  color: #7bd0ff;
  font-weight: bold;
  margin-right: 10px;
}

button {
  font-family: 'Courier New', Courier, monospace;
  font-weight: bold;
  font-size: 16px;
  letter-spacing: 2px;
  color: #10132a;
  background: linear-gradient(180deg, #ffe28a, #ffd76b);
  border: 3px solid #6b4a00;
  border-radius: 8px;
  padding: 12px 28px;
  cursor: pointer;
  box-shadow: 0 4px 0 #6b4a00;
  transition: transform 0.05s ease;
}

button:hover { filter: brightness(1.08); }

button:active {
  transform: translateY(4px);
  box-shadow: 0 0 0 #6b4a00;
}

#gradeLetter {
  font-size: 72px;
  font-weight: bold;
  margin: 6px 0 14px;
  text-shadow: 4px 4px 0 rgba(0,0,0,0.4);
}

.stats {
  background: rgba(0,0,0,0.3);
  border: 2px solid #4a5080;
  border-radius: 8px;
  padding: 12px 18px;
  margin-bottom: 20px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  font-size: 15px;
  padding: 5px 0;
  color: #e8e8f0;
}

/* ---------- Level title card ---------- */
#level-title-card {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(6, 8, 20, 0.75);
  z-index: 8;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.6s ease;
}

#level-title-card.hidden { display: none; }
#level-title-card.fade-out { opacity: 0; }

#level-title-card .level-num {
  font-size: 44px;
  font-weight: bold;
  color: #ffd76b;
  letter-spacing: 4px;
  text-shadow: 4px 4px 0 #6b4a00;
}

#level-title-card .level-loc {
  font-size: 30px;
  font-weight: bold;
  color: #7bd0ff;
  letter-spacing: 6px;
  margin-top: 8px;
  text-shadow: 3px 3px 0 #10132a;
}

/* ---------- Netanyahu narrator ---------- */
#narrator {
  position: absolute;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 520px;
  width: 90%;
  background: rgba(10, 12, 28, 0.9);
  border: 3px solid #ffd76b;
  border-radius: 8px;
  padding: 8px 14px;
  z-index: 6;
  pointer-events: none;
}

#narrator.hidden { display: none; }

#narratorPortrait {
  image-rendering: pixelated;
  width: 48px;
  height: 48px;
  border: 2px solid #7bd0ff;
  border-radius: 4px;
  flex-shrink: 0;
}

.narrator-text { color: #fff; text-align: left; }

.narrator-name {
  font-size: 12px;
  font-weight: bold;
  color: #ffd76b;
  letter-spacing: 1px;
  margin-bottom: 3px;
}

#narratorMessage {
  font-size: 13px;
  line-height: 1.4;
  color: #e8e8f0;
}
