*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: stretch;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background:
    radial-gradient(circle at top, #3d1c86 0%, transparent 50%),
    radial-gradient(circle at bottom, #12081f 0%, #04010a 70%);
  color: #f9f9ff;
}

#app {
  width: 100%;
  max-width: 1280px;
  padding: 16px;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 16px;
}

.top-bar h1 {
  font-size: 1.4rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #ffe6f4;
}

.controls-hint {
  font-size: 0.85rem;
  opacity: 0.8;
}

main {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.screen {
  width: 100%;
}

.hidden {
  display: none !important;
}

.card {
  max-width: 520px;
  background: rgba(6, 3, 20, 0.92);
  border-radius: 16px;
  padding: 24px 28px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.card h2 {
  margin-top: 0;
  margin-bottom: 8px;
  font-size: 1.2rem;
}

.card p {
  margin: 4px 0;
  line-height: 1.5;
}

.small {
  font-size: 0.85rem;
  opacity: 0.85;
}

#menu-screen {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px 0;
}

.file-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 16px 0;
  font-size: 0.95rem;
}

.file-label span {
  opacity: 0.9;
}

.file-label input[type="file"] {
  padding: 6px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(5, 3, 18, 0.9);
  color: inherit;
  font-size: 0.9rem;
}

button {
  appearance: none;
  border: none;
  border-radius: 999px;
  padding: 10px 20px;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  background: linear-gradient(135deg, #ff66aa, #ff9a66);
  color: #140417;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
  transition: transform 0.1s ease, box-shadow 0.1s ease, filter 0.15s ease;
}

button:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow: 0 16px 35px rgba(0, 0, 0, 0.7);
}

button:active {
  transform: translateY(1px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.8);
}

button:disabled {
  opacity: 0.4;
  cursor: default;
  transform: none;
  box-shadow: none;
}

kbd {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 0.9em;
  background: rgba(0, 0, 0, 0.35);
}

/* Game screen */

#game-screen {
  position: relative;
}

#game-canvas {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 18px;
  background: #05030b;
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.9);
}

/* HUD overlay */

#hud {
  position: absolute;
  top: 12px;
  left: 24px;
  display: flex;
  gap: 18px;
  font-weight: 600;
  text-shadow: 0 0 6px rgba(0, 0, 0, 0.8);
  pointer-events: none;
}

.hud-item {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.9rem;
}

/* Results overlay */

#results-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background: radial-gradient(
    circle at center,
    rgba(0, 0, 0, 0.15),
    rgba(0, 0, 0, 0.9)
  );
}

/* Responsive tweaks */

@media (max-width: 768px) {
  #app {
    padding: 12px;
  }

  .card {
    max-width: 100%;
    padding: 20px 18px;
  }

  #hud {
    top: 8px;
    left: 12px;
    gap: 10px;
  }

  .top-bar {
    flex-direction: column;
    gap: 4px;
  }

  .top-bar h1 {
    font-size: 1.1rem;
  }
}
