* {
  box-sizing: border-box;
}

:root {
  color-scheme: dark;
  --bg: #0d1117;
  --panel: #090e13;
  --titlebar: #161b22;
  --border: #30363d;
  --text: #e6edf3;
  --muted: #8b949e;
  --green: #3fb950;
  --green-bright: #56d364;
  --blue: #58a6ff;
  --yellow: #e3b341;
  --red: #f85149;
  --cyan: #39c5cf;
}

html,
body {
  min-height: 100%;
  margin: 0;
  background:
    radial-gradient(circle at 50% -10%, rgba(63, 185, 80, 0.06), transparent 34%),
    var(--bg);
  color: var(--text);
}

body {
  min-height: 100vh;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

button {
  font: inherit;
}

.asteroids-shell {
  width: min(1320px, calc(100% - 32px));
  margin: 0 auto;
  padding: 30px 0 24px;
}

.asteroids-window {
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow:
    0 30px 90px rgba(0, 0, 0, 0.42),
    0 0 0 1px rgba(255, 255, 255, 0.015) inset;
}

.asteroids-titlebar {
  height: 48px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  background: var(--titlebar);
  border-bottom: 1px solid #252d36;
}

.window-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}

.window-dot {
  width: 12px;
  height: 12px;
  display: inline-block;
  border: 0;
  border-radius: 50%;
}

a.window-dot {
  text-decoration: none;
  cursor: pointer;
}

.window-dot.red { background: #ff5f57; }
.window-dot.yellow { background: #febc2e; }
.window-dot.green { background: #28c840; }

a.window-dot.red:hover,
a.window-dot.red:focus-visible {
  outline: 2px solid rgba(255, 95, 87, 0.35);
  outline-offset: 3px;
  transform: scale(1.08);
}

.asteroids-title {
  color: #9aa4af;
  font-size: 0.78rem;
  text-align: center;
}

.asteroids-status {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--green);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px rgba(63, 185, 80, 0.45);
}

.asteroids-console {
  padding: 18px;
  background:
    linear-gradient(rgba(5, 9, 13, 0.97), rgba(5, 9, 13, 0.97)),
    repeating-linear-gradient(
      0deg,
      transparent 0 25px,
      rgba(255, 255, 255, 0.012) 25px 26px
    );
}

.console-command {
  margin-bottom: 12px;
  color: #c9d1d9;
  font-size: 0.8rem;
}

.prompt {
  color: var(--green);
}

.hud {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
  color: #78828d;
}

.hud div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  background: #0e151c;
  border: 1px solid #222b34;
  border-radius: 7px;
  font-size: 0.72rem;
}

.hud strong {
  color: #d8e0e7;
}

.stage-wrap {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #020503;
  border: 1px solid #29322f;
  border-radius: 9px;
}

#asteroids-canvas {
  width: 100%;
  height: 100%;
  display: block;
  background: #020503;
}

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(2, 5, 3, 0.45);
}

.overlay.hidden {
  display: none;
}

.overlay-panel {
  min-width: min(360px, 86%);
  padding: 24px;
  background: rgba(8, 13, 10, 0.92);
  border: 1px solid #2d3b32;
  border-radius: 10px;
  text-align: center;
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.35);
}

.overlay-title {
  margin-bottom: 12px;
  color: var(--green-bright);
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.overlay-copy {
  color: #aeb7c0;
  font-size: 0.8rem;
  line-height: 1.7;
}

.overlay-panel button {
  margin-top: 18px;
  min-height: 42px;
  padding: 9px 15px;
  color: #d9ffe1;
  background: rgba(63, 185, 80, 0.1);
  border: 1px solid #2f6b3e;
  border-radius: 7px;
  cursor: pointer;
}

.mobile-controls {
  display: none;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 12px;
}

.mobile-controls button {
  min-height: 46px;
  color: #d8dee4;
  background: #111820;
  border: 1px solid #30363d;
  border-radius: 7px;
  cursor: pointer;
}

.console-strip {
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 12px;
  color: #66717c;
  font-size: 0.68rem;
}

.console-strip a {
  color: #66717c;
  text-decoration: none;
}

.status-line {
  margin-top: 10px;
  color: #7d8791;
  font-size: 0.7rem;
  text-align: center;
}

.game-note {
  margin: 12px 0 0;
  color: #6e7681;
  font-size: 0.7rem;
  line-height: 1.5;
  text-align: center;
}

@media (max-width: 700px) {
  .asteroids-shell {
    width: min(100% - 18px, 1320px);
    padding-top: 12px;
  }

  .asteroids-titlebar {
    padding: 0 10px;
  }

  .asteroids-title {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .asteroids-console {
    padding: 11px;
  }

  .hud {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mobile-controls {
    display: grid;
  }

  .console-strip {
    gap: 8px 14px;
  }
}


/* RunsLinux shared Labs workstation shell */
@media (min-width: 901px) {
  html, body { width: 100%; height: 100%; overflow: hidden; }
  body.rl-has-site-nav { background: #080d13; }
  .asteroids-shell {
    position: relative !important;
    width: 100vw !important;
    max-width: none !important;
    height: calc(100vh - 54px) !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    background: url('/assets/terminal-workstation.webp') center top / cover no-repeat !important;
  }
  .asteroids-shell > .asteroids-window {
    position: absolute !important;
    left: 19.65% !important;
    top: 5.75% !important;
    width: 62.75% !important;
    height: 60.45% !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 !important;
    overflow: auto !important;
    border-radius: 10px !important;
    z-index: 3 !important;
    box-shadow: none !important;
  }
  .asteroids-shell > :not(.asteroids-window) { display: none !important; }
}

/* Workstation fit pass v1.1: fit the complete Asteroids playfield inside the monitor. */
@media (min-width: 901px) {
  .asteroids-shell > .asteroids-window { overflow: hidden !important; display: flex !important; flex-direction: column !important; }
  .asteroids-titlebar { flex: 0 0 42px !important; height: 42px !important; }
  .asteroids-console { flex: 1 1 auto !important; min-height: 0 !important; height: auto !important; overflow: hidden !important; display: flex !important; flex-direction: column !important; padding: 8px 10px 10px !important; }
  .console-command { margin-bottom: 6px !important; font-size: .68rem !important; }
  .hud { flex: 0 0 auto !important; margin-bottom: 6px !important; gap: 6px !important; }
  .hud div { padding: 5px 7px !important; font-size: .64rem !important; }
  .stage-wrap { flex: 1 1 auto !important; min-height: 0 !important; height: auto !important; aspect-ratio: auto !important; }
  #asteroids-canvas { width: 100% !important; height: 100% !important; }
  .console-strip, .status-line, .game-note { display: none !important; }
}
