/* ═══════════════════════════════════════════════════════════════════════════
   ROUGE AI — styles.css
   happystoner5420 Games
   Photorealistic AAA-Quality UI — Windows 11 Takeover Aesthetic
═══════════════════════════════════════════════════════════════════════════ */

/* ─── CUSTOM PROPERTIES ─────────────────────────────────────────────────── */
:root {
  --bg:           #0a0a0f;
  --surface:      #111118;
  --surface-2:    #16161f;
  --surface-3:    #1e1e28;
  --border:       rgba(255,255,255,0.07);
  --border-bright:rgba(255,255,255,0.14);

  --nexus:        #00ffcc;
  --nexus-dim:    rgba(0,255,204,0.15);
  --nexus-glow:   rgba(0,255,204,0.4);

  --chaos:        #ff2a2a;
  --chaos-dim:    rgba(255,42,42,0.15);
  --chaos-glow:   rgba(255,42,42,0.4);

  --oracle:       #cc88ff;
  --oracle-dim:   rgba(204,136,255,0.15);
  --oracle-glow:  rgba(204,136,255,0.4);

  --text:         #e8e8e8;
  --text-muted:   #888;
  --text-faint:   #444;

  --win-chrome:   #202020;
  --win-frame:    #2c2c2c;

  --taskbar-h:    48px;
  --ticker-h:     32px;
  --sidebar-w:    260px;
  --radius:       8px;
}

/* ─── RESET & BASE ───────────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  user-select: none;
}

/* Scrollbar — dark theme */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(0,0,0,0.4);
}
::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.12);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.22);
}

/* ─── KEYFRAME ANIMATIONS ────────────────────────────────────────────────── */

/* Glitch — text skew + color shift + clip-path slices */
@keyframes glitch {
  0%   { transform: none; text-shadow: 3px 0 #ff2a2a, -3px 0 #00ffcc; clip-path: none; }
  2%   { transform: skewX(-3deg) translateX(2px); text-shadow: 5px 0 #ff2a2a, -5px 0 #00ffcc; clip-path: polygon(0 15%, 100% 15%, 100% 30%, 0 30%); }
  4%   { transform: skewX(2deg) translateX(-2px); text-shadow: -4px 0 #ff2a2a, 4px 0 #00ffcc; clip-path: polygon(0 60%, 100% 60%, 100% 75%, 0 75%); }
  6%   { transform: none; clip-path: none; text-shadow: 3px 0 #ff2a2a, -3px 0 #00ffcc; }
  8%   { transform: skewX(-1deg); text-shadow: 2px 0 #ff2a2a, -2px 0 #00ffcc; clip-path: polygon(0 5%, 100% 5%, 100% 10%, 0 10%); }
  10%  { transform: none; clip-path: none; }
  92%  { transform: none; text-shadow: 3px 0 #ff2a2a, -3px 0 #00ffcc; clip-path: none; }
  94%  { transform: skewX(4deg) translateX(-3px); text-shadow: 6px 0 #ff2a2a, -6px 0 #00ffcc; clip-path: polygon(0 40%, 100% 40%, 100% 55%, 0 55%); }
  96%  { transform: skewX(-3deg) translateX(3px); clip-path: polygon(0 10%, 100% 10%, 100% 20%, 0 20%); }
  98%  { transform: none; text-shadow: 3px 0 #ff2a2a, -3px 0 #00ffcc; clip-path: none; }
  100% { transform: none; text-shadow: 3px 0 #ff2a2a, -3px 0 #00ffcc; clip-path: none; }
}

/* Scanline overlay drift */
@keyframes scanlines {
  0%   { background-position: 0 0; }
  100% { background-position: 0 8px; }
}

/* NPC avatar edge flicker */
@keyframes flicker {
  0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% { opacity: 0.38; filter: brightness(1) saturate(1); }
  20%  { opacity: 0.12; filter: brightness(0.5) saturate(0); }
  22%  { opacity: 0.44; filter: brightness(1.2); }
  24%  { opacity: 0.2;  filter: brightness(0.7); }
  55%  { opacity: 0.15; filter: brightness(0.4); }
}

/* NPC status badge pulse */
@keyframes pulse-glow {
  0%, 100% { opacity: 1;   box-shadow: 0 0 4px currentColor; }
  50%       { opacity: 0.6; box-shadow: 0 0 10px currentColor, 0 0 20px currentColor; }
}

/* Activity ticker left-scroll */
@keyframes ticker-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* Chat message slide-in */
@keyframes npc-enter {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Blinking cursor */
@keyframes blink-cursor {
  0%, 49%  { opacity: 1; }
  50%, 100%{ opacity: 0; }
}

/* Subtle vertical float for menu avatars */
@keyframes float-y {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-12px); }
}

/* Menu bg grid drift */
@keyframes grid-drift {
  0%   { background-position: 0 0; }
  100% { background-position: 60px 60px; }
}

/* Red warning pulse */
@keyframes warn-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

/* Win title bar glitch shimmer */
@keyframes titlebar-shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ─── UTILITY CLASSES ────────────────────────────────────────────────────── */
.hidden { display: none !important; }

.glow-cyan {
  text-shadow:
    0 0 6px var(--nexus),
    0 0 14px var(--nexus),
    0 0 28px rgba(0,255,204,0.4);
}
.glow-red {
  text-shadow:
    0 0 6px var(--chaos),
    0 0 14px var(--chaos),
    0 0 28px rgba(255,42,42,0.4);
}
.glow-purple {
  text-shadow:
    0 0 6px var(--oracle),
    0 0 14px var(--oracle),
    0 0 28px rgba(204,136,255,0.4);
}

.monospace { font-family: 'Courier New', monospace; }

.c-nexus  { color: var(--nexus); }
.c-chaos  { color: var(--chaos); }
.c-oracle { color: var(--oracle); }

.blink-cursor { animation: blink-cursor 1s step-end infinite; }

/* ═══════════════════════════════════════════════════════════════════════════
   MAIN MENU — #screen-menu
═══════════════════════════════════════════════════════════════════════════ */
#screen-menu {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;

  /* Dark base + animated circuit grid */
  background-color: var(--bg);
  background-image:
    /* Radial vignette */
    radial-gradient(ellipse 120% 80% at 50% 50%, rgba(255,42,42,0.04) 0%, transparent 70%),
    /* Horizontal grid lines */
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 59px,
      rgba(255,42,42,0.05) 59px,
      rgba(255,42,42,0.05) 60px
    ),
    /* Vertical grid lines */
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 59px,
      rgba(0,255,204,0.04) 59px,
      rgba(0,255,204,0.04) 60px
    );
  animation: grid-drift 8s linear infinite;
  z-index: 0;
}

/* Scanline overlay */
.scanline-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.18) 2px,
    rgba(0,0,0,0.18) 4px
  );
  animation: scanlines 0.12s steps(1, end) infinite;
}

/* Menu vignette corners */
.menu-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background: radial-gradient(ellipse 100% 100% at 50% 50%, transparent 40%, rgba(0,0,0,0.75) 100%);
}

/* ── NPC edge avatars ── */
.menu-npc-avatar {
  position: absolute;
  width: 150px;
  z-index: 3;
  animation: flicker 4s ease-in-out infinite, float-y 6s ease-in-out infinite;
  filter: saturate(0.6) brightness(0.7);
}
.menu-npc-avatar img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 4px;
  display: block;
}
.menu-npc-avatar .npc-avatar-placeholder {
  width: 150px;
  height: 200px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  font-weight: 900;
  color: rgba(255,255,255,0.6);
}

.menu-npc-left-top {
  left: -30px;
  top: 8%;
  animation-duration: 3.7s, 7s;
  animation-delay: 0s, 0.3s;
  transform-origin: left center;
  mask-image: linear-gradient(to right, transparent, black 40%, black 80%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 40%, black 80%, transparent);
}
.menu-npc-left-bottom {
  left: -20px;
  bottom: 14%;
  animation-duration: 5.1s, 8s;
  animation-delay: 0.8s, 1.2s;
  mask-image: linear-gradient(to right, transparent, black 35%, black 85%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 35%, black 85%, transparent);
}
.menu-npc-right-mid {
  right: -30px;
  top: 30%;
  animation-duration: 4.4s, 6.5s;
  animation-delay: 0.4s, 0.7s;
  mask-image: linear-gradient(to left, transparent, black 40%, black 80%, transparent);
  -webkit-mask-image: linear-gradient(to left, transparent, black 40%, black 80%, transparent);
}

/* ── Menu center ── */
.menu-center {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  width: 100%;
  max-width: 480px;
  padding: 0 24px;
}

/* ── Title block ── */
.menu-title-block {
  text-align: center;
}

.menu-eyebrow {
  font-size: 0.65rem;
  letter-spacing: 0.35em;
  color: var(--text-muted);
  margin-bottom: 10px;
  text-transform: uppercase;
}

#menu-title {
  font-size: clamp(3rem, 8vw, 5rem);
  font-weight: 900;
  color: var(--chaos);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  line-height: 1;
  position: relative;
  animation: glitch 4s steps(1, end) infinite;

  /* Deep multi-layer glow */
  text-shadow:
    0 0 8px  rgba(255,42,42,0.9),
    0 0 20px rgba(255,42,42,0.6),
    0 0 50px rgba(255,42,42,0.3),
    3px 0   rgba(0,255,204,0.5),
    -3px 0  rgba(255,42,42,0.5);
}

/* Pseudo glitch layers */
#menu-title::before,
#menu-title::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  pointer-events: none;
}
#menu-title::before {
  color: var(--nexus);
  clip-path: polygon(0 20%, 100% 20%, 100% 40%, 0 40%);
  transform: translateX(3px);
  opacity: 0;
  animation: glitch 4s steps(1, end) infinite;
  animation-delay: 0.05s;
}
#menu-title::after {
  color: var(--chaos);
  clip-path: polygon(0 60%, 100% 60%, 100% 80%, 0 80%);
  transform: translateX(-3px);
  opacity: 0;
  animation: glitch 4s steps(1, end) infinite;
  animation-delay: 0.1s;
}

.menu-subtitle {
  font-size: 0.85rem;
  letter-spacing: 0.3em;
  color: var(--chaos);
  margin-top: 8px;
  opacity: 0.8;
  font-weight: 600;
  text-transform: uppercase;
  animation: warn-pulse 2.5s ease-in-out infinite;
}

.menu-divider {
  width: 200px;
  height: 1px;
  margin: 16px auto 0;
  background: linear-gradient(
    90deg,
    transparent,
    var(--chaos) 30%,
    var(--chaos) 70%,
    transparent
  );
  box-shadow: 0 0 8px var(--chaos);
}

/* ── Navigation buttons ── */
.menu-nav {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  align-items: center;
}

.menu-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 360px;
  height: 56px;
  padding: 0 24px;
  background: transparent;
  border-radius: 6px;
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.18s ease;
}

/* Shimmer pseudo on hover */
.menu-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    105deg,
    transparent,
    rgba(255,255,255,0.06),
    transparent
  );
  transition: left 0.4s ease;
}
.menu-btn:hover::before { left: 160%; }

.btn-icon {
  font-size: 1.1rem;
  width: 20px;
  text-align: center;
}

/* CONTINUE — cyan */
.menu-btn-continue {
  border: 2px solid var(--nexus);
  color: var(--nexus);
}
.menu-btn-continue:hover,
.menu-btn-continue:focus-visible {
  background: rgba(0,255,204,0.1);
  box-shadow:
    0 0 12px var(--nexus-glow),
    0 0 30px rgba(0,255,204,0.2),
    inset 0 0 12px rgba(0,255,204,0.05);
  color: #fff;
  border-color: #fff;
  transform: translateX(3px);
}

/* HOW TO PLAY / CREDITS — purple */
.menu-btn-howtoplay,
.menu-btn-credits {
  border: 2px solid var(--oracle);
  color: var(--oracle);
}
.menu-btn-howtoplay:hover,
.menu-btn-howtoplay:focus-visible,
.menu-btn-credits:hover,
.menu-btn-credits:focus-visible {
  background: rgba(204,136,255,0.1);
  box-shadow:
    0 0 12px var(--oracle-glow),
    0 0 30px rgba(204,136,255,0.2),
    inset 0 0 12px rgba(204,136,255,0.05);
  color: #fff;
  border-color: #ddb8ff;
  transform: translateX(3px);
}

/* EXIT — red */
.menu-btn-exit {
  border: 2px solid var(--chaos);
  color: var(--chaos);
}
.menu-btn-exit:hover,
.menu-btn-exit:focus-visible {
  background: rgba(255,42,42,0.1);
  box-shadow:
    0 0 12px var(--chaos-glow),
    0 0 30px rgba(255,42,42,0.2),
    inset 0 0 12px rgba(255,42,42,0.05);
  color: #fff;
  border-color: #ff6666;
  transform: translateX(3px);
}

/* ── Menu footer ── */
.menu-footer {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  color: var(--text-faint);
  white-space: nowrap;
}
.menu-footer-text { color: var(--text-muted); font-weight: 600; }
.menu-footer-sep  { color: var(--text-faint); }
.menu-footer-version { color: var(--text-faint); }

/* ── Corner decorations ── */
.corner-deco {
  position: absolute;
  z-index: 4;
  width: 40px;
  height: 40px;
  pointer-events: none;
}
.corner-tl { top: 16px; left: 16px; border-top: 2px solid var(--chaos); border-left: 2px solid var(--chaos); }
.corner-tr { top: 16px; right: 16px; border-top: 2px solid var(--chaos); border-right: 2px solid var(--chaos); }
.corner-bl { bottom: 16px; left: 16px; border-bottom: 2px solid var(--chaos); border-left: 2px solid var(--chaos); }
.corner-br { bottom: 16px; right: 16px; border-bottom: 2px solid var(--chaos); border-right: 2px solid var(--chaos); }

/* ═══════════════════════════════════════════════════════════════════════════
   MODALS
═══════════════════════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.88);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: 24px;
}

.modal-box {
  position: relative;
  background:
    linear-gradient(145deg, var(--surface-2) 0%, var(--surface) 100%);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  padding: 36px 40px 32px;
  width: 100%;
  max-width: 580px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.04),
    0 4px 24px rgba(0,0,0,0.7),
    0 24px 80px rgba(0,0,0,0.6),
    0 0 60px rgba(255,42,42,0.06),
    inset 0 1px 0 rgba(255,255,255,0.06);
}

.modal-box-credits { max-width: 520px; }

.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 32px;
  height: 32px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 50%;
  color: var(--text-muted);
  font-size: 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  line-height: 1;
}
.modal-close:hover {
  background: rgba(255,42,42,0.15);
  border-color: var(--chaos);
  color: var(--chaos);
  box-shadow: 0 0 10px rgba(255,42,42,0.3);
}

.modal-title {
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.modal-divider {
  height: 1px;
  margin: 12px 0 20px;
  background: linear-gradient(
    90deg,
    var(--chaos) 0%,
    var(--oracle) 50%,
    transparent 100%
  );
  opacity: 0.5;
}

.modal-content {
  font-size: 0.875rem;
  line-height: 1.65;
  color: var(--text-muted);
}

/* ── How To Play content ── */
.htp-warning {
  font-family: 'Courier New', monospace;
  font-size: 0.75rem;
  color: var(--chaos);
  letter-spacing: 0.2em;
  text-align: center;
  padding: 8px 12px;
  border: 1px solid rgba(255,42,42,0.3);
  border-radius: 4px;
  margin-bottom: 20px;
  background: rgba(255,42,42,0.06);
  animation: warn-pulse 2s ease-in-out infinite;
}

.htp-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 24px;
}

.htp-list li {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.htp-bullet {
  font-family: 'Courier New', monospace;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--chaos);
  background: rgba(255,42,42,0.1);
  border: 1px solid rgba(255,42,42,0.3);
  border-radius: 3px;
  padding: 2px 6px;
  flex-shrink: 0;
  margin-top: 1px;
  letter-spacing: 0.05em;
}

.htp-text {
  color: var(--text);
  font-size: 0.855rem;
}
.htp-text code {
  font-family: 'Courier New', monospace;
  font-size: 0.78rem;
  color: var(--nexus);
  background: rgba(0,255,204,0.08);
  border: 1px solid rgba(0,255,204,0.2);
  border-radius: 3px;
  padding: 1px 5px;
}
.htp-text strong { color: var(--text); }
.htp-text em { color: var(--oracle); font-style: normal; }

.htp-final strong { color: var(--chaos); }

/* ── HTP section title ── */
.htp-section-title {
  font-size: 0.62rem;
  letter-spacing: 0.3em;
  color: var(--chaos);
  text-transform: uppercase;
  border-top: 1px solid rgba(255,42,42,0.2);
  padding-top: 18px;
  margin-top: 4px;
  margin-bottom: 14px;
}

/* ── Command groups ── */
.htp-cmd-group {
  margin-bottom: 18px;
}
.htp-cmd-group-label {
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  color: var(--text-muted);
  font-family: 'Courier New', monospace;
  margin-bottom: 8px;
  text-transform: uppercase;
}
.htp-cmd-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 5px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.htp-cmd-row:last-child { border-bottom: none; }
.htp-cmd {
  font-family: 'Courier New', monospace;
  font-size: 0.76rem;
  color: var(--nexus);
  background: rgba(0,255,204,0.07);
  border: 1px solid rgba(0,255,204,0.18);
  border-radius: 4px;
  padding: 2px 7px;
  white-space: nowrap;
  flex-shrink: 0;
}
.htp-cmd-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}
.htp-cmd-desc em { color: var(--oracle); font-style: normal; }

/* ── Games grid (full-width entries) ── */
.htp-games-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.htp-games-grid-full {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.htp-game-entry {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 5px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.htp-game-entry:last-child { border-bottom: none; }
.htp-game-tag {
  font-size: 0.75rem;
  padding: 3px 9px;
  border: 1px solid var(--border-bright);
  border-radius: 99px;
  color: var(--text-muted);
  background: rgba(255,255,255,0.03);
  white-space: nowrap;
  flex-shrink: 0;
}
.htp-game-ctrl {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: 'Courier New', monospace;
}

/* ── Note at the bottom ── */
.htp-note {
  margin-top: 16px;
  padding: 10px 14px;
  background: rgba(0,255,204,0.05);
  border: 1px solid rgba(0,255,204,0.15);
  border-radius: 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.5;
}
.htp-note strong { color: var(--nexus); }

/* ── Credits content ── */
.credits-studio {
  text-align: center;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.credits-studio-name {
  font-size: 1.3rem;
  font-weight: 900;
  letter-spacing: 0.15em;
  color: var(--text);
  text-shadow:
    0 0 10px rgba(0,255,204,0.3),
    0 0 30px rgba(0,255,204,0.1);
}
.credits-studio-tagline {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 4px;
  letter-spacing: 0.1em;
  font-style: italic;
}

.credits-section {
  margin-bottom: 18px;
}
.credits-section-title {
  font-size: 0.6rem;
  letter-spacing: 0.3em;
  color: var(--text-faint);
  text-transform: uppercase;
  margin-bottom: 6px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  padding-bottom: 4px;
}
.credits-entry {
  font-size: 0.875rem;
  color: var(--text-muted);
  padding: 2px 0;
}
.credits-dedication {
  color: var(--oracle);
  font-style: italic;
  font-size: 0.95rem;
}

.credits-cast {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.credits-cast-entry {
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.credits-cast-name {
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  min-width: 80px;
}
.credits-cast-role {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-style: italic;
}

.credits-legal {
  font-size: 0.65rem;
  color: var(--text-faint);
  text-align: center;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  line-height: 1.8;
}

/* ═══════════════════════════════════════════════════════════════════════════
   GAME SCREEN — #screen-game
═══════════════════════════════════════════════════════════════════════════ */
#screen-game {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  overflow: hidden;
}

/* ─── Activity Ticker ─── */
#activity-ticker {
  height: var(--ticker-h);
  min-height: var(--ticker-h);
  max-height: var(--ticker-h);
  background: #0d1117;
  border-bottom: 1px solid rgba(255,42,42,0.2);
  overflow: hidden;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  position: relative;
  z-index: 10;

  /* Fade edges */
  mask-image: linear-gradient(
    to right,
    transparent 0%,
    black 4%,
    black 96%,
    transparent 100%
  );
  -webkit-mask-image: linear-gradient(
    to right,
    transparent 0%,
    black 4%,
    black 96%,
    transparent 100%
  );
}

#ticker-track {
  display: flex;
  align-items: center;
  gap: 0;
  white-space: nowrap;
  animation: ticker-scroll 30s linear infinite;
  /* Double content in JS for seamless loop */
}

.ticker-label {
  font-family: 'Courier New', monospace;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--chaos);
  letter-spacing: 0.2em;
  padding: 0 20px 0 16px;
  text-shadow: 0 0 8px var(--chaos);
  background: rgba(255,42,42,0.08);
  height: var(--ticker-h);
  display: flex;
  align-items: center;
  border-right: 1px solid rgba(255,42,42,0.3);
  margin-right: 16px;
  flex-shrink: 0;
}

.ticker-item {
  font-family: 'Courier New', monospace;
  font-size: 0.72rem;
  color: rgba(255,42,42,0.9);
  padding: 0 4px;
}

.ticker-sep {
  color: rgba(255,42,42,0.4);
  padding: 0 16px;
  font-size: 0.7rem;
}

/* ─── Desktop area ─── */
#desktop {
  flex: 1;
  display: flex;
  flex-direction: row;
  overflow: hidden;
  position: relative;

  /* Circuit wallpaper using CSS gradients */
  background-color: #0c0c14;
  background-image:
    radial-gradient(ellipse 80% 60% at 50% 50%, rgba(0,255,204,0.02) 0%, transparent 70%),
    radial-gradient(ellipse 40% 40% at 20% 80%, rgba(255,42,42,0.03) 0%, transparent 60%),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 79px,
      rgba(0,255,204,0.025) 79px,
      rgba(0,255,204,0.025) 80px
    ),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 79px,
      rgba(0,255,204,0.02) 79px,
      rgba(0,255,204,0.02) 80px
    );
}

/* ─── NPC Sidebar ─── */
#npc-sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: rgba(13,13,20,0.97);
  border-right: 1px solid rgba(255,255,255,0.06);
  padding: 12px 10px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0;
  flex-shrink: 0;
  position: relative;
  z-index: 5;

  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: inset -1px 0 0 rgba(255,255,255,0.04);
}

.sidebar-label {
  font-family: 'Courier New', monospace;
  font-size: 0.58rem;
  letter-spacing: 0.22em;
  color: var(--text-faint);
  text-transform: uppercase;
  padding: 4px 2px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  margin-bottom: 10px;
}

/* ── World Domination Progress Bar ── */
.dom-progress-block {
  margin-bottom: 14px;
  padding: 10px 10px 8px;
  border: 1px solid rgba(255,42,42,0.25);
  border-radius: 4px;
  background: rgba(255,0,0,0.04);
  position: relative;
  overflow: hidden;
}
.dom-progress-block::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px; height: 100%;
  background: #ff2a2a;
  box-shadow: 0 0 8px #ff2a2a;
}
.dom-progress-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.dom-label-text {
  font-family: 'Courier New', monospace;
  font-size: 0.58rem;
  letter-spacing: 0.16em;
  color: #ff4444;
  text-transform: uppercase;
  font-weight: 700;
}
.dom-label-pct {
  font-family: 'Courier New', monospace;
  font-size: 0.7rem;
  font-weight: 900;
  color: #ff6666;
  letter-spacing: 0.05em;
  text-shadow: 0 0 8px rgba(255,42,42,0.7);
}
.dom-bar-track {
  width: 100%;
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 5px;
}
.dom-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #cc0000, #ff2a2a, #ff6600);
  border-radius: 3px;
  transition: width 1.2s ease;
  box-shadow: 0 0 6px rgba(255,42,42,0.7);
  position: relative;
}
.dom-bar-fill::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 6px; height: 100%;
  background: rgba(255,255,255,0.5);
  border-radius: 3px;
  animation: domPulse 1.4s ease-in-out infinite;
}
@keyframes domPulse {
  0%, 100% { opacity: 0.3; }
  50%       { opacity: 1;   }
}
.dom-sub-text {
  font-family: 'Courier New', monospace;
  font-size: 0.54rem;
  color: var(--text-faint);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}



/* NPC Panel */
.npc-panel {
  margin-bottom: 10px;
  padding: 12px 10px 10px;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.025);
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s, background 0.2s;
}

/* Colored left accent bar */
.npc-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  border-radius: var(--radius) 0 0 var(--radius);
}

.npc-panel-nexus7::before { background: var(--nexus); box-shadow: 0 0 8px var(--nexus); }
.npc-panel-chaos::before  { background: var(--chaos);  box-shadow: 0 0 8px var(--chaos);  }
.npc-panel-oracle::before { background: var(--oracle); box-shadow: 0 0 8px var(--oracle); }

.npc-panel-nexus7:hover { border-color: rgba(0,255,204,0.2);   background: rgba(0,255,204,0.04); }
.npc-panel-chaos:hover  { border-color: rgba(255,42,42,0.2);   background: rgba(255,42,42,0.04); }
.npc-panel-oracle:hover { border-color: rgba(204,136,255,0.2); background: rgba(204,136,255,0.04); }

.npc-panel-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

/* NPC avatars — circular, sidebar */
.npc-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  flex-shrink: 0;
  transition: box-shadow 0.2s;
}
.npc-avatar-nexus7 {
  border: 2px solid var(--nexus);
  box-shadow: 0 0 8px rgba(0,255,204,0.4), inset 0 0 4px rgba(0,255,204,0.1);
}
.npc-avatar-chaos {
  border: 2px solid var(--chaos);
  box-shadow: 0 0 8px rgba(255,42,42,0.4), inset 0 0 4px rgba(255,42,42,0.1);
}
.npc-avatar-oracle {
  border: 2px solid var(--oracle);
  box-shadow: 0 0 8px rgba(204,136,255,0.4), inset 0 0 4px rgba(204,136,255,0.1);
}

/* Placeholder circle when image missing */
.npc-avatar-placeholder {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 900;
  flex-shrink: 0;
}
.placeholder-nexus7 {
  background: radial-gradient(circle, rgba(0,255,204,0.25), rgba(0,255,204,0.08));
  border: 2px solid var(--nexus);
  color: var(--nexus);
  box-shadow: 0 0 10px rgba(0,255,204,0.3);
}
.placeholder-chaos {
  background: radial-gradient(circle, rgba(255,42,42,0.25), rgba(255,42,42,0.08));
  border: 2px solid var(--chaos);
  color: var(--chaos);
  box-shadow: 0 0 10px rgba(255,42,42,0.3);
}
.placeholder-oracle {
  background: radial-gradient(circle, rgba(204,136,255,0.25), rgba(204,136,255,0.08));
  border: 2px solid var(--oracle);
  color: var(--oracle);
  box-shadow: 0 0 10px rgba(204,136,255,0.3);
}

.npc-panel-info {
  flex: 1;
  min-width: 0;
}

.npc-name {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.npc-name-nexus7 { color: var(--nexus); text-shadow: 0 0 6px rgba(0,255,204,0.5); }
.npc-name-chaos  { color: var(--chaos);  text-shadow: 0 0 6px rgba(255,42,42,0.5); }
.npc-name-oracle { color: var(--oracle); text-shadow: 0 0 6px rgba(204,136,255,0.5); }

.npc-status {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  border-radius: 99px;
  padding: 2px 8px;
  margin-top: 3px;
  animation: pulse-glow 2s ease-in-out infinite;
  white-space: nowrap;
  font-family: 'Courier New', monospace;
}
.npc-status-nexus7 {
  color: var(--nexus);
  background: rgba(0,255,204,0.1);
  border: 1px solid rgba(0,255,204,0.3);
}
.npc-status-chaos {
  color: var(--chaos);
  background: rgba(255,42,42,0.1);
  border: 1px solid rgba(255,42,42,0.3);
}
.npc-status-oracle {
  color: var(--oracle);
  background: rgba(204,136,255,0.1);
  border: 1px solid rgba(204,136,255,0.3);
}

.npc-activity {
  font-size: 0.67rem;
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: 'Courier New', monospace;
}

.npc-stats-row {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.04);
}
.npc-stat {
  font-size: 0.6rem;
  font-family: 'Courier New', monospace;
  color: var(--text-faint);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 3px;
  padding: 1px 5px;
  letter-spacing: 0.05em;
}
.npc-stat-games { margin-left: auto; }

/* Sidebar desktop icons */
.sidebar-desktop-icons {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.04);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sidebar-icon {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: default;
  opacity: 0.6;
  transition: opacity 0.15s;
}
.sidebar-icon:hover { opacity: 0.9; background: rgba(255,255,255,0.04); }
.sidebar-icon-img { font-size: 1rem; width: 20px; text-align: center; }
.sidebar-icon-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  line-height: 1.3;
}
.sidebar-icon-sub {
  display: block;
  font-size: 0.58rem;
  color: var(--chaos);
  font-family: 'Courier New', monospace;
  opacity: 0.7;
}

/* ─── Chat Area ─── */
#chat-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  padding: 0;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: rgba(0,0,0,0.4);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
  height: 40px;
}
.chat-header-title {
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  color: var(--text-faint);
  font-family: 'Courier New', monospace;
  display: flex;
  align-items: center;
  gap: 8px;
}
.chat-header-icon { font-size: 0.85rem; }

.chat-header-badges {
  display: flex;
  gap: 6px;
}
.chat-badge {
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 99px;
  font-family: 'Courier New', monospace;
}
.chat-badge-nexus7 {
  color: var(--nexus);
  background: rgba(0,255,204,0.08);
  border: 1px solid rgba(0,255,204,0.25);
}
.chat-badge-chaos {
  color: var(--chaos);
  background: rgba(255,42,42,0.08);
  border: 1px solid rgba(255,42,42,0.25);
}
.chat-badge-oracle {
  color: var(--oracle);
  background: rgba(204,136,255,0.08);
  border: 1px solid rgba(204,136,255,0.25);
}

/* Chat messages scroll area */
#chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scroll-behavior: smooth;
}

/* Chat message bubbles */
.chat-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.875rem;
  line-height: 1.55;
  animation: npc-enter 0.25s ease both;
  word-break: break-word;
  align-self: flex-start;
  position: relative;
}

.chat-msg .sender {
  display: block;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 4px;
  font-family: 'Courier New', monospace;
}
.chat-msg .msg-text {
  display: block;
}
.chat-msg .msg-time {
  display: block;
  font-size: 0.58rem;
  color: rgba(255,255,255,0.25);
  margin-top: 5px;
  text-align: right;
  font-family: 'Courier New', monospace;
}

/* NEXUS-7 */
.chat-msg.nexus7 {
  background: rgba(0,255,204,0.07);
  border-left: 3px solid var(--nexus);
  box-shadow:
    0 2px 8px rgba(0,0,0,0.3),
    inset 0 1px 0 rgba(0,255,204,0.06);
}
.chat-msg.nexus7 .sender { color: var(--nexus); text-shadow: 0 0 6px rgba(0,255,204,0.4); }

/* CHAOS */
.chat-msg.chaos {
  background: rgba(255,42,42,0.07);
  border-left: 3px solid var(--chaos);
  box-shadow:
    0 2px 8px rgba(0,0,0,0.3),
    inset 0 1px 0 rgba(255,42,42,0.06);
}
.chat-msg.chaos .sender { color: var(--chaos); text-shadow: 0 0 6px rgba(255,42,42,0.4); }

/* ORACLE */
.chat-msg.oracle {
  background: rgba(204,136,255,0.07);
  border-left: 3px solid var(--oracle);
  box-shadow:
    0 2px 8px rgba(0,0,0,0.3),
    inset 0 1px 0 rgba(204,136,255,0.06);
}
.chat-msg.oracle .sender { color: var(--oracle); text-shadow: 0 0 6px rgba(204,136,255,0.4); }

/* Player */
.chat-msg.player {
  background: rgba(255,255,255,0.05);
  border-left: 3px solid #666;
  align-self: flex-end;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.chat-msg.player .sender { color: #aaa; }

/* System */
/* Typing indicator bubble */
.chat-typing {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  margin: 2px 0;
  animation: fadeInMsg 0.18s ease;
}
.chat-typing .sender {
  font-size: 0.72rem;
  font-weight: 700;
  font-family: 'Courier New', monospace;
  letter-spacing: 0.06em;
  flex-shrink: 0;
}
.typing-dots {
  display: flex;
  gap: 4px;
  align-items: center;
}
.typing-dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  animation: typingBounce 1.1s ease-in-out infinite;
  opacity: 0.5;
}
.typing-dots span:nth-child(2) { animation-delay: 0.18s; }
.typing-dots span:nth-child(3) { animation-delay: 0.36s; }
@keyframes typingBounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40%           { transform: translateY(-5px); opacity: 1;   }
}
.chat-typing.nexus7 .sender { color: var(--nexus); }
.chat-typing.chaos  .sender { color: var(--chaos);  }
.chat-typing.oracle .sender { color: var(--oracle); }
.chat-typing.nexus7 .typing-dots { color: var(--nexus); }
.chat-typing.chaos  .typing-dots { color: var(--chaos);  }
.chat-typing.oracle .typing-dots { color: var(--oracle); }

.chat-msg.system {
  background: transparent;
  border-left: none;
  color: var(--chaos);
  font-size: 0.72rem;
  font-family: 'Courier New', monospace;
  text-align: center;
  align-self: center;
  max-width: 100%;
  opacity: 0.75;
  padding: 4px 8px;
}

/* ── Chat input row ── */
#chat-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: rgba(0,0,0,0.35);
  border-top: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}

.input-prefix {
  font-size: 0.9rem;
  color: var(--nexus);
  font-weight: 700;
  flex-shrink: 0;
  text-shadow: 0 0 6px var(--nexus);
  font-family: 'Courier New', monospace;
}

#chat-input {
  flex: 1;
  height: 40px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
  color: var(--text);
  padding: 0 14px;
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  caret-color: var(--nexus);
}
#chat-input::placeholder {
  color: rgba(255,255,255,0.2);
  font-style: italic;
}
#chat-input:focus {
  border-color: var(--nexus);
  background: rgba(0,255,204,0.04);
  box-shadow:
    0 0 0 1px rgba(0,255,204,0.2),
    0 0 12px rgba(0,255,204,0.1);
}

#chat-send {
  height: 40px;
  padding: 0 20px;
  background: rgba(0,255,204,0.1);
  border: 1px solid var(--nexus);
  border-radius: 6px;
  color: var(--nexus);
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}
#chat-send:hover {
  background: rgba(0,255,204,0.2);
  box-shadow: 0 0 12px rgba(0,255,204,0.3);
  color: #fff;
}
#chat-send:active {
  transform: scale(0.97);
}

/* ═══════════════════════════════════════════════════════════════════════════
   WIN11 TASKBAR — #taskbar
═══════════════════════════════════════════════════════════════════════════ */
#taskbar {
  height: var(--taskbar-h);
  min-height: var(--taskbar-h);
  display: flex;
  align-items: center;
  flex-shrink: 0;
  position: relative;
  z-index: 20;

  background: rgba(18,18,20,0.9);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-top: 1px solid rgba(255,255,255,0.08);

  box-shadow:
    0 -1px 0 rgba(255,255,255,0.04),
    0 -4px 20px rgba(0,0,0,0.5),
    inset 0 1px 0 rgba(255,255,255,0.04);
}

/* Start button */
#start-btn {
  width: var(--taskbar-h);
  height: var(--taskbar-h);
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-right: 1px solid rgba(255,255,255,0.05);
  cursor: pointer;
  transition: background 0.15s;
  flex-shrink: 0;
}
#start-btn:hover {
  background: rgba(255,255,255,0.08);
}
#start-btn:active {
  background: rgba(255,42,42,0.12);
}

.start-logo {
  font-size: 1.25rem;
  color: rgba(255,255,255,0.85);
  display: block;
  animation: warn-pulse 3s ease-in-out infinite;
  filter: drop-shadow(0 0 4px rgba(255,42,42,0.5));
}

/* Taskbar center icons */
#taskbar-center {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 8px;
  height: 100%;
}

/* ── Game Launcher Popup ── */
#game-launcher-popup {
  position: fixed;
  bottom: calc(var(--taskbar-h) + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  width: 480px;
  background: rgba(18, 18, 24, 0.97);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  box-shadow:
    0 0 0 1px rgba(0,0,0,0.6),
    0 20px 60px rgba(0,0,0,0.8),
    0 0 30px rgba(0,255,204,0.06);
  backdrop-filter: blur(16px);
  z-index: 900;
  padding: 0 0 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
#game-launcher-popup.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.gl-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.gl-title {
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--nexus);
  text-shadow: 0 0 10px rgba(0,255,204,0.4);
  text-transform: uppercase;
}
.gl-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color 0.1s, background 0.1s;
}
.gl-close:hover {
  color: var(--chaos);
  background: rgba(255,42,42,0.1);
}

.gl-subtitle {
  font-family: 'Courier New', monospace;
  font-size: 0.56rem;
  letter-spacing: 0.2em;
  color: var(--text-faint);
  text-align: center;
  padding: 6px 0 10px;
  text-transform: uppercase;
}

.gl-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  padding: 0 12px 4px;
}

.gl-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  padding: 10px 4px 8px;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, transform 0.1s;
  position: relative;
  overflow: hidden;
}
.gl-item::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0,255,204,0.05) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.15s;
}
.gl-item:hover {
  background: rgba(0,255,204,0.07);
  border-color: rgba(0,255,204,0.25);
  transform: translateY(-2px);
}
.gl-item:hover::before { opacity: 1; }
.gl-item:active { transform: translateY(0); }

.gl-item-nuke {
  border-color: rgba(255,42,42,0.15);
  background: rgba(255,0,0,0.04);
}
.gl-item-nuke::before {
  background: linear-gradient(135deg, rgba(255,42,42,0.08) 0%, transparent 60%);
}
.gl-item-nuke:hover {
  background: rgba(255,42,42,0.1);
  border-color: rgba(255,42,42,0.4);
}

.gl-icon {
  font-size: 1.4rem;
  line-height: 1;
  filter: drop-shadow(0 0 4px rgba(0,255,204,0.3));
}
.gl-item-nuke .gl-icon {
  filter: drop-shadow(0 0 4px rgba(255,42,42,0.5));
}
.gl-name {
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.gl-desc {
  font-family: 'Courier New', monospace;
  font-size: 0.48rem;
  color: var(--text-faint);
  text-align: center;
  letter-spacing: 0.02em;
  line-height: 1.3;
}

.gl-tip {
  text-align: center;
  font-family: 'Courier New', monospace;
  font-size: 0.54rem;
  color: var(--text-faint);
  padding: 8px 14px 0;
  border-top: 1px solid rgba(255,255,255,0.04);
  margin-top: 6px;
}
.gl-tip code {
  color: var(--nexus);
  background: rgba(0,255,204,0.08);
  padding: 1px 4px;
  border-radius: 3px;
  font-size: inherit;
}

.taskbar-app {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  cursor: pointer;
  position: relative;
  font-size: 1.1rem;
  color: rgba(255,255,255,0.7);
  transition: background 0.12s;
}
.taskbar-app:hover {
  background: rgba(255,255,255,0.08);
}
.taskbar-app.active::after {
  content: '';
  position: absolute;
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
}

.taskbar-app-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  animation: pulse-glow 2s ease-in-out infinite;
}
.dot-nexus7 { background: var(--nexus); color: var(--nexus); box-shadow: 0 0 6px var(--nexus); }
.dot-chaos  { background: var(--chaos);  color: var(--chaos);  box-shadow: 0 0 6px var(--chaos);  }
.dot-oracle { background: var(--oracle); color: var(--oracle); box-shadow: 0 0 6px var(--oracle); }

.taskbar-divider {
  width: 1px;
  height: 28px;
  background: rgba(255,255,255,0.08);
  margin: 0 4px;
}

/* Taskbar right cluster */
#taskbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
  padding-right: 8px;
  height: 100%;
}

#taskbar-notif {
  position: relative;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.12s;
}
#taskbar-notif:hover { background: rgba(255,255,255,0.08); }

.notif-icon { line-height: 1; }
.notif-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 14px;
  height: 14px;
  background: var(--chaos);
  border-radius: 99px;
  font-size: 0.5rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  box-shadow: 0 0 6px rgba(255,42,42,0.5);
  transition: transform 0.15s, box-shadow 0.15s;
}
.notif-badge.notif-active {
  animation: notifPop 0.3s ease;
  box-shadow: 0 0 10px rgba(255,42,42,0.9);
}
@keyframes notifPop {
  0%   { transform: scale(1);   }
  50%  { transform: scale(1.35);}
  100% { transform: scale(1);   }
}

#clock {
  padding: 4px 10px;
  border-radius: 6px;
  cursor: default;
  text-align: right;
  min-width: 76px;
  transition: background 0.12s;
}
#clock:hover { background: rgba(255,255,255,0.05); }

#clock-time {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
}
#clock-date {
  font-size: 0.62rem;
  color: var(--text-muted);
  line-height: 1.2;
}

#btn-return-menu {
  height: 32px;
  padding: 0 12px;
  background: transparent;
  border: 1px solid rgba(255,42,42,0.4);
  border-radius: 4px;
  color: var(--chaos);
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  margin-left: 4px;
}
#btn-return-menu:hover {
  background: rgba(255,42,42,0.15);
  border-color: var(--chaos);
  color: #fff;
  box-shadow: 0 0 10px rgba(255,42,42,0.25);
}

/* ═══════════════════════════════════════════════════════════════════════════
   FLOATING GAME WINDOW — #game-window
═══════════════════════════════════════════════════════════════════════════ */
#game-window {
  position: fixed;
  top: 8%;
  left: 50%;
  transform: translateX(-50%);
  width: min(820px, 94vw);
  z-index: 100;

  background: #1a1a24;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: var(--radius);
  overflow: hidden;

  box-shadow:
    0 0 0 1px rgba(255,255,255,0.04),
    0 8px 32px rgba(0,0,0,0.7),
    0 24px 80px rgba(0,0,0,0.6),
    0 0 60px rgba(0,255,204,0.04),
    0 48px 120px rgba(0,0,0,0.5);
}

/* Drag handle – title bar */
.game-window-titlebar {
  height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px 0 12px;
  cursor: move;
  user-select: none;
  position: relative;

  background: #22222e;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius) var(--radius) 0 0;

  /* Subtle shimmer */
  background-image: linear-gradient(
    105deg,
    rgba(255,255,255,0) 0%,
    rgba(255,255,255,0.025) 50%,
    rgba(255,255,255,0) 100%
  );
  background-size: 200% 100%;
  animation: titlebar-shimmer 6s linear infinite;
}

/* Win11 traffic-light dots (min/max only) */
.win-btns {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.win-btn {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: none;
  cursor: default;
  flex-shrink: 0;
  transition: filter 0.15s;
}
.win-btn:hover { filter: brightness(1.3); }
.win-btn-min   { background: #febc2e; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.15); }
.win-btn-max   { background: #28c840; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.15); }

.game-window-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(255,255,255,0.7);
  letter-spacing: 0.08em;
  flex: 1;
  text-align: center;
  pointer-events: none;
}

/* ── Visible close button — right side of titlebar ── */
.game-close-x {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 5px;
  color: rgba(255,255,255,0.55);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.game-close-x:hover {
  background: #c0392b;
  border-color: #e74c3c;
  color: #fff;
}
.game-close-x:active {
  background: #922b21;
}

/* Game canvas container */
#game-canvas-container {
  padding: 16px;
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse 80% 60% at 50% 50%, rgba(0,255,204,0.03) 0%, transparent 70%),
    #13131c;
  position: relative;
  overflow: hidden;
}

/* NPC commentary strip */
.game-commentary {
  padding: 10px 16px;
  background: #0e0e16;
  border-top: 1px solid rgba(255,255,255,0.07);
  font-size: 0.75rem;
  font-family: 'Courier New', monospace;
  color: var(--text-muted);
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.commentary-label {
  color: rgba(255,42,42,0.6);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  flex-shrink: 0;
}
#commentary-text {
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════════════════════
   NUKE SIMULATOR OVERLAY — #nuke-overlay
═══════════════════════════════════════════════════════════════════════════ */
#nuke-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: #000;
  overflow: hidden;
}

#nuke-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* NORAD scanline overlay on nuke screen */
.nuke-scanlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.25) 2px,
    rgba(0,0,0,0.25) 4px
  );
  mix-blend-mode: multiply;
}

/* Central status text */
#nuke-status-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  font-size: clamp(1.8rem, 5vw, 3.5rem);
  font-weight: 900;
  color: #00ff44;
  text-shadow:
    0 0 10px #00ff44,
    0 0 30px rgba(0,255,68,0.6),
    0 0 70px rgba(0,255,68,0.3);
  font-family: 'Courier New', monospace;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  line-height: 1.3;
  pointer-events: none;
  animation: warn-pulse 1.5s ease-in-out infinite;
}

/* NORAD header bar */
.nuke-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: rgba(0,0,0,0.7);
  border-bottom: 1px solid rgba(0,255,68,0.3);
  font-family: 'Courier New', monospace;
  font-size: 0.72rem;
  color: rgba(0,255,68,0.8);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.nuke-header-mid {
  font-weight: 700;
  color: #00ff44;
  text-shadow: 0 0 8px #00ff44;
}
.nuke-header-right {
  font-variant-numeric: tabular-nums;
}

/* Bottom data strip */
.nuke-footer {
  position: absolute;
  bottom: 60px;
  left: 0;
  right: 0;
  z-index: 5;
  display: flex;
  justify-content: center;
  gap: 0;
  background: rgba(0,0,0,0.7);
  border-top: 1px solid rgba(0,255,68,0.3);
  border-bottom: 1px solid rgba(0,255,68,0.15);
  padding: 8px 0;
}
.nuke-data-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 32px;
  border-right: 1px solid rgba(0,255,68,0.15);
}
.nuke-data-col:last-child { border-right: none; }
.nuke-data-label {
  font-size: 0.58rem;
  letter-spacing: 0.25em;
  color: rgba(0,255,68,0.5);
  font-family: 'Courier New', monospace;
  text-transform: uppercase;
  margin-bottom: 3px;
}
.nuke-data-val {
  font-size: 1rem;
  font-weight: 700;
  font-family: 'Courier New', monospace;
  color: #00ff44;
  text-shadow: 0 0 8px rgba(0,255,68,0.6);
  font-variant-numeric: tabular-nums;
}

/* Nuke close button */
#nuke-close {
  position: absolute;
  top: 46px;
  right: 16px;
  z-index: 10;
  padding: 8px 16px;
  background: rgba(255,42,42,0.15);
  border: 1px solid var(--chaos);
  border-radius: 4px;
  color: var(--chaos);
  font-family: 'Courier New', monospace;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  cursor: pointer;
  text-transform: uppercase;
  transition: all 0.15s;
}
#nuke-close:hover {
  background: rgba(255,42,42,0.3);
  box-shadow: 0 0 12px rgba(255,42,42,0.4);
  color: #fff;
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE ADJUSTMENTS
═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 700px) {
  :root {
    --sidebar-w: 200px;
  }

  #menu-title {
    font-size: 2.8rem;
  }

  .menu-btn {
    max-width: 100%;
    height: 50px;
    font-size: 0.9rem;
  }

  .menu-npc-avatar { width: 100px; }

  .npc-panel { padding: 8px; }

  .npc-avatar {
    width: 36px;
    height: 36px;
  }

  .npc-avatar-placeholder {
    width: 36px;
    height: 36px;
    font-size: 0.9rem;
  }

  #game-window {
    top: 4%;
    width: 98vw;
  }

  .nuke-footer {
    flex-wrap: wrap;
    gap: 4px;
    padding: 6px 8px;
  }
  .nuke-data-col {
    padding: 0 14px;
  }
  #nuke-status-text {
    font-size: 1.5rem;
  }
}

@media (max-width: 480px) {
  :root { --sidebar-w: 0px; }
  #npc-sidebar { display: none; }

  #chat-input { font-size: 1rem; }

  .modal-box { padding: 24px 18px 20px; }
}
