/* === THE ENCYCLOPRISON - RETRO CSS FOUNDATION === */

/* Fonts - the holy trinity of bad taste */
@import url('https://fonts.googleapis.com/css2?family=Comic+Neue:wght@400;700&family=Creepster&family=Press+Start+2P&display=swap');

:root {
  --hot-pink: #ff00ff;
  --lime: #00ff00;
  --electric-blue: #00ffff;
  --yellow: #ffff00;
  --orange: #ff6600;
  --red: #ff0000;
  --purple: #9900ff;
  --dark-bg: #1a0a2e;
  --brick: #8b4513;
  --steel: #708090;
}

/* === RESET & BASE === */
* { box-sizing: border-box; }

body {
  font-family: 'Comic Neue', 'Comic Sans MS', cursive, sans-serif;
  color: var(--lime);
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  min-height: 100vh;
}

a {
  color: var(--electric-blue);
  text-decoration: underline;
  font-weight: bold;
}
a:visited { color: var(--purple); }
a:hover {
  color: var(--yellow);
  text-shadow: 0 0 10px var(--yellow);
  cursor: pointer;
}

h1, h2, h3 {
  font-family: 'Creepster', 'Comic Neue', cursive;
  text-shadow: 3px 3px 0 #000, -1px -1px 0 #000;
}

/* === BACKGROUNDS === */
.bg-brick {
  background-color: #3a1a0a;
  background-image:
    linear-gradient(to right, #5a2a0a 0px, #5a2a0a 100px, #3a1a0a 100px, #3a1a0a 102px),
    linear-gradient(to bottom, #4a2010 0px, #4a2010 30px, #2a0a00 30px, #2a0a00 32px);
  background-size: 102px 32px;
}

.bg-stars {
  background-color: #0a0020;
  background-image:
    radial-gradient(2px 2px at 20px 30px, #fff, transparent),
    radial-gradient(2px 2px at 40px 70px, #fff, transparent),
    radial-gradient(1px 1px at 90px 40px, #fff, transparent),
    radial-gradient(2px 2px at 130px 80px, #fff, transparent),
    radial-gradient(1px 1px at 160px 20px, #fff, transparent),
    radial-gradient(2px 2px at 200px 60px, #aaf, transparent);
  background-size: 220px 100px;
}

.bg-checker {
  background-color: #222;
  background-image:
    linear-gradient(45deg, #333 25%, transparent 25%),
    linear-gradient(-45deg, #333 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #333 75%),
    linear-gradient(-45deg, transparent 75%, #333 75%);
  background-size: 40px 40px;
  background-position: 0 0, 0 20px, 20px -20px, -20px 0px;
}

.bg-void { background: #000; }

.bg-ocean {
  background: linear-gradient(180deg, #001a33 0%, #003366 40%, #004d80 70%, #006699 100%);
}

.bg-green-sky {
  background: linear-gradient(180deg, #2d5a1e 0%, #4a8c2a 30%, #7bc043 60%, #d4d4aa 100%);
}

.bg-hotel {
  background: linear-gradient(180deg, #2c1810 0%, #4a2c20 50%, #6b3a28 100%);
}

.bg-office {
  background: #008080;
}

.bg-garden {
  background: linear-gradient(180deg, #1a4a1a 0%, #2d6b2d 50%, #1a3a1a 100%);
}

/* === ANIMATIONS === */
@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

@keyframes rainbow {
  0% { color: #ff0000; }
  14% { color: #ff7700; }
  28% { color: #ffff00; }
  42% { color: #00ff00; }
  57% { color: #0000ff; }
  71% { color: #8b00ff; }
  85% { color: #ff00ff; }
  100% { color: #ff0000; }
}

@keyframes rainbow-bg {
  0% { background-color: #ff0000; }
  14% { background-color: #ff7700; }
  28% { background-color: #ffff00; }
  42% { background-color: #00ff00; }
  57% { background-color: #0000ff; }
  71% { background-color: #8b00ff; }
  85% { background-color: #ff00ff; }
  100% { background-color: #ff0000; }
}

@keyframes glow-pulse {
  0%, 100% { text-shadow: 0 0 5px currentColor; }
  50% { text-shadow: 0 0 20px currentColor, 0 0 40px currentColor; }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes flicker {
  0%, 95%, 100% { opacity: 1; }
  96% { opacity: 0.3; }
  97% { opacity: 0.8; }
  98% { opacity: 0.2; }
  99% { opacity: 0.9; }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-20px); }
}

@keyframes marquee-scroll {
  0% { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}

@keyframes wobble {
  0%, 100% { transform: rotate(-2deg); }
  50% { transform: rotate(2deg); }
}

@keyframes fall {
  0% { transform: translateY(-100vh); opacity: 0; }
  10% { opacity: 1; }
  100% { transform: translateY(100vh); opacity: 0; }
}

@keyframes typing {
  from { width: 0; }
  to { width: 100%; }
}

@keyframes sweep {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* === UTILITY CLASSES === */
.blink { animation: blink 1s step-end infinite; }
.rainbow-text { animation: rainbow 3s linear infinite; }
.glow { animation: glow-pulse 2s ease-in-out infinite; }
.spin { animation: spin 3s linear infinite; }
.flicker { animation: flicker 4s linear infinite; }
.shake { animation: shake 0.3s ease-in-out infinite; }
.float { animation: float 3s ease-in-out infinite; }
.wobble { animation: wobble 2s ease-in-out infinite; }

.marquee {
  overflow: hidden;
  white-space: nowrap;
}
.marquee-inner {
  display: inline-block;
  animation: marquee-scroll 15s linear infinite;
}

.text-shadow-hard {
  text-shadow: 3px 3px 0 #000;
}

.text-glow-green {
  text-shadow: 0 0 10px var(--lime), 0 0 20px var(--lime);
}

.text-glow-pink {
  text-shadow: 0 0 10px var(--hot-pink), 0 0 20px var(--hot-pink);
}

.border-retro {
  border: 3px ridge #888;
}

.border-double {
  border: 4px double var(--lime);
}

.border-groove {
  border: 4px groove #aa8855;
}

/* === COMPONENTS === */

/* Retro button */
.btn-retro {
  font-family: 'Press Start 2P', monospace;
  font-size: 14px;
  padding: 15px 30px;
  background: linear-gradient(180deg, #666 0%, #333 100%);
  color: var(--lime);
  border: 3px outset #888;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 2px;
}
.btn-retro:hover {
  background: linear-gradient(180deg, #888 0%, #555 100%);
  border-style: inset;
  text-shadow: 0 0 10px var(--lime);
}
.btn-retro:active {
  transform: scale(0.95);
}

/* Big dramatic button */
.btn-dramatic {
  font-family: 'Creepster', cursive;
  font-size: 32px;
  padding: 20px 60px;
  background: linear-gradient(180deg, #cc0000 0%, #660000 100%);
  color: var(--yellow);
  border: 4px outset #ff4444;
  cursor: pointer;
  text-shadow: 2px 2px 0 #000;
  animation: glow-pulse 2s ease-in-out infinite;
}
.btn-dramatic:hover {
  background: linear-gradient(180deg, #ff0000 0%, #880000 100%);
  transform: scale(1.1);
  animation: shake 0.3s ease-in-out infinite;
}

/* Visitor counter */
.visitor-counter {
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  color: var(--yellow);
  background: #000;
  border: 2px inset #666;
  padding: 5px 10px;
  display: inline-block;
  text-align: center;
}

/* Under construction banner */
.under-construction {
  background: repeating-linear-gradient(
    -45deg,
    #000,
    #000 10px,
    var(--yellow) 10px,
    var(--yellow) 20px
  );
  padding: 8px;
  text-align: center;
}
.under-construction span {
  background: #000;
  color: var(--yellow);
  padding: 4px 12px;
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
}

/* Fire bar separator */
.fire-bar {
  height: 20px;
  background: linear-gradient(90deg,
    #ff0000, #ff6600, #ffff00, #ff6600, #ff0000,
    #ff6600, #ffff00, #ff6600, #ff0000);
  background-size: 200% 100%;
  animation: marquee-scroll 2s linear infinite;
}

/* Chat/terminal style */
.terminal {
  background: #000;
  border: 2px solid var(--lime);
  padding: 20px;
  font-family: 'Courier New', monospace;
  color: var(--lime);
  max-width: 600px;
  margin: 0 auto;
  box-shadow: 0 0 20px rgba(0, 255, 0, 0.3);
}

.terminal input {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--lime);
  color: var(--lime);
  font-family: 'Courier New', monospace;
  font-size: 16px;
  width: 80%;
  outline: none;
}

.terminal .prompt::before {
  content: "> ";
  color: var(--lime);
}

/* Chat bubble */
.chat-bubble {
  background: #1a1a2e;
  border: 2px solid var(--electric-blue);
  border-radius: 15px;
  padding: 12px 18px;
  margin: 8px 0;
  max-width: 80%;
  color: #fff;
  position: relative;
}
.chat-bubble.bot {
  margin-right: auto;
  border-color: var(--hot-pink);
}
.chat-bubble.user {
  margin-left: auto;
  border-color: var(--electric-blue);
}

/* Win98 window */
.win98-window {
  background: #c0c0c0;
  border: 2px outset #fff;
  box-shadow: 2px 2px 0 #000;
}
.win98-titlebar {
  background: linear-gradient(90deg, #000080, #1084d0);
  color: white;
  font-family: 'Trebuchet MS', sans-serif;
  font-size: 12px;
  font-weight: bold;
  padding: 3px 5px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.win98-titlebar-buttons {
  display: flex;
  gap: 2px;
}
.win98-titlebar-btn {
  width: 16px;
  height: 14px;
  background: #c0c0c0;
  border: 1px outset #fff;
  font-size: 8px;
  line-height: 12px;
  text-align: center;
  cursor: pointer;
  color: #000;
}
.win98-body {
  padding: 10px;
  background: #fff;
  margin: 3px;
  border: 1px inset #888;
  color: #000;
  font-family: 'Trebuchet MS', sans-serif;
}

/* Desktop icon */
.desktop-icon {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  width: 80px;
  padding: 5px;
  cursor: pointer;
  text-align: center;
  color: #fff;
  font-size: 11px;
  text-shadow: 1px 1px 2px #000;
}
.desktop-icon:hover {
  background: rgba(0, 0, 128, 0.4);
  outline: 1px dotted #fff;
}
.desktop-icon .icon {
  font-size: 32px;
  margin-bottom: 4px;
}

/* Card for clickable items */
.card-clickable {
  background: rgba(0, 0, 0, 0.6);
  border: 2px solid #555;
  padding: 15px;
  cursor: pointer;
  transition: all 0.2s;
}
.card-clickable:hover {
  border-color: var(--yellow);
  box-shadow: 0 0 15px rgba(255, 255, 0, 0.3);
  transform: scale(1.02);
}

/* Progress bar */
.progress-bar-container {
  background: #000;
  border: 2px inset #666;
  height: 25px;
  width: 100%;
  max-width: 400px;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--lime), var(--electric-blue));
  width: 0%;
  transition: width 0.3s;
}

/* Fake scrollbar gutter for retro feel */
.page-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}

.center-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  text-align: center;
  padding: 20px;
}

/* HR styles */
hr.retro {
  border: none;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--hot-pink), var(--electric-blue), var(--lime), var(--yellow), transparent);
  margin: 20px 0;
}

hr.fire {
  border: none;
  height: 15px;
  background: linear-gradient(90deg,
    #ff0000, #ff6600, #ffff00, #ff6600, #ff0000,
    #ff6600, #ffff00, #ff6600, #ff0000);
  background-size: 200% 100%;
  animation: marquee-scroll 2s linear infinite;
}

/* Tooltip */
.tooltip {
  position: absolute;
  background: #000;
  color: var(--yellow);
  padding: 8px 12px;
  border: 1px solid var(--yellow);
  font-size: 12px;
  pointer-events: none;
  z-index: 1000;
  font-family: 'Comic Neue', cursive;
}

/* Sparkle cursor canvas */
#sparkle-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 99999;
}

/* Hidden link */
.hidden-link {
  color: inherit;
  text-decoration: none;
}
.hidden-link:hover {
  text-decoration: underline;
  text-shadow: 0 0 5px var(--yellow);
}
