.games-intro {
  padding: 64px 0 32px;
  background: radial-gradient(circle at 50% 0%, var(--lighter-background), var(--background) 70%);
}

.games-intro h1 {
  font-size: 2.5rem;
  color: var(--foreground);
}

.games-intro .tagline {
  margin-top: 8px;
  color: var(--cyan);
  font-size: 1.1rem;
}

.game-room {
  padding: 16px 0 80px;
}

.game-room-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
}

/* --- Console (old-school top-loader look) --- */

.console {
  --shell-light: #e4dfd0;
  --shell: #cdc7b6;
  --shell-dark: #a19b8a;
  --shell-deck: #4a473e;
  --shell-ink: #2c2a24;
  --accent-maroon: #7c1f2b;

  width: 100%;
  max-width: 760px;
  background: linear-gradient(180deg, var(--shell-light) 0%, var(--shell) 55%, var(--shell-dark) 100%);
  border: 1px solid #8a8474;
  border-radius: 16px 16px 30px 30px;
  padding: 18px 24px 22px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  position: relative;
}

.console::before {
  /* maroon accent band, classic top-loader trim */
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 54px;
  height: 8px;
  background: linear-gradient(180deg, var(--accent-maroon), #591620);
}

.console-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.console-brand {
  font-family: monospace;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  color: var(--shell-ink);
}

.console-brand em {
  font-style: normal;
  font-weight: 400;
  font-size: 0.6rem;
  color: #5b5646;
  letter-spacing: 0.12em;
  margin-left: 6px;
}

.console-led {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #5c1219;
  box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.6);
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.console.powered-on .console-led {
  background: #ff4136;
  box-shadow: 0 0 8px 2px rgba(255, 65, 54, 0.7), inset 0 0 2px rgba(0, 0, 0, 0.3);
}

.console-vents {
  position: absolute;
  top: 24px;
  right: 28px;
  width: 60px;
  height: 10px;
  background: repeating-linear-gradient(
    90deg,
    var(--shell-dark) 0,
    var(--shell-dark) 3px,
    transparent 3px,
    transparent 8px
  );
  opacity: 0.7;
}

.console-slot {
  height: 30px;
  margin: 22px auto 18px;
  max-width: 440px;
  background: linear-gradient(180deg, #3a382f, #1c1a16);
  border-radius: 4px;
  border: 1px solid #171510;
  box-shadow: inset 0 4px 8px rgba(0, 0, 0, 0.6), 0 1px 0 rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: box-shadow 0.15s ease, background 0.15s ease;
  color: #cfc9b8;
  font-family: monospace;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.console-slot .slot-opening {
  width: 46px;
  height: 4px;
  background: #030302;
  border-radius: 2px;
}

.console-slot.slot-hover {
  box-shadow: inset 0 4px 8px rgba(0, 0, 0, 0.6), 0 0 0 2px var(--accent), 0 1px 0 rgba(255, 255, 255, 0.3);
  color: var(--accent, #faa968);
}

.console-screen {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 2;
  background: #020c17;
  border-radius: 6px;
  border: 10px solid var(--shell-ink);
  box-shadow: inset 0 0 0 2px #000, inset 0 2px 12px rgba(0, 0, 0, 0.8);
  overflow: hidden;
}

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

#game-canvas:focus {
  outline: none;
}

.screen-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  font-family: monospace;
  letter-spacing: 0.1em;
}

.screen-placeholder p {
  margin: 0;
}

.screen-placeholder .hint {
  font-size: 0.75rem;
  color: var(--light-foreground);
  letter-spacing: 0.02em;
  text-transform: none;
}

.hud {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.hud #hud-title {
  color: var(--light-foreground);
  font-size: 0.7rem;
  font-family: monospace;
  letter-spacing: 0.08em;
  background: rgba(2, 12, 23, 0.6);
  padding: 3px 8px;
  border-radius: 4px;
}

#eject-btn {
  font: inherit;
  font-size: 0.75rem;
  padding: 5px 12px;
  border-radius: 6px;
  border: 1px solid var(--muted);
  background: var(--dark-background);
  color: var(--foreground);
  cursor: pointer;
}

#eject-btn:hover {
  border-color: var(--red);
  color: var(--red);
}

.console-controls {
  margin-top: 16px;
  text-align: center;
}

.console-buttons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 12px;
}

.console-btn {
  font-family: monospace;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #f0ece0;
  background: linear-gradient(180deg, #6b6a63, #38372f);
  border: 1px solid #24231d;
  border-radius: 999px;
  padding: 7px 18px;
  box-shadow: 0 2px 0 #1a1913, inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

button.console-btn {
  cursor: pointer;
}

button.console-btn:hover {
  filter: brightness(1.15);
}

button.console-btn:active {
  box-shadow: 0 0 0 #1a1913, inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transform: translateY(2px);
}

.console-btn-power {
  background: linear-gradient(180deg, #8a232f, #5c1219);
}

.console-controls p {
  color: var(--shell-ink, #2c2a24);
  font-size: 0.8rem;
  opacity: 0.85;
}

/* --- Cartridge shelf --- */

.cartridge-shelf {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: center;
}

.cartridge {
  --cart-shell: #d6d1c2;
  --cart-shell-dark: #a6a190;

  width: 116px;
  height: 148px;
  cursor: grab;
  position: relative;
  margin-top: 10px;
  background: linear-gradient(180deg, var(--cart-shell), var(--cart-shell-dark));
  border: 1px solid #78735f;
  border-radius: 5px 5px 9px 9px;
  padding: 10px 9px 16px;
  display: flex;
  align-items: stretch;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.5), inset 0 -2px 0 rgba(0, 0, 0, 0.2), 0 6px 14px rgba(0, 0, 0, 0.3);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.cartridge::before {
  /* thumb notch */
  content: "";
  position: absolute;
  top: -9px;
  left: 50%;
  transform: translateX(-50%);
  width: 34px;
  height: 10px;
  background: var(--cart-shell-dark);
  border-radius: 4px 4px 0 0;
  border: 1px solid #78735f;
  border-bottom: none;
}

.cartridge::after {
  /* connector ridges */
  content: "";
  position: absolute;
  left: 9px;
  right: 9px;
  bottom: 6px;
  height: 10px;
  border-radius: 0 0 3px 3px;
  background: repeating-linear-gradient(90deg, #45423a 0 3px, #58544a 3px 6px);
}

.cartridge:hover {
  transform: translateY(-4px);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.5), inset 0 -2px 0 rgba(0, 0, 0, 0.2), 0 12px 22px rgba(0, 0, 0, 0.4);
}

.cartridge:active,
.cartridge.dragging {
  cursor: grabbing;
  opacity: 0.7;
}

.cartridge:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.cartridge-label {
  width: 100%;
  border-radius: 3px;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-align: center;
  border: 3px solid var(--label-border, var(--teal));
  background: #f4efe0;
}

.cartridge-title {
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  color: #211f1a;
  line-height: 1.15;
}

.cartridge-sub {
  font-size: 0.55rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #6b6656;
}

.cartridge-asteroids {
  --label-border: var(--green);
}

.cartridge-coolcars {
  --label-border: var(--red);
}
