
/* -------------------------------------------------------- */
/* CUSTOM FONTS */
/* -------------------------------------------------------- */

@font-face {
  font-family: "VCR";
  src: url("fonts/VCR.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
}


/* -------------------------------------------------------- */
/* VARIABLES */
/* -------------------------------------------------------- */

/* Variables are used like this: var(--text-color) */
:root {
  /* Background Colors: */
  --background-color: #000000;
  --content-background-color: #924dbf;
  --sidebar-background-color: #924DBF;

  /* Text Colors: */
  --text-color: #000000;
  --sidebar-text-color: #000000;
  --link-color: #201a25;
  --link-color-hover: #7780ec;

  /* Text: */
  --font: "VCR", Arial, sans-serif;
  --heading-font: "VCR", Georgia, serif;
  --font-size: 14px;

  /* Other Settings: */
  --margin: 10px;
  --padding: 20px;
  --border: 2px solid #000000;
  --round-borders: 0px;
  --sidebar-width: 250px;
}

/* -------------------------------------------------------- */
/* BASICS */
/* -------------------------------------------------------- */

* {
  box-sizing: border-box;
}

body {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-height: 100vh;
  font-size: var(--font-size);
  margin: 0;
  padding: var(--margin);
  color: var(--text-color);
  font-family: var(--font);
  line-height: 1.2;
  background: var(--background-color);
  background-image: url("images/background.gif");
  background-repeat: repeat;
  cursor: url("images/cursors/cursor.png"), auto;
}

::selection {
  /* (Text highlighted by the user) */
  background: rgba(0, 0, 0, 0.2);
}

mark {
  /* Text highlighted by using the <mark> element */
  text-shadow: 1px 1px 4px var(--link-color);
  background-color: inherit;
  color: var(--text-color);
}

/* Links: */
a {
  text-decoration: underline;
}

a,
a:visited {
  color: var(--link-color);
}

a:hover,
a:focus {
  color: var(--link-color-hover);
  text-decoration: none;
}

a,
button {
  cursor: url("images/cursors/cursor-click.png") 16 16, pointer;
}
/* -------------------------------------------------------- */
/* LAYOUT */
/* -------------------------------------------------------- */

.layout {
  width: 100%;
  max-width: 1600px; /* prevents ultra-wide monitor ugliness */
  display: grid;
  grid-gap: var(--margin);
  grid-template:
    "header header header" auto
    "leftSidebar main rightSidebar" auto
    "footer footer footer" auto
    / minmax(220px, 260px) 1fr minmax(220px, 260px);
}

main {
  grid-area: main;
  overflow-y: auto;
  padding: var(--padding);
  background: var(--content-background-color);
  border: var(--border);
  border-radius: var(--round-borders);
}

/* -------------------------------------------------------- */
/* HEADER */
/* -------------------------------------------------------- */

header {
  grid-area: header;
  font-size: 1.2em;
  border: var(--border);
  border-radius: var(--round-borders);
  background: var(--content-background-color);
}

.header-content {
  padding: var(--padding);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.header-title {
  font-family: var(--heading-font);
  font-size: 1.5em;
  font-weight: bold;
}

.header-image img {
  width: 100%;
  height: auto;
}

/* -------------------------------------------------------- */
/* SIDEBARS: Fully Centered and Proper Width */
/* -------------------------------------------------------- */

.left-sidebar {
  grid-area: leftSidebar;
  display: flex;
  flex-direction: column;
  align-items: center; /* center all children */
  text-align: center;
  padding: var(--padding);
  border: var(--border);
  border-radius: var(--round-borders);
  background: var(--sidebar-background-color);
  width: var(--sidebar-width);
}

.right-sidebar {
  grid-area: rightSidebar;
  display: flex;
  flex-direction: column;
  align-items: center; /* center all children */
  text-align: center;
  padding: var(--padding);
  border: var(--border);
  border-radius: var(--round-borders);
  background: var(--sidebar-background-color);
  width: var(--sidebar-width);
}

.sidebar-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
  margin-bottom: 2em;
}

.sidebar-title {
  font-weight: bold;
  font-size: 1.2em;
  font-family: var(--heading-font);
  margin-bottom: 0.5em;
}

/* Blinkies / Stamps grids */
.stamps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(40px, 1fr));
  justify-items: center;
  width: 100%;
  gap: 5px;
  margin-bottom: 1em;
}

.stamps-grid img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
  object-fit: contain;
}

.blinkies-grid {
  display: flex;
  flex-direction: column;   /* stack vertically */
  align-items: center;
  gap: 6px;
}

.blinkies-grid img {
  width: auto;              /* DO NOT stretch */
  height: auto;
  max-width: 150px;         /* classic blinkie width */
  image-rendering: pixelated;
  display: block;
}

/* Last.fm box */
.lastfm-box {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-top: 0.5em;
}

.lastfm-box img,
.lastfm-box iframe {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

/* ---------------- Retro Player ---------------- */

#retro-player {
  display: flex;
  flex-direction: column;
  align-items: center;   /* center all player content */
  width: 100%;
  margin-top: 10px;
  background: #222;
  border: 3px solid #0ff;
  border-radius: 5px;
  padding: 10px;
  box-shadow: 0 0 10px #0ff;
  color: #0ff;
  font-family: "Courier New", monospace;
}

/* Screen */
#retro-player .screen {
  width: 100%;
  background: #000;
  color: #0ff;
  font-size: 14px;
  padding: 5px;
  margin-bottom: 10px;
  border: 2px inset #0ff;
  overflow: hidden;
  white-space: nowrap;
  height: 22px;
  line-height: 22px;
  position: relative;
  display: flex;
  justify-content: center; /* center scrolling text */
}

#track-name-scroll {
  position: relative;
  white-space: nowrap;
  text-align: center;
  animation: scroll-name 10s linear infinite;
}

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

/* Controls */
#retro-player .controls {
  display: flex;
  justify-content: center; /* center buttons */
  gap: 5px;
  margin-bottom: 5px;
}

#retro-player .controls button {
  background: #000;
  color: #0ff;
  border: 2px outset #0ff;
  width: 50px;
  height: 30px;
  cursor: pointer;
  font-weight: bold;
}

#retro-player .controls button:active {
  border-style: inset;
}

/* VU Meter */
#vu-meter {
  display: flex;
  justify-content: center; /* center bars */
  align-items: flex-end;   /* grow bars from bottom */
  width: 100%;
  height: 10px;            /* visible height */
  gap: 4px;
  margin-top: 5px;
}

.vu-bar {
  width: 15%;
  height: 100%;            /* JS will set actual height */
  min-height: 2px;         /* never disappear */
  background-color: #0ff;
  display: block;
  border-radius: 2px;
}

/* Visitor Counter Fallback Text */
.counter-fallback {
  display: none;
  text-align: center;
  font-size: 0.8em;
  color: #000;
  opacity: 0.7;
}

.visitor-counter:not([src]) + .counter-fallback,
.visitor-counter[src=""] + .counter-fallback {
  display: block;
}

/* Sidebar Blockquote: */

.sidebar-section blockquote {
  background: rgba(0, 0, 0, 0.1);
  padding: 15px;
  margin: 1em 0;
  border-radius: 10px;
  overflow: hidden;
}

.sidebar-section blockquote > *:first-child {
  margin-top: 0;
}

.sidebar-section blockquote > *:last-child {
  margin-bottom: 0;
}

/* Site Button: */

.site-button {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.site-button textarea {
  font-family: monospace;
  font-size: 0.7em;
}

/* -------------------------------------------------------- */
/* FOOTER */
/* -------------------------------------------------------- */

footer {
  grid-area: footer;
  border: var(--border);
  border-radius: var(--round-borders);
  font-size: 0.75em;
  padding: 15px;
  background: var(--content-background-color);
  display: flex;
  justify-content: center;
  position: relative;
}

#secret-rain {
  position: absolute;
  left: 10px;
  bottom: 10px;
  width: 40px;
  cursor: pointer;
}

footer a,
footer a:visited {
  color: var(--link-color);
}

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

/* -------------------------------------------------------- */
/* NAVIGATION */
/* -------------------------------------------------------- */

nav {
  margin-bottom: 3em;
}

nav .sidebar-title {
  margin-bottom: 0.5em;
}

nav ul {
  margin: 0 -5px;
  padding: 0;
  list-style: none;
  user-select: none;
}

nav ul li {
  margin-bottom: 0;
}

nav > ul li > a,
nav > ul li > strong {
  display: inline-block;
}

nav > ul li > a,
nav > ul li > details summary,
nav > ul li > strong {
  padding: 5px 10px;
}

nav > ul li > a.active,
nav > ul li > details.active summary {
  font-weight: bold;
}

nav ul summary {
  cursor: pointer;
}

nav ul ul li > a {
  padding-left: 30px;
}

/* NAVIGATION IN HEADER */

header nav {
  margin-bottom: 0;
}

header nav ul {
  display: flex;
  flex-wrap: wrap;
  margin: 0;
}

header nav ul li {
  position: relative;
}

header nav ul li:first-child > a {
  padding-left: 0;
}

header nav ul li:last-child > a {
  padding-right: 0;
}

/* Subnavigation (Drop-Down): */

header nav ul ul {
  background: var(--content-background-color);
  display: none;
  position: absolute;
  top: 100%;
  left: 10px;
  padding: 0.5em;
  z-index: 1;
  border: var(--border);
  min-width: 100%;
  box-shadow: 0px 1px 5px rgba(0,0,0,0.2);
}

header nav ul li:hover ul,
header nav ul li:focus-within ul {
  display: block;
}

header nav ul li strong {
  color: var(--link-color);
  text-decoration: underline;
  font-weight: normal;
}

header nav ul ul li a {
  display: block;
  padding-left: 0;
  padding-right: 0;
}

/* -------------------------------------------------------- */
/* CONTENT */
/* -------------------------------------------------------- */

main {
  line-height: 1.5;
  text-align: center;
}

main a,
main a:visited {
  color: var(--link-color);
}

main a:hover,
main a:focus {
  color: var(--link-color-hover);
  text-decoration-style: wavy;
}

main p,
main .image,
main .full-width-image,
main .two-columns {
  margin: 0.75em 0;
}

main ol,
main ul {
  margin: 0.5em 0;
  padding-left: 1.5em;
}

main ol li,
main ul li {
  margin-bottom: 0.2em;
  line-height: 1.3;
}

main ol {
  padding-left: 2em;
}

main blockquote {
  background: rgba(0, 0, 0, 0.1);
  padding: 15px;
  margin: 1em 0;
  border-radius: 10px;
}

main pre {
  margin: 1em 0 1.5em;
}

main code {
  text-transform: none;
}

main center {
  margin: 1em 0;
  padding: 0 1em;
}

main hr {
  border: 0;
  border-top: var(--border);
  margin: 1.5em 0;
}

/* HEADINGS: */

main h1,
main h2,
main h3,
main h4,
main h5,
main h6 {
  font-family: var(--heading-font);
  margin-bottom: 0;
  line-height: 1.5;
}

/* Section headers (centered, retro divider style) */
.section-header {
  text-align: center;
  margin: 1.5em 0 0.75em;
  padding: 0.25em 0;
  border-top: 2px solid #000;
  border-bottom: 2px solid #000;
}

main h1:first-child,
main h2:first-child,
main h3:first-child,
main h4:first-child,
main h5:first-child,
main h6:first-child {
  margin-top: 0;
}

main h1 {
  font-size: 1.5em;
}

main h2 {
  font-size: 1.4em;
}

main h3 {
  font-size: 1.3em;
}

main h4 {
  font-size: 1.2em;
}

main h5 {
  font-size: 1.1em;
}

main h6 {
  font-size: 1em;
}

/* COLUMNS: */

.two-columns {
  display: flex;
}

.two-columns > * {
  flex: 1 1 0;
  margin: 0;
}

.two-columns > *:first-child {
  padding-right: 0.75em;
}

.two-columns > *:last-child {
  padding-left: 0.75em;
}

/* -------------------------------------------------------- */
/* CONTENT IMAGES */
/* -------------------------------------------------------- */

.image {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
}

.full-width-image {
  display: block;
  width: 100%;
  height: auto;
}

.images {
  display: flex;
  width: calc(100% + 5px + 5px);
  margin-left: -5px;
  margin-right: -5px;
}

.images img {
  width: 100%;
  height: auto;
  padding: 5px;
  margin: 0;
  overflow: hidden;
}

.section-image {
  display: block;
  margin: 0 auto 1.5em auto;
  max-width: 100%;
  height: auto;
}

/* -------------------------------------------------------- */
/* JS GALLERY */
/* -------------------------------------------------------- */

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}

.gallery-item {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.gallery-thumb {
  aspect-ratio: 1 / 1;
  width: 100%;
  overflow: hidden;
}

.gallery-thumb img {
  width: 100%;
  height: 100% !important;   /* overrides global img rules */
  object-fit: cover;
  display: block;
}

.gallery-item p {
  margin-top: 6px;
  font-size: 14px;
  text-align: center;
}

/* -------------------------------------------------------- */
/* ACCESSIBILITY */
/* -------------------------------------------------------- */

/* please do not remove this. */

#skip-to-content-link {
  position: fixed;
  top: 0;
  left: 0;
  display: inline-block;
  padding: 0.375rem 0.75rem;
  line-height: 1;
  font-size: 1.25rem;
  background-color: var(--content-background-color);
  color: var(--text-color);
  transform: translateY(-3rem);
  transition: transform 0.1s ease-in;
  z-index: 99999999999;
}

#skip-to-content-link:focus,
#skip-to-content-link:focus-within {
  transform: translateY(0);
}

/* ============================= */
/* 📱 MOBILE LAYOUT FIX (PETRAPIXEL) */
/* ============================= */

@media (max-width: 768px) {

  /* Kill the grid and use vertical flow */
  .layout {
    display: flex !important;
    flex-direction: column;
    width: 100%;
  }

  /* Force full-width stretching */
  header,
  main,
  footer,
  .sidebar {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }

  /* Order elements explicitly */
  header {
    order: 1;
  }

  .sidebar.left {
    order: 2;
  }

  main {
    order: 3;
  }

  .sidebar.right {
    order: 4;
  }

  footer {
    order: 5;
  }

  /* Remove desktop margins */
  header,
  main,
  footer,
  .sidebar {
    margin: 0;
    padding: 12px;
  }

  /* Center sidebar content if desired */
  .sidebar {
    text-align: center;
  }

  /* Responsive images */
  img {
    max-width: 100%;
    height: auto;
  }

}


/* Sidebar stamps grid fitting the sidebar width */
.stamps-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  justify-items: center;
  margin-bottom: 1em;
}

.stamps-grid img {
  width: 100%;      /* or max-width: 100% */
  height: auto;     /* keep original height */
  display: block;
  border-radius: 4px;
  object-fit: contain; /* fit the whole image */
}

.lastfm-box {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-top: 0.5em;
}

.lastfm-box iframe {
  border: none;
  border-radius: 4px;
}

.counter-fallback {
  display: none;
  text-align: center;
  font-size: 0.8em;
  color: #000;
  opacity: 0.7;
}

/* Show fallback if the image fails to load */
.visitor-counter:not([src]) + .counter-fallback,
.visitor-counter[src=""] + .counter-fallback {
  display: block;
}

/* Neon hover glow */
button, a, .blinkies-grid img, .stamps-grid img {
  transition: all 0.2s ease-in-out;
}

button:hover, a:hover, .blinkies-grid img:hover, .stamps-grid img:hover {
  box-shadow: 0 0 10px #7300ff, 0 0 20px #7300ff, 0 0 30px #7300ff;
  transform: scale(1.05);
}

/* ---------------- Retro Digital Clock ---------------- */
#retro-clock {
  font-family: "VCR", monospace;
  font-size: 1.2em;
  color: #0ff;
  text-align: center;
  margin: 10px 0;
}

/* ---------------- Fake Windows 95 Popups ---------------- */
.win95-popup {
  position: fixed;
  width: 220px;
  border: 2px solid #000;
  background: #c0c0c0;
  font-family: "VCR", monospace;
  display: none;
  z-index: 9999;
}

.win95-popup .titlebar {
  background: #000080;
  color: #fff;
  padding: 2px 5px;
  font-weight: bold;
}

.win95-popup .content {
  padding: 10px;
  font-size: 0.9em;
}

.win95-popup .close-btn {
  margin: 5px;
  cursor: pointer;
  border: 2px outset #000;
  background: #c0c0c0;
}

.win95-popup .close-btn:active {
  border-style: inset;
}

.cursor-sparkle {
  position: absolute; /* now relative to the sparkle container */
  width: 2px;
  height: 2px;
  pointer-events: none;
  border-radius: 50%;
  opacity: 1;
  transition: opacity 0.5s linear, transform 0.5s linear;
}

#sparkle-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
  z-index: 9999999;
}

@media (max-width: 768px) {

  .layout {
    display: flex;
    flex-direction: column;
  }

  header {
    order: 1;
  }

  .left-sidebar {
    order: 2;
    width: 100%;
  }

  main {
    order: 3;
    width: 100%;
  }

  .right-sidebar {
    order: 4;
    width: 100%;
  }

  footer {
    order: 5;
  }
}

.image-confetti {
  position: fixed;
  top: -60px;
  width: 48px;
  height: auto;
  z-index: 9999;
  animation: fall linear forwards;
}

@keyframes fall {
  to {
    transform: translateY(110vh) rotate(360deg);
    opacity: 0;
  }
}

#secret-rain {
  position: absolute;
  left: 10px;
  bottom: 10px;
  width: 40px;
  cursor: pointer;
  pointer-events: auto;

  opacity: 0.15;
  transition: opacity 0.3s ease;
}

footer:hover #secret-rain {
  opacity: 1;
}

#statuscafe {
    padding: .5em;
    background-color: #924DBF;
    border: 1px solid rgb(0, 0, 0);
}
#statuscafe-username {
    margin-bottom: .5em;
}
#statuscafe-content {
    margin: 0 1em 0.5em 1em;
}
