* {
  box-sizing: border-box;
}

:root {
  color-scheme: dark;

  --bg: #0d1117;
  --panel: #0b1016;
  --titlebar: #161b22;
  --border: #30363d;

  --text: #e6edf3;
  --muted: #8b949e;

  --green: #3fb950;
  --green-bright: #56d364;
  --blue: #58a6ff;
}

html,
body {
  min-height: 100%;
  margin: 0;

  background:
    radial-gradient(circle at 50% -10%, rgba(63, 185, 80, 0.065), transparent 36%),
    var(--bg);

  color: var(--text);
}

body {
  min-height: 100vh;

  font-family:
    "SFMono-Regular",
    Consolas,
    "Liberation Mono",
    Menlo,
    monospace;
}

button {
  font: inherit;
}

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

.pong-window {
  overflow: hidden;

  background: #090e13;

  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;
}

.pong-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);
}

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

.pong-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);
}

.pong-console {
  padding: 20px;

  background:
    linear-gradient(rgba(7, 11, 15, 0.95), rgba(7, 11, 15, 0.95)),
    repeating-linear-gradient(
      0deg,
      transparent 0 25px,
      rgba(255, 255, 255, 0.012) 25px 26px
    );
}

.console-banner {
  margin-bottom: 14px;

  color: #c9d1d9;

  font-size: 0.8rem;
}

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

.game-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;

  margin-bottom: 12px;
}

.scoreboard {
  display: flex;
  gap: 24px;

  color: #9aa4af;

  font-size: 0.8rem;
}

.scoreboard strong {
  color: var(--green-bright);
  font-size: 1rem;
}

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

.toolbar-actions button,
.mobile-controls button {
  min-height: 42px;

  padding: 8px 13px;

  color: #d8dee4;
  background: #121920;

  border: 1px solid var(--border);
  border-radius: 7px;

  cursor: pointer;
}

.toolbar-actions button:hover,
.toolbar-actions button:focus-visible,
.mobile-controls button:hover,
.mobile-controls button:focus-visible {
  color: white;
  border-color: var(--green);
  outline: none;
}

.game-stage {
  position: relative;

  overflow: hidden;

  width: 100%;
  aspect-ratio: 16 / 9;

  background: #020503;

  border: 1px solid #28302e;
  border-radius: 9px;
}

#pong-canvas {
  width: 100%;
  height: 100%;

  display: block;

  background:
    radial-gradient(circle at center, rgba(63, 185, 80, 0.025), transparent 58%),
    #020503;
}

.game-message {
  position: absolute;
  inset: 0;

  display: grid;
  place-items: center;

  padding: 20px;

  color: #d7f7df;

  font-size: clamp(0.9rem, 2vw, 1.35rem);
  font-weight: 700;
  text-align: center;

  pointer-events: none;

  text-shadow: 0 0 14px rgba(63, 185, 80, 0.35);
}

.game-message.hidden {
  display: none;
}

.mobile-controls {
  display: none;
  grid-template-columns: 1fr 1.4fr 1fr;
  gap: 10px;

  margin-top: 12px;
}

.console-help {
  display: flex;
  justify-content: center;
  gap: 22px;
  flex-wrap: wrap;

  margin-top: 13px;

  color: #68717b;

  font-size: 0.68rem;
}

.pong-note {
  margin: 12px 0 0;

  color: #6e7681;

  font-size: 0.7rem;
  text-align: center;
}

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

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

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

  .pong-console {
    padding: 12px;
  }

  .mobile-controls {
    display: grid;
  }

  .console-help {
    gap: 10px 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
}


/* RunsLinux shared Labs workstation shell */
@media (min-width: 901px) {
  html, body { width: 100%; height: 100%; overflow: hidden; }
  body.rl-has-site-nav { background: #080d13; }
  .pong-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;
  }
  .pong-shell > .pong-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;
  }
  .pong-shell > :not(.pong-window) { display: none !important; }
}

/* Workstation fit pass v1.1: fit the complete Pong court inside the monitor. */
@media (min-width: 901px) {
  .pong-shell > .pong-window { overflow: hidden !important; display: flex !important; flex-direction: column !important; }
  .pong-titlebar { flex: 0 0 42px !important; height: 42px !important; }
  .pong-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-banner { margin-bottom: 6px !important; font-size: .68rem !important; }
  .game-toolbar { flex: 0 0 auto !important; margin-bottom: 6px !important; }
  .game-stage { flex: 1 1 auto !important; min-height: 0 !important; height: auto !important; aspect-ratio: auto !important; }
  #pong-canvas { width: 100% !important; height: 100% !important; }
  .console-help, .pong-note { display: none !important; }
}
