/* =============================================================
   PAMSITE - GeoCities Rainbow Edition (2000s)
   Tutti gli ID/classi usati dal JS sono preservati.
   ============================================================= */

:root {
  /* === Palette arcobaleno === */
  --c-red:     #ff4a4a;
  --c-orange:  #ff9b3a;
  --c-yellow:  #ffd84a;
  --c-green:   #58e764;
  --c-cyan:    #3ef0ff;
  --c-blue:    #4d75ff;
  --c-violet:  #b066ff;
  --c-pink:    #ff5fc1;
  --c-magenta: #ff1bd9;

  /* === Carta / inchiostro === */
  --paper:        #fffaf0;
  --paper-soft:   #fff5e1;
  --paper-cream:  #fff6d6;
  --paper-pink:   #ffe7f1;
  --paper-blue:   #e2f1ff;
  --paper-mint:   #e5ffe8;
  --ink:          #1d0e29;
  --ink-soft:     #4d2c5b;
  --ink-muted:    #6b4f73;

  /* === Link classici === */
  --link:         #0000ee;
  --link-visited: #551a8b;
  --link-hover:   #ff007a;

  /* === Compat circus page === */
  --neon-cyan:    #00f7ff;
  --neon-magenta: #ff1bd9;
  --neon-yellow:  #ffe54f;
  --neon-lime:    #64ff66;
  --neon-pink-soft: #ffaeec;
  --hot-blue-1:   #1c5dd7;
  --hot-blue-2:   #0a246a;
  --bg-panel:     #09006a;
  --bg-panel-soft: rgba(10, 6, 90, 0.82);
  --bg-screen:    rgba(2, 0, 26, 0.74);
  --bg-card:      rgba(8, 4, 60, 0.78);
  --bg-card-dark: linear-gradient(180deg, #08006a, #02002e);
  --text-main:    #f6f6ff;
  --text-muted:   #b8bbdf;

  /* === Tokens === */
  --radius-sm: 6px;
  --radius-md: 12px;
  --site-width: min(1400px, 98vw);
  --shadow-soft: 0 6px 22px rgba(70, 0, 90, 0.28);
  --shadow-card: 4px 4px 0 rgba(0, 0, 0, 0.18);

  /* Rainbow gradient riusabile */
  --rainbow:
    linear-gradient(90deg,
      var(--c-red) 0%,
      var(--c-orange) 16%,
      var(--c-yellow) 33%,
      var(--c-green) 50%,
      var(--c-cyan) 66%,
      var(--c-blue) 83%,
      var(--c-violet) 100%);
  --rainbow-soft:
    linear-gradient(90deg,
      #ffd1d1, #ffe1c4, #fff4c4, #d4ffd9, #d4f9ff, #d4dcff, #ebd4ff);
}

@font-face {
  font-family: "Comic Sans MS";
  src: url("/fonts/ComicSansMS.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
}

/* ============================================================
   RESET
   ============================================================ */

html { box-sizing: border-box; scroll-behavior: smooth; }
*, *::before, *::after { box-sizing: inherit; }

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

body {
  font-family: "Comic Sans MS", "Trebuchet MS", cursive, sans-serif;
  color: var(--ink);
  line-height: 1.55;
  text-align: center;
  background:
    linear-gradient(180deg,
      #ffd1ec 0%,
      #ffe2a8 18%,
      #fffbb0 32%,
      #c6ffc6 50%,
      #b8eaff 68%,
      #c9c9ff 84%,
      #efc9ff 100%) fixed;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ============================================================
   SKY BACKGROUND (stelline + nuvole)
   ============================================================ */

#sky-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.sky-stars {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 12% 18%, #fff 0 1.5px, transparent 2px),
    radial-gradient(circle at 78% 32%, #fff 0 1.5px, transparent 2px),
    radial-gradient(circle at 42% 76%, #fff 0 1.5px, transparent 2px),
    radial-gradient(circle at 88% 88%, #fff 0 1.5px, transparent 2px),
    radial-gradient(circle at 24% 92%, #fff 0 1.5px, transparent 2px),
    radial-gradient(circle at 58% 12%, #fff 0 1.5px, transparent 2px);
  background-size: 320px 320px;
  animation: stars-twinkle 3.2s steps(2) infinite;
  opacity: 0.85;
}

@keyframes stars-twinkle {
  0%, 100% { opacity: 0.85; }
  50%      { opacity: 0.45; }
}

.sky-clouds {
  position: absolute;
  inset: -20% -10% 0 -10%;
  background:
    radial-gradient(ellipse 180px 60px at 10% 18%, rgba(255,255,255,0.7), transparent 70%),
    radial-gradient(ellipse 240px 70px at 70% 30%, rgba(255,255,255,0.55), transparent 70%),
    radial-gradient(ellipse 200px 60px at 35% 60%, rgba(255,255,255,0.5), transparent 70%),
    radial-gradient(ellipse 280px 80px at 85% 78%, rgba(255,255,255,0.55), transparent 70%);
  animation: clouds-drift 80s linear infinite;
  filter: blur(0.5px);
}

@keyframes clouds-drift {
  from { transform: translateX(0); }
  to   { transform: translateX(-12%); }
}

/* ============================================================
   CONTAINER
   ============================================================ */

#container {
  position: relative;
  z-index: 2;
  width: var(--site-width);
  margin: 18px auto 100px;
  padding: 0;
  background: var(--paper);
  border: 4px solid #000;
  border-radius: 4px;
  box-shadow:
    0 0 0 4px var(--c-pink),
    0 0 0 8px var(--c-yellow),
    0 0 0 12px var(--c-cyan),
    0 0 0 16px var(--c-violet),
    var(--shadow-soft);
  background-image:
    /* stelline diffuse sul foglio */
    radial-gradient(circle at 8% 12%, rgba(255,160,200,0.12) 0 3px, transparent 4px),
    radial-gradient(circle at 80% 24%, rgba(180,140,255,0.12) 0 3px, transparent 4px),
    radial-gradient(circle at 30% 70%, rgba(255,220,90,0.12) 0 3px, transparent 4px),
    radial-gradient(circle at 92% 85%, rgba(120,220,255,0.12) 0 3px, transparent 4px);
  background-size: 480px 480px;
}

/* ============================================================
   HEADER / WORDART TITLE
   ============================================================ */

.site-header {
  position: relative;
  background: var(--rainbow-soft);
  border-bottom: 3px dashed var(--c-magenta);
  padding: 18px 18px 12px;
}

.header-tape {
  position: absolute;
  top: -1px; left: 0; right: 0;
  height: 18px;
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
  background: linear-gradient(90deg, var(--c-pink), var(--c-violet), var(--c-blue), var(--c-cyan), var(--c-green), var(--c-yellow), var(--c-orange), var(--c-red));
  color: #fff;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  overflow: hidden;
  text-shadow: 0 1px 0 rgba(0,0,0,0.35);
}

.header-tape > span {
  display: inline-block;
  animation: tape-bob 1.6s ease-in-out infinite;
}
.header-tape > span:nth-child(2n) { animation-delay: -0.4s; }
.header-tape > span:nth-child(3n) { animation-delay: -0.8s; }

@keyframes tape-bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-2px); }
}

.site-header-inner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding-top: 12px;
}

.site-brand {
  flex: 1 1 auto;
  text-align: center;
}

/* === WordArt === */
.site-title.wordart {
  margin: 0;
  font-family: "Impact", "Comic Sans MS", cursive;
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  letter-spacing: 0.04em;
  line-height: 1;
}

.wordart-inner {
  position: relative;
  display: inline-block;
  background: var(--rainbow);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-stroke: 2px #000;
  filter:
    drop-shadow(2px 2px 0 #000)
    drop-shadow(4px 4px 0 rgba(255,0,170,0.55));
  transform: skewY(-2deg);
  animation: wordart-bounce 2.8s ease-in-out infinite;
}

@keyframes wordart-bounce {
  0%, 100% { transform: skewY(-2deg) translateY(0); }
  50%      { transform: skewY(-2deg) translateY(-3px); }
}

.site-tagline {
  margin-top: 8px;
  font-size: 0.95rem;
  font-weight: bold;
  color: var(--ink-soft);
}

.rainbow-text {
  background: var(--rainbow);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: bold;
}

.auth-links {
  display: flex;
  gap: 6px;
  flex: 0 0 auto;
  padding: 4px 6px;
  background: #fff;
  border: 2px outset #ddd;
}

.auth-links a {
  font-family: "Comic Sans MS", cursive;
  font-weight: bold;
  color: var(--link);
  text-decoration: underline;
  padding: 2px 6px;
}
.auth-links a:hover { color: var(--link-hover); background: var(--paper-pink); }

/* Ticker */
.site-ticker {
  display: flex;
  align-items: center;
  margin-top: 12px;
  border: 3px ridge var(--c-pink);
  background: #000;
  color: #ffea3a;
  font-family: "Courier New", monospace;
  font-size: 0.95rem;
}

.ticker-prefix {
  flex: 0 0 auto;
  padding: 4px 10px;
  background: var(--c-magenta);
  color: #fff;
  font-weight: bold;
  letter-spacing: 0.1em;
}

.site-ticker marquee {
  flex: 1 1 auto;
  padding: 4px 6px;
}

/* ============================================================
   NAVBAR - 3D RAINBOW BUTTONS
   ============================================================ */

.navbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  padding: 12px 12px 14px;
  background:
    repeating-linear-gradient(45deg,
      rgba(255,255,255,0.5) 0 8px,
      rgba(255,255,255,0.25) 8px 16px),
    linear-gradient(180deg, var(--paper-pink), var(--paper-blue));
  border-top: 3px double var(--c-violet);
  border-bottom: 3px double var(--c-violet);
}

.navbar a {
  --btn-c: var(--c-cyan);
  --btn-c-dark: #2a5dcc;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  font-family: "Comic Sans MS", cursive;
  font-size: 0.98rem;
  font-weight: bold;
  color: #000;
  text-decoration: none;
  background: linear-gradient(180deg, #fff 0%, var(--btn-c) 60%, var(--btn-c-dark) 100%);
  border: 3px outset #fff;
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.6),
    3px 3px 0 rgba(0,0,0,0.35);
  text-shadow: 1px 1px 0 rgba(255,255,255,0.65);
  letter-spacing: 0.02em;
  transition: transform .12s ease, filter .12s ease;
  position: relative;
}

.navbar a:hover {
  transform: translate(-2px, -2px) rotate(-1.5deg);
  filter:
    saturate(1.25)
    drop-shadow(0 0 6px var(--btn-c))
    drop-shadow(0 0 14px var(--btn-c));
  z-index: 2;
}

.navbar a:active,
.navbar a.active {
  transform: translate(2px, 2px);
  border-style: inset;
  box-shadow: inset 2px 2px 4px rgba(0,0,0,0.3);
}

.navbar a.active {
  filter: brightness(1.12);
}

.navbar a .nav-ico {
  font-size: 1.1em;
  filter: drop-shadow(1px 1px 0 rgba(0,0,0,0.5));
  animation: nav-ico-wiggle 3.4s ease-in-out infinite;
}
@keyframes nav-ico-wiggle {
  0%, 100% { transform: rotate(0deg); }
  50%      { transform: rotate(10deg); }
}

/* Rainbow rotation: 7 colors */
.navbar a:nth-child(7n+1) { --btn-c: #ff8a8a; --btn-c-dark: #b81a1a; } /* red */
.navbar a:nth-child(7n+2) { --btn-c: #ffb463; --btn-c-dark: #b85a00; } /* orange */
.navbar a:nth-child(7n+3) { --btn-c: #ffe46e; --btn-c-dark: #a88800; color:#222; }/* yellow */
.navbar a:nth-child(7n+4) { --btn-c: #7fe891; --btn-c-dark: #1a7a3d; } /* green */
.navbar a:nth-child(7n+5) { --btn-c: #7fd7ff; --btn-c-dark: #1a5a99; } /* cyan */
.navbar a:nth-child(7n+6) { --btn-c: #9a9fff; --btn-c-dark: #2222b8; } /* blue */
.navbar a:nth-child(7n)   { --btn-c: #d18bff; --btn-c-dark: #6a1aaf; } /* violet */

/* ============================================================
   LAYOUT - doppia sidebar + hub centrale
   ============================================================ */

.site-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 220px;
  gap: 14px;
  padding: 16px;
  align-items: start;
}

.site-sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.site-content {
  min-width: 0;
  padding: 8px 6px;
  text-align: left;
}

/* loading state hook (script.js usa .page-is-loading) */
.site-content.page-is-loading { opacity: 0.55; filter: saturate(0.6); }

/* ============================================================
   SIDE CARDS
   ============================================================ */

.side-card {
  background: var(--paper);
  border: 3px solid var(--c-pink);
  border-radius: 8px;
  padding: 8px 10px 10px;
  box-shadow: 3px 3px 0 rgba(0,0,0,0.18);
  position: relative;
}

.site-sidebar-left  .side-card:nth-child(4n+1) { border-color: var(--c-pink); }
.site-sidebar-left  .side-card:nth-child(4n+2) { border-color: var(--c-violet); }
.site-sidebar-left  .side-card:nth-child(4n+3) { border-color: var(--c-orange); background: var(--paper-cream); }
.site-sidebar-left  .side-card:nth-child(4n)   { border-color: var(--c-green); background: var(--paper-mint); }

.site-sidebar-right .side-card:nth-child(4n+1) { border-color: var(--c-cyan); background: var(--paper-blue); }
.site-sidebar-right .side-card:nth-child(4n+2) { border-color: var(--c-magenta); }
.site-sidebar-right .side-card:nth-child(4n+3) { border-color: var(--c-yellow); background: var(--paper-cream); }
.site-sidebar-right .side-card:nth-child(4n)   { border-color: var(--c-violet); background: var(--paper-pink); }

.side-card-title {
  margin: -8px -10px 8px;
  padding: 4px 8px;
  background: var(--rainbow);
  color: #fff;
  font-family: "Impact", "Comic Sans MS", cursive;
  font-weight: bold;
  letter-spacing: 0.04em;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.55);
  border-bottom: 2px dashed rgba(0,0,0,0.25);
  border-radius: 5px 5px 0 0;
  text-align: center;
  font-size: 0.95rem;
}

.side-links {
  list-style: none;
  margin: 0;
  padding: 0;
  text-align: left;
}
.side-links li {
  margin: 4px 0;
  padding: 3px 4px;
  border-bottom: 1px dotted #d8b6c8;
}
.side-links li:last-child { border-bottom: none; }

.side-links a {
  display: block;
  color: var(--link);
  text-decoration: underline;
  font-weight: bold;
  font-size: 0.93rem;
  padding: 1px 2px;
}
.side-links a:hover {
  background: linear-gradient(90deg, #ffe1a8, transparent);
  color: var(--link-hover);
}

/* Visitor counter (LCD) */
.side-counter {
  display: flex;
  gap: 2px;
  justify-content: center;
  margin: 6px 0;
}
.side-counter span {
  display: inline-block;
  min-width: 1.1rem;
  padding: 2px 4px;
  background: #000;
  color: #00ff66;
  font-family: "Courier New", monospace;
  font-weight: bold;
  border: 1px inset #444;
  text-shadow: 0 0 4px #00ff66;
}

.side-online {
  text-align: center;
  font-size: 0.82rem;
  color: var(--ink-muted);
}

.led-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #888;
  box-shadow: 0 0 6px #fff inset;
  vertical-align: middle;
}
.led-dot-green {
  background: #2ecc40;
  box-shadow: 0 0 6px #2ecc40, 0 0 1px #fff inset;
  animation: led-blink 2s steps(2) infinite;
}
@keyframes led-blink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.35; }
}

/* Clock */
.side-card-clock { text-align: center; }
.side-clock {
  font-family: "Courier New", monospace;
  font-size: 1.4rem;
  font-weight: bold;
  color: #00ff66;
  background: #000;
  padding: 4px 8px;
  margin: 6px auto 2px;
  display: inline-block;
  border: 2px inset #444;
  text-shadow: 0 0 5px #00ff66;
  letter-spacing: 0.05em;
}
.side-date {
  font-family: "Courier New", monospace;
  color: var(--ink-soft);
  font-size: 0.85rem;
}

/* Now spinning */
.side-now {
  background: #000;
  color: var(--c-cyan);
  padding: 4px 6px;
  border: 2px inset #444;
  margin-bottom: 6px;
  font-family: "Courier New", monospace;
  font-size: 0.85rem;
}
.side-now marquee { display: block; }

.side-mini-list {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  text-align: left;
  font-size: 0.85rem;
}
.side-mini-list li {
  padding: 2px 4px;
  border-bottom: 1px dotted #d8b6c8;
}
.side-mini-list li:last-child { border-bottom: none; }

/* Webring badges */
.side-badges {
  display: grid;
  grid-template-columns: repeat(2, auto);
  gap: 4px;
  justify-content: center;
  padding-top: 4px;
}
.side-badges img {
  display: block;
  border: 1px solid #333;
  background: #fff;
}

/* Quote card */
.side-quote {
  font-style: italic;
  font-size: 0.88rem;
  color: var(--ink-soft);
  padding: 4px 6px;
  background: rgba(255,255,255,0.5);
  border-left: 3px solid var(--c-violet);
  text-align: left;
}

/* Construction */
.side-card-construction {
  text-align: center;
}
.construction-note {
  margin: 6px 0 0;
  font-size: 0.8rem;
  font-style: italic;
  color: var(--ink-muted);
}

/* === Theme switcher card === */
.side-card-theme {
  text-align: center;
}

.theme-switch {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  margin-top: 4px;
}

.theme-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 4px;
  background: linear-gradient(180deg, #fff, #f3f3f3);
  border: 3px outset #fff;
  border-radius: 8px;
  cursor: pointer;
  font-family: "Comic Sans MS", cursive;
  font-weight: bold;
  font-size: 0.78rem;
  color: var(--ink);
  box-shadow: 2px 2px 0 rgba(0,0,0,0.18);
  transition: filter .15s, transform .12s;
}
.theme-btn:hover {
  filter: brightness(1.08) saturate(1.15);
  transform: translate(-1px,-1px);
}
.theme-btn.is-active {
  border-style: inset;
  background: linear-gradient(180deg, var(--c-yellow), var(--c-pink));
  box-shadow:
    inset 0 0 0 1px rgba(0,0,0,0.15),
    0 0 10px var(--c-pink);
  transform: translate(1px,1px);
}

.theme-swatch {
  position: relative;
  width: 100%;
  height: 22px;
  border-radius: 4px;
  border: 2px solid #000;
  box-shadow: inset 0 0 0 1px #fff;
}
.theme-swatch-rainbow {
  background:
    linear-gradient(90deg,
      #ff4a4a, #ff9b3a, #ffd84a, #58e764, #3ef0ff, #4d75ff, #b066ff);
}
.theme-swatch-kawaii {
  background:
    linear-gradient(90deg,
      #ffd1e8, #ffc1d8, #e3b6ff, #c4a8ff, #b6c8ff);
}
.theme-swatch-console {
  background:
    linear-gradient(180deg, #1c1c22 0%, #2a2a30 50%, #1c1c22 100%);
  box-shadow:
    inset 0 0 0 1px #ff7000,
    inset 0 0 6px rgba(255, 112, 0, 0.6);
}
.theme-swatch-console::after {
  content: '▶';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #ff7000;
  font-size: 0.85rem;
  text-shadow: 0 0 6px #ff7000;
}
.theme-swatch-neon {
  background: linear-gradient(180deg, #04004e 0%, #1a0033 50%, #08006a 100%);
  box-shadow:
    inset 0 0 0 2px #00f7ff,
    inset 0 0 8px rgba(255, 27, 217, 0.6);
}
.theme-swatch-neon::after {
  content: '✦';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #ffe54f;
  font-size: 0.9rem;
  text-shadow: 0 0 6px #ff1bd9, 0 0 12px #00f7ff;
}

.theme-btn-label {
  letter-spacing: 0.02em;
}

.theme-note {
  margin: 6px 0 0;
  font-size: 0.75rem;
  font-style: italic;
  color: var(--ink-muted);
}

/* ============================================================
   FOOTER
   ============================================================ */

.site-footer {
  margin-top: 8px;
  padding: 12px 18px 16px;
  background: var(--rainbow-soft);
  border-top: 3px dashed var(--c-magenta);
  font-size: 0.82rem;
  color: var(--ink-soft);
  text-align: center;
}
.site-footer-row {
  margin: 4px 0;
}
.site-footer-sep {
  margin: 0 8px;
  color: var(--c-violet);
  font-weight: bold;
}
.site-footer-credits a {
  color: var(--link);
  text-decoration: underline;
}
.site-footer-credits a:hover { color: var(--link-hover); }

/* ============================================================
   COMMON: page, links, headings, blink, dividers
   ============================================================ */

.site-content .page {
  display: block;
  margin: 0 auto;
  padding: 8px 0;
}

.page-title {
  position: relative;
  margin: 8px 0 14px;
  padding: 6px 10px;
  font-family: "Impact", "Comic Sans MS", cursive;
  font-size: clamp(1.4rem, 2.6vw, 1.9rem);
  letter-spacing: 0.03em;
  text-align: center;
  background: var(--rainbow);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-stroke: 1.5px #000;
  filter: drop-shadow(2px 2px 0 rgba(0,0,0,0.6));
}

.page-title::before,
.page-title::after {
  content: "★ ✿ ★";
  display: block;
  font-family: "Comic Sans MS", cursive;
  font-size: 0.7rem;
  color: var(--c-magenta);
  -webkit-text-stroke: 0;
  filter: none;
}

.page-lead {
  margin: 0 auto 14px;
  padding: 8px 12px;
  background: rgba(255,255,255,0.7);
  border: 2px dashed var(--c-violet);
  border-radius: 8px;
  font-size: 0.98rem;
  color: var(--ink);
  text-align: center;
  max-width: 760px;
}

.site-content p,
.site-content li,
.site-content figcaption,
.site-content label {
  color: var(--ink);
}

.site-content a {
  color: var(--link);
  text-decoration: underline;
}
.site-content a:visited { color: var(--link-visited); }
.site-content a:hover   { color: var(--link-hover); background: #fff5b0; }

/* Divider GIF stile (CSS) */
.divider,
.site-content hr {
  border: none;
  height: 12px;
  background:
    repeating-linear-gradient(90deg,
      var(--c-pink) 0 12px,
      var(--c-yellow) 12px 24px,
      var(--c-green) 24px 36px,
      var(--c-cyan) 36px 48px,
      var(--c-violet) 48px 60px);
  background-size: 60px 12px;
  animation: divider-scroll 2s linear infinite;
  margin: 18px 0;
  border-radius: 6px;
  box-shadow: 0 2px 0 rgba(0,0,0,0.15);
}
@keyframes divider-scroll {
  from { background-position: 0 0; }
  to   { background-position: 60px 0; }
}

.blink {
  animation: blink 1.05s steps(2, end) infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0; }
}

/* ============================================================
   GENERIC PANELS
   ============================================================ */

.panel {
  background: var(--paper);
  border: 3px ridge var(--c-violet);
  border-radius: 10px;
  padding: 12px 14px;
  margin: 12px 0;
  box-shadow: var(--shadow-card);
}

.panel-title {
  margin: 0 0 8px;
  padding: 4px 8px;
  font-family: "Impact", "Comic Sans MS", cursive;
  background: linear-gradient(90deg, var(--c-pink), var(--c-violet));
  color: #fff;
  border-radius: 4px;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.5);
  letter-spacing: 0.03em;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}

/* ============================================================
   HOME PAGE
   ============================================================ */

.welcome {
  background: linear-gradient(90deg, var(--c-pink), var(--c-yellow), var(--c-cyan));
  color: #000;
  padding: 6px 8px;
  border: 2px ridge var(--c-magenta);
  font-weight: bold;
  margin-bottom: 14px;
  text-shadow: 1px 1px 0 #fff;
}
.welcome marquee { display: block; }

.hero-gif {
  display: block;
  margin: 16px auto;
  max-width: 100%;
  border: 5px ridge var(--c-pink);
  border-radius: 4px;
  background: #fff;
  box-shadow: var(--shadow-card);
}

.home-copy {
  background: rgba(255,255,255,0.7);
  border: 2px dashed var(--c-pink);
  text-align: left;
}

.notice-box {
  margin: 18px auto;
  max-width: 680px;
  background: var(--paper-cream);
  border: 3px dashed var(--c-red);
  border-radius: 10px;
  padding: 10px 14px;
  text-align: left;
}
.notice-title {
  display: inline-block;
  background: var(--c-red);
  color: #fff;
  font-weight: bold;
  padding: 2px 10px;
  margin-bottom: 6px;
  border-radius: 4px;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.5);
}
.notice-highlight {
  background: var(--c-yellow);
  color: #000;
  padding: 0 4px;
  font-weight: bold;
  border: 1px solid #000;
}

/* Chatbox */
.chatbox {
  margin: 12px 0;
  padding: 10px;
  background: var(--paper-blue);
  border: 3px ridge var(--c-cyan);
  border-radius: 10px;
}

.chat-messages {
  min-height: 80px;
  max-height: 260px;
  overflow-y: auto;
  margin-bottom: 8px;
  padding: 6px;
  background: #fff;
  border: 2px inset #ccc;
  font-size: 0.9rem;
  text-align: left;
}
.chat-messages .chat-msg {
  margin: 4px 0;
  padding: 4px 6px;
  background: #f5f9ff;
  border-left: 3px solid var(--c-blue);
}
.chat-messages .chat-msg .chat-name {
  font-weight: bold;
  color: var(--c-magenta);
}
.chat-messages .chat-msg .chat-time {
  color: var(--ink-muted);
  font-size: 0.8rem;
  margin-left: 4px;
}

/* ============================================================
   HOME - hero + hub + bulletin
   ============================================================ */

.home-hero-title {
  margin-bottom: 14px;
}
.home-hero-title .wordart-inner {
  font-size: clamp(1.6rem, 4.2vw, 2.6rem);
  -webkit-text-stroke: 2px #000;
}

.home-hero {
  display: grid;
  grid-template-columns: minmax(220px, 360px) 1fr;
  gap: 18px;
  align-items: center;
  margin: 0 0 18px;
  padding: 18px;
  background:
    repeating-linear-gradient(45deg,
      rgba(255,255,255,0.55) 0 10px,
      rgba(255,255,255,0.25) 10px 20px),
    linear-gradient(180deg, var(--paper-pink), var(--paper-cream), var(--paper-blue));
  border: 4px ridge var(--c-pink);
  border-radius: 14px;
  box-shadow: 5px 5px 0 rgba(0,0,0,0.18);
}

.home-hero-gif-wrap {
  position: relative;
  padding: 6px;
  background: #fff;
  border: 5px solid #000;
  border-radius: 6px;
  box-shadow:
    0 0 0 4px var(--c-pink),
    0 0 0 8px var(--c-yellow),
    0 0 0 12px var(--c-cyan),
    0 0 0 16px var(--c-violet),
    6px 6px 0 rgba(0,0,0,0.35);
  transform: rotate(-2deg);
  transition: transform .25s ease;
}
.home-hero-gif-wrap:hover {
  transform: rotate(0deg) scale(1.02);
}

.home-hero-gif {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 2px;
}

.home-hero-sparkles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.home-hero-sparkles span {
  position: absolute;
  font-size: 1.6rem;
  filter: drop-shadow(1px 1px 0 #fff) drop-shadow(0 0 6px var(--c-magenta));
  animation: hero-sparkle 2.4s ease-in-out infinite;
}
.home-hero-sparkles span:nth-child(1) { top: -14px; left: -10px; color: var(--c-magenta); animation-delay: 0s; }
.home-hero-sparkles span:nth-child(2) { top: -10px; right: -8px; color: var(--c-yellow); animation-delay: -0.6s; }
.home-hero-sparkles span:nth-child(3) { bottom: -10px; left: -6px; color: var(--c-cyan); animation-delay: -1.2s; }
.home-hero-sparkles span:nth-child(4) { bottom: -14px; right: -12px; color: var(--c-violet); animation-delay: -1.8s; }
@keyframes hero-sparkle {
  0%, 100% { transform: scale(1) rotate(0deg); opacity: 1; }
  50%      { transform: scale(1.3) rotate(20deg); opacity: 0.6; }
}

.home-hero-copy {
  margin: 0;
  padding: 14px 16px;
  background: rgba(255,255,255,0.78);
  border: 3px dashed var(--c-violet);
  border-radius: 10px;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--ink);
  text-align: left;
}

/* === Section title (more compact than .page-title) === */
.home-section-title {
  margin: 22px 0 10px;
  text-align: center;
  font-family: "Impact", "Comic Sans MS", cursive;
}
.home-section-title .wordart-inner {
  font-size: clamp(1.2rem, 2.4vw, 1.7rem);
}

/* === Hub a card === */
.home-hub {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.hub-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 10px 10px;
  background: var(--paper);
  border: 3px ridge var(--c-pink);
  border-radius: 10px;
  text-decoration: none !important;
  color: var(--ink) !important;
  text-align: center;
  box-shadow: 4px 4px 0 rgba(0,0,0,0.18);
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
  overflow: hidden;
}

.hub-card:hover {
  transform: translate(-3px, -3px) rotate(-1deg);
  box-shadow: 6px 6px 0 var(--hub-c, var(--c-pink));
  filter: saturate(1.2);
}
.hub-card:hover .hub-cta {
  background: var(--hub-c, var(--c-pink));
  color: #fff;
}

.hub-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 5px;
  background: var(--rainbow);
}

.hub-card::after {
  content: '★';
  position: absolute;
  top: 6px;
  right: 8px;
  color: var(--hub-c, var(--c-pink));
  font-size: 0.85rem;
  filter: drop-shadow(0 0 4px var(--hub-c, var(--c-pink)));
  animation: hub-star 1.8s ease-in-out infinite;
}
@keyframes hub-star {
  0%, 100% { transform: scale(1) rotate(0deg); }
  50%      { transform: scale(1.4) rotate(30deg); }
}

.hub-ico {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  font-size: 2rem;
  background: linear-gradient(180deg, #fff, var(--hub-c, var(--c-pink)));
  border: 3px ridge #fff;
  border-radius: 50%;
  color: #000;
  margin-top: 4px;
  text-shadow: 1px 1px 0 rgba(255,255,255,0.6);
  box-shadow: 2px 2px 0 rgba(0,0,0,0.25);
}

.hub-title {
  font-family: "Impact", "Comic Sans MS", cursive;
  font-size: 1.15rem;
  font-weight: bold;
  color: var(--hub-c-dark, var(--c-magenta));
  letter-spacing: 0.03em;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.18);
}

.hub-desc {
  font-size: 0.82rem;
  color: var(--ink-soft);
  line-height: 1.35;
  flex: 1 1 auto;
  padding: 0 4px;
}

.hub-cta {
  margin-top: 6px;
  padding: 3px 12px;
  background: #fff;
  border: 2px outset var(--hub-c, var(--c-pink));
  border-radius: 12px;
  font-size: 0.82rem;
  font-weight: bold;
  color: var(--hub-c-dark, var(--c-magenta)) !important;
  transition: background .15s, color .15s;
}

/* 6 colori arcobaleno per le card */
.hub-c1 { --hub-c: var(--c-pink);   --hub-c-dark: #c91470; border-color: var(--c-pink); }
.hub-c2 { --hub-c: var(--c-violet); --hub-c-dark: #6a1aaf; border-color: var(--c-violet); }
.hub-c3 { --hub-c: var(--c-orange); --hub-c-dark: #b85a00; border-color: var(--c-orange); background: var(--paper-cream); }
.hub-c4 { --hub-c: var(--c-green);  --hub-c-dark: #1a7a3d; border-color: var(--c-green);  background: var(--paper-mint); }
.hub-c5 { --hub-c: var(--c-cyan);   --hub-c-dark: #1a5a99; border-color: var(--c-cyan);   background: var(--paper-blue); }
.hub-c6 { --hub-c: var(--c-yellow); --hub-c-dark: #a88800; border-color: var(--c-yellow); background: var(--paper-cream); }

/* === Strip novità === */
.home-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 8px;
  padding: 8px 12px;
  background: linear-gradient(90deg, var(--c-yellow), var(--c-pink));
  border: 3px ridge #fff;
  border-radius: 8px;
  font-size: 0.92rem;
  color: #000;
  text-shadow: 1px 1px 0 rgba(255,255,255,0.45);
  box-shadow: 3px 3px 0 rgba(0,0,0,0.2);
}
.home-strip-tag {
  background: #000;
  color: var(--c-yellow);
  font-weight: bold;
  padding: 2px 8px;
  border-radius: 12px;
  font-family: "Comic Sans MS", cursive;
  letter-spacing: 0.04em;
  text-shadow: 0 0 4px var(--c-yellow);
}

/* === Bulletin chat head === */
.chatbox-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: -10px -10px 8px;
  padding: 6px 10px;
  background: linear-gradient(90deg, var(--c-cyan), var(--c-violet));
  color: #fff;
  font-family: "Comic Sans MS", cursive;
  font-weight: bold;
  font-size: 0.88rem;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.4);
  border-radius: 8px 8px 0 0;
}
.chatbox-led {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--c-green);
  box-shadow: 0 0 8px var(--c-green);
  animation: led-blink 1.6s steps(2) infinite;
}

/* === Mobile home === */
@media (max-width: 720px) {
  .home-hero {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .home-hero-gif-wrap {
    margin: 0 auto;
    max-width: 280px;
  }
  .home-hub {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ============================================================
   ABOUT PAGE
   ============================================================ */

.about-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 18px;
  align-items: start;
}

.about-card {
  background: var(--paper);
  border: 3px ridge var(--c-pink);
  border-radius: 8px;
  padding: 12px;
  box-shadow: var(--shadow-card);
  text-align: left;
}

.about-photo-wrap { text-align: center; }
.about-photo {
  width: 100%;
  max-width: 200px;
  border: 4px ridge var(--c-violet);
  background: #fff;
}
.about-badge {
  margin-top: 8px;
  padding: 4px 6px;
  background: var(--c-green);
  color: #000;
  font-size: 0.8rem;
  font-weight: bold;
  border: 2px outset #fff;
}

.about-list {
  list-style: "♥ ";
  padding-left: 20px;
  margin: 6px 0;
}

.about-mini-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  margin-top: 8px;
}
.about-mini {
  padding: 4px 8px;
  background: var(--paper-cream);
  border: 2px dashed var(--c-orange);
  font-size: 0.85rem;
  text-align: center;
}

/* ============================================================
   GIF GALLERIES (anime / videogame)
   ============================================================ */

.gif-section {
  margin: 18px 0;
  padding: 12px;
  background: var(--paper);
  border: 3px ridge var(--c-cyan);
  border-radius: 10px;
  box-shadow: var(--shadow-card);
}

.gif-header {
  margin: 0 0 10px;
  padding: 6px 10px;
  background: linear-gradient(90deg, var(--c-cyan), var(--c-violet));
  color: #fff;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.4);
  font-family: "Impact", "Comic Sans MS", cursive;
  border-radius: 4px;
  letter-spacing: 0.05em;
}

.gif-gifs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.gif-item {
  background: #fff;
  border: 3px ridge var(--c-pink);
  border-radius: 6px;
  padding: 4px;
  text-align: center;
  cursor: pointer;
  transition: transform .15s ease;
}
.gif-item:hover {
  transform: scale(1.04) rotate(-1deg);
  border-color: var(--c-yellow);
  box-shadow: 0 0 12px var(--c-pink);
}

.gif-item img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
  border: 1px solid #000;
}

.gif-title {
  margin: 4px 0 2px;
  font-size: 0.85rem;
  font-weight: bold;
  color: var(--ink);
}

/* ============================================================
   DOWNLOAD PAGE
   ============================================================ */

.download-section {
  margin: 16px 0;
  padding: 10px 12px;
  background: var(--paper);
  border: 3px dashed var(--c-orange);
  border-radius: 10px;
}

.download-header {
  margin: 0 0 10px;
  padding: 4px 8px;
  background: var(--c-orange);
  color: #fff;
  font-family: "Impact", cursive;
  border-radius: 4px;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.4);
}

.download-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}

.download-item {
  background: var(--paper-cream);
  border: 2px ridge var(--c-yellow);
  border-radius: 6px;
  padding: 8px;
  text-align: center;
}
.download-thumb {
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid #000;
  margin-bottom: 6px;
}
.download-thumb img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.download-title {
  font-weight: bold;
  font-size: 0.9rem;
}
.download-info {
  font-size: 0.78rem;
  color: var(--ink-muted);
  margin-bottom: 6px;
}

.download-button,
.preview-btn,
button[type="submit"],
.midi-toggle-btn,
.midi-tbtn,
#close-game,
#edit-profile-btn,
.danger-btn,
.profile-menu button {
  display: inline-block;
  padding: 5px 14px;
  font-family: "Comic Sans MS", cursive;
  font-weight: bold;
  color: #000;
  background: linear-gradient(180deg, #fff 0%, var(--c-pink) 70%, #b9248a 100%);
  border: 3px outset #fff;
  cursor: pointer;
  text-decoration: none;
  text-shadow: 1px 1px 0 rgba(255,255,255,0.55);
  box-shadow: 2px 2px 0 rgba(0,0,0,0.3);
  transition: filter .12s, transform .12s;
}
.download-button:hover,
.preview-btn:hover,
button[type="submit"]:hover,
#close-game:hover,
#edit-profile-btn:hover {
  filter: saturate(1.25) brightness(1.06);
  transform: translate(-1px,-1px);
}
.download-button:active,
.preview-btn:active,
button[type="submit"]:active {
  transform: translate(2px,2px);
  border-style: inset;
}

.danger-btn {
  background: linear-gradient(180deg, #fff 0%, var(--c-red) 60%, #8a0d0d 100%);
  color: #fff;
}

/* ============================================================
   GUESTBOOK PAGE (i dettagli sono in guestbook.css)
   ============================================================ */

.guest-counters {
  margin-top: 16px;
  padding: 8px;
  background: var(--paper-pink);
  border: 2px dashed var(--c-pink);
  border-radius: 6px;
}
.guest-counters-title {
  font-weight: bold;
  margin-bottom: 4px;
  color: var(--ink-soft);
}
.guest-counters-row img { display: inline-block; }

/* ============================================================
   BLOG
   ============================================================ */

.blog-controls {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding: 8px;
  background: var(--paper-blue);
  border: 2px dashed var(--c-blue);
  border-radius: 6px;
}
.blog-controls input {
  padding: 4px 8px;
  border: 2px inset #ccc;
  font-family: inherit;
  flex: 1 1 200px;
}
.blog-controls button {
  padding: 4px 12px;
  font-family: "Comic Sans MS", cursive;
  font-weight: bold;
  background: linear-gradient(180deg, #fff, var(--c-cyan));
  border: 3px outset #fff;
  cursor: pointer;
}
.blog-controls button:hover { filter: brightness(1.08); }

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.blog-card {
  background: var(--paper);
  border: 3px ridge var(--c-violet);
  border-radius: 8px;
  padding: 8px;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
.blog-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0 var(--c-violet);
}

.blog-card-thumb {
  display: block;
  width: 100%;
  height: 120px;
  object-fit: cover;
  border: 1px solid #000;
  margin-bottom: 6px;
}
.blog-card-title {
  font-weight: bold;
  font-size: 0.95rem;
  color: var(--ink);
  margin-bottom: 4px;
}
.blog-card-meta {
  font-size: 0.78rem;
  color: var(--ink-muted);
}

.blog-inline-img {
  max-width: 100%;
  display: block;
  margin: 8px 0;
  border: 2px solid var(--c-violet);
}

/* Single post view */
#single-post {
  background: var(--paper);
  border: 3px ridge var(--c-pink);
  border-radius: 10px;
  padding: 16px;
  text-align: left;
  box-shadow: var(--shadow-card);
}
#single-post h1, #single-post h2 {
  margin-top: 0;
  font-family: "Impact", cursive;
  color: var(--c-magenta);
  border-bottom: 2px dashed var(--c-pink);
  padding-bottom: 4px;
}

/* Pagination */
.page-button {
  display: inline-block;
  margin: 0 2px;
  padding: 3px 9px;
  background: linear-gradient(180deg, #fff, var(--c-cyan));
  border: 2px outset #fff;
  cursor: pointer;
  font-weight: bold;
  text-decoration: none;
  color: var(--ink);
}
.page-button:hover { filter: brightness(1.1); }
.page-button.active {
  background: var(--c-magenta);
  color: #fff;
  border-style: inset;
}

/* ============================================================
   MIDI ROOM
   ============================================================ */

.midi-room {
  background: linear-gradient(180deg, #1a0030, #08001a);
  color: #f0f0ff;
  border: 4px ridge var(--c-magenta);
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 0 18px rgba(255, 27, 217, 0.35);
}
.midi-room.is-playing {
  box-shadow: 0 0 24px var(--c-magenta), 0 0 36px var(--c-cyan);
}

.midi-topbar {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.midi-search-wrap {
  display: flex;
  flex-direction: column;
  font-size: 0.85rem;
  color: var(--c-cyan);
  flex: 1 1 220px;
}
.midi-search-wrap input {
  padding: 4px 8px;
  border: 2px inset #444;
  background: #000;
  color: var(--c-cyan);
  font-family: "Courier New", monospace;
}
.midi-count {
  background: #000;
  border: 2px inset #444;
  padding: 4px 10px;
  color: var(--c-yellow);
  font-family: "Courier New", monospace;
}

.midi-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 10px;
}
.midi-category-btn {
  padding: 3px 10px;
  font-family: "Comic Sans MS", cursive;
  font-weight: bold;
  background: linear-gradient(180deg, #fff, var(--c-pink));
  border: 2px outset #fff;
  cursor: pointer;
  font-size: 0.85rem;
}
.midi-category-btn.active {
  background: linear-gradient(180deg, var(--c-yellow), var(--c-orange));
  border-style: inset;
}

.midi-console {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 12px;
  margin: 12px 0;
  padding: 10px;
  background: #000;
  border: 3px inset #555;
  border-radius: 8px;
}

.midi-display {
  background: linear-gradient(180deg, #001a1a, #000);
  border: 2px inset #444;
  padding: 10px;
  color: var(--c-cyan);
  font-family: "Courier New", monospace;
}

.midi-display-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  border-bottom: 1px dashed var(--c-cyan);
  padding-bottom: 4px;
  margin-bottom: 6px;
}
.midi-led-row { display:flex; align-items:center; gap:6px; }
.midi-led {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--c-magenta);
  box-shadow: 0 0 6px var(--c-magenta);
  animation: led-blink 1.4s steps(2) infinite;
}

.midi-status { color: var(--c-yellow); }
.midi-bank-active { color: var(--c-pink); }

.midi-now-title {
  color: var(--c-yellow);
  font-weight: bold;
  font-size: 1rem;
  text-shadow: 0 0 6px var(--c-yellow);
  margin: 4px 0;
}
.midi-now-info { font-size: 0.82rem; color: var(--c-cyan); }

.midi-progress { margin-top: 8px; }
.midi-progress-bar {
  height: 10px;
  background: #002a2a;
  border: 2px inset #333;
  position: relative;
  overflow: hidden;
}
.midi-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--c-magenta), var(--c-yellow));
  transition: width .25s linear;
  box-shadow: 0 0 6px var(--c-magenta);
}

.midi-time-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
  font-size: 0.78rem;
}
.midi-time { color: var(--c-cyan); }
.midi-meter {
  display: flex;
  gap: 2px;
  flex: 1 1 auto;
  justify-content: center;
}
.midi-meter span {
  display: inline-block;
  width: 4px;
  height: 12px;
  background: var(--c-green);
  box-shadow: 0 0 4px var(--c-green);
  animation: midi-meter 0.6s steps(4) infinite;
}
.midi-meter span:nth-child(2) { animation-delay: -0.1s; height: 10px; }
.midi-meter span:nth-child(3) { animation-delay: -0.2s; height: 14px; }
.midi-meter span:nth-child(4) { animation-delay: -0.3s; }
.midi-meter span:nth-child(5) { animation-delay: -0.4s; height: 9px; }
.midi-meter span:nth-child(6) { animation-delay: -0.5s; height: 12px; }
@keyframes midi-meter {
  0%, 100% { opacity: 0.4; }
  50%      { opacity: 1; }
}

.midi-controls {
  background: linear-gradient(180deg, #1a0a3a, #08001a);
  border: 2px inset #444;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.midi-transport {
  display: flex;
  gap: 4px;
  justify-content: center;
}
.midi-tbtn {
  padding: 6px 10px;
  font-size: 1rem;
  background: linear-gradient(180deg, #fff, #ccc);
  color: #000;
  border: 3px outset #fff;
  cursor: pointer;
}
.midi-tbtn-play {
  background: linear-gradient(180deg, var(--c-yellow), var(--c-orange));
}
.midi-tbtn:active { border-style: inset; transform: translate(1px,1px); }

.midi-toggles {
  display: flex;
  gap: 4px;
  justify-content: center;
}
.midi-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: #222;
  color: #ccc;
  border: 2px outset #555;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.82rem;
}
.midi-toggle-btn.is-active {
  background: var(--c-magenta);
  color: #000;
  border-style: inset;
}
.midi-toggle-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #666;
}
.midi-toggle-btn.is-active .midi-toggle-dot {
  background: var(--c-yellow);
  box-shadow: 0 0 6px var(--c-yellow);
}

.midi-volume-wrap,
.midi-bank-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--c-cyan);
}
.midi-volume-wrap input[type="range"] {
  flex: 1 1 auto;
  accent-color: var(--c-magenta);
}
.midi-bank-wrap select {
  flex: 1 1 auto;
  background: #000;
  color: var(--c-yellow);
  border: 2px inset #444;
  font-family: "Courier New", monospace;
  padding: 2px 4px;
}
.midi-volume-readout {
  min-width: 36px;
  text-align: right;
  color: var(--c-yellow);
}
.midi-field-label { color: var(--c-pink); }

.midi-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.midi-empty {
  padding: 12px;
  text-align: center;
  color: var(--c-pink);
  background: rgba(0,0,0,0.4);
  border: 1px dashed var(--c-cyan);
}
.midi-group {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
  overflow: hidden;
}
.midi-group-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 10px;
  background: linear-gradient(90deg, var(--c-violet), var(--c-magenta));
}
.midi-group-title {
  margin: 0;
  font-family: "Comic Sans MS", cursive;
  color: #fff;
  font-size: 0.95rem;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.5);
}
.midi-group-count {
  background: #000;
  color: var(--c-yellow);
  padding: 1px 6px;
  border-radius: 10px;
  font-family: "Courier New", monospace;
  font-size: 0.78rem;
}
.midi-group-list { padding: 4px; }
.midi-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  margin: 4px 0;
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 4px;
}
.midi-item.is-playing {
  background: rgba(255,27,217,0.18);
  border-color: var(--c-magenta);
  box-shadow: 0 0 8px rgba(255,27,217,0.5);
}
.midi-item-main { flex: 1 1 auto; min-width: 0; }
.midi-item-btn {
  display: inline-block;
  padding: 3px 10px;
  background: linear-gradient(180deg, #fff, var(--c-cyan));
  color: #000;
  border: 2px outset #fff;
  font-family: "Comic Sans MS", cursive;
  font-weight: bold;
  cursor: pointer;
  font-size: 0.85rem;
}
.midi-item-btn.active {
  background: linear-gradient(180deg, var(--c-yellow), var(--c-orange));
  border-style: inset;
}
.midi-item-meta {
  font-size: 0.78rem;
  color: var(--c-cyan);
  margin-top: 2px;
}
.midi-item-side {
  display: flex;
  align-items: center;
  gap: 6px;
}
.midi-item-tag {
  font-size: 0.72rem;
  background: var(--c-violet);
  color: #fff;
  padding: 1px 6px;
  border-radius: 8px;
}

/* ============================================================
   ARCADE
   ============================================================ */

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}
.game-item {
  background: var(--paper);
  border: 3px ridge var(--c-orange);
  border-radius: 6px;
  padding: 8px;
  text-align: center;
  cursor: pointer;
  transition: transform .15s;
}
.game-item:hover {
  transform: scale(1.04);
  border-color: var(--c-yellow);
  box-shadow: 0 0 10px var(--c-yellow);
}
.game-item img {
  width: 100%;
  height: 100px;
  object-fit: cover;
  border: 1px solid #000;
}
.game-item .game-title {
  margin-top: 6px;
  font-weight: bold;
  font-size: 0.9rem;
}

#game-view {
  display: none;
  margin-top: 16px;
  padding: 12px;
  background: #000;
  border: 4px ridge var(--c-magenta);
  border-radius: 8px;
}
#game-view.open { display: block; }
#game-view h3 {
  color: var(--c-yellow);
  margin: 0 0 8px;
  font-family: "Impact", cursive;
  text-shadow: 1px 1px 0 #000;
}
#game-frame {
  display: block;
  width: 100%;
  height: 480px;
  border: 2px inset #555;
  background: #000;
}
#score-section {
  margin-top: 10px;
  padding: 10px;
  background: rgba(255,255,255,0.05);
  border: 1px dashed var(--c-cyan);
  color: #fff;
}
#score-section .panel-title {
  background: linear-gradient(90deg, var(--c-magenta), var(--c-violet));
}
#score-list {
  list-style: none;
  padding: 0;
  margin: 8px 0;
  color: var(--c-yellow);
  font-family: "Courier New", monospace;
}
#score-list li {
  padding: 2px 6px;
  border-bottom: 1px dashed rgba(255,255,255,0.2);
}

/* ============================================================
   PROFILE
   ============================================================ */

.profile-hero {
  display: grid;
  grid-template-columns: 100px 1fr auto;
  gap: 14px;
  align-items: center;
}
.profile-avatar {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border: 4px ridge var(--c-pink);
  background: #fff;
}
.profile-bio { color: var(--ink-soft); font-style: italic; }
.profile-stats {
  display: flex;
  gap: 12px;
  margin-top: 6px;
}
.profile-stat {
  background: var(--paper-cream);
  border: 2px dashed var(--c-orange);
  padding: 4px 8px;
  text-align: center;
}
.profile-stat span {
  display: block;
  font-weight: bold;
  color: var(--c-magenta);
  font-size: 1.2rem;
}
.profile-stat small {
  display: block;
  font-size: 0.78rem;
  color: var(--ink-muted);
}

.profile-edit { display: none; }
.profile-edit.open { display: block; }

.profile-forms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.profile-form {
  padding: 8px;
  background: var(--paper-blue);
  border: 2px dashed var(--c-blue);
}

.profile-posts-title { margin-top: 18px; }

/* Profile menu (auth) */
.profile-menu {
  position: relative;
  display: inline-block;
}
.profile-menu button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  background: linear-gradient(180deg, #fff, var(--c-cyan));
  border: 2px outset #fff;
  cursor: pointer;
  font-family: "Comic Sans MS", cursive;
  font-weight: bold;
  color: var(--ink);
  line-height: 1.2;
}
#profile-menu-avatar {
  width: 24px;
  height: 24px;
  object-fit: cover;
  border: 1px solid #000;
  border-radius: 3px;
  background: #fff;
  flex-shrink: 0;
}
#profile-menu-name {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 4px;
  background: var(--paper);
  border: 3px outset #fff;
  box-shadow: 4px 4px 0 rgba(0,0,0,0.3);
  min-width: 160px;
  z-index: 200;
}
.profile-menu.open .profile-dropdown { display: block; }
.profile-dropdown a {
  display: block;
  padding: 6px 10px;
  color: var(--link);
  text-decoration: none;
  font-weight: bold;
  border-bottom: 1px dotted #ccc;
}
.profile-dropdown a:hover {
  background: var(--c-yellow);
  color: var(--link-hover);
}

/* ============================================================
   SETUP
   ============================================================ */

.setup-photo {
  width: 100%;
  max-width: 360px;
  border: 4px ridge var(--c-cyan);
  background: #fff;
}

.setup-specs {
  text-align: left;
}
.retro-spec-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.retro-spec-list li {
  padding: 4px 8px;
  border-bottom: 1px dotted var(--c-violet);
  font-family: "Courier New", monospace;
}
.spec-label {
  display: inline-block;
  min-width: 90px;
  color: var(--c-magenta);
  font-weight: bold;
}

.software-container {
  margin-top: 16px;
  padding: 12px;
  background: var(--paper);
  border: 3px ridge var(--c-green);
  border-radius: 8px;
}
.software-title {
  font-family: "Impact", cursive;
  font-size: 1.1rem;
  text-align: center;
  margin-bottom: 8px;
  color: var(--ink);
}
.software-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}
.software-item {
  margin: 0;
  text-align: center;
  width: 80px;
}
.software-item img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border: 2px ridge var(--c-yellow);
  background: #fff;
  padding: 4px;
}
.software-item figcaption {
  margin-top: 4px;
  font-size: 0.78rem;
  font-weight: bold;
}

/* ============================================================
   AUTH PAGES (login / register)
   ============================================================ */

#login-page,
#register-page {
  max-width: 420px;
  margin: 24px auto;
  padding: 20px;
  background: var(--paper);
  border: 4px ridge var(--c-pink);
  border-radius: 12px;
  box-shadow: var(--shadow-card);
}
#login-page form,
#register-page form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
#login-page input,
#register-page input {
  padding: 6px 10px;
  border: 2px inset #ccc;
  font-family: inherit;
}
#login-page button,
#register-page button {
  padding: 8px 14px;
  font-family: "Comic Sans MS", cursive;
  font-weight: bold;
  background: linear-gradient(180deg, #fff, var(--c-pink));
  border: 3px outset #fff;
  cursor: pointer;
}

/* ============================================================
   MODAL (gif viewer)
   ============================================================ */

#gif-modal.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.78);
  z-index: 3000;
  align-items: center;
  justify-content: center;
}
#gif-modal.modal.open {
  display: flex;
}

.modal-content {
  background: var(--paper);
  border: 4px ridge var(--c-pink);
  border-radius: 8px;
  padding: 12px;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.modal-title {
  margin-bottom: 6px;
  font-family: "Impact", cursive;
  color: var(--c-magenta);
  text-shadow: 1px 1px 0 rgba(0,0,0,0.4);
}
.modal-image {
  max-width: 80vw;
  max-height: 70vh;
  border: 2px solid #000;
  background: #fff;
}
.close-button {
  margin-top: 10px;
  padding: 5px 16px;
  font-family: "Comic Sans MS", cursive;
  font-weight: bold;
  background: linear-gradient(180deg, #fff, var(--c-red));
  color: #fff;
  border: 3px outset #fff;
  cursor: pointer;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.5);
}

/* ============================================================
   SPARKLE TRAIL
   ============================================================ */

/* Cursor head sparkle (single dot following pointer; JS sets backgroundColor) */
#sparkle {
  position: fixed;
  display: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 5000;
  box-shadow:
    0 0 6px 2px currentColor,
    0 0 14px 4px rgba(255,255,255,0.4);
  filter: drop-shadow(0 0 3px #fff);
}

/* Trail: many short-lived dots spawned by JS (sets backgroundColor inline) */
.sparkle-dot {
  position: fixed;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 5000;
  box-shadow:
    0 0 8px 2px currentColor,
    0 0 18px 4px rgba(255,255,255,0.45);
  animation: sparkle-fade 0.6s ease-out forwards;
  mix-blend-mode: screen;
}

@keyframes sparkle-fade {
  0% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
  60% {
    transform: scale(1.25) rotate(120deg);
    opacity: 0.85;
  }
  100% {
    transform: scale(0.15) rotate(220deg) translateY(28px);
    opacity: 0;
  }
}

/* ============================================================
   MASCOT
   ============================================================ */

.mascot {
  position: fixed;
  bottom: 12px;
  left: 12px;
  z-index: 1500;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  pointer-events: none;
}

.mascot-img {
  width: 96px;
  height: 96px;
  object-fit: contain;
  filter: drop-shadow(2px 4px 4px rgba(0,0,0,0.4));
  animation: mascot-bob 2.2s ease-in-out infinite;
  pointer-events: auto;
  cursor: pointer;
  background: transparent;
}
@keyframes mascot-bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-4px); }
}

.mascot-bubble {
  background: #fff;
  border: 3px solid #000;
  border-radius: 14px;
  padding: 6px 10px;
  font-family: "Comic Sans MS", cursive;
  font-weight: bold;
  color: var(--ink);
  max-width: 240px;
  position: relative;
  opacity: 0;
  transform: translateY(8px) scale(0.85);
  transition: opacity .25s ease, transform .25s ease;
  font-size: 0.92rem;
  box-shadow: 3px 3px 0 rgba(0,0,0,0.2);
  pointer-events: auto;
}
.mascot-bubble.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.mascot-bubble::after {
  content: '';
  position: absolute;
  left: -10px;
  bottom: 14px;
  border: 10px solid transparent;
  border-right-color: #000;
}
.mascot-bubble::before {
  content: '';
  position: absolute;
  left: -6px;
  bottom: 16px;
  border: 8px solid transparent;
  border-right-color: #fff;
  z-index: 1;
}

/* ============================================================
   WELCOME POPUP
   ============================================================ */

#welcome-popup {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 4000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: welcome-in 0.25s ease;
}
@keyframes welcome-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
#welcome-popup.closing { animation: welcome-out 0.25s ease forwards; }
@keyframes welcome-out {
  to { opacity: 0; }
}
.welcome-window {
  width: 380px;
  max-width: 92vw;
  background: var(--chrome-face, #ece9d8);
  border: 3px outset #fff;
  font-family: "Tahoma", "Comic Sans MS", sans-serif;
  color: #000;
  box-shadow: 6px 6px 0 rgba(0,0,0,0.3);
  --chrome-face: #ece9d8;
}
.welcome-titlebar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 8px;
  background: linear-gradient(90deg, #0a246a, #1c5dd7 60%, #4a90ff);
  color: #fff;
  font-weight: bold;
  font-size: 0.9rem;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.4);
}
.welcome-close {
  background: #c0c0c0;
  border: 2px outset #fff;
  width: 22px;
  height: 22px;
  cursor: pointer;
  font-weight: bold;
  font-family: "Tahoma", sans-serif;
  color: #000;
  padding: 0;
}
.welcome-close:active { border-style: inset; }
.welcome-body {
  display: flex;
  gap: 12px;
  padding: 16px;
}
.welcome-icon {
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  background: var(--c-yellow);
  border: 2px solid #000;
  border-radius: 50%;
  font-family: "Impact", sans-serif;
  font-size: 1.8rem;
  text-align: center;
  line-height: 48px;
  color: #b8001a;
  font-weight: bold;
}
.welcome-text {
  flex: 1 1 auto;
  font-size: 0.92rem;
}
.welcome-text p { margin: 0 0 8px; }
.welcome-actions {
  text-align: right;
  padding: 8px 12px 12px;
}
.welcome-ok {
  padding: 4px 16px;
  background: var(--chrome-face, #ece9d8);
  border: 2px outset #fff;
  cursor: pointer;
  font-family: "Tahoma", sans-serif;
  font-weight: bold;
  min-width: 80px;
}
.welcome-ok:active { border-style: inset; }

/* ============================================================
   RETRO TOAST (script.js)
   ============================================================ */

.retro-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 5000;
  padding: 8px 14px;
  background: var(--c-yellow);
  color: #000;
  border: 3px outset #fff;
  font-family: "Comic Sans MS", cursive;
  font-weight: bold;
  box-shadow: 4px 4px 0 rgba(0,0,0,0.4);
  animation: toast-pop 0.3s ease;
}
@keyframes toast-pop {
  from { transform: translateY(20px) scale(0.8); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}

/* ============================================================
   TOOLBAR (guestbook/blog editors)
   ============================================================ */

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 4px;
}
.format-buttons {
  display: flex;
  gap: 3px;
  background: var(--paper-cream);
  border: 2px outset #fff;
  padding: 3px;
}
.toolbar-btn {
  padding: 2px 8px;
  font-family: "Times New Roman", serif;
  font-weight: bold;
  background: linear-gradient(180deg, #fff, #ddd);
  border: 2px outset #fff;
  cursor: pointer;
  min-width: 28px;
}
.toolbar-btn:active { border-style: inset; }
.toolbar-btn:hover { background: var(--c-yellow); }

.emote-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  padding: 4px;
  background: var(--paper-blue);
  border-bottom: 2px solid var(--c-blue);
}
.emote-tab-btn {
  padding: 3px 8px;
  background: linear-gradient(180deg, #fff, var(--c-cyan));
  border: 2px outset #fff;
  cursor: pointer;
  font-family: "Comic Sans MS", cursive;
  font-size: 0.82rem;
}
.emote-tab-btn.active {
  background: linear-gradient(180deg, var(--c-yellow), var(--c-orange));
  border-style: inset;
}
.emote-content {
  max-height: 200px;
  overflow-y: auto;
  padding: 6px;
  background: var(--paper-cream);
  border: 2px inset #ccc;
}
.emote-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
  gap: 4px;
}
.emote-btn {
  width: 32px;
  height: 32px;
  object-fit: contain;
  cursor: pointer;
  padding: 2px;
  background: #fff;
  border: 1px solid transparent;
}
.emote-btn:hover {
  border-color: var(--c-magenta);
  background: var(--c-yellow);
}
.emote-in-msg {
  display: inline-block;
  width: 20px;
  height: 20px;
  vertical-align: middle;
  object-fit: contain;
}
.emote-empty, .emote-error-notice {
  padding: 12px;
  text-align: center;
  color: var(--ink-muted);
  font-style: italic;
}

/* Action buttons row */
.action-buttons {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  align-items: center;
  margin-top: 6px;
}

/* ============================================================
   EDITOR TIPS / POST PREVIEW
   ============================================================ */

.editor-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.editor-tip {
  font-size: 0.82rem;
  color: var(--ink-muted);
  font-style: italic;
}
.post-preview, .gb-preview {
  margin-top: 8px;
  padding: 8px;
  background: var(--paper-cream);
  border: 2px dashed var(--c-violet);
  border-radius: 4px;
  min-height: 40px;
  font-size: 0.92rem;
  text-align: left;
}
.post-editor textarea,
.post-editor input,
.guestbook-form input,
.guestbook-form textarea {
  font-family: inherit;
  font-size: 0.95rem;
}

/* Loading block */
.loading-block {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  padding: 12px;
  color: var(--ink-muted);
  font-style: italic;
}
.loading-block img { width: 24px; height: 24px; }

/* Errors */
.error {
  padding: 8px 12px;
  color: #b8001a;
  background: #ffe1e1;
  border: 2px dashed #b8001a;
  margin: 6px 0;
  font-weight: bold;
}

/* ============================================================
   MOBILE
   ============================================================ */

@media (max-width: 980px) {
  :root {
    --site-width: min(100% - 24px, 760px);
  }

  .site-layout {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .site-sidebar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
  }
  .site-content {
    order: 1;
  }
  .site-sidebar-left {
    order: 2;
  }
  .site-sidebar-right {
    order: 3;
  }
  .about-layout {
    grid-template-columns: 1fr;
  }
  .midi-console {
    grid-template-columns: 1fr;
  }
  .two-col {
    grid-template-columns: 1fr;
  }

  /* Navbar: tablet — compact rainbow row */
  .navbar {
    gap: 5px;
    padding: 10px 10px 12px;
  }
  .navbar a {
    padding: 6px 10px;
    font-size: 0.9rem;
    min-height: 40px;
  }
}

@media (max-width: 640px) {
  body {
    line-height: 1.5;
  }

  #container {
    width: calc(100vw - 14px);
    margin: 7px auto 56px;
    border-width: 3px;
    box-shadow:
      0 0 0 3px var(--c-pink),
      0 0 0 6px var(--c-yellow),
      0 0 0 9px var(--c-cyan);
  }

  .site-header {
    padding: 14px 10px 10px;
  }

  .header-tape {
    height: 14px;
    font-size: 0.58rem;
    letter-spacing: 0.16em;
  }

  .site-header-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding-top: 8px;
  }

  .site-title.wordart {
    font-size: clamp(1.85rem, 13vw, 2.55rem);
  }

  .wordart-inner {
    -webkit-text-stroke-width: 1.4px;
    filter:
      drop-shadow(1px 1px 0 #000)
      drop-shadow(3px 3px 0 rgba(255,0,170,0.45));
  }

  .site-tagline {
    font-size: 0.82rem;
    line-height: 1.35;
  }

  /* === NAVBAR MOBILE: griglia 3 colonne, tutto visibile senza scroll === */
  .navbar {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    padding: 8px;
    overflow: visible;
    flex-wrap: initial;
    justify-content: initial;
    scroll-snap-type: none;
    -webkit-mask-image: none;
            mask-image: none;
  }
  .navbar a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-width: 0;
    min-height: 62px;
    padding: 6px 4px;
    font-size: 0.72rem;
    line-height: 1.1;
    text-align: center;
    white-space: normal;
    word-break: break-word;
    border-width: 2px;
    border-radius: 6px;
    scroll-snap-align: initial;
    box-shadow:
      inset 0 0 0 1px rgba(255,255,255,0.55),
      2px 2px 0 rgba(0,0,0,0.3);
  }
  .navbar a .nav-ico {
    font-size: 1.55em;
    line-height: 1;
  }
  .navbar a:hover {
    transform: none;
    filter: none;
  }
  .navbar a:active {
    transform: translate(1px, 1px);
    filter: brightness(1.05);
  }

  .site-layout {
    padding: 10px;
  }

  .site-content {
    padding: 4px 0;
  }

  .site-sidebar {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .site-sidebar > .side-card { min-width: 0; }
  /* Card che hanno senso solo a tutta larghezza */
  .site-sidebar > .side-card-badges,
  .site-sidebar > .side-card-quote,
  .site-sidebar > .side-card-construction,
  .site-sidebar > .side-card-theme {
    grid-column: 1 / -1;
  }

  .side-card {
    padding: 8px;
  }

  .side-card-title {
    margin: -8px -8px 8px;
    font-size: 0.86rem;
  }

  .side-counter span { min-width: 0.9rem; padding: 2px 3px; font-size: 0.86rem; }

  .page-title {
    margin: 6px 0 10px;
    font-size: clamp(1.25rem, 8vw, 1.65rem);
    -webkit-text-stroke-width: 1px;
    filter: drop-shadow(1px 1px 0 rgba(0,0,0,0.65));
  }

  .page-lead,
  .panel,
  .notice-box,
  #single-post {
    padding: 10px;
    border-radius: 8px;
  }

  .home-hero {
    gap: 12px;
    padding: 12px;
    border-width: 3px;
    border-radius: 10px;
  }

  .home-hero-gif-wrap {
    max-width: min(260px, 82vw);
    box-shadow:
      0 0 0 3px var(--c-pink),
      0 0 0 6px var(--c-yellow),
      0 0 0 9px var(--c-cyan),
      4px 4px 0 rgba(0,0,0,0.28);
  }

  .home-hero-copy {
    padding: 10px;
    font-size: 0.93rem;
  }

  .home-hub,
  .download-grid,
  .blog-grid,
  .game-grid {
    grid-template-columns: 1fr;
  }

  .hub-card {
    min-height: 0;
    align-items: flex-start;
    text-align: left;
    padding: 12px;
  }

  .hub-ico {
    width: 44px;
    height: 44px;
    font-size: 1.5rem;
  }

  .hub-desc {
    padding: 0;
  }

  .home-strip {
    align-items: flex-start;
    font-size: 0.84rem;
  }

  .gif-section,
  .download-section,
  .software-container,
  .midi-room,
  .blog-card,
  .game-item {
    border-width: 2px;
    border-radius: 8px;
  }

  .gif-section,
  .download-section,
  .software-container,
  .midi-room {
    padding: 10px;
  }

  .gif-gifs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .gif-item {
    padding: 3px;
  }

  .gif-item img {
    height: 104px;
  }

  .download-button,
  .preview-btn,
  button[type="submit"],
  .page-button,
  #close-game,
  #edit-profile-btn,
  .danger-btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    font-size: 0.95rem;
  }

  .blog-controls {
    display: grid;
    grid-template-columns: 1fr;
  }

  .blog-controls input,
  .blog-controls button {
    width: 100%;
  }

  .midi-categories {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .midi-category-btn,
  .midi-toggle-btn,
  .midi-item-btn {
    min-height: 36px;
  }

  .midi-display-head,
  .midi-time-row,
  .midi-volume-wrap,
  .midi-bank-wrap {
    align-items: stretch;
    flex-direction: column;
    gap: 5px;
  }

  .midi-transport,
  .midi-toggles {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .midi-tbtn,
  .midi-toggle-btn {
    justify-content: center;
    width: 100%;
  }

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

  .midi-item-side {
    justify-content: space-between;
  }

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

  .action-buttons {
    flex-wrap: wrap;
    justify-content: stretch;
    gap: 8px;
  }
  .action-buttons > button[type="submit"] {
    flex: 1 1 auto;
  }

  .chatbox-head { font-size: 0.84rem; padding: 6px 8px; }
  .chat-messages { max-height: 240px; }
  #chat-input, .guestbook-form textarea {
    font-size: 16px;  /* iOS: evita auto-zoom in caso di focus */
  }
  .guestbook-form input,
  .post-editor input,
  .post-editor textarea,
  input[type="text"],
  input[type="email"],
  input[type="password"],
  textarea {
    font-size: 16px;
  }

  .profile-menu,
  .profile-menu button {
    width: 100%;
  }

  .profile-menu button {
    justify-content: center;
  }

  .profile-dropdown {
    left: 0;
    right: 0;
  }

  .auth-links {
    flex-wrap: wrap;
  }

  .site-ticker { font-size: 0.85rem; }
  .ticker-prefix { font-size: 0.75rem; padding: 4px 6px; }
  .mascot { display: none; }
  .auth-links { justify-content: center; }
  .profile-hero { grid-template-columns: 76px 1fr; gap: 10px; }
  .profile-avatar { width: 76px; height: 76px; }
  .profile-hero button { grid-column: 1 / -1; }
  #game-frame { height: 360px; }

  .site-content img,
  .site-content video,
  .site-content iframe {
    max-width: 100%;
  }

  .site-content pre,
  .site-content code,
  .site-content table {
    max-width: 100%;
    overflow-x: auto;
  }

  .modal-content {
    width: calc(100vw - 20px);
    max-width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
    padding: 10px;
  }

  .modal-image {
    max-width: 100%;
    max-height: 64vh;
  }

  .close-button {
    margin-top: 8px;
    padding: 10px 22px;
    min-height: 44px;
    font-size: 0.95rem;
  }

  /* Mascot hidden via base mobile rule. Pop-up benvenuto: ridimensiona */
  #welcome-popup .welcome-window {
    width: calc(100vw - 24px) !important;
    max-width: calc(100vw - 24px) !important;
  }
}

@media (max-width: 420px) {
  /* Navbar resta a griglia: 3 colonne, etichette più compatte */
  .navbar {
    padding: 6px;
    gap: 5px;
  }
  .navbar a {
    padding: 5px 3px;
    font-size: 0.68rem;
    min-height: 58px;
  }
  .navbar a .nav-ico {
    font-size: 1.45em;
  }

  .site-sidebar {
    grid-template-columns: 1fr;
  }
  .site-sidebar > .side-card,
  .site-sidebar > .side-card-badges,
  .site-sidebar > .side-card-quote,
  .site-sidebar > .side-card-construction,
  .site-sidebar > .side-card-theme {
    grid-column: auto;
  }

  .gif-gifs {
    grid-template-columns: 1fr;
  }

  .site-footer {
    padding: 10px;
    font-size: 0.78rem;
  }

  .site-footer-sep {
    display: block;
    margin: 4px 0;
  }

  .auth-links {
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
    padding: 3px 4px;
  }
  .auth-links a {
    padding: 4px 8px;
    min-height: 32px;
    display: inline-flex;
    align-items: center;
  }
}

/* ============================================================
   THEME: KAWAII PASTELLO (rosa + celeste + lilla)
   Variazione opzionale, attivata via body.theme-kawaii.
   Ridefinisce le variabili principali e qualche regola di sfondo.
   ============================================================ */

body.theme-kawaii {
  /* Palette pastello: meno saturi, in famiglia rosa/lilla/celeste */
  --c-red:     #ffb1c7;
  --c-orange:  #ffd2b3;
  --c-yellow:  #fff2c2;
  --c-green:   #c8eed1;
  --c-cyan:    #c4dfff;
  --c-blue:    #c4c8ff;
  --c-violet:  #d4b8ff;
  --c-pink:    #ffc0d8;
  --c-magenta: #d782c1;

  /* Carta e inchiostro */
  --paper:        #fffafc;
  --paper-soft:   #fff5fa;
  --paper-cream:  #fff5e8;
  --paper-pink:   #ffeef6;
  --paper-blue:   #f0f4ff;
  --paper-mint:   #f1fbf4;

  --ink:        #4d2c5b;
  --ink-soft:   #6a4575;
  --ink-muted:  #8a6b94;

  --link:         #8a5dc8;
  --link-visited: #b07ad3;
  --link-hover:   #d782c1;

  /* Gradienti rainbow morbidi */
  --rainbow:
    linear-gradient(90deg,
      #ffd1e8 0%,
      #ffc0d8 25%,
      #e3b6ff 50%,
      #c4c8ff 75%,
      #b8e6ff 100%);
  --rainbow-soft:
    linear-gradient(90deg,
      #fff0f7, #ffe5f1, #f5e0ff, #ebd9ff, #d8e3ff);

  /* Ombra più morbida */
  --shadow-soft: 0 6px 22px rgba(190, 130, 200, 0.28);
  --shadow-card: 4px 4px 0 rgba(180, 130, 190, 0.22);
}

/* Sfondo del corpo (pastello cielo-rosa) */
body.theme-kawaii {
  background:
    linear-gradient(180deg,
      #fff5fa 0%,
      #ffe9f5 35%,
      #f0e8ff 70%,
      #e6e8ff 100%) fixed;
}

/* Stelline molto più tenui */
body.theme-kawaii .sky-stars {
  opacity: 0.55;
  filter: hue-rotate(310deg) saturate(0.6);
}

/* Container: bordo nero più sottile + anelli pastello */
body.theme-kawaii #container {
  border-color: #b483c4;
}

/* Header tape: meno scura, ombra ridotta */
body.theme-kawaii .header-tape {
  text-shadow: 0 1px 0 rgba(150, 100, 170, 0.4);
}

/* WordArt: outline lilla scuro invece di nero, drop-shadow tenue */
body.theme-kawaii .wordart-inner {
  -webkit-text-stroke: 2px #6a3a85;
  filter:
    drop-shadow(2px 2px 0 #6a3a85)
    drop-shadow(4px 4px 0 rgba(212, 130, 193, 0.45));
}
body.theme-kawaii .page-title {
  -webkit-text-stroke: 1.5px #6a3a85;
  filter: drop-shadow(2px 2px 0 rgba(106, 58, 133, 0.5));
}
body.theme-kawaii .page-title::before,
body.theme-kawaii .page-title::after {
  color: var(--c-magenta);
}

/* Navbar - sfondo bianco-pesco, pulsanti tutti in famiglia rosa/lilla */
body.theme-kawaii .navbar {
  background:
    repeating-linear-gradient(45deg,
      rgba(255,255,255,0.55) 0 8px,
      rgba(255,255,255,0.25) 8px 16px),
    linear-gradient(180deg, #fff0f7, #e8e0ff);
  border-top-color: var(--c-violet);
  border-bottom-color: var(--c-violet);
}
body.theme-kawaii .navbar a {
  text-shadow: 1px 1px 0 rgba(255,255,255,0.7);
}

/* Override la rotazione 7-color rainbow con un ciclo pastello più corto */
body.theme-kawaii .navbar a:nth-child(7n+1) { --btn-c: #ffc0d8; --btn-c-dark: #d782c1; }
body.theme-kawaii .navbar a:nth-child(7n+2) { --btn-c: #ffd2b3; --btn-c-dark: #c98a5a; }
body.theme-kawaii .navbar a:nth-child(7n+3) { --btn-c: #fff2c2; --btn-c-dark: #b89a55; color:#3d2050; }
body.theme-kawaii .navbar a:nth-child(7n+4) { --btn-c: #c8eed1; --btn-c-dark: #5fa86d; }
body.theme-kawaii .navbar a:nth-child(7n+5) { --btn-c: #c4dfff; --btn-c-dark: #5a8ac9; }
body.theme-kawaii .navbar a:nth-child(7n+6) { --btn-c: #c4c8ff; --btn-c-dark: #6266c9; }
body.theme-kawaii .navbar a:nth-child(7n)   { --btn-c: #d4b8ff; --btn-c-dark: #8a5dc8; }

/* Link: lilla con underline sottile (sostituisce il blu acceso classico) */
body.theme-kawaii .site-content a {
  color: var(--link);
  text-decoration: underline dotted var(--c-violet);
  text-underline-offset: 2px;
}
body.theme-kawaii .site-content a:hover {
  background: #fff0f7;
  color: var(--link-hover);
}
body.theme-kawaii .side-links a { color: var(--link); }
body.theme-kawaii .side-links a:hover {
  background: linear-gradient(90deg, #ffe5f1, transparent);
  color: var(--link-hover);
}

/* Side card titles: gradient pastello invece di rainbow saturo */
body.theme-kawaii .side-card-title {
  text-shadow: 1px 1px 0 rgba(106, 58, 133, 0.4);
}

/* Counter LCD: verde meno acceso */
body.theme-kawaii .side-counter span,
body.theme-kawaii .side-clock {
  color: #b07ad3;
  text-shadow: 0 0 4px #d8a6f0;
}
body.theme-kawaii .side-now { color: var(--c-magenta); }

/* Hero home: gradient pastello */
body.theme-kawaii .home-hero {
  background:
    repeating-linear-gradient(45deg,
      rgba(255,255,255,0.6) 0 10px,
      rgba(255,255,255,0.25) 10px 20px),
    linear-gradient(180deg, #ffeef6, #fff5e8, #f0f4ff);
}

/* Hub cards: tutti in toni rosa/lilla invece del rainbow secco */
body.theme-kawaii .hub-c1 { --hub-c: #ffc0d8; --hub-c-dark: #c91470; }
body.theme-kawaii .hub-c2 { --hub-c: #d4b8ff; --hub-c-dark: #6a1aaf; }
body.theme-kawaii .hub-c3 { --hub-c: #ffd2b3; --hub-c-dark: #b85a00; background: var(--paper-cream); }
body.theme-kawaii .hub-c4 { --hub-c: #c8eed1; --hub-c-dark: #1a7a3d; background: var(--paper-mint); }
body.theme-kawaii .hub-c5 { --hub-c: #c4dfff; --hub-c-dark: #1a5a99; background: var(--paper-blue); }
body.theme-kawaii .hub-c6 { --hub-c: #fff2c2; --hub-c-dark: #a88800; background: var(--paper-cream); }

/* Bordi e badge */
body.theme-kawaii .panel,
body.theme-kawaii .about-card,
body.theme-kawaii .gif-section,
body.theme-kawaii .blog-card,
body.theme-kawaii .game-item,
body.theme-kawaii .side-card {
  border-style: ridge;
}

/* Mascot bubble: bordo lilla invece di nero */
body.theme-kawaii .mascot-bubble {
  border-color: #6a3a85;
}
body.theme-kawaii .mascot-bubble::after { border-right-color: #6a3a85; }

/* Strip e ticker: testo viola scuro per leggibilità */
body.theme-kawaii .home-strip { color: #3d2050; }
body.theme-kawaii .home-strip-tag {
  background: #523058;
  color: #fff5e1;
  text-shadow: 0 0 4px #fff5e1;
}
body.theme-kawaii .site-ticker {
  background: #2a0033;
  color: #ffd1f0;
  border-color: var(--c-magenta);
}
body.theme-kawaii .ticker-prefix { background: var(--c-magenta); }

/* Welcome popup titlebar - tono lilla */
body.theme-kawaii .welcome-titlebar {
  background: linear-gradient(90deg, #6a3a85, #b07ad3 60%, #d782c1);
}
body.theme-kawaii .welcome-icon {
  background: #ffd1ec;
  color: #6a3a85;
  border-color: #6a3a85;
}

/* ============================================================
   THEME: CONSOLE GAMER (PS1 / Sega vibes)
   Antracite + accent arancio/rosso, font tech, niente caos rainbow.
   ============================================================ */

body.theme-console {
  /* Palette: meno saturi, dominanza arancio/rosso/grigio */
  --c-red:     #ff3520;
  --c-orange:  #ff7000;
  --c-yellow:  #ffb800;
  --c-green:   #4ac95c;
  --c-cyan:    #3da8d8;
  --c-blue:    #4060d8;
  --c-violet:  #8055cc;
  --c-pink:    #ff5544;
  --c-magenta: #ff5044;

  /* Surfaces SCURE */
  --paper:        #1f1f25;
  --paper-soft:   #25252d;
  --paper-cream:  #2a2520;
  --paper-pink:   #2a2025;
  --paper-blue:   #1f2530;
  --paper-mint:   #1f2a25;

  /* Inchiostro chiaro per fondo scuro */
  --ink:        #e8e8ee;
  --ink-soft:   #b8b8c4;
  --ink-muted:  #80808c;

  /* Link arancio caldo */
  --link:         #ff8c1a;
  --link-visited: #c95800;
  --link-hover:   #ffb800;

  /* Rainbow ridotto: solo gradiente caldo arancio/rosso/giallo */
  --rainbow:
    linear-gradient(90deg,
      #ff3520 0%,
      #ff7000 35%,
      #ffb800 70%,
      #4ac95c 100%);
  --rainbow-soft:
    linear-gradient(90deg, #2a1a18, #30221a, #2a2a1a, #1f2a1f);

  --shadow-soft: 0 6px 22px rgba(255, 90, 0, 0.18);
  --shadow-card: 4px 4px 0 rgba(0, 0, 0, 0.6);
}

/* Font più tech: Tahoma/Verdana sostituisce Comic Sans */
body.theme-console {
  font-family: "Tahoma", "Verdana", "Geneva", sans-serif;
  background:
    radial-gradient(ellipse at top, #28282f 0%, #15151b 60%, #0a0a10 100%) fixed;
  color: var(--ink);
}

/* Stelle del cielo: pochissime, fredde */
body.theme-console .sky-stars {
  opacity: 0.25;
  filter: hue-rotate(20deg) saturate(0.4);
}
body.theme-console .sky-clouds {
  opacity: 0.15;
  filter: hue-rotate(20deg) brightness(0.5);
}

/* Container: bordo singolo arancio caldo invece dei 4 anelli rainbow */
body.theme-console #container {
  background: #1a1a22;
  background-image:
    repeating-linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.018) 0 1px,
      transparent 1px 3px);
  border-color: #ff7000;
  box-shadow:
    0 0 0 2px #2a1a10,
    0 0 0 4px #ff7000,
    0 0 24px rgba(255, 112, 0, 0.25),
    var(--shadow-soft);
}

/* Header: dark con accent caldo */
body.theme-console .site-header {
  background:
    linear-gradient(180deg, #20202a, #15151c);
  border-bottom: 2px solid #ff7000;
}
body.theme-console .site-footer {
  background:
    linear-gradient(180deg, #15151c, #0d0d12);
  border-top: 2px solid #ff7000;
  color: var(--ink-muted);
}
body.theme-console .header-tape {
  background:
    linear-gradient(90deg, #ff3520, #ff7000, #ffb800, #ff7000, #ff3520);
}

/* WordArt: outline scura + fill arancio invece di rainbow */
body.theme-console .wordart-inner {
  background: linear-gradient(180deg, #ffd060 0%, #ff7000 60%, #ff3520 100%);
  -webkit-text-stroke: 2px #0a0a10;
  filter:
    drop-shadow(2px 2px 0 #0a0a10)
    drop-shadow(0 0 10px rgba(255, 112, 0, 0.5));
}
body.theme-console .page-title {
  -webkit-text-stroke: 1.5px #0a0a10;
  filter: drop-shadow(2px 2px 0 #0a0a10);
}
body.theme-console .page-title::before,
body.theme-console .page-title::after {
  content: '── ◆ ──';
  color: #ff7000;
  -webkit-text-stroke: 0;
  filter: none;
}
body.theme-console .site-tagline { color: var(--ink-soft); }
body.theme-console .rainbow-text {
  background: linear-gradient(90deg, #ff7000, #ffb800, #4ac95c);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Ticker */
body.theme-console .site-ticker {
  background: #000;
  color: #ff8c1a;
  border-color: #ff7000;
}
body.theme-console .ticker-prefix {
  background: #ff7000;
  color: #000;
}

/* Navbar: pulsanti dark con bordo arancio, niente rainbow */
body.theme-console .navbar {
  background:
    repeating-linear-gradient(45deg,
      rgba(255, 112, 0, 0.06) 0 8px,
      transparent 8px 16px),
    linear-gradient(180deg, #18181f, #0e0e14);
  border-top: 2px solid #ff7000;
  border-bottom: 2px solid #ff7000;
}
body.theme-console .navbar a {
  background: linear-gradient(180deg, #2a2a32 0%, #1a1a22 100%);
  border-color: #3a3a44;
  color: #e8e8ee;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.7);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    3px 3px 0 rgba(0, 0, 0, 0.55);
}
body.theme-console .navbar a:hover {
  background: linear-gradient(180deg, #3a2a1a 0%, #ff7000 100%);
  filter: drop-shadow(0 0 8px #ff7000);
  color: #fff;
}
body.theme-console .navbar a.active {
  background: linear-gradient(180deg, #ff8c1a 0%, #ff3520 100%);
  color: #fff;
  border-color: #ff3520;
}
body.theme-console .navbar a .nav-ico {
  color: #ff7000;
  filter: drop-shadow(0 0 4px rgba(255, 112, 0, 0.8));
}
body.theme-console .navbar a:hover .nav-ico,
body.theme-console .navbar a.active .nav-ico { color: #fff; }

/* Side cards: scure con bordo arancio/rosso ciclico */
body.theme-console .side-card {
  background: #1c1c24;
  border-color: #ff7000;
  color: var(--ink);
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.6);
}
body.theme-console .site-sidebar-left  .side-card:nth-child(4n+1) { border-color: #ff7000; }
body.theme-console .site-sidebar-left  .side-card:nth-child(4n+2) { border-color: #ff3520; background: #221820; }
body.theme-console .site-sidebar-left  .side-card:nth-child(4n+3) { border-color: #ffb800; background: #221f15; }
body.theme-console .site-sidebar-left  .side-card:nth-child(4n)   { border-color: #4ac95c; background: #182218; }
body.theme-console .site-sidebar-right .side-card:nth-child(4n+1) { border-color: #3da8d8; background: #16202a; }
body.theme-console .site-sidebar-right .side-card:nth-child(4n+2) { border-color: #ff7000; }
body.theme-console .site-sidebar-right .side-card:nth-child(4n+3) { border-color: #ffb800; background: #221f15; }
body.theme-console .site-sidebar-right .side-card:nth-child(4n)   { border-color: #8055cc; background: #1f1828; }

body.theme-console .side-card-title {
  background: linear-gradient(90deg, #ff3520, #ff7000, #ffb800);
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.7);
  border-bottom: 2px solid #0a0a10;
}

body.theme-console .side-links a {
  color: #ff8c1a;
  text-decoration: underline dotted #ff7000;
}
body.theme-console .side-links a:hover {
  background: linear-gradient(90deg, rgba(255, 112, 0, 0.2), transparent);
  color: #ffb800;
}
body.theme-console .side-links li { border-bottom-color: #3a3a44; }

/* LED counter / clock: arancio invece di verde */
body.theme-console .side-counter span {
  background: #000;
  color: #ff7000;
  border-color: #000;
  text-shadow: 0 0 5px #ff7000;
}
body.theme-console .side-clock {
  color: #ff7000;
  text-shadow: 0 0 5px #ff7000;
}
body.theme-console .side-date { color: var(--ink-soft); }
body.theme-console .side-now {
  background: #000;
  color: #ff8c1a;
}
body.theme-console .side-quote {
  background: rgba(255, 112, 0, 0.08);
  border-left-color: #ff7000;
  color: var(--ink-soft);
}

/* Page content + link */
body.theme-console .site-content,
body.theme-console .site-content p,
body.theme-console .site-content li,
body.theme-console .site-content figcaption,
body.theme-console .site-content label {
  color: var(--ink);
}
body.theme-console .site-content a {
  color: var(--link);
  text-decoration: underline;
}
body.theme-console .site-content a:visited { color: var(--link-visited); }
body.theme-console .site-content a:hover   {
  color: var(--link-hover);
  background: rgba(255, 184, 0, 0.12);
}

body.theme-console .page-lead {
  background: rgba(255, 112, 0, 0.08);
  border: 2px dashed #ff7000;
  color: var(--ink);
}

body.theme-console .notice-box,
body.theme-console .home-strip {
  background: linear-gradient(90deg, #2a1a10, #1a1410);
  border: 2px solid #ff7000;
  color: var(--ink);
  text-shadow: none;
}
body.theme-console .notice-title { background: #ff3520; }
body.theme-console .notice-highlight {
  background: #ffb800;
  color: #000;
}
body.theme-console .home-strip-tag {
  background: #ff3520;
  color: #fff;
  text-shadow: 0 0 4px #ffb800;
}

/* Hero home */
body.theme-console .home-hero {
  background:
    repeating-linear-gradient(45deg,
      rgba(255, 112, 0, 0.04) 0 10px,
      transparent 10px 20px),
    linear-gradient(180deg, #1a1a22, #14141c);
  border-color: #ff7000;
}
body.theme-console .home-hero-gif-wrap {
  border-color: #000;
  box-shadow:
    0 0 0 3px #ff3520,
    0 0 0 6px #ff7000,
    0 0 0 9px #ffb800,
    6px 6px 0 #000;
}
body.theme-console .home-hero-copy {
  background: rgba(255, 112, 0, 0.06);
  border-color: #ff7000;
  color: var(--ink);
}

/* Hub cards: dark con accent caldo */
body.theme-console .hub-card {
  background: #1c1c24;
  color: var(--ink) !important;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.55);
}
body.theme-console .hub-c1 { --hub-c: #ff3520; --hub-c-dark: #ff5544; border-color: #ff3520; background: #221820; }
body.theme-console .hub-c2 { --hub-c: #ff7000; --hub-c-dark: #ff8c1a; border-color: #ff7000; }
body.theme-console .hub-c3 { --hub-c: #ffb800; --hub-c-dark: #ffd060; border-color: #ffb800; background: #221f15; }
body.theme-console .hub-c4 { --hub-c: #4ac95c; --hub-c-dark: #6adb78; border-color: #4ac95c; background: #182218; }
body.theme-console .hub-c5 { --hub-c: #3da8d8; --hub-c-dark: #5dbde6; border-color: #3da8d8; background: #16202a; }
body.theme-console .hub-c6 { --hub-c: #8055cc; --hub-c-dark: #a576e8; border-color: #8055cc; background: #1f1828; }

body.theme-console .hub-ico {
  background: linear-gradient(180deg, #2a2a32, var(--hub-c));
  border-color: #000;
  color: #fff;
  text-shadow: 1px 1px 0 #000;
}
body.theme-console .hub-title {
  color: var(--hub-c);
  text-shadow: 1px 1px 0 #000;
}
body.theme-console .hub-desc { color: var(--ink-soft); }
body.theme-console .hub-cta {
  background: #0a0a10;
  color: var(--hub-c) !important;
  border-color: var(--hub-c);
}
body.theme-console .hub-card:hover .hub-cta {
  background: var(--hub-c);
  color: #000 !important;
}

/* Chatbox / bulletin */
body.theme-console .chatbox {
  background: #16161e;
  border-color: #ff7000;
}
body.theme-console .chat-messages {
  background: #0a0a12;
  border-color: #3a3a44;
  color: var(--ink);
}
body.theme-console .chat-messages .chat-msg {
  background: #1c1c24;
  border-left-color: #ff7000;
}
body.theme-console .chat-messages .chat-msg .chat-name { color: #ff8c1a; }
body.theme-console .chatbox-head {
  background: linear-gradient(90deg, #ff3520, #ff7000);
}

/* About */
body.theme-console .about-card,
body.theme-console .gif-section,
body.theme-console .panel,
body.theme-console .blog-card,
body.theme-console .game-item,
body.theme-console .download-section,
body.theme-console .download-item,
body.theme-console .software-container {
  background: #1c1c24;
  color: var(--ink);
  border-color: #ff7000;
}
body.theme-console .about-mini {
  background: #221f15;
  border-color: #ffb800;
  color: var(--ink);
}
body.theme-console .about-badge {
  background: #4ac95c;
  color: #000;
}
body.theme-console .panel-title,
body.theme-console .gif-header,
body.theme-console .download-header {
  background: linear-gradient(90deg, #ff3520, #ff7000);
}
body.theme-console .blog-card-meta { color: var(--ink-muted); }

/* Setup specs */
body.theme-console .retro-spec-list li {
  color: var(--ink);
  border-bottom-color: #3a3a44;
}
body.theme-console .spec-label { color: #ff7000; }
body.theme-console .software-item img {
  background: #0a0a12;
  border-color: #ff7000;
}

/* Profile */
body.theme-console .profile-stat {
  background: #1c1c24;
  border-color: #ff7000;
  color: var(--ink);
}
body.theme-console .profile-stat span { color: #ff8c1a; }
body.theme-console .profile-bio { color: var(--ink-soft); }
body.theme-console .profile-form {
  background: #1c1c24;
  border-color: #ff7000;
}
body.theme-console input,
body.theme-console textarea,
body.theme-console select {
  background: #0a0a12;
  color: var(--ink);
  border-color: #3a3a44;
}

/* Buttons (download/preview/submit/etc) */
body.theme-console .download-button,
body.theme-console .preview-btn,
body.theme-console button[type="submit"],
body.theme-console #close-game,
body.theme-console #edit-profile-btn,
body.theme-console .blog-controls button,
body.theme-console .page-button {
  background: linear-gradient(180deg, #ff8c1a, #ff3520);
  color: #fff;
  border-color: #ffb800;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.6);
}
body.theme-console .page-button.active {
  background: #ffb800;
  color: #000;
}
body.theme-console .danger-btn {
  background: linear-gradient(180deg, #ff3520, #8a1010);
  border-color: #ff3520;
}

/* Toolbar / pickers */
body.theme-console .toolbar-btn {
  background: linear-gradient(180deg, #2a2a32, #1a1a22);
  border-color: #3a3a44;
  color: var(--ink);
}
body.theme-console .toolbar-btn:hover {
  background: #ff7000;
  color: #000;
}
body.theme-console .emote-tabs {
  background: #1c1c24;
  border-bottom-color: #ff7000;
}
body.theme-console .emote-tab-btn {
  background: linear-gradient(180deg, #2a2a32, #1a1a22);
  color: var(--ink);
  border-color: #3a3a44;
}
body.theme-console .emote-tab-btn.active {
  background: linear-gradient(180deg, #ff8c1a, #ff3520);
  color: #fff;
}
body.theme-console .emote-content {
  background: #14141c;
  border-color: #3a3a44;
}
body.theme-console .emote-btn { background: #1c1c24; }

/* Game view */
body.theme-console #game-view {
  background: #000;
  border-color: #ff7000;
}
body.theme-console #game-view h3 { color: #ff7000; }
body.theme-console #score-list { color: #ffb800; }

/* Mascot */
body.theme-console .mascot-bubble {
  background: #1c1c24;
  border-color: #ff7000;
  color: var(--ink);
}
body.theme-console .mascot-bubble::after { border-right-color: #ff7000; }
body.theme-console .mascot-bubble::before { border-right-color: #1c1c24; }

/* Welcome popup */
body.theme-console .welcome-window {
  background: #1c1c24;
  color: var(--ink);
  border-color: #ff7000;
}
body.theme-console .welcome-titlebar {
  background: linear-gradient(90deg, #1a0a05, #ff3520 60%, #ff7000);
}
body.theme-console .welcome-icon {
  background: #ffb800;
  color: #2a1a10;
  border-color: #2a1a10;
}
body.theme-console .welcome-close,
body.theme-console .welcome-ok {
  background: linear-gradient(180deg, #2a2a32, #1a1a22);
  color: var(--ink);
  border-color: #3a3a44;
}

/* Modal gif */
body.theme-console .modal-content {
  background: #1c1c24;
  border-color: #ff7000;
}
body.theme-console .modal-title { color: #ff7000; }

/* Disabilita le animazioni più "scintillanti" del rainbow */
body.theme-console .header-tape > span { animation-duration: 3s; opacity: 0.7; }
body.theme-console .hub-card::after { color: #ff7000; }

/* ============================================================
   THEME: NEON CYBER Y2K
   Navy/viola scuro + accent ciano/magenta/giallo, bordi tratteggiati,
   LED verdi. Estetica MSN/Y2K cyber dei primi 2000s.
   ============================================================ */

body.theme-neon {
  /* Palette neon (mappa sui --neon-* classici) */
  --c-red:     #ff5757;
  --c-orange:  #ff7e2a;
  --c-yellow:  #ffe54f;
  --c-green:   #64ff66;
  --c-cyan:    #00f7ff;
  --c-blue:    #1c5dd7;
  --c-violet:  #8a2be2;
  --c-pink:    #ff1bd9;
  --c-magenta: #ff1bd9;

  /* Surfaces scure-navy */
  --paper:        #0d0a4a;
  --paper-soft:   #1a0a55;
  --paper-cream:  #1a0a40;
  --paper-pink:   #2a0a45;
  --paper-blue:   #08006a;
  --paper-mint:   #0a2a3a;

  --ink:        #f6f6ff;
  --ink-soft:   #b8bbdf;
  --ink-muted:  #8a8db0;

  --link:         #00f7ff;
  --link-visited: #ff1bd9;
  --link-hover:   #ffe54f;

  --rainbow:
    linear-gradient(90deg,
      #00f7ff 0%,
      #ff1bd9 33%,
      #ffe54f 66%,
      #64ff66 100%);
  --rainbow-soft:
    linear-gradient(90deg, #0a0035, #1a0a4a, #2a0a45, #1a0a4a);

  --shadow-soft: 0 6px 22px rgba(0, 247, 255, 0.25);
  --shadow-card: 4px 4px 0 rgba(0, 0, 0, 0.6);
}

/* Body bg cosmico */
body.theme-neon {
  font-family: "Tahoma", "Verdana", "Geneva", sans-serif;
  background:
    radial-gradient(ellipse at top, #1a0033 0%, #04004e 50%, #08006a 100%) fixed;
  color: var(--ink);
}

body.theme-neon .sky-stars {
  opacity: 0.7;
  filter: hue-rotate(160deg);
}
body.theme-neon .sky-clouds { display: none; }

/* Container con cyan dashed border e magenta halo */
body.theme-neon #container {
  background: #08006a;
  background-image:
    radial-gradient(circle at 15% 12%, rgba(255, 27, 217, 0.12) 0 200px, transparent 220px),
    radial-gradient(circle at 85% 30%, rgba(0, 247, 255, 0.12) 0 220px, transparent 240px),
    radial-gradient(circle at 30% 80%, rgba(255, 229, 79, 0.08) 0 200px, transparent 220px);
  border: 3px dashed #00f7ff;
  border-radius: 6px;
  box-shadow:
    0 0 0 2px #ff1bd9,
    0 0 24px rgba(0, 247, 255, 0.45),
    var(--shadow-soft);
}

/* Header */
body.theme-neon .site-header {
  background: linear-gradient(180deg, #1a0a4a, #08003a);
  border-bottom: 2px dashed #ff1bd9;
}
body.theme-neon .header-tape {
  background:
    linear-gradient(90deg, #ff1bd9, #8a2be2, #1c5dd7, #00f7ff, #1c5dd7, #8a2be2, #ff1bd9);
}

/* WordArt: verde/giallo fill + magenta outline (no cyan-on-cyan) + cyan glow */
body.theme-neon .wordart-inner {
  background: linear-gradient(180deg, #64ff66 0%, #ffe54f 100%);
  -webkit-text-stroke: 2px #ff1bd9;
  filter:
    drop-shadow(2px 2px 0 #00f7ff)
    drop-shadow(0 0 12px rgba(0, 247, 255, 0.55));
}
body.theme-neon .page-title {
  -webkit-text-stroke: 1.5px #ff1bd9;
  background: linear-gradient(180deg, #ffe54f 0%, #ff7e2a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(2px 2px 0 #00f7ff);
}
body.theme-neon .page-title::before,
body.theme-neon .page-title::after {
  content: '✦ ◆ ✦';
  color: #ff1bd9;
  -webkit-text-stroke: 0;
  filter: none;
}

body.theme-neon .site-tagline { color: #00f7ff; }
body.theme-neon .rainbow-text {
  background: linear-gradient(90deg, #00f7ff, #ff1bd9, #ffe54f);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
}

/* Ticker */
body.theme-neon .site-ticker {
  background: #000;
  color: #ffe54f;
  border-color: #ff1bd9;
}
body.theme-neon .ticker-prefix {
  background: #ff1bd9;
  color: #fff;
  text-shadow: 0 0 4px #00f7ff;
}

/* Navbar: pulsanti dark teal con accent verde */
body.theme-neon .navbar {
  background:
    repeating-linear-gradient(45deg,
      rgba(0, 247, 255, 0.06) 0 8px,
      transparent 8px 16px),
    linear-gradient(180deg, #0a0a35, #050018);
  border-top: 2px dashed #00f7ff;
  border-bottom: 2px dashed #00f7ff;
}
body.theme-neon .navbar a {
  background: linear-gradient(180deg, #0e2a4a 0%, #061830 100%);
  border-color: #00f7ff;
  color: #d8f8ff;
  text-shadow: 0 0 4px rgba(0, 247, 255, 0.6);
  box-shadow:
    inset 0 0 0 1px rgba(0, 247, 255, 0.25),
    3px 3px 0 rgba(0, 0, 0, 0.6);
}
body.theme-neon .navbar a:hover {
  background: linear-gradient(180deg, #1a4a7a 0%, #00f7ff 100%);
  filter: drop-shadow(0 0 10px #00f7ff);
  color: #000;
}
body.theme-neon .navbar a.active {
  background: linear-gradient(180deg, #64ff66 0%, #1c8a30 100%);
  color: #000;
  border-color: #64ff66;
  filter: drop-shadow(0 0 10px #64ff66);
}
body.theme-neon .navbar a .nav-ico {
  color: #64ff66;
  filter: drop-shadow(0 0 4px #64ff66);
}
body.theme-neon .navbar a:hover .nav-ico,
body.theme-neon .navbar a.active .nav-ico { color: #000; }

/* Side cards: navy con bordo dashed ciclico */
body.theme-neon .side-card {
  background: #0a0a3a;
  border-style: dashed;
  border-color: #00f7ff;
  color: var(--ink);
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.55);
}
body.theme-neon .site-sidebar-left  .side-card:nth-child(4n+1) { border-color: #00f7ff; }
body.theme-neon .site-sidebar-left  .side-card:nth-child(4n+2) { border-color: #ff1bd9; background: #1a0535; }
body.theme-neon .site-sidebar-left  .side-card:nth-child(4n+3) { border-color: #ffe54f; background: #1a1530; }
body.theme-neon .site-sidebar-left  .side-card:nth-child(4n)   { border-color: #64ff66; background: #0a2a25; }
body.theme-neon .site-sidebar-right .side-card:nth-child(4n+1) { border-color: #00f7ff; background: #0a1a3a; }
body.theme-neon .site-sidebar-right .side-card:nth-child(4n+2) { border-color: #ff1bd9; background: #1a0535; }
body.theme-neon .site-sidebar-right .side-card:nth-child(4n+3) { border-color: #ffe54f; background: #1a1530; }
body.theme-neon .site-sidebar-right .side-card:nth-child(4n)   { border-color: #8a2be2; background: #1a0a3a; }

body.theme-neon .side-card-title {
  background: linear-gradient(90deg, #ff1bd9, #8a2be2);
  color: #ffe54f;
  text-shadow: 0 0 5px #ff1bd9, 1px 1px 0 rgba(0, 0, 0, 0.6);
  border-bottom: 1px dashed #00f7ff;
}

body.theme-neon .side-links a {
  color: #00f7ff;
  text-decoration: underline dotted #ff1bd9;
}
body.theme-neon .side-links a:hover {
  background: linear-gradient(90deg, rgba(255, 27, 217, 0.25), transparent);
  color: #ffe54f;
}
body.theme-neon .side-links li { border-bottom-color: #1a3a5a; }

/* LED counter / clock: verde luminescente */
body.theme-neon .side-counter span,
body.theme-neon .side-clock {
  color: #64ff66;
  background: #000;
  text-shadow: 0 0 6px #64ff66;
}
body.theme-neon .side-date { color: #00f7ff; }
body.theme-neon .side-now {
  background: #000;
  color: #00f7ff;
  border-color: #00f7ff;
}
body.theme-neon .side-quote {
  background: rgba(0, 247, 255, 0.08);
  border-left-color: #00f7ff;
  color: var(--ink-soft);
}

/* Content text + link classico cyber */
body.theme-neon .site-content,
body.theme-neon .site-content p,
body.theme-neon .site-content li,
body.theme-neon .site-content figcaption,
body.theme-neon .site-content label {
  color: var(--ink);
}
body.theme-neon .site-content a {
  color: var(--link);
  text-decoration: underline;
  text-shadow: 0 0 4px rgba(0, 247, 255, 0.5);
}
body.theme-neon .site-content a:visited { color: var(--link-visited); }
body.theme-neon .site-content a:hover {
  color: var(--link-hover);
  background: rgba(255, 229, 79, 0.12);
  text-shadow: 0 0 4px #ffe54f;
}

body.theme-neon .page-lead {
  background: rgba(0, 247, 255, 0.06);
  border: 2px dashed #00f7ff;
  color: var(--ink);
}

/* Hero home */
body.theme-neon .home-hero {
  background:
    repeating-linear-gradient(45deg,
      rgba(0, 247, 255, 0.05) 0 10px,
      transparent 10px 20px),
    linear-gradient(180deg, #0a0a4a, #08003a);
  border: 4px dashed #00f7ff;
}
body.theme-neon .home-hero-gif-wrap {
  border-color: #000;
  box-shadow:
    0 0 0 3px #ff1bd9,
    0 0 0 6px #00f7ff,
    0 0 0 9px #ffe54f,
    0 0 0 12px #64ff66,
    6px 6px 0 rgba(0, 0, 0, 0.5);
}
body.theme-neon .home-hero-copy {
  background: rgba(0, 247, 255, 0.06);
  border-color: #ff1bd9;
  color: var(--ink);
}

/* Hub cards: navy con bordi neon ciclici */
body.theme-neon .hub-card {
  background: #0a0a3a;
  color: var(--ink) !important;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.6);
}
body.theme-neon .hub-c1 { --hub-c: #ff1bd9; --hub-c-dark: #ff7eed; border-color: #ff1bd9; background: #1a0535; }
body.theme-neon .hub-c2 { --hub-c: #b76ef8; --hub-c-dark: #d4a8ff; border-color: #b76ef8; background: #1a0a3a; }
body.theme-neon .hub-c3 { --hub-c: #ff7e2a; --hub-c-dark: #ffa55a; border-color: #ff7e2a; background: #2a1a18; }
body.theme-neon .hub-c4 { --hub-c: #64ff66; --hub-c-dark: #a0ffa0; border-color: #64ff66; background: #0a2a18; }
body.theme-neon .hub-c5 { --hub-c: #00f7ff; --hub-c-dark: #80fbff; border-color: #00f7ff; background: #0a2a3a; }
body.theme-neon .hub-c6 { --hub-c: #ffe54f; --hub-c-dark: #fff09a; border-color: #ffe54f; background: #2a2810; }

body.theme-neon .hub-ico {
  background: linear-gradient(180deg, #0a0a35, var(--hub-c));
  border-color: #00f7ff;
  color: #fff;
  text-shadow: 1px 1px 0 #000;
  box-shadow: 0 0 10px var(--hub-c);
}
body.theme-neon .hub-title {
  color: var(--hub-c-dark);
  text-shadow: 0 0 8px var(--hub-c), 1px 1px 0 #000;
}
body.theme-neon .hub-desc { color: var(--ink-soft); }
body.theme-neon .hub-cta {
  background: #000;
  color: var(--hub-c) !important;
  border-color: var(--hub-c);
}
body.theme-neon .hub-card:hover .hub-cta {
  background: var(--hub-c);
  color: #000 !important;
  text-shadow: none;
}

/* Strip novità + notice */
body.theme-neon .notice-box,
body.theme-neon .home-strip {
  background: linear-gradient(90deg, #1a0a4a, #08003a);
  border: 2px dashed #00f7ff;
  color: var(--ink);
  text-shadow: none;
}
body.theme-neon .notice-title { background: #ff1bd9; color: #fff; }
body.theme-neon .notice-highlight {
  background: #ffe54f;
  color: #08006a;
}
body.theme-neon .home-strip-tag {
  background: #ff1bd9;
  color: #ffe54f;
  text-shadow: 0 0 6px #00f7ff;
}

/* Chatbox / bulletin */
body.theme-neon .chatbox {
  background: #08003a;
  border: 3px solid #00f7ff;
  box-shadow: 0 0 0 2px #ff1bd9 inset;
}
body.theme-neon .chat-messages {
  background: #000020;
  border: 2px solid #ff1bd9;
  color: var(--ink);
}
body.theme-neon .chat-messages .chat-msg {
  background: rgba(0, 247, 255, 0.08);
  border-left-color: #00f7ff;
}
body.theme-neon .chat-messages .chat-msg .chat-name { color: #ffe54f; }
body.theme-neon .chatbox-head {
  background: linear-gradient(90deg, #ff1bd9, #8a2be2);
  color: #ffe54f;
}

/* About, panels, blog */
body.theme-neon .about-card,
body.theme-neon .gif-section,
body.theme-neon .panel,
body.theme-neon .blog-card,
body.theme-neon .game-item,
body.theme-neon .download-section,
body.theme-neon .download-item,
body.theme-neon .software-container {
  background: #0a0a3a;
  color: var(--ink);
  border: 3px dashed #00f7ff;
}
body.theme-neon .about-mini {
  background: rgba(255, 229, 79, 0.06);
  border-color: #ffe54f;
  color: var(--ink);
}
body.theme-neon .about-badge {
  background: #64ff66;
  color: #000;
  text-shadow: 0 0 4px #fff;
}
body.theme-neon .panel-title,
body.theme-neon .gif-header,
body.theme-neon .download-header {
  background: linear-gradient(90deg, #ff1bd9, #8a2be2);
  color: #ffe54f;
}
body.theme-neon .blog-card-meta { color: var(--ink-muted); }
body.theme-neon .blog-card-title { color: #00f7ff; }

/* Setup specs */
body.theme-neon .retro-spec-list li {
  color: var(--ink);
  border-bottom-color: #1a3a5a;
}
body.theme-neon .spec-label { color: #ff1bd9; }
body.theme-neon .software-item img {
  background: #000;
  border-color: #00f7ff;
}

/* Profile */
body.theme-neon .profile-stat {
  background: rgba(0, 247, 255, 0.08);
  border-color: #ff1bd9;
  color: var(--ink);
}
body.theme-neon .profile-stat span { color: #ffe54f; }
body.theme-neon .profile-bio { color: #00f7ff; }
body.theme-neon .profile-form {
  background: #0a0a3a;
  border-color: #00f7ff;
}
body.theme-neon input,
body.theme-neon textarea,
body.theme-neon select {
  background: #000020;
  color: var(--ink);
  border: 2px solid #00f7ff;
}
body.theme-neon input:focus,
body.theme-neon textarea:focus,
body.theme-neon select:focus {
  outline: none;
  border-color: #ff1bd9;
  box-shadow: 0 0 6px #ff1bd9;
}

/* Buttons */
body.theme-neon .download-button,
body.theme-neon .preview-btn,
body.theme-neon button[type="submit"],
body.theme-neon #close-game,
body.theme-neon #edit-profile-btn,
body.theme-neon .blog-controls button,
body.theme-neon .page-button {
  background: linear-gradient(180deg, #ff1bd9, #8a2be2);
  color: #fff;
  border: 2px solid #00f7ff;
  text-shadow: 0 0 4px #00f7ff;
  box-shadow: 0 0 8px rgba(0, 247, 255, 0.4);
}
body.theme-neon .download-button:hover,
body.theme-neon .preview-btn:hover,
body.theme-neon button[type="submit"]:hover {
  background: linear-gradient(180deg, #ffe54f, #ff7e2a);
  color: #08006a;
}
body.theme-neon .page-button.active {
  background: #64ff66;
  color: #000;
  border-color: #00f7ff;
}
body.theme-neon .danger-btn {
  background: linear-gradient(180deg, #ff5757, #8a0d0d);
  border-color: #ff1bd9;
}

/* Toolbar / pickers */
body.theme-neon .toolbar-btn {
  background: linear-gradient(180deg, #1a1a4a, #0a0a3a);
  border: 2px solid #00f7ff;
  color: var(--ink);
}
body.theme-neon .toolbar-btn:hover {
  background: #ffe54f;
  color: #08006a;
}
body.theme-neon .emote-tabs {
  background: #0a0a3a;
  border-bottom: 2px dashed #ff1bd9;
}
body.theme-neon .emote-tab-btn {
  background: linear-gradient(180deg, #1a1a4a, #0a0a3a);
  color: var(--ink);
  border-color: #00f7ff;
}
body.theme-neon .emote-tab-btn.active {
  background: linear-gradient(180deg, #ff1bd9, #8a2be2);
  color: #ffe54f;
}
body.theme-neon .emote-content {
  background: #000020;
  border: 2px solid #00f7ff;
}
body.theme-neon .emote-btn { background: #0a0a3a; }

/* Game view */
body.theme-neon #game-view {
  background: #000;
  border: 3px dashed #00f7ff;
}
body.theme-neon #game-view h3 { color: #ffe54f; }
body.theme-neon #score-list { color: #64ff66; }

/* Mascot */
body.theme-neon .mascot-bubble {
  background: #0a0a3a;
  border: 3px solid #00f7ff;
  color: var(--ink);
  box-shadow: 0 0 10px rgba(0, 247, 255, 0.4);
}
body.theme-neon .mascot-bubble::after { border-right-color: #00f7ff; }
body.theme-neon .mascot-bubble::before { border-right-color: #0a0a3a; }

/* Welcome popup */
body.theme-neon .welcome-window {
  background: #0a0a3a;
  color: var(--ink);
  border: 2px solid #00f7ff;
}
body.theme-neon .welcome-titlebar {
  background: linear-gradient(90deg, #1a0a55, #ff1bd9 60%, #8a2be2);
  color: #ffe54f;
}
body.theme-neon .welcome-icon {
  background: #ffe54f;
  color: #ff1bd9;
  border-color: #ff1bd9;
}
body.theme-neon .welcome-close,
body.theme-neon .welcome-ok {
  background: linear-gradient(180deg, #1a1a4a, #0a0a3a);
  color: var(--ink);
  border: 2px solid #00f7ff;
}

/* Modal gif */
body.theme-neon .modal-content {
  background: #0a0a3a;
  border: 3px dashed #00f7ff;
}
body.theme-neon .modal-title {
  color: #ffe54f;
  text-shadow: 0 0 6px #ff1bd9;
}

/* ============================================================
   FIX leggibilità su temi scuri (Console + Neon)
   Elementi che nel base hanno bg bianco/chiaro hardcoded.
   ============================================================ */

/* Auth links: cornice scura con link visibili */
body.theme-neon .auth-links {
  background: #0a0a3a;
  border: 2px solid #00f7ff;
}
body.theme-neon .auth-links a {
  color: #ffe54f;
  text-shadow: 0 0 4px rgba(0, 247, 255, 0.5);
}
body.theme-neon .auth-links a:hover {
  background: #ff1bd9;
  color: #fff;
}

body.theme-console .auth-links {
  background: #1c1c24;
  border: 2px solid #ff7000;
}
body.theme-console .auth-links a {
  color: #ff8c1a;
}
body.theme-console .auth-links a:hover {
  background: #ff7000;
  color: #000;
}

/* Profile menu button: bg scuro per non perdere il testo bianco */
body.theme-neon .profile-menu button {
  background: linear-gradient(180deg, #1a0a4a, #08003a);
  color: #ffe54f;
  border: 2px solid #00f7ff;
}
body.theme-neon #profile-menu-avatar {
  border-color: #00f7ff;
}
body.theme-neon .profile-dropdown {
  background: #0a0a3a;
  border: 2px solid #00f7ff;
}
body.theme-neon .profile-dropdown a {
  color: #00f7ff;
  border-bottom-color: #1a3a5a;
}
body.theme-neon .profile-dropdown a:hover {
  background: #ff1bd9;
  color: #ffe54f;
}

body.theme-console .profile-menu button {
  background: linear-gradient(180deg, #2a2a32, #1a1a22);
  color: #ff8c1a;
  border: 2px solid #ff7000;
}
body.theme-console #profile-menu-avatar { border-color: #ff7000; }
body.theme-console .profile-dropdown {
  background: #1c1c24;
  border: 2px solid #ff7000;
}
body.theme-console .profile-dropdown a {
  color: var(--ink);
  border-bottom-color: #3a3a44;
}
body.theme-console .profile-dropdown a:hover {
  background: #ff7000;
  color: #000;
}

/* Gallery cards (anime/videogame): bg bianco invisibilizza il title chiaro */
body.theme-neon .gif-item {
  background: #0a0a3a;
  border-color: #00f7ff;
}
body.theme-neon .gif-item:hover {
  border-color: #ffe54f;
  box-shadow: 0 0 12px #ff1bd9;
}
body.theme-neon .gif-title { color: var(--ink); }

body.theme-console .gif-item {
  background: #1c1c24;
  border-color: #ff7000;
}
body.theme-console .gif-item:hover {
  border-color: #ffb800;
  box-shadow: 0 0 10px #ff7000;
}
body.theme-console .gif-title { color: var(--ink); }

/* Footer: ereditava rainbow-soft chiaro, sostituiamo con sfondo coerente */
body.theme-neon .site-footer {
  background: linear-gradient(180deg, #1a0a4a, #08003a);
  border-top: 2px dashed #ff1bd9;
  color: var(--ink-soft);
}
body.theme-neon .site-footer-sep { color: #00f7ff; }
body.theme-neon .site-footer a { color: #ffe54f; }

/* =============================================================
   CAINE PURGED — il sito perde i colori finché caine.exe non viene
   ripristinato (vedi circus.js → playEp08 / restore). Indipendente
   dal tema, immagini comprese. Override massimo: applicato a <html>.
   ============================================================= */
html.caine-purged,
html.caine-purged body {
  filter: grayscale(1) !important;
  -webkit-filter: grayscale(1) !important;
}
