/* ============================================================
   NETRUNNER 1985 — Vaporwave Stylesheet
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=VT323&family=Share+Tech+Mono&family=Orbitron:wght@400;700;900&display=swap');

:root {
  --bg:          #0a0015;
  --screen-bg:   #040010;
  --pink:        #ff2d78;
  --cyan:        #00e5ff;
  --purple:      #cc44ff;
  --yellow:      #ffe600;
  --green:       #00ff41;
  --dim-green:   #1a4d1a;
  --dark-purple: #1a003a;
  --monitor-col: #1a0035;
  --glow-pink:   0 0 8px #ff2d78, 0 0 20px #ff2d7860;
  --glow-cyan:   0 0 8px #00e5ff, 0 0 20px #00e5ff60;
  --glow-green:  0 0 6px #00ff41, 0 0 14px #00ff4140;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  overflow: hidden;
  width: 100vw;
  height: 100vh;
  font-family: 'VT323', monospace;
  user-select: none;
}

/* ---- Room Background ---- */
#room {
  width: 100vw;
  height: calc(100vh + 70px);
  margin-top: -70px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

#room-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #0a0025 0%, #1a0040 40%, #2d0060 60%, #3d0080 75%, #000080 100%);
  z-index: 0;
}

/* Vaporwave sun */
#sun {
  position: absolute;
  bottom: 38%;
  left: 50%;
  transform: translateX(-50%);
  width: 320px;
  height: 160px;
  border-radius: 160px 160px 0 0;
  background: linear-gradient(180deg, #ffcc00 0%, #ff6600 30%, #ff0080 60%, #cc00cc 80%, transparent 100%);
  overflow: hidden;
  z-index: 1;
}

#sun::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(
    180deg,
    transparent 0px,
    transparent 12px,
    var(--bg) 12px,
    var(--bg) 16px
  );
  bottom: 0;
}

/* Perspective grid */
#grid {
  position: absolute;
  bottom: 38%;
  left: 0;
  right: 0;
  height: 38%;
  z-index: 1;
  overflow: hidden;
}

#grid::before,
#grid::after {
  content: '';
  position: absolute;
  inset: 0;
}

#grid::before {
  background:
    repeating-linear-gradient(90deg, #ff00ff20 0px, transparent 1px, transparent 60px, #ff00ff20 61px),
    repeating-linear-gradient(180deg, #ff00ff20 0px, transparent 1px, transparent 40px, #ff00ff20 41px);
  transform: perspective(400px) rotateX(60deg);
  transform-origin: bottom center;
}

#grid::after {
  background: linear-gradient(0deg, var(--bg) 0%, transparent 60%);
}

/* Mountains silhouette */
#mountains {
  position: absolute;
  bottom: 38%;
  left: 0;
  right: 0;
  height: 120px;
  z-index: 2;
  background:
    radial-gradient(ellipse 200px 120px at 15% 100%, #0a0015 50%, transparent 50%),
    radial-gradient(ellipse 300px 150px at 45% 100%, #0a0015 50%, transparent 50%),
    radial-gradient(ellipse 250px 130px at 70% 100%, #0a0015 50%, transparent 50%),
    radial-gradient(ellipse 180px 100px at 88% 100%, #0a0015 50%, transparent 50%);
}

/* ---- Desk / Monitor ---- */
#desk {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding-bottom: 0;
}

/* Monitor stand */
#monitor-stand {
  display: flex;
  flex-direction: column;
  align-items: center;
}

#monitor-body {
  background: linear-gradient(180deg, #2a0050 0%, #1a0035 100%);
  border: 3px solid #5500aa;
  border-radius: 12px 12px 4px 4px;
  padding: 22px 30px 12px;
  box-shadow:
    0 0 40px #aa00ff60,
    inset 0 0 20px #00000080;
  position: relative;
}

#monitor-bezel {
  background: #080015;
  border-radius: 6px;
  padding: 4px;
  border: 2px solid #3a0070;
  box-shadow: inset 0 0 20px #00000060;
}

#screen {
  width: 1280px;
  height: 860px;
  background: var(--screen-bg);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}

/* CRT scanlines */
#scanlines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.18) 2px,
    rgba(0,0,0,0.18) 4px
  );
  pointer-events: none;
  z-index: 9999;
}

/* CRT screen glow */
#screen::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 4px;
  box-shadow: inset 0 0 60px #00ff4108, inset 0 0 120px #00000080;
  pointer-events: none;
  z-index: 9998;
}

#monitor-chin {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 20px;
  border-top: 1px solid #3a0070;
}

#power-light {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: var(--glow-green);
  animation: blink 3s ease-in-out infinite;
}

@keyframes blink {
  0%,90%,100% { opacity: 1; }
  95% { opacity: 0.3; }
}

#monitor-brand {
  font-family: 'Orbitron', monospace;
  font-size: 10px;
  color: #5500aa;
  letter-spacing: 3px;
}

#stand-neck {
  width: 130px; height: 48px;
  background: linear-gradient(180deg, #2a0050, #1a0035);
  margin: 0 auto;
  clip-path: polygon(20% 0%, 80% 0%, 100% 100%, 0% 100%);
  border: 1px solid #5500aa;
}

#stand-base {
  width: 380px; height: 20px;
  background: linear-gradient(180deg, #2a0050, #1a0035);
  border-radius: 4px;
  border: 2px solid #5500aa;
  box-shadow: 0 4px 20px #aa00ff40;
}

/* ---- Keyboard ---- */
#keyboard {
  width: 1000px;
  background: linear-gradient(180deg, #1a0030 0%, #110022 100%);
  border: 2px solid #440088;
  border-radius: 8px;
  padding: 16px 24px 18px;
  margin-top: 12px;
  box-shadow: 0 8px 30px #aa00ff30;
}

#kb-keys {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.kb-row {
  font-family: 'VT323', monospace;
  font-size: 20px;
  color: #6600cc;
  letter-spacing: 12px;
  text-align: center;
  text-shadow: 0 0 4px #6600cc80;
}

.kb-space {
  letter-spacing: 4px;
  font-size: 17px;
  margin-top: 2px;
}

/* ---- Desktop ---- */
#desktop {
  width: 100%;
  height: 100%;
  position: relative;
  background: transparent;
}

/* Animated wallpaper grid */
#wallpaper {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, #04001080 0%, #0a002880 100%),
    repeating-linear-gradient(90deg,  transparent, transparent 40px, #ff00ff08 40px, #ff00ff08 41px),
    repeating-linear-gradient(180deg, transparent, transparent 40px, #00ffff06 40px, #00ffff06 41px);
  z-index: 0;
}

/* ---- Status bar ---- */
#statusbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 36px;
  background: #04000e;
  border-bottom: 1px solid #330066;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 100;
  font-size: 20px;
}

#sb-title {
  color: var(--purple);
  font-size: 20px;
  letter-spacing: 1px;
  text-shadow: var(--glow-pink);
}

#sb-stats {
  color: #446644;
  font-size: 19px;
}

#sb-stats span {
  color: var(--green);
}

#sb-time {
  color: var(--cyan);
  font-size: 20px;
}

/* ---- Taskbar ---- */
#taskbar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40px;
  background: #04000e;
  border-top: 1px solid #330066;
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 8px;
  z-index: 100;
}

#tb-menu {
  font-size: 20px;
  color: var(--pink);
  text-shadow: var(--glow-pink);
  padding: 0 12px;
  border: 1px solid #ff2d7840;
  border-radius: 2px;
  cursor: pointer;
  height: 30px;
  line-height: 30px;
  white-space: nowrap;
}

#tb-menu:hover { background: #ff2d7820; }

#tb-apps {
  display: flex;
  gap: 5px;
  flex: 1;
}

.tb-app {
  font-size: 19px;
  color: var(--cyan);
  padding: 0 12px;
  border: 1px solid #00e5ff40;
  border-radius: 2px;
  cursor: pointer;
  height: 30px;
  line-height: 30px;
  white-space: nowrap;
  background: #00e5ff10;
}

.tb-app:hover { background: #00e5ff25; }

#tb-tray {
  display: flex;
  gap: 14px;
  align-items: center;
  font-size: 20px;
}

#tb-credits {
  color: var(--yellow);
  text-shadow: 0 0 6px #ffe60080;
}

#tb-clock {
  color: var(--cyan);
  min-width: 62px;
}

/* ---- Desktop Icons ---- */
#desktop-icons {
  position: absolute;
  top: 46px;
  left: 10px;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 8px;
  width: 224px;   /* fits exactly 2 icons per row */
  z-index: 50;
}

.dicon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  width: 100px;
  padding: 8px 6px;
  border-radius: 4px;
  transition: background 0.15s;
}

.dicon:hover { background: #ffffff10; }

.dicon-gfx {
  font-family: 'VT323', monospace;
  font-size: 22px;
  color: var(--cyan);
  text-align: center;
  line-height: 1.15;
  text-shadow: var(--glow-cyan);
  letter-spacing: 1px;
}

.dicon-label {
  font-size: 15px;
  color: var(--green);
  text-align: center;
  text-shadow: var(--glow-green);
  line-height: 1.2;
}

/* ---- Windows ---- */
#windows {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 200;
}

.window {
  position: absolute;
  pointer-events: all;
  background: #060012;
  border: 1px solid #5500aa;
  border-radius: 4px;
  box-shadow:
    0 0 20px #aa00ff50,
    0 0 1px #cc44ff80;
  min-width: 300px;
  transition: box-shadow 0.2s;
}

.window:focus-within {
  box-shadow: 0 0 30px #cc44ff80, 0 0 2px #ff44ff;
}

.window.minimized { display: none; }

.win-titlebar {
  background: linear-gradient(90deg, #1a0040 0%, #2a0060 100%);
  border-bottom: 1px solid #440088;
  padding: 6px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: move;
  height: 40px;
}

.win-title {
  font-family: 'VT323', monospace;
  font-size: 21px;
  color: var(--purple);
  text-shadow: 0 0 6px #cc44ff80;
  letter-spacing: 1px;
}

.win-controls {
  display: flex;
  gap: 6px;
}

.win-btn {
  font-family: 'VT323', monospace;
  font-size: 18px;
  background: none;
  border: 1px solid #440088;
  color: #aa44ff;
  cursor: pointer;
  width: 30px;
  height: 24px;
  line-height: 22px;
  text-align: center;
  padding: 0;
  border-radius: 2px;
}

.win-btn:hover { background: #440088; }
.win-close:hover { background: #880022 !important; color: #ff4466 !important; border-color: #ff4466 !important; }

.win-body { overflow: hidden; }

/* ---- Terminal Window ---- */
#term-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 14px;
  background: #030008;
  font-family: 'Share Tech Mono', 'VT323', monospace;
}

#trace-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  height: 26px;
}

#trace-label {
  font-size: 19px;
  color: #336633;
  min-width: 110px;
  font-family: 'VT323', monospace;
}

#trace-track {
  flex: 1;
  height: 12px;
  background: #0d0020;
  border: 1px solid #220044;
  border-radius: 2px;
  overflow: hidden;
}

#trace-bar {
  height: 100%;
  width: 0%;
  background: var(--green);
  transition: width 0.5s, background 0.3s;
  box-shadow: var(--glow-green);
}

#term-output {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  font-size: 20px;
  line-height: 1.5;
  padding: 2px 6px;
  word-break: break-all;
}

#term-output::-webkit-scrollbar { width: 6px; }
#term-output::-webkit-scrollbar-track { background: #080015; }
#term-output::-webkit-scrollbar-thumb { background: #440088; border-radius: 2px; }

.term-line {
  font-family: 'Share Tech Mono', monospace;
  font-size: 20px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-all;
}

#term-inputrow {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid #1a0030;
  margin-top: 6px;
  flex-shrink: 0;
}

#term-prompt {
  font-family: 'Share Tech Mono', monospace;
  font-size: 20px;
  color: var(--green);
  white-space: nowrap;
  text-shadow: var(--glow-green);
}

#term-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: 'Share Tech Mono', monospace;
  font-size: 20px;
  color: #ffffff;
  caret-color: var(--green);
}

/* ---- Bank Window ---- */
.app-body {
  padding: 18px;
  font-family: 'VT323', monospace;
  color: var(--green);
  height: 100%;
  overflow-y: auto;
}

.bank-header {
  font-family: 'Orbitron', monospace;
  font-size: 23px;
  color: var(--cyan);
  text-shadow: var(--glow-cyan);
  text-align: center;
  letter-spacing: 3px;
  margin-bottom: 16px;
}

.bank-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.bank-card {
  background: #0d0020;
  border: 1px solid #440088;
  border-radius: 4px;
  padding: 12px;
  text-align: center;
}

.bank-card-label {
  font-size: 18px;
  color: #6600cc;
  letter-spacing: 2px;
  margin-bottom: 6px;
}

.bank-card-value {
  font-size: 40px;
  color: var(--yellow);
  text-shadow: 0 0 8px #ffe60080;
}

.bank-actions { margin-bottom: 16px; }

.bank-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.bank-row input {
  flex: 1;
  background: #080015;
  border: 1px solid #440088;
  color: var(--green);
  font-family: 'VT323', monospace;
  font-size: 25px;
  padding: 7px 12px;
  border-radius: 2px;
  outline: none;
}

.bank-row input:focus { border-color: var(--cyan); }

.btn-neon {
  background: #0d0020;
  border: 1px solid var(--pink);
  color: var(--pink);
  font-family: 'VT323', monospace;
  font-size: 23px;
  padding: 6px 18px;
  cursor: pointer;
  border-radius: 2px;
  text-shadow: var(--glow-pink);
  transition: background 0.15s;
}

.btn-neon:hover { background: #ff2d7820; }

.btn-cyan {
  border-color: var(--cyan);
  color: var(--cyan);
  text-shadow: var(--glow-cyan);
}

.btn-cyan:hover { background: #00e5ff20; }

.bank-msg {
  margin-top: 8px;
  font-size: 20px;
  min-height: 24px;
}

.bank-info {
  background: #0d0020;
  border: 1px solid #330066;
  border-radius: 4px;
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.bank-info-label { font-size: 18px; color: #6600cc; letter-spacing: 2px; }
.bank-info-value { font-size: 30px; color: var(--green); text-shadow: var(--glow-green); }

.bank-flavor {
  font-size: 17px;
  color: #330066;
  text-align: center;
  line-height: 1.5;
  font-style: italic;
}

/* ---- Shop Window ---- */
.shop-body {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 10px;
  font-family: 'VT323', monospace;
  overflow: hidden;
}

.shop-wallet {
  font-size: 23px;
  color: var(--yellow);
  text-align: right;
  margin-bottom: 8px;
  text-shadow: 0 0 6px #ffe60060;
}

.shop-tabs {
  display: flex;
  gap: 5px;
  margin-bottom: 8px;
  flex-shrink: 0;
}

.tab-btn {
  font-family: 'VT323', monospace;
  font-size: 22px;
  background: #0d0020;
  border: 1px solid #440088;
  color: #6600cc;
  padding: 4px 18px;
  cursor: pointer;
  border-radius: 2px;
  transition: all 0.15s;
}

.tab-btn.active {
  background: #1a0040;
  border-color: var(--purple);
  color: var(--purple);
  text-shadow: 0 0 6px #cc44ff80;
}

.shop-panel {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 4px;
}

.shop-panel::-webkit-scrollbar { width: 4px; }
.shop-panel::-webkit-scrollbar-track { background: #080015; }
.shop-panel::-webkit-scrollbar-thumb { background: #440088; border-radius: 2px; }

.shop-panel.hidden { display: none; }

.shop-item {
  background: #0d0020;
  border: 1px solid #330066;
  border-radius: 4px;
  padding: 8px 10px;
  transition: border-color 0.15s;
}

.shop-item:hover:not(.owned) { border-color: #6600cc; }

.shop-item.owned { opacity: 0.5; }

.shop-item.cant-afford { opacity: 0.7; }

.shop-item-name {
  font-size: 23px;
  color: var(--cyan);
  margin-bottom: 3px;
}

.shop-item.owned .shop-item-name { color: #446644; }

.shop-item-desc {
  font-size: 18px;
  color: #6600cc;
  margin-bottom: 3px;
  line-height: 1.3;
}

.shop-item-flavor {
  font-size: 17px;
  color: #3a0055;
  font-style: italic;
  margin-bottom: 3px;
  line-height: 1.3;
}

.shop-item-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}

.shop-price {
  font-size: 26px;
  color: var(--yellow);
  text-shadow: 0 0 4px #ffe60060;
}

.btn-shop {
  font-family: 'VT323', monospace;
  font-size: 22px;
  background: #0d0020;
  border: 1px solid var(--pink);
  color: var(--pink);
  padding: 3px 18px;
  cursor: pointer;
  border-radius: 2px;
  transition: background 0.15s;
}

.btn-shop:hover:not(:disabled) { background: #ff2d7820; }

.btn-shop:disabled,
.btn-shop.btn-owned {
  border-color: #336633;
  color: #336633;
  cursor: default;
}

.shop-msg {
  margin-top: 8px;
  font-size: 20px;
  min-height: 24px;
  flex-shrink: 0;
}

/* ---- Inventory Window ---- */
.inv-body {
  overflow-y: auto;
}

.inv-body::-webkit-scrollbar { width: 4px; }
.inv-body::-webkit-scrollbar-thumb { background: #440088; }

.inv-header {
  font-family: 'Orbitron', monospace;
  font-size: 20px;
  color: var(--purple);
  text-align: center;
  letter-spacing: 3px;
  margin-bottom: 12px;
  text-shadow: 0 0 6px #cc44ff80;
}

.inv-section {
  margin-bottom: 12px;
}

.inv-label {
  font-size: 19px;
  color: #6600cc;
  letter-spacing: 2px;
  border-bottom: 1px solid #220044;
  padding-bottom: 3px;
  margin-bottom: 6px;
}

.inv-item {
  font-size: 20px;
  color: var(--green);
  padding: 3px 0;
  line-height: 1.4;
}

.inv-empty {
  font-size: 19px;
  color: #330055;
  font-style: italic;
}

/* ---- BBS Window ---- */
.bbs-body {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 10px;
  font-family: 'VT323', monospace;
  overflow: hidden;
}

.bbs-header {
  text-align: center;
  margin-bottom: 8px;
}

.bbs-title {
  font-family: 'Orbitron', monospace;
  font-size: 19px;
  color: var(--yellow);
  text-shadow: 0 0 8px #ffe60080;
  letter-spacing: 2px;
}

.bbs-subtitle {
  font-size: 18px;
  color: #554400;
  font-style: italic;
  margin-top: 2px;
}

.bbs-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 7px;
}

.bbs-refresh { font-size: 18px; color: #554400; }
.bbs-wallet  { font-size: 22px; color: var(--yellow); text-shadow: 0 0 5px #ffe60060; }

.bbs-effects-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 8px;
}

.bbs-effect-badge {
  font-size: 17px;
  color: var(--green);
  background: #001a00;
  border: 1px solid #003300;
  border-radius: 2px;
  padding: 2px 8px;
  text-shadow: var(--glow-green);
}

.bbs-listings {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding-right: 4px;
}

.bbs-listings::-webkit-scrollbar { width: 4px; }
.bbs-listings::-webkit-scrollbar-track { background: #080015; }
.bbs-listings::-webkit-scrollbar-thumb { background: #440088; border-radius: 2px; }

.bbs-listing {
  background: #0d0015;
  border: 1px solid #3a2200;
  border-radius: 3px;
  padding: 7px 9px;
  transition: border-color 0.15s;
}

.bbs-listing:hover:not(.bbs-sold) { border-color: #ffe60060; }
.bbs-listing.bbs-sold        { opacity: 0.45; }
.bbs-listing.bbs-cant-afford { opacity: 0.65; }

.bbs-listing-header {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 3px;
}

.bbs-type {
  font-size: 15px;
  padding: 1px 6px;
  border-radius: 2px;
  border: 1px solid;
  white-space: nowrap;
  letter-spacing: 0.5px;
}

.bbs-type-soft  { color: var(--cyan);   border-color: var(--cyan);   background: #00e5ff10; }
.bbs-type-svc   { color: var(--yellow); border-color: var(--yellow); background: #ffe60010; }
.bbs-type-intel { color: var(--pink);   border-color: var(--pink);   background: #ff2d7810; }
.bbs-type-hw    { color: var(--green);  border-color: var(--green);  background: #00ff4110; }
.bbs-type-virus { color: #ff8800;       border-color: #ff8800;       background: #ff880010; }

.bbs-name { font-size: 21px; color: var(--cyan); }

.bbs-listing-desc {
  font-size: 17px;
  color: #6600cc;
  line-height: 1.3;
  margin-bottom: 5px;
}

.bbs-listing-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.bbs-price { font-size: 23px; color: var(--yellow); text-shadow: 0 0 4px #ffe60060; }

.btn-bbs {
  font-family: 'VT323', monospace;
  font-size: 21px;
  background: #0d0015;
  border: 1px solid var(--yellow);
  color: var(--yellow);
  padding: 3px 16px;
  cursor: pointer;
  border-radius: 2px;
  transition: background 0.15s;
}

.btn-bbs:hover:not(:disabled) { background: #ffe60018; }

.btn-bbs:disabled,
.btn-bbs.btn-bbs-sold { border-color: #554400; color: #554400; cursor: default; }

.bbs-msg { margin-top: 6px; font-size: 19px; min-height: 24px; flex-shrink: 0; }

/* ---- Animations ---- */
@keyframes glitch {
  0%,100% { transform: translateX(0); }
  20%      { transform: translateX(-2px); filter: hue-rotate(90deg); }
  40%      { transform: translateX(2px); }
  60%      { transform: translateX(-1px); filter: hue-rotate(-90deg); }
  80%      { transform: translateX(1px); }
}

.glitch { animation: glitch 0.3s infinite; }

@keyframes pulse-pink {
  0%,100% { box-shadow: var(--glow-pink); }
  50%     { box-shadow: 0 0 20px #ff2d78, 0 0 40px #ff2d7840; }
}

@keyframes flicker {
  0%,95%,100% { opacity: 1; }
  97% { opacity: 0.7; }
  98% { opacity: 0.9; }
}

#screen { animation: flicker 8s ease-in-out infinite; }

/* ---- IRC Window ---- */
#irc-layout {
  display: flex;
  height: 100%;
  font-family: 'Share Tech Mono', monospace;
  font-size: 13px;
  background: #050010;
}

#irc-sidebar {
  width: 160px;
  flex-shrink: 0;
  border-right: 1px solid #330055;
  display: flex;
  flex-direction: column;
  padding: 8px 0;
  background: #07001a;
}

#irc-channel-label, #irc-user-label {
  font-size: 10px;
  color: #554477;
  letter-spacing: 0.12em;
  padding: 4px 10px 4px;
  text-transform: uppercase;
}

#irc-user-label { margin-top: 10px; border-top: 1px solid #220033; padding-top: 10px; }

#irc-tabs { display: flex; flex-direction: column; }

.irc-tab {
  padding: 5px 10px;
  cursor: pointer;
  color: #665588;
  font-size: 12px;
  position: relative;
  white-space: nowrap;
  overflow: hidden;
  transition: background 0.15s, color 0.15s;
}
.irc-tab:hover { background: #110025; color: #9966cc; }
.irc-tab-active { color: #bf7fff !important; background: #150030 !important; border-left: 2px solid #bf7fff; }

.irc-badge {
  display: inline-block;
  background: #ff2d78;
  color: #fff;
  font-size: 9px;
  border-radius: 8px;
  padding: 0 4px;
  margin-left: 4px;
  vertical-align: middle;
  line-height: 14px;
}

#irc-users { display: flex; flex-direction: column; gap: 2px; padding: 4px 0; overflow-y: auto; flex: 1; }
.irc-user { font-size: 11px; padding: 2px 10px; }
.irc-user-self { color: #00ff41 !important; }

#irc-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#irc-channel-desc {
  padding: 6px 12px;
  font-size: 11px;
  color: #554477;
  border-bottom: 1px solid #220033;
  background: #06001a;
  flex-shrink: 0;
}

#irc-messages {
  flex: 1;
  overflow-y: auto;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.irc-msg { line-height: 1.5; word-break: break-word; }
.irc-msg-time { color: #332244; font-size: 11px; margin-right: 4px; }
.irc-msg-nick { font-weight: bold; margin-right: 6px; }
.irc-msg-nick::before { content: '<'; }
.irc-msg-nick::after  { content: '>'; }
.irc-msg-text { color: #c0a8e0; }

#irc-input-row {
  display: flex;
  align-items: center;
  padding: 6px 10px;
  border-top: 1px solid #220033;
  background: #06001a;
  flex-shrink: 0;
  gap: 8px;
}

#irc-nick-label { color: #00ff41; font-size: 13px; white-space: nowrap; }

#irc-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #888;
  font-family: 'Share Tech Mono', monospace;
  font-size: 13px;
  font-style: italic;
}

/* ---- Gazette Window ---- */
.gz-wrapper {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #04000f;
  font-family: 'Share Tech Mono', monospace;
  color: #c8b8e8;
  overflow: hidden;
}

.gz-masthead {
  text-align: center;
  padding: 10px 16px 8px;
  border-bottom: 2px solid #440066;
  background: #08001e;
  flex-shrink: 0;
}

.gz-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 20px;
  font-weight: 900;
  color: #bf7fff;
  letter-spacing: 0.18em;
  text-shadow: 0 0 12px #bf7fff80;
}

.gz-meta {
  font-size: 10px;
  color: #554477;
  letter-spacing: 0.1em;
  margin-top: 4px;
}
.gz-meta-sep { margin: 0 6px; }

.gz-nav {
  display: flex;
  gap: 4px;
  padding: 6px 10px;
  border-bottom: 1px solid #220033;
  background: #060015;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.gz-nav-btn {
  background: transparent;
  border: 1px solid #330055;
  color: #665588;
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  padding: 3px 8px;
  cursor: pointer;
  border-radius: 2px;
  transition: all 0.15s;
}
.gz-nav-btn:hover   { border-color: #9966cc; color: #9966cc; }
.gz-nav-active      { border-color: #bf7fff !important; color: #bf7fff !important; background: #150030 !important; }

.gz-content {
  flex: 1;
  overflow-y: auto;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gz-empty { color: #554477; font-style: italic; padding: 20px; text-align: center; }

/* Player story banner */
.gz-player-story {
  border: 1px solid #ff2d78;
  background: #1a0010;
  padding: 10px 14px;
  border-radius: 3px;
}
.gz-ps-label {
  font-size: 10px;
  color: #ff2d78;
  letter-spacing: 0.12em;
  margin-bottom: 6px;
}

/* Story components */
.gz-story-section {
  font-size: 9px;
  letter-spacing: 0.15em;
  color: #7755aa;
  margin-bottom: 4px;
  text-transform: uppercase;
}
.gz-story-headline  { color: #e8d8ff; line-height: 1.3; margin-bottom: 6px; }
.gz-headline-lg     { font-size: 16px; font-family: 'Orbitron', sans-serif; font-weight: 700; }
.gz-headline-sm     { font-size: 13px; font-weight: bold; }
.gz-story-body      { font-size: 12px; color: #a090c8; line-height: 1.6; }

.gz-lead { padding-bottom: 10px; border-bottom: 1px solid #220033; }

.gz-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.gz-secondary { padding: 6px 0; }

.gz-divider { border-top: 1px solid #220033; }

/* Editorial */
.gz-section-label {
  font-size: 9px;
  letter-spacing: 0.2em;
  color: #554477;
  margin-bottom: 6px;
}
.gz-ed-title  { font-size: 14px; color: #e8d8ff; font-weight: bold; margin-bottom: 2px; }
.gz-ed-author { font-size: 11px; color: #7755aa; font-style: italic; margin-bottom: 8px; }

/* Classifieds */
.gz-classifieds { display: flex; flex-direction: column; gap: 5px; }
.gz-classified  { font-size: 11px; color: #887799; line-height: 1.5; padding-left: 6px; }

/* ---- Page Footer ---- */
#page-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 6px 0 8px;
  text-align: center;
  font-family: 'Share Tech Mono', monospace;
  font-size: 12px;
  color: rgba(180, 130, 255, 0.45);
  letter-spacing: 0.05em;
  pointer-events: none;
  z-index: 9999;
}
#page-footer a {
  color: rgba(0, 255, 180, 0.6);
  text-decoration: none;
  pointer-events: all;
  transition: color 0.2s;
}
#page-footer a:hover {
  color: rgba(0, 255, 180, 1);
}

/* ============================================================
   WORLD MAP
   ============================================================ */

.worldmap-wrap {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #06090f;
  color: #00ffcc;
  font-family: 'Share Tech Mono', monospace;
  overflow: hidden;
}

.worldmap-header {
  text-align: center;
  font-size: 13px;
  font-family: 'Orbitron', sans-serif;
  color: #00ffcc;
  letter-spacing: 0.15em;
  padding: 8px 0 6px;
  border-bottom: 1px solid #0a3a3a;
  text-shadow: 0 0 8px #00ffcc88;
  flex-shrink: 0;
}

.worldmap-svg-wrap {
  flex: 1;
  overflow: hidden;
  position: relative;
  padding: 6px 10px 4px;
}

.worldmap-svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Map ocean background */
.map-ocean {
  fill: #040d18;
}

/* Continent land fill */
.continent {
  fill: #0d2b0d;
  stroke: #1a5a1a;
  stroke-width: 0.8;
  stroke-linejoin: round;
}
.continent-ice {
  fill: #1a2a2a;
  stroke: #2a4a4a;
}

/* Graticule grid lines */
.map-graticule {
  stroke: rgba(0, 200, 160, 0.18);
  stroke-width: 0.7;
}
.map-graticule.map-tropic {
  stroke: rgba(255, 200, 0, 0.10);
  stroke-dasharray: 4 4;
}

/* Axis labels */
.map-axis-label {
  fill: rgba(0, 200, 160, 0.35);
  font-size: 8px;
  font-family: 'Share Tech Mono', monospace;
}

/* City dots — unhacked */
.map-city {
  fill: #1a3a3a;
  stroke: #336655;
  stroke-width: 1;
  cursor: default;
  transition: fill 0.3s, stroke 0.3s;
}
.map-city:hover {
  fill: #2a5a5a;
  stroke: #44aa88;
}

/* City dots — hacked/lit */
.map-city.lit {
  fill: #00ffcc;
  stroke: #00ffcc;
  filter: drop-shadow(0 0 4px #00ffcc) drop-shadow(0 0 8px #00ffcc88);
}
.map-city.lit:hover {
  fill: #ffffff;
}

/* City pulse ring (hacked) */
.map-pulse {
  fill: none;
  stroke: #00ffcc;
  stroke-width: 1.2;
  opacity: 0;
  animation: mapPulse 2.4s ease-out infinite;
}

@keyframes mapPulse {
  0%   { r: 4;  opacity: 0.8; }
  100% { r: 16; opacity: 0;   }
}

/* City labels */
.map-city-label {
  fill: #2a6655;
  font-size: 7px;
  font-family: 'Share Tech Mono', monospace;
  letter-spacing: 0.04em;
  text-anchor: middle;
  pointer-events: none;
}
.map-city-label.lit {
  fill: #00ffcc;
  text-shadow: none;
  filter: drop-shadow(0 0 3px #00ffcc);
}

/* Tooltip */
.wm-tooltip {
  display: none;
  position: absolute;
  background: rgba(0, 10, 20, 0.92);
  border: 1px solid #00ffcc55;
  color: #00ffcc;
  font-size: 10px;
  font-family: 'Share Tech Mono', monospace;
  padding: 5px 8px;
  pointer-events: none;
  z-index: 999;
  white-space: nowrap;
  line-height: 1.6;
  box-shadow: 0 0 10px rgba(0,255,200,0.15);
}

/* Footer bar */
.worldmap-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 5px 12px 7px;
  border-top: 1px solid #0a3a3a;
  flex-shrink: 0;
}

.worldmap-legend {
  flex: 1;
  font-size: 10px;
  color: #447766;
  letter-spacing: 0.05em;
}

.wm-legend-dot {
  font-size: 12px;
}
.wm-legend-dot.cold { color: #336655; }
.wm-legend-dot.lit  { color: #00ffcc; text-shadow: 0 0 6px #00ffcc; }

.wm-tropic-key {
  color: rgba(255, 200, 0, 0.45);
  letter-spacing: 2px;
}
.wm-eq-key {
  color: rgba(0, 200, 160, 0.45);
}

.worldmap-stats {
  font-size: 11px;
  font-family: 'Orbitron', sans-serif;
  color: #00ccaa;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.wm-refresh-btn {
  background: transparent;
  border: 1px solid #00ffcc44;
  color: #00ffcc88;
  font-family: 'Share Tech Mono', monospace;
  font-size: 10px;
  padding: 3px 8px;
  cursor: pointer;
  letter-spacing: 0.08em;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.wm-refresh-btn:hover {
  background: rgba(0, 255, 200, 0.08);
  color: #00ffcc;
  border-color: #00ffcc88;
}
