/* Chud Fertilization Factory – 90s GeoCities / Cameron's World aesthetic */

:root {
  --bg: #d4d0c8;
  --bg-pattern: #c0c0c0;
  --surface: #ffffcc;
  --surface-alt: #ccffcc;
  --text: #000000;
  --text-muted: #333333;
  --accent: #0000ff;
  --accent-visited: #800080;
  --accent-hover: #ff00ff;
  --peak: #006600;
  --peak-bg: #ccffcc;
  --fertile: #996600;
  --fertile-bg: #ffff99;
  --recovery: #660066;
  --recovery-bg: #ffccff;
  --border: #000000;
  --radius: 0;
  --shadow: none;
  --font-sans: "Comic Sans MS", "Trebuchet MS", Arial, sans-serif;
  --font-display: "Times New Roman", Georgia, serif;
  --font-mono: "Courier New", monospace;
}

/* Dark mode – neon-on-dark 90s */
html.theme-dark {
  --bg: #000066;
  --bg-pattern: #000044;
  --surface: #1a1a3e;
  --surface-alt: #2a1a4e;
  --text: #00ff00;
  --text-muted: #00cccc;
  --accent: #00ffff;
  --accent-visited: #ff00ff;
  --accent-hover: #ffff00;
  --peak-bg: #003300;
  --fertile-bg: #332200;
  --recovery-bg: #330033;
  --border: #00ff00;
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

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

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Local 90s assets: assets/blinkies/, assets/backgrounds/ */

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.4;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(212, 208, 200, 0.82), rgba(212, 208, 200, 0.82)),
    url("assets/backgrounds/marbleshine.gif");
  background-repeat: repeat;
}

html.theme-dark body {
  background-image:
    linear-gradient(rgba(0, 0, 50, 0.9), rgba(0, 0, 50, 0.9)),
    url("assets/backgrounds/redsparkle.gif");
  background-repeat: repeat;
}

/* Page-specific + scroll-phase backgrounds */
body {
  background-attachment: scroll;
  transition: background-color 0.4s ease, background-image 0.4s ease;
}

body.page-index.bg-phase-0 { background-image: linear-gradient(rgba(212, 208, 200, 0.78), rgba(212, 208, 200, 0.78)), url("assets/backgrounds/marbleshine.gif"); }
body.page-index.bg-phase-1 { background-image: linear-gradient(rgba(220, 200, 220, 0.75), rgba(220, 200, 220, 0.75)), url("assets/backgrounds/raindrops.webp"); }
body.page-index.bg-phase-2 { background-image: linear-gradient(rgba(200, 220, 220, 0.75), rgba(200, 220, 220, 0.75)), url("assets/backgrounds/redsparkle.gif"); }

html.theme-dark body.page-index.bg-phase-0 { background-image: linear-gradient(rgba(0, 0, 50, 0.88), rgba(0, 0, 50, 0.88)), url("assets/backgrounds/redsparkle.gif"); }
html.theme-dark body.page-index.bg-phase-1 { background-image: linear-gradient(rgba(30, 20, 60, 0.88), rgba(30, 20, 60, 0.88)), url("assets/backgrounds/raindrops.webp"); }
html.theme-dark body.page-index.bg-phase-2 { background-image: linear-gradient(rgba(20, 40, 50, 0.88), rgba(20, 40, 50, 0.88)), url("assets/backgrounds/red.gif"); }

body.page-profile.bg-phase-0 { background-image: linear-gradient(rgba(204, 220, 220, 0.82), rgba(204, 220, 220, 0.82)), url("assets/backgrounds/water.png"); }
body.page-profile.bg-phase-1 { background-image: linear-gradient(rgba(212, 208, 200, 0.78), rgba(212, 208, 200, 0.78)), url("assets/backgrounds/water2.webp"); }
body.page-profile.bg-phase-2 { background-image: linear-gradient(rgba(220, 204, 220, 0.78), rgba(220, 204, 220, 0.78)), url("assets/backgrounds/red.gif"); }

html.theme-dark body.page-profile.bg-phase-0 { background-image: linear-gradient(rgba(30, 20, 60, 0.88), rgba(30, 20, 60, 0.88)), url("assets/backgrounds/water.png"); }
html.theme-dark body.page-profile.bg-phase-1 { background-image: linear-gradient(rgba(0, 0, 50, 0.88), rgba(0, 0, 50, 0.88)), url("assets/backgrounds/water2.webp"); }
html.theme-dark body.page-profile.bg-phase-2 { background-image: linear-gradient(rgba(40, 20, 50, 0.88), rgba(40, 20, 50, 0.88)), url("assets/backgrounds/red.gif"); }

body.bg-phase-0,
body.bg-phase-1,
body.bg-phase-2 {
  background-repeat: repeat;
}

.app {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 1rem 1.5rem 2rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body.page-profile .app {
  max-width: none;
}

/* Header */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 3px double var(--border);
}

.logo {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--accent);
  margin: 0;
  text-decoration: none;
}

.logo:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Header buttons – override 98.css global button so theme/mute keep our look */
.theme-toggle,
.music-mute,
.music-mute-header {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: bold;
  padding: 0.35rem 0.6rem;
  border: 2px outset var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.theme-toggle:hover,
.music-mute:hover,
.music-mute-header:hover {
  border-style: inset;
  background: var(--bg-pattern);
}

.nav-link {
  color: var(--accent);
  text-decoration: underline;
  font-weight: bold;
  font-size: 0.95rem;
}

.nav-link:hover {
  color: var(--accent-hover);
}

.nav-link:visited {
  color: var(--accent-visited);
}

/* Section backgrounds – different images per area */
.notice {
  margin-bottom: 1.5rem;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border);
  border-left: 5px solid #c00;
  font-size: 0.9rem;
  color: var(--text);
  font-family: var(--font-sans);
  background-color: var(--surface);
  background-image: linear-gradient(rgba(255, 255, 204, 0.9), rgba(255, 255, 204, 0.9)), url("assets/backgrounds/water.png");
  background-repeat: repeat;
}

html.theme-dark .notice {
  border-left-color: #f44;
  background-image: linear-gradient(rgba(26, 26, 62, 0.92), rgba(26, 26, 62, 0.92)), url("assets/backgrounds/water.png");
}

.notice strong {
  font-weight: bold;
}

.nineties-hr {
  border: none;
  border-top: 3px solid var(--border);
  margin: 1rem 0 1.5rem 0;
}

/* GeoCities archive graphics */
.geocities-banner-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem 1rem;
  margin-bottom: 1rem;
  padding: 0.5rem 0;
}

.geocities-gif,
.blinkie {
  display: inline-block;
  vertical-align: middle;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

.blinkie { width: 88px; height: 31px; object-fit: contain; }

.geocities-divider {
  display: block;
  margin: 1rem auto;
  max-width: 100%;
  height: auto;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

.geocities-welcome {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: bold;
  margin: 0.5rem 0;
  color: var(--text);
  text-align: center;
}

.geocities-intro {
  font-size: 0.9rem;
  font-style: italic;
  margin: 0.25rem 0 0.75rem 0;
  color: var(--text-muted);
  text-align: center;
}

.geocities-email {
  font-size: 0.9rem;
  margin: 0.5rem 0;
  text-align: center;
}

.geocities-email a {
  color: var(--accent);
  text-decoration: underline;
}

.geocities-email a:hover { color: var(--accent-hover); }
.geocities-email a:visited { color: var(--accent-visited); }

.geocities-attribution {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.geocities-attribution a {
  color: var(--accent);
  text-decoration: underline;
}

.geocities-attribution a:hover { color: var(--accent-hover); }
.geocities-attribution a:visited { color: var(--accent-visited); }

/* GeoCities collage strip (Cameron's World–style) */
.geocities-collage {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem 1rem;
  padding: 1rem 0;
}

.geocities-collage .geocities-gif {
  opacity: 0.9;
}

.geocities-collage .geocities-gif:hover {
  opacity: 1;
}

.geocities-inline {
  padding: 0.35rem 0;
  margin-bottom: 0.25rem;
  justify-content: flex-start;
}

/* Footer: one line only, fill width */
.footer .geocities-footer-row {
  flex-wrap: nowrap;
  justify-content: space-evenly;
  gap: 0.5rem 1.5rem;
}

.footer .geocities-footer-row .blinkie {
  flex-shrink: 0;
}

/* Collage above site-status: one line, fill space */
.geocities-collage {
  flex-wrap: nowrap;
  justify-content: space-evenly;
}

.geocities-collage .geocities-gif {
  flex-shrink: 0;
}

.geocities-in-card {
  margin-top: 0.5rem;
}

/* Main */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Cards – 90s table-like panels, tiled backgrounds */
.card {
  border: 2px solid var(--border);
  padding: 1rem 1.25rem;
  box-shadow: none;
  background-color: var(--surface);
  background-image: linear-gradient(rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.85)), url("assets/backgrounds/redsparkle.gif");
  background-repeat: repeat;
}

[data-status="peak"] {
  background-color: var(--peak-bg);
  background-image: linear-gradient(rgba(204, 255, 204, 0.9), rgba(204, 255, 204, 0.9)), url("assets/backgrounds/marbleshine.gif");
  border-color: var(--peak);
}

[data-status="fertile"] {
  background-color: var(--fertile-bg);
  background-image: linear-gradient(rgba(255, 255, 153, 0.9), rgba(255, 255, 153, 0.9)), url("assets/backgrounds/water.png");
  border-color: var(--fertile);
}

[data-status="recovery"] {
  background-color: var(--recovery-bg);
  background-image: linear-gradient(rgba(255, 204, 255, 0.9), rgba(255, 204, 255, 0.9)), url("assets/backgrounds/redsparkle.gif");
  border-color: var(--recovery);
}

html.theme-dark .card {
  background-image: linear-gradient(rgba(26, 26, 62, 0.9), rgba(26, 26, 62, 0.9)), url("assets/backgrounds/redsparkle.gif");
}

html.theme-dark [data-status="peak"] {
  background-image: linear-gradient(rgba(0, 51, 0, 0.9), rgba(0, 51, 0, 0.9)), url("assets/backgrounds/redsparkle.gif");
}

html.theme-dark [data-status="fertile"] {
  background-image: linear-gradient(rgba(51, 34, 0, 0.9), rgba(51, 34, 0, 0.9)), url("assets/backgrounds/water.png");
}

html.theme-dark [data-status="recovery"] {
  background-image: linear-gradient(rgba(51, 0, 51, 0.9), rgba(51, 0, 51, 0.9)), url("assets/backgrounds/marbleshine.gif");
}

/* Search – 98.css window (field-row, button). Override only .search-result. */
.search-section {
  margin-bottom: 0;
}

.search-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.75rem 1rem;
  width: 100%;
}

.search-and-player {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: 1rem;
  flex: 1 1 100%;
  min-width: 0;
}

@media (min-width: 900px) {
  .search-and-player {
    flex: 1 1 auto;
    max-width: 100%;
  }
}

.search-row .win98-search-inline {
  flex-shrink: 0;
}

.search-row .music-player-inline {
  flex: 1;
  min-width: 260px;
  margin-top: 0;
}

.search-row .search-row-gifs {
  flex: 0 0 auto;
  margin-bottom: 0;
  justify-content: flex-start;
}

.search-row-gifs-left {
  width: 100%;
}

@media (min-width: 900px) {
  .search-row-gifs-left {
    width: auto;
    flex: 0 0 auto;
  }

  .search-row-gifs-right {
    flex: 1 1 auto;
    min-width: 0;
  }
}

.win98-search .field-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.win98-search .field-row label {
  min-width: 4em;
  flex-shrink: 0;
}

.win98-search .field-row input {
  flex: 1;
  min-width: 180px;
}

.win98-search .search-result {
  margin: 0.75rem 0 0 0;
  font-size: 0.95rem;
  font-style: italic;
}

/* Credits – full-width row of three 98.css windows */
.credits-section {
  margin-top: 1rem;
  width: 100%;
}

.credits-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  width: 100%;
}

.win98-credits-box {
  flex: 1;
  min-width: 200px;
}

.win98-credits .window-body p {
  margin: 0 0 0.5rem 0;
}

.win98-credits .window-body p:last-of-type {
  margin-bottom: 0;
}

.win98-credits .status-bar a {
  color: inherit;
  text-decoration: underline;
}

.win98-credits .status-bar a:hover {
  text-decoration: none;
}

.search-result {
  margin: 1rem 0 0 0;
  font-size: 1rem;
  font-style: italic;
  color: var(--text-muted);
}

.search-result-link {
  color: var(--accent);
  text-decoration: underline;
}

.search-result-link:hover {
  color: var(--accent-hover);
}

.search-result-link:visited {
  color: var(--accent-visited);
}

.search-result-error {
  color: #c00;
  font-style: normal;
}

.status-blocks-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Section title */
.section-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: bold;
  margin: 0 0 1rem 0;
  color: var(--text);
}

/* Status blocks */
.status-block {
  position: relative;
  padding-top: 2.5rem;
}

.status-heading {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: bold;
  margin: 0 0 0.25rem 0;
  color: var(--text);
  position: absolute;
  top: 1rem;
  left: 1rem;
}

.pct {
  font-weight: bold;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.see-all {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 0.9rem;
  color: var(--accent);
  text-decoration: underline;
  font-weight: bold;
}

.see-all:hover {
  color: var(--accent-hover);
}

.see-all:visited {
  color: var(--accent-visited);
}

/* Tables – 90s bordered style */
.table-wrap {
  overflow-x: auto;
  margin-top: 0.5rem;
  border: 1px solid var(--border);
}

.status-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  background: var(--surface);
}

.status-table th,
.status-table td {
  padding: 0.5rem 0.6rem;
  text-align: left;
  border: 1px solid var(--border);
}

.status-table th {
  font-weight: bold;
  background: var(--bg-pattern);
  color: var(--text);
  font-size: 0.85rem;
  text-transform: none;
}

html.theme-dark .status-table th {
  background: var(--surface-alt);
}

.status-table tbody tr:hover {
  background: var(--surface-alt);
}

.status-table .icon-cell {
  width: 48px;
  padding-right: 0.5rem;
  vertical-align: middle;
}

.status-table .avatar,
.status-table .avatar-img {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  display: block;
  object-fit: cover;
  background: var(--bg-pattern);
}

.status-table .avatar-img {
  font-size: 0;
}

html.theme-dark .status-table .avatar,
html.theme-dark .status-table .avatar-img {
  background: var(--surface-alt);
}

.status-table .name-cell {
  font-weight: bold;
}

.status-table .name-link {
  color: var(--accent);
  text-decoration: underline;
}

.status-table .name-link:hover {
  color: var(--accent-hover);
}

.status-table .name-link:visited {
  color: var(--accent-visited);
}

.status-table .desc-cell {
  color: var(--text-muted);
  font-size: 0.85rem;
  max-width: 320px;
}

@media (min-width: 900px) {
  .status-table .desc-cell {
    max-width: 50%;
  }
}

/* Trending */
.trending-section {
  position: relative;
  padding-top: 2.5rem;
  background-color: var(--surface) !important;
  background-image: linear-gradient(rgba(255, 255, 204, 0.88), rgba(255, 255, 204, 0.88)), url("assets/backgrounds/marbleshine.gif") !important;
  background-repeat: repeat;
}

html.theme-dark .trending-section {
  background-image: linear-gradient(rgba(26, 26, 62, 0.9), rgba(26, 26, 62, 0.9)), url("assets/backgrounds/marbleshine.gif") !important;
}

.trending-section .status-heading {
  position: absolute;
  top: 1rem;
  left: 1rem;
}

.trending-section .see-all {
  position: absolute;
  top: 1rem;
  right: 1rem;
}

/* Site status */
.site-status .status-heading {
  margin: 0 0 0.75rem 0;
  position: static;
}

.site-status p {
  margin: 0 0 0.35rem 0;
  font-size: 0.95rem;
  color: var(--text);
}

.site-status strong {
  color: var(--accent);
}

/* Music player – progress bar, marquee, controls */
.music-player-section {
  margin-top: 1rem;
}

.music-player {
  margin-top: 0.75rem;
  width: 100%;
}

.music-marquee-wrap {
  overflow: hidden;
  white-space: nowrap;
  padding: 0.35rem 0.5rem;
  margin-bottom: 0.5rem;
  border: 1px solid var(--border);
  background: var(--bg-pattern);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text);
  max-width: 100%;
  width: 100%;
}

@media (min-width: 640px) {
  .music-marquee-wrap {
    max-width: 420px;
  }
}

html.theme-dark .music-marquee-wrap {
  background: var(--surface-alt);
}

.music-marquee {
  display: inline-flex;
  width: max-content;
  animation: music-marquee 24s linear infinite;
}

.music-marquee-inner {
  display: inline-block;
  padding-right: 2em;
  flex-shrink: 0;
}

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

.music-progress-wrap {
  height: 12px;
  width: 100%;
  background: var(--bg-pattern);
  border: 1px solid var(--border);
  margin-bottom: 0.5rem;
  cursor: pointer;
  position: relative;
}

html.theme-dark .music-progress-wrap {
  background: var(--surface-alt);
}

.music-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.05s linear;
}

html.theme-dark .music-progress-fill {
  background: var(--accent);
}

.music-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  width: 100%;
}

.music-player-inline .music-controls {
  flex-wrap: nowrap;
}

.music-player-inline .music-controls .music-time,
.music-player-inline .music-controls .music-btn {
  flex-shrink: 0;
}

.music-time {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  min-width: 7em;
}

.music-btn {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: bold;
  padding: 0.3rem 0.6rem;
  border: 2px outset var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.music-btn:hover {
  border-style: inset;
  background: var(--bg-pattern);
}

.music-btn-main {
  font-size: 1rem;
  padding: 0.35rem 0.75rem;
}

/* Footer */
.footer {
  margin-top: 2rem;
  padding: 1.5rem 1rem 1rem;
  border-top: 3px double var(--border);
  text-align: center;
  background-color: var(--surface);
  background-image: linear-gradient(rgba(255, 255, 204, 0.9), rgba(255, 255, 204, 0.9)), url("assets/backgrounds/marbleshine.gif");
  background-repeat: repeat;
}

html.theme-dark .footer {
  background-image: linear-gradient(rgba(26, 26, 62, 0.9), rgba(26, 26, 62, 0.9)), url("assets/backgrounds/redsparkle.gif");
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem 1.25rem;
  margin-bottom: 0.75rem;
}

.footer-nav a {
  color: var(--accent);
  text-decoration: underline;
  font-size: 0.9rem;
  font-weight: bold;
}

.footer-nav a:hover {
  color: var(--accent-hover);
}

.footer-nav a:visited {
  color: var(--accent-visited);
}

.footer-disclaimer,
.footer-copy {
  margin: 0.25rem 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* 90s under-construction banner */
.nineties-banner {
  text-align: center;
  margin-bottom: 1rem;
  padding: 0.5rem;
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--text-muted);
}

.nineties-banner .blink {
  display: inline-block;
  margin: 0 0.25rem;
}

.visitor-counter {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* Characters page */
.characters-section.card {
  width: 100%;
  box-sizing: border-box;
  border: 2px solid var(--border);
  background-image: linear-gradient(rgba(255, 255, 204, 0.88), rgba(255, 255, 204, 0.88)), url("assets/backgrounds/water.png");
}

html.theme-dark .characters-section.card {
  background-image: linear-gradient(rgba(42, 26, 78, 0.92), rgba(42, 26, 78, 0.92)), url("assets/backgrounds/water.png");
}

.characters-section .section-title {
  margin-bottom: 0.5rem;
}

.characters-intro {
  margin: 0 0 1rem 0;
  font-size: 0.95rem;
  color: var(--text);
  font-family: var(--font-sans);
}

.characters-list {
  margin-top: 0.5rem;
}

.characters-ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.5rem 1.5rem;
}

.characters-ul li {
  margin: 0;
}

.character-link {
  color: var(--accent);
  text-decoration: underline;
  font-size: 0.95rem;
}

.character-link:hover {
  color: var(--accent-hover);
}

.character-link:visited {
  color: var(--accent-visited);
}

.characters-empty {
  margin: 0;
  font-style: italic;
  color: var(--text-muted);
}

@media (min-width: 640px) {
  .app {
    padding: 1.5rem 2rem 2rem;
  }

  .logo {
    font-size: 1.75rem;
  }
}
