* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: #10141a;
  overflow: hidden;
  font-family: "Segoe UI", Arial, sans-serif;
  -webkit-user-select: none;
  user-select: none;
}

#game-container {
  position: relative;
  margin: 0 auto;
  height: 100vh;
  aspect-ratio: 9 / 16;
  max-width: 100vw;
  background: #000;
  touch-action: none;
  overflow: hidden;
}

#game-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

#hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 14px 16px;
  pointer-events: none;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

#hud-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

#hud-level {
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

#progress-track {
  flex: 1;
  height: 8px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 4px;
  overflow: hidden;
}

#progress-fill {
  width: 0%;
  height: 100%;
  background: #ffd23f;
  transition: width 0.15s linear;
}

#hud-coins {
  font-weight: 700;
  font-size: 14px;
  min-width: 28px;
  text-align: right;
}

#hud-count-wrap {
  margin-top: 8px;
  text-align: center;
  font-size: 22px;
  font-weight: 800;
}

#hud-count {
  font-size: 28px;
}

#hud-classes {
  margin-top: 2px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: rgba(255, 255, 255, 0.85);
}

#hint {
  position: absolute;
  bottom: 18px;
  left: 0;
  right: 0;
  text-align: center;
  color: rgba(255, 255, 255, 0.75);
  font-size: 12px;
  pointer-events: none;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
}

.overlay.hidden {
  display: none;
}

.panel {
  background: #1b2027;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 28px 32px;
  text-align: center;
  color: #fff;
  min-width: 220px;
}

.panel h1 {
  margin: 0 0 10px;
  font-size: 26px;
  letter-spacing: 0.04em;
}

.panel p {
  margin: 0 0 18px;
  color: rgba(255, 255, 255, 0.8);
}

.panel button {
  pointer-events: auto;
  border: none;
  border-radius: 8px;
  padding: 12px 26px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.03em;
  background: #ffd23f;
  color: #2a2000;
  cursor: pointer;
}

.panel button:active {
  transform: translateY(1px);
}
