/* ==========================================================================
   SURFNET-KIT — Win95/98 Desktop Shell & Portal Components
   ========================================================================== */

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

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

html {
  scrollbar-color: #bdbdbd #dedede;
  scrollbar-width: thin;
}
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #dedede; }
::-webkit-scrollbar-thumb {
  background: #bdbdbd;
  border: 2px solid;
  border-color: #fff #555 #555 #fff;
  border-radius: 0;
}

body {
  background-color: var(--bg-color);
  background-image: var(--bg-tile);
  background-repeat: repeat;
  background-attachment: fixed;
  color: var(--text-main);
  font-family: Tahoma, "MS Sans Serif", Verdana, Arial, sans-serif;
  font-size: 13px;
  line-height: 1.45;
  padding-bottom: 54px;
}

a {
  color: var(--link-color);
}
a:hover {
  color: var(--link-hover);
}

img.pixel {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* Bevel Utility Classes */
.bevel-out {
  background: var(--win-bg);
  border: 2px solid;
  border-color: var(--win-border-light) var(--win-border-deep) var(--win-border-deep) var(--win-border-light);
  box-shadow: inset 1px 1px 0 var(--win-border-mid), inset -1px -1px 0 var(--win-border-dark);
}

.bevel-in {
  background: var(--win-surface);
  border: 2px solid;
  border-color: var(--win-border-dark) var(--win-border-light) var(--win-border-light) var(--win-border-dark);
  box-shadow: inset 1px 1px 0 var(--win-border-deep), inset -1px -1px 0 var(--win-border-mid);
}

.btn98 {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 5px 11px;
  background: var(--win-bg);
  color: var(--text-main);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  border: 2px solid;
  border-color: var(--win-border-light) var(--win-border-deep) var(--win-border-deep) var(--win-border-light);
  box-shadow: inset -1px -1px 0 var(--win-border-dark);
  user-select: none;
}

.btn98:hover {
  filter: brightness(1.05);
}

.btn98:active,
.btn98.is-active {
  border-color: var(--win-border-deep) var(--win-border-light) var(--win-border-light) var(--win-border-deep);
  box-shadow: inset 1px 1px 0 var(--win-border-dark);
  transform: translate(1px, 1px);
}

.btn98-primary {
  background: var(--brand-primary, linear-gradient(180deg, #ff38b8 0%, #c80088 100%));
  color: #ffffff;
}

.btn98-cyan {
  background: var(--brand-secondary, linear-gradient(180deg, #1ae0ff 0%, #0095b8 100%));
  color: #061826;
}

.btn98-rainbow {
  background: linear-gradient(90deg, #ff0099 0%, #ff7a00 22%, #ffd500 44%, #00d95f 64%, #00d0ff 82%, #8a2be2 100%);
  color: #ffffff;
  text-shadow: 1px 1px 0 #000000;
}

.btn98-sm {
  padding: 2px 7px;
  font-size: 11px;
}

/* Top Classic ISP Browser / Portal Chrome */
.portal-topbar {
  position: sticky;
  top: 0;
  z-index: 400;
  padding: 6px 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.portal-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.portal-brand img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.portal-brand-text strong {
  display: block;
  font-size: 15px;
  letter-spacing: 0.2px;
}

.portal-brand-text small {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
}

.portal-address {
  flex: 1 1 240px;
  max-width: 420px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.portal-address span {
  font-size: 11px;
  font-weight: 700;
}

.portal-address-bar {
  flex: 1;
  padding: 4px 8px;
  font-family: "Courier New", monospace;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.portal-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.portal-select {
  padding: 4px 6px;
  font-family: inherit;
  font-size: 12px;
  color: var(--text-main);
  background: var(--win-surface);
  border: 2px inset var(--win-border-dark);
}

/* Marquee Ticker Ribbon */
.portal-ticker {
  padding: 4px 10px;
  background: #0b0e22;
  color: #00f0ff;
  border-bottom: 2px solid var(--win-border-deep);
  font-family: "Courier New", monospace;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: hidden;
}

.ticker-badge {
  background: var(--accent-magenta);
  color: #ffffff;
  padding: 1px 6px;
  font-size: 10px;
  text-transform: uppercase;
  flex-shrink: 0;
}

.ticker-track {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
}

.ticker-text {
  display: inline-block;
  padding-left: 100%;
  animation: surfnet-marquee 26s linear infinite;
}

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

@media (prefers-reduced-motion: reduce) {
  .ticker-text {
    animation: none;
    padding-left: 0;
  }
}

/* Under Construction Strip */
.construction-banner {
  margin: 10px auto 0;
  max-width: 1360px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: repeating-linear-gradient(
    -45deg,
    #ffcc00,
    #ffcc00 12px,
    #1a1a1a 12px,
    #1a1a1a 24px
  );
  border: 2px solid #000;
}

.construction-banner-inner {
  background: var(--win-bg);
  padding: 6px 14px;
  border: 2px outset var(--win-border-light);
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

.construction-banner img {
  height: 44px;
  width: auto;
}

/* Main 3-Column Portal Grid */
.desktop-grid {
  max-width: 1380px;
  margin: 14px auto;
  padding: 0 12px;
  display: grid;
  grid-template-columns: 205px minmax(0, 1fr) 235px;
  gap: 14px;
  align-items: start;
}

/* Standard Win98 Window Frame */
.win98 {
  background: var(--win-bg);
  border: 2px solid;
  border-color: var(--win-border-light) var(--win-border-deep) var(--win-border-deep) var(--win-border-light);
  box-shadow: inset 1px 1px 0 var(--win-border-mid), inset -1px -1px 0 var(--win-border-dark), var(--shadow-win);
  margin-bottom: 14px;
}

.win98.is-hidden {
  display: none !important;
}

.win98.is-maximized {
  position: fixed !important;
  inset: 52px 12px 46px 12px !important;
  width: auto !important;
  z-index: 350 !important;
  margin: 0 !important;
  display: flex;
  flex-direction: column;
}

.win98.is-maximized .win98-body {
  flex: 1;
  overflow: auto;
}

.win98-titlebar {
  background: var(--titlebar-active);
  color: var(--titlebar-text);
  padding: 4px 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-weight: 700;
  font-size: 12px;
  user-select: none;
}

.win98.is-inactive .win98-titlebar {
  background: var(--titlebar-inactive);
}

.win98-title-left {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.win98-title-left img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.win98-title-left span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.win98-controls {
  display: flex;
  gap: 3px;
  flex-shrink: 0;
}

.win98-ctrl {
  width: 18px;
  height: 18px;
  padding: 0;
  background: var(--win-bg);
  color: var(--text-main);
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  border: 2px solid;
  border-color: var(--win-border-light) var(--win-border-deep) var(--win-border-deep) var(--win-border-light);
}

.win98-body {
  padding: 12px;
}

.win98-header-art {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 12px;
}

.win98-header-art img {
  max-height: 180px;
  max-width: 100%;
  width: auto;
  object-fit: contain;
}

.win98-divider {
  display: block;
  width: min(100%, 480px);
  height: auto;
  margin: 12px auto;
}

/* Left Sidebar: Channels */
.channel-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.channel-btn {
  width: 100%;
  justify-content: flex-start;
  padding: 6px 8px;
  text-align: left;
  font-size: 12px;
}

.channel-btn img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  flex-shrink: 0;
}

.channel-btn.is-current {
  background: var(--win-surface);
  border-color: var(--win-border-deep) var(--win-border-light) var(--win-border-light) var(--win-border-deep);
  color: var(--accent-magenta);
}

/* Right Sidebar: Buddy List & Hit Counter */
.owner-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  margin-bottom: 8px;
}

.owner-card img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.away-box {
  padding: 7px 8px;
  font-size: 11px;
  font-style: italic;
  margin-bottom: 10px;
}

.buddy-group-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin: 8px 0 5px;
  color: var(--text-muted);
}

.buddy-roster {
  list-style: none;
  margin: 0;
  padding: 6px;
  max-height: 170px;
  overflow-y: auto;
}

.buddy-roster li {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 4px;
  font-size: 12px;
}

.buddy-roster img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.online-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #14d85c;
  border: 1px solid #000;
  flex-shrink: 0;
}

.hit-counter-wrap {
  margin-top: 10px;
  text-align: center;
  padding: 8px;
}

.hit-counter-digits {
  display: inline-flex;
  gap: 2px;
  background: #000;
  padding: 4px 6px;
  border: 2px inset #666;
  margin-top: 4px;
}

.hit-counter-digits span {
  display: inline-block;
  width: 18px;
  height: 24px;
  line-height: 24px;
  background: linear-gradient(180deg, #1c1c1c 0%, #050505 50%, #1c1c1c 100%);
  color: #39ff14;
  font-family: "Courier New", monospace;
  font-size: 15px;
  font-weight: 700;
  border: 1px solid #333;
}

.award-box {
  margin-top: 10px;
  text-align: center;
}

.award-box img {
  width: 120px;
  height: auto;
}

/* Catalog / Shop & Gallery Cards */
.retro-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
}

.retro-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 10px;
}

.retro-card-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 54px;
  height: 54px;
  object-fit: contain;
  pointer-events: none;
  z-index: 2;
}

.retro-card-media {
  height: 150px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  place-items: center;
  padding: 8px;
  margin-bottom: 8px;
  overflow: hidden;
  cursor: pointer;
}

.retro-card-media img {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  object-fit: contain;
  object-position: center;
}

.retro-card h3 {
  margin: 0 0 4px;
  font-size: 14px;
}

.retro-card p {
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--text-muted);
  flex: 1;
}

.retro-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: auto;
}

.price-tag {
  font-family: "Courier New", monospace;
  font-weight: 700;
  font-size: 14px;
  color: var(--accent-magenta);
}

.shop-bag { margin-top: 14px; padding: 10px; }
.shop-bag ul { padding-left: 20px; }
.shop-bag li { margin-bottom: 6px; }
.shop-bag button { margin-left: 6px; }
.surfnet-legal { max-width: 760px; margin: 4rem auto 1rem; }
.surfnet-legal h1, .surfnet-consent h2 { margin: 0; font: inherit; }
.surfnet-legal-copy { white-space: normal; overflow-wrap: anywhere; }
.surfnet-legal-footer, .surfnet-legal-links { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px; padding: 12px; }
.surfnet-consent { position: fixed; z-index: 9999; bottom: 60px; right: 12px; width: min(460px, calc(100% - 24px)); max-height: calc(100vh - 72px); overflow: auto; }
.surfnet-consent[hidden] { display: none; }
.surfnet-consent-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* About / News / Links Lists */
.about-copy {
  padding: 12px;
  white-space: pre-line;
  font-size: 13px;
}

.links-list,
.news-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.link-row,
.news-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
}

.link-row img,
.news-row img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  flex-shrink: 0;
}

.link-row-meta {
  flex: 1;
  min-width: 0;
}

.link-row-meta strong {
  display: block;
  font-size: 13px;
}

.link-row-meta small {
  color: var(--text-muted);
}

/* Winamp-Inspired Music Lounge */
.winamp-deck {
  background: #1a1d26;
  color: #39ff14;
  border: 2px solid;
  border-color: #4f556b #08090d #08090d #4f556b;
  padding: 10px;
  font-family: "Courier New", monospace;
}

.winamp-top {
  display: grid;
  grid-template-columns: 1fr 140px;
  gap: 10px;
  margin-bottom: 10px;
}

.winamp-lcd {
  background: #060b07;
  border: 2px inset #333;
  padding: 8px;
}

.winamp-track-title {
  font-size: 13px;
  font-weight: 700;
  color: #39ff14;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.winamp-track-sub {
  font-size: 11px;
  color: #00e5ff;
  margin-top: 3px;
}

.winamp-viz {
  width: 100%;
  height: 54px;
  background: #04070d;
  border: 2px inset #333;
  display: block;
}

.winamp-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}

.winamp-playlist {
  list-style: none;
  margin: 0;
  padding: 4px;
  background: #080a10;
  border: 2px inset #333;
  max-height: 170px;
  overflow-y: auto;
}

.winamp-playlist li {
  padding: 5px 8px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: #9be8ff;
}

.winamp-playlist li:hover,
.winamp-playlist li.is-playing {
  background: #1a2c6b;
  color: #ffffff;
  font-weight: 700;
}

/* Guestbook */
.gb-form {
  padding: 10px;
  margin-bottom: 12px;
}

.gb-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}

.field98 label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 3px;
}

.field98 input,
.field98 textarea,
.field98 select {
  width: 100%;
  padding: 5px 7px;
  font-family: inherit;
  font-size: 13px;
  color: var(--text-main);
  background: var(--win-surface);
  border: 2px solid;
  border-color: var(--win-border-dark) var(--win-border-light) var(--win-border-light) var(--win-border-dark);
}

.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.gb-entries {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gb-entry {
  padding: 9px 10px;
}

.gb-entry-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
  font-size: 12px;
}

.gb-entry-head img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.gb-entry-date {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-muted);
}

/* Footer: Webring + 88x31 Badges */
.portal-footer {
  max-width: 1356px;
  margin: 14px auto 20px;
  padding: 14px 12px;
  text-align: center;
}

.webring-box {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 8px 14px;
  margin-bottom: 12px;
}

.webring-box img {
  height: 52px;
  width: auto;
}

.footer-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
}

.footer-badges img {
  height: 31px;
  width: auto;
  border: 1px solid #000;
}

.custom-coded-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 88px;
  height: 31px;
  border: 1px solid #000;
  background: #000080;
  color: #fff;
  font: bold 10px/1.1 Tahoma, sans-serif;
  text-align: center;
}

/* Bottom Fixed Win98 Taskbar */
.taskbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 40px;
  z-index: 500;
  background: var(--taskbar-bg);
  border-top: 2px solid var(--win-border-light);
  padding: 4px 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.start-btn {
  padding: 4px 10px;
  font-weight: 900;
}

.start-btn img {
  width: 18px;
  height: 18px;
}

.taskbar-windows {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}
.taskbar-windows::-webkit-scrollbar { display: none; }

.taskbar-scroll { flex: 0 0 auto; padding: 3px 5px; }
.taskbar-scroll[hidden] { display: none; }

.taskbar-pill {
  flex: 0 0 auto;
  white-space: nowrap;
  padding: 3px 9px;
  font-size: 11px;
}

.taskbar-tray {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

/* Start Menu Popover */
.start-menu {
  position: fixed;
  left: 8px;
  bottom: 42px;
  width: 230px;
  z-index: 510;
  display: flex;
}

.start-menu[hidden] {
  display: none;
}

.start-menu-rail {
  width: 28px;
  background: linear-gradient(180deg, #000080 0%, #c80088 100%);
  color: #ffffff;
  font-weight: 900;
  font-size: 13px;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 10px 0;
  letter-spacing: 1px;
}

.start-menu-items {
  flex: 1;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Optional 56K Dial-Up Intro Overlay & Lightbox */
.dialup-overlay,
.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(6, 10, 26, 0.78);
  display: grid;
  place-items: center;
  padding: 16px;
}

.dialup-overlay[hidden],
.lightbox-overlay[hidden] {
  display: none;
}

.dialup-modal {
  width: min(440px, 100%);
}

.dialup-progress {
  height: 18px;
  padding: 2px;
  margin: 10px 0;
}

.dialup-progress-fill {
  height: 100%;
  width: 0%;
  background: repeating-linear-gradient(90deg, #000080, #000080 10px, #00d0e8 10px, #00d0e8 14px);
  transition: width 0.25s linear;
}

.lightbox-card {
  width: min(560px, 100%);
}

.lightbox-card img {
  display: block;
  max-width: 100%;
  max-height: 65vh;
  margin: 0 auto 10px;
  object-fit: contain;
}

.status-banner {
  padding: 7px 10px;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 700;
  border: 2px solid;
}

.status-banner.is-ok {
  background: #e6ffed;
  border-color: #0b8a3e;
  color: #064d22;
}

.status-banner.is-err {
  background: #ffe6eb;
  border-color: #c4002f;
  color: #7d001e;
}

/* Responsive Breakpoints */
@media (max-width: 1080px) {
  .desktop-grid {
    grid-template-columns: 185px minmax(0, 1fr);
  }
  .sidebar-right {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
  }
}

@media (max-width: 780px) {
  .desktop-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .win98-header-art img { max-height: 120px; }
  .channel-list {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .channel-list .channel-btn {
    width: auto;
    flex: 1 1 130px;
  }
  .portal-address {
    display: none;
  }
  .gb-grid,
  .winamp-top {
    grid-template-columns: 1fr;
  }
}
