:root {
  --accent: #0000ff;
  --ink: #e9f1ff;
  --muted: #70809d;
  --line: #1c2b47;
  background: #030711;
  color: var(--ink);
}


.noselect {
  -webkit-touch-callout: none; /* iOS Safari */
    -webkit-user-select: none; /* Safari */
     -khtml-user-select: none; /* Konqueror HTML */
       -moz-user-select: none; /* Old versions of Firefox */
        -ms-user-select: none; /* Internet Explorer/Edge */
            user-select: none; /* Non-prefixed version, currently
                                  supported by Chrome, Edge, Opera and Firefox */
}

.controls,
.controls button {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(
    circle at 50% -20%,
    #15294b,
    #07101f 37%,
    #030711 70%
  );
  font-family: ui-monospace, Consolas, monospace;
}

.shell {
  width: min(1060px, calc(100% - 32px));
  margin: auto;
  padding: 28px 0 40px;
}

header,
footer,
.hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

header {
  margin-bottom: 18px;
}

h1 {
  font: 800 clamp(2rem, 7vw, 4.5rem) / 0.8 Arial, sans-serif;
  letter-spacing: -0.07em;
  margin: 6px 0 0;
}

h1 span {
  color: #7cf7d4;
}

.eyebrow,
small {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.16em;
  margin: 0;
}

button {
  cursor: pointer;
  font-family: inherit;
  touch-action: none;
}

.game-card {
  border: 1px solid color-mix(in srgb, var(--accent) 35%, #1c2b47);
  background: #07101f;
  box-shadow: 0 0 60px color-mix(in srgb, var(--accent) 10%, transparent);
  padding: 12px;
}

.hud {
  padding: 10px 10px 18px;
}

.hud > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hud strong {
  font-size: 15px;
  color: var(--accent);
}

.stage {
  text-align: center;
}

.screen {
  position: relative;
  border: 1px solid var(--line);
  overflow: hidden;
  background: #030711;
  aspect-ratio: 10/7;
}

canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  z-index: 2;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #030711b8;
  backdrop-filter: blur(2px);
}

.overlay.hidden {
  display: none;
}

.overlay p {
  font: bold clamp(18px, 4vw, 34px) Arial, sans-serif;
}

.overlay button {
  background: var(--accent);
  border: 0;
  padding: 14px 26px;
  font-weight: bold;
  margin-bottom: 16px;
}

.header-actions {
  display: flex;
  gap: 8px;
}

#pause,
#sound,
footer button {
  color: var(--ink);
  background: #091328;
  border: 1px solid var(--line);
  padding: 10px 14px;
}

#pause:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

#pause:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.controls {
  display: none;
  gap: 8px;
  padding-top: 10px;
}

.controls button {
  flex: 1;
  border: 1px solid var(--line);
  background: #0d1930;
  color: var(--ink);
  padding: 14px;
  font-weight: bold;
  touch-action: none;
}

.controls .fire {
  background: var(--accent);
  color: #030711;
}

footer {
  gap: 24px;
  padding: 18px 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
  border-bottom: 1px solid var(--line);
}

footer b {
  color: var(--ink);
}

footer div {
  display: flex;
}

footer button.active {
  color: var(--accent);
  border-color: var(--accent);
}

@media (max-width: 680px) {
  .shell {
    width: calc(100% - 18px);
    padding-top: 16px;
  }
  .controls {
    display: flex;
  }
  .hud strong {
    font-size: 11px;
  }
  footer {
    align-items: flex-start;
    flex-direction: column;
  }
  .overlay small {
    font-size: 8px;
  }
}

.maga {
    color: #ff0000;
}

.invaders {
    color: #0000ff;
}
