/* ============================================
   SANTAX ARCHIVE — tema terminale CRT verde
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=VT323&family=Share+Tech+Mono&display=swap');

:root {
  --bg-void: #050807;
  --bg-panel: #0b120d;
  --green-core: #49ff88;
  --green-soft: #1fae54;
  --green-deep: #0c3d1e;
  --green-dim: #3f8f5c;
  --glow: rgba(73, 255, 136, 0.55);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg-void);
  color: var(--green-core);
  font-family: 'Share Tech Mono', monospace;
  overflow-x: hidden;
}

/* ---------- Sfondo in loop ---------- */
.bg-loop {
  position: fixed;
  top: 0;
  left: 0;
  width: 200%;
  height: 200%;
  background-repeat: repeat;
  background-size: 400px 400px;
  z-index: 0;
  opacity: 0.25;
  animation: bgScroll 40s linear infinite;
  pointer-events: none;
}

.bg-loop.bg-macao { background-image: url('macao.png'); }
.bg-loop.bg-tokyo  { background-image: url('tokyo.png'); }

@keyframes bgScroll {
  from { transform: translate(0, 0); }
  to   { transform: translate(-400px, -400px); }
}

/* ---------- CRT wrapper: scanlines + vignette ---------- */
.crt {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px 40px;
  text-align: center;
}

.crt::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10;
  mix-blend-mode: overlay;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0px,
    rgba(0, 0, 0, 0) 2px,
    rgba(0, 0, 0, 0.45) 3px
  );
  animation: flicker 6s infinite;
}

.crt::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9;
  background: radial-gradient(ellipse at center, transparent 45%, rgba(0, 0, 0, 0.88) 100%);
}

@keyframes flicker {
  0%, 96%, 100% { opacity: 1; }
  97% { opacity: 0.85; }
  98% { opacity: 1; }
  99% { opacity: 0.9; }
}

/* ---------- Logo ---------- */
.logo-frame {
  display: inline-flex;
  padding: 14px;
  background: var(--bg-panel);
  border: 2px solid var(--green-soft);
  border-radius: 10px;
  box-shadow: 0 0 30px var(--glow);
  animation: pulseGlow 3s ease-in-out infinite alternate;
}

@keyframes pulseGlow {
  from { box-shadow: 0 0 18px var(--glow); }
  to   { box-shadow: 0 0 40px var(--glow); }
}

.logo-frame img {
  display: block;
  width: 150px;
  height: auto;
  filter: drop-shadow(0 0 10px var(--glow));
}

/* ---------- Titles ---------- */
h1.title {
  position: relative;
  font-family: 'VT323', monospace;
  font-size: clamp(2.4rem, 8vw, 4.4rem);
  letter-spacing: 5px;
  text-transform: uppercase;
  color: var(--green-core);
  text-shadow: 0 0 8px var(--glow), 0 0 22px var(--green-deep);
  margin: 26px 0 6px;
}

h1.title::before {
  content: attr(data-text);
  position: absolute;
  left: 2px;
  top: 0;
  width: 100%;
  color: var(--green-deep);
  overflow: hidden;
  clip-path: inset(0 0 0 0);
  animation: glitchShift 5.5s infinite linear;
  z-index: -1;
}

@keyframes glitchShift {
  0%, 92%, 100% { clip-path: inset(0 0 0 0); transform: translate(0, 0); }
  93% { clip-path: inset(10% 0 60% 0); transform: translate(-3px, 0); }
  94% { clip-path: inset(60% 0 5% 0); transform: translate(3px, 0); }
  95% { clip-path: inset(30% 0 40% 0); transform: translate(-2px, 0); }
  96% { clip-path: inset(0 0 0 0); transform: translate(0, 0); }
}

/* ---------- Boot / typewriter line ---------- */
.boot-line {
  display: inline-block;
  font-size: 0.95rem;
  color: var(--green-dim);
  white-space: nowrap;
  overflow: hidden;
  border-right: 2px solid var(--green-core);
  width: 0;
  max-width: 100%;
  margin: 6px 0 0;
  animation:
    typing 2.4s steps(30, end) forwards,
    blinkCaret 0.8s step-end infinite;
}

@keyframes typing {
  from { width: 0; }
  to   { width: 30ch; }
}

@keyframes blinkCaret {
  50% { border-color: transparent; }
}

/* ---------- Menu ---------- */
nav.menu {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: min(380px, 90vw);
  margin-top: 44px;
}

.term-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px 20px;
  border: 1px solid var(--green-soft);
  background: linear-gradient(180deg, rgba(31, 174, 84, 0.08), rgba(0, 0, 0, 0));
  color: var(--green-core);
  text-decoration: none;
  letter-spacing: 3px;
  font-size: 1rem;
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: translateY(6px);
  animation: menuReveal 0.6s ease forwards;
  transition: color 0.2s ease, box-shadow 0.25s ease, transform 0.2s ease;
}

.term-btn::before {
  content: '>';
  color: var(--green-core);
  opacity: 0.7;
}

.term-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--green-core);
  transform: translateX(-100%);
  transition: transform 0.25s ease;
  z-index: -1;
}

.term-btn:hover,
.term-btn:focus-visible {
  color: var(--bg-void);
  box-shadow: 0 0 25px var(--glow);
  transform: translateX(4px);
  outline: none;
}

.term-btn:hover::after,
.term-btn:focus-visible::after {
  transform: translateX(0);
}

/* ---------- Image buttons (Reviews menu) ---------- */
.img-menu {
  align-items: stretch;
}

.term-btn-img {
  display: block;
  padding: 8px;
  border: 1px solid var(--green-soft);
  background: linear-gradient(180deg, rgba(31, 174, 84, 0.08), rgba(0, 0, 0, 0));
  line-height: 0;
  opacity: 0;
  transform: translateY(6px);
  animation: menuReveal 0.6s ease forwards;
  transition: box-shadow 0.25s ease, transform 0.2s ease, border-color 0.2s ease;
}

.term-btn-img img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 0 6px var(--glow));
}

.term-btn-img:hover,
.term-btn-img:focus-visible {
  border-color: var(--green-core);
  box-shadow: 0 0 25px var(--glow);
  transform: translateX(4px);
  outline: none;
}

@keyframes menuReveal {
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Fade-in sequenziale fino a 100 bottoni ---------- */
.term-btn:nth-of-type(1),  .term-btn-img:nth-of-type(1)  { animation-delay: 2.40s; }
.term-btn:nth-of-type(2),  .term-btn-img:nth-of-type(2)  { animation-delay: 2.45s; }
.term-btn:nth-of-type(3),  .term-btn-img:nth-of-type(3)  { animation-delay: 2.50s; }
.term-btn:nth-of-type(4),  .term-btn-img:nth-of-type(4)  { animation-delay: 2.55s; }
.term-btn:nth-of-type(5),  .term-btn-img:nth-of-type(5)  { animation-delay: 2.60s; }
.term-btn:nth-of-type(6),  .term-btn-img:nth-of-type(6)  { animation-delay: 2.65s; }
.term-btn:nth-of-type(7),  .term-btn-img:nth-of-type(7)  { animation-delay: 2.70s; }
.term-btn:nth-of-type(8),  .term-btn-img:nth-of-type(8)  { animation-delay: 2.75s; }
.term-btn:nth-of-type(9),  .term-btn-img:nth-of-type(9)  { animation-delay: 2.80s; }
.term-btn:nth-of-type(10), .term-btn-img:nth-of-type(10) { animation-delay: 2.85s; }
.term-btn:nth-of-type(11), .term-btn-img:nth-of-type(11) { animation-delay: 2.90s; }
.term-btn:nth-of-type(12), .term-btn-img:nth-of-type(12) { animation-delay: 2.95s; }
.term-btn:nth-of-type(13), .term-btn-img:nth-of-type(13) { animation-delay: 3.00s; }
.term-btn:nth-of-type(14), .term-btn-img:nth-of-type(14) { animation-delay: 3.05s; }
.term-btn:nth-of-type(15), .term-btn-img:nth-of-type(15) { animation-delay: 3.10s; }
.term-btn:nth-of-type(16), .term-btn-img:nth-of-type(16) { animation-delay: 3.15s; }
.term-btn:nth-of-type(17), .term-btn-img:nth-of-type(17) { animation-delay: 3.20s; }
.term-btn:nth-of-type(18), .term-btn-img:nth-of-type(18) { animation-delay: 3.25s; }
.term-btn:nth-of-type(19), .term-btn-img:nth-of-type(19) { animation-delay: 3.30s; }
.term-btn:nth-of-type(20), .term-btn-img:nth-of-type(20) { animation-delay: 3.35s; }
.term-btn:nth-of-type(21), .term-btn-img:nth-of-type(21) { animation-delay: 3.40s; }
.term-btn:nth-of-type(22), .term-btn-img:nth-of-type(22) { animation-delay: 3.45s; }
.term-btn:nth-of-type(23), .term-btn-img:nth-of-type(23) { animation-delay: 3.50s; }
.term-btn:nth-of-type(24), .term-btn-img:nth-of-type(24) { animation-delay: 3.55s; }
.term-btn:nth-of-type(25), .term-btn-img:nth-of-type(25) { animation-delay: 3.60s; }
.term-btn:nth-of-type(26), .term-btn-img:nth-of-type(26) { animation-delay: 3.65s; }
.term-btn:nth-of-type(27), .term-btn-img:nth-of-type(27) { animation-delay: 3.70s; }
.term-btn:nth-of-type(28), .term-btn-img:nth-of-type(28) { animation-delay: 3.75s; }
.term-btn:nth-of-type(29), .term-btn-img:nth-of-type(29) { animation-delay: 3.80s; }
.term-btn:nth-of-type(30), .term-btn-img:nth-of-type(30) { animation-delay: 3.85s; }
.term-btn:nth-of-type(31), .term-btn-img:nth-of-type(31) { animation-delay: 3.90s; }
.term-btn:nth-of-type(32), .term-btn-img:nth-of-type(32) { animation-delay: 3.95s; }
.term-btn:nth-of-type(33), .term-btn-img:nth-of-type(33) { animation-delay: 4.00s; }
.term-btn:nth-of-type(34), .term-btn-img:nth-of-type(34) { animation-delay: 4.05s; }
.term-btn:nth-of-type(35), .term-btn-img:nth-of-type(35) { animation-delay: 4.10s; }
.term-btn:nth-of-type(36), .term-btn-img:nth-of-type(36) { animation-delay: 4.15s; }
.term-btn:nth-of-type(37), .term-btn-img:nth-of-type(37) { animation-delay: 4.20s; }
.term-btn:nth-of-type(38), .term-btn-img:nth-of-type(38) { animation-delay: 4.25s; }
.term-btn:nth-of-type(39), .term-btn-img:nth-of-type(39) { animation-delay: 4.30s; }
.term-btn:nth-of-type(40), .term-btn-img:nth-of-type(40) { animation-delay: 4.35s; }
.term-btn:nth-of-type(41), .term-btn-img:nth-of-type(41) { animation-delay: 4.40s; }
.term-btn:nth-of-type(42), .term-btn-img:nth-of-type(42) { animation-delay: 4.45s; }
.term-btn:nth-of-type(43), .term-btn-img:nth-of-type(43) { animation-delay: 4.50s; }
.term-btn:nth-of-type(44), .term-btn-img:nth-of-type(44) { animation-delay: 4.55s; }
.term-btn:nth-of-type(45), .term-btn-img:nth-of-type(45) { animation-delay: 4.60s; }
.term-btn:nth-of-type(46), .term-btn-img:nth-of-type(46) { animation-delay: 4.65s; }
.term-btn:nth-of-type(47), .term-btn-img:nth-of-type(47) { animation-delay: 4.70s; }
.term-btn:nth-of-type(48), .term-btn-img:nth-of-type(48) { animation-delay: 4.75s; }
.term-btn:nth-of-type(49), .term-btn-img:nth-of-type(49) { animation-delay: 4.80s; }
.term-btn:nth-of-type(50), .term-btn-img:nth-of-type(50) { animation-delay: 4.85s; }
.term-btn:nth-of-type(51), .term-btn-img:nth-of-type(51) { animation-delay: 4.90s; }
.term-btn:nth-of-type(52), .term-btn-img:nth-of-type(52) { animation-delay: 4.95s; }
.term-btn:nth-of-type(53), .term-btn-img:nth-of-type(53) { animation-delay: 5.00s; }
.term-btn:nth-of-type(54), .term-btn-img:nth-of-type(54) { animation-delay: 5.05s; }
.term-btn:nth-of-type(55), .term-btn-img:nth-of-type(55) { animation-delay: 5.10s; }
.term-btn:nth-of-type(56), .term-btn-img:nth-of-type(56) { animation-delay: 5.15s; }
.term-btn:nth-of-type(57), .term-btn-img:nth-of-type(57) { animation-delay: 5.20s; }
.term-btn:nth-of-type(58), .term-btn-img:nth-of-type(58) { animation-delay: 5.25s; }
.term-btn:nth-of-type(59), .term-btn-img:nth-of-type(59) { animation-delay: 5.30s; }
.term-btn:nth-of-type(60), .term-btn-img:nth-of-type(60) { animation-delay: 5.35s; }
.term-btn:nth-of-type(61), .term-btn-img:nth-of-type(61) { animation-delay: 5.40s; }
.term-btn:nth-of-type(62), .term-btn-img:nth-of-type(62) { animation-delay: 5.45s; }
.term-btn:nth-of-type(63), .term-btn-img:nth-of-type(63) { animation-delay: 5.50s; }
.term-btn:nth-of-type(64), .term-btn-img:nth-of-type(64) { animation-delay: 5.55s; }
.term-btn:nth-of-type(65), .term-btn-img:nth-of-type(65) { animation-delay: 5.60s; }
.term-btn:nth-of-type(66), .term-btn-img:nth-of-type(66) { animation-delay: 5.65s; }
.term-btn:nth-of-type(67), .term-btn-img:nth-of-type(67) { animation-delay: 5.70s; }
.term-btn:nth-of-type(68), .term-btn-img:nth-of-type(68) { animation-delay: 5.75s; }
.term-btn:nth-of-type(69), .term-btn-img:nth-of-type(69) { animation-delay: 5.80s; }
.term-btn:nth-of-type(70), .term-btn-img:nth-of-type(70) { animation-delay: 5.85s; }
.term-btn:nth-of-type(71), .term-btn-img:nth-of-type(71) { animation-delay: 5.90s; }
.term-btn:nth-of-type(72), .term-btn-img:nth-of-type(72) { animation-delay: 5.95s; }
.term-btn:nth-of-type(73), .term-btn-img:nth-of-type(73) { animation-delay: 6.00s; }
.term-btn:nth-of-type(74), .term-btn-img:nth-of-type(74) { animation-delay: 6.05s; }
.term-btn:nth-of-type(75), .term-btn-img:nth-of-type(75) { animation-delay: 6.10s; }
.term-btn:nth-of-type(76), .term-btn-img:nth-of-type(76) { animation-delay: 6.15s; }
.term-btn:nth-of-type(77), .term-btn-img:nth-of-type(77) { animation-delay: 6.20s; }
.term-btn:nth-of-type(78), .term-btn-img:nth-of-type(78) { animation-delay: 6.25s; }
.term-btn:nth-of-type(79), .term-btn-img:nth-of-type(79) { animation-delay: 6.30s; }
.term-btn:nth-of-type(80), .term-btn-img:nth-of-type(80) { animation-delay: 6.35s; }
.term-btn:nth-of-type(81), .term-btn-img:nth-of-type(81) { animation-delay: 6.40s; }
.term-btn:nth-of-type(82), .term-btn-img:nth-of-type(82) { animation-delay: 6.45s; }
.term-btn:nth-of-type(83), .term-btn-img:nth-of-type(83) { animation-delay: 6.50s; }
.term-btn:nth-of-type(84), .term-btn-img:nth-of-type(84) { animation-delay: 6.55s; }
.term-btn:nth-of-type(85), .term-btn-img:nth-of-type(85) { animation-delay: 6.60s; }
.term-btn:nth-of-type(86), .term-btn-img:nth-of-type(86) { animation-delay: 6.65s; }
.term-btn:nth-of-type(87), .term-btn-img:nth-of-type(87) { animation-delay: 6.70s; }
.term-btn:nth-of-type(88), .term-btn-img:nth-of-type(88) { animation-delay: 6.75s; }
.term-btn:nth-of-type(89), .term-btn-img:nth-of-type(89) { animation-delay: 6.80s; }
.term-btn:nth-of-type(90), .term-btn-img:nth-of-type(90) { animation-delay: 6.85s; }
.term-btn:nth-of-type(91), .term-btn-img:nth-of-type(91) { animation-delay: 6.90s; }
.term-btn:nth-of-type(92), .term-btn-img:nth-of-type(92) { animation-delay: 6.95s; }
.term-btn:nth-of-type(93), .term-btn-img:nth-of-type(93) { animation-delay: 7.00s; }
.term-btn:nth-of-type(94), .term-btn-img:nth-of-type(94) { animation-delay: 7.05s; }
.term-btn:nth-of-type(95), .term-btn-img:nth-of-type(95) { animation-delay: 7.10s; }
.term-btn:nth-of-type(96), .term-btn-img:nth-of-type(96) { animation-delay: 7.15s; }
.term-btn:nth-of-type(97), .term-btn-img:nth-of-type(97) { animation-delay: 7.20s; }
.term-btn:nth-of-type(98), .term-btn-img:nth-of-type(98) { animation-delay: 7.25s; }
.term-btn:nth-of-type(99), .term-btn-img:nth-of-type(99) { animation-delay: 7.30s; }
.term-btn:nth-of-type(100), .term-btn-img:nth-of-type(100) { animation-delay: 7.35s; }

/* ---------- Fallback per oltre 100 bottoni ---------- */
.term-btn:nth-of-type(n+101), .term-btn-img:nth-of-type(n+101) { animation-delay: 7.40s; }

/* ---------- Footer ---------- */
footer.tag {
  margin-top: 50px;
  font-size: 0.75rem;
  letter-spacing: 2px;
  color: var(--green-dim);
}

/* ---------- Sub-pages ---------- */
.back-link {
  margin-top: 40px;
}

.content-panel {
  margin-top: 30px;
  width: min(520px, 90vw);
  border: 1px solid var(--green-deep);
  background: rgba(11, 18, 13, 0.6);
  padding: 26px 22px;
  text-align: left;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--green-dim);
}

.content-panel strong { color: var(--green-core); }

/* ---------- Story reader ---------- */
.story-wrap {
  width: min(680px, 92vw);
  margin-top: 30px;
  text-align: left;
}

.chapter {
  border: 1px solid var(--green-deep);
  background: rgba(11, 18, 13, 0.55);
  padding: 22px 24px;
  margin-bottom: 22px;
}

.chapter h2 {
  font-family: 'VT323', monospace;
  font-size: 1.6rem;
  letter-spacing: 3px;
  color: var(--green-core);
  text-shadow: 0 0 8px var(--glow);
  margin: 0 0 12px;
}

.chapter pre {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--green-dim);
  white-space: pre-wrap;
  word-wrap: break-word;
  margin: 0;
}

.story-empty {
  width: min(680px, 92vw);
  color: var(--green-dim);
  font-size: 0.95rem;
  margin-top: 30px;
  line-height: 1.6;
}

/* ---------- Review pages: title banner ---------- */
.title-banner {
  display: inline-flex;
  margin: 0 0 8px;
  padding: 10px;
  background: var(--bg-panel);
  border: 2px solid var(--green-soft);
  border-radius: 10px;
  box-shadow: 0 0 30px var(--glow);
  animation: pulseGlow 3s ease-in-out infinite alternate;
}

.title-banner img {
  display: block;
  max-width: 340px;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 0 10px var(--glow));
}

.game-cover {
  margin-top: 20px;
}

.game-cover img {
  max-width: 280px;
  width: 100%;
  height: auto;
  border: 2px solid var(--green-soft);
  box-shadow: 0 0 20px var(--glow);
}

/* ---------- Info panel ---------- */
.info-panel {
  width: min(560px, 92vw);
  margin-top: 26px;
  border: 1px solid var(--green-deep);
  background: rgba(11, 18, 13, 0.55);
  text-align: left;
}

.info-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--green-deep);
  font-size: 0.9rem;
}

.info-row:last-child { border-bottom: none; }

.info-row .info-label {
  min-width: 110px;
  color: var(--green-dim);
  letter-spacing: 2px;
  flex-shrink: 0;
}

.info-row .info-value {
  color: var(--green-core);
}

.info-row .info-value img {
  height: 34px;
  width: auto;
  filter: drop-shadow(0 0 6px var(--glow));
}

/* ---------- Review text ---------- */
.review-text {
  width: min(560px, 92vw);
  margin-top: 26px;
  text-align: left;
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--green-dim);
}

.review-text strong { color: var(--green-core); }

/* ---------- Star rating ---------- */
.rating-row {
  display: flex;
  gap: 8px;
  margin-top: 22px;
}

.rating-row img {
  width: 42px;
  height: auto;
  filter: drop-shadow(0 0 6px var(--glow));
}

.star-half {
  display: inline-block;
  width: 21px;
  overflow: hidden;
}

.star-half img {
  width: 42px;
  max-width: none;
}

.rating-caption {
  margin-top: 10px;
  font-family: 'VT323', monospace;
  font-size: 1.4rem;
  letter-spacing: 3px;
  color: var(--green-core);
  text-shadow: 0 0 8px var(--glow);
}

/* ---------- Screenshot gallery ---------- */
.gallery-heading {
  margin-top: 34px;
  font-family: 'VT323', monospace;
  font-size: 1.5rem;
  letter-spacing: 3px;
  color: var(--green-core);
  text-shadow: 0 0 8px var(--glow);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  width: min(680px, 92vw);
  margin-top: 16px;
}

.gallery-grid img {
  width: 100%;
  height: 100px;
  object-fit: cover;
  border: 1px solid var(--green-soft);
  cursor: pointer;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.gallery-grid img:hover,
.gallery-grid img:focus-visible {
  box-shadow: 0 0 20px var(--glow);
  transform: scale(1.03);
  outline: none;
}

.gallery-empty {
  width: min(680px, 92vw);
  margin-top: 16px;
  color: var(--green-dim);
  font-size: 0.9rem;
}

/* ---------- Lightbox ---------- */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 30px;
  background: rgba(0, 0, 0, 0.9);
  cursor: zoom-out;
}

.lightbox-overlay.active { display: flex; }

.lightbox-overlay img {
  max-width: 100%;
  max-height: 100%;
  border: 2px solid var(--green-soft);
  box-shadow: 0 0 40px var(--glow);
}

/* ---------- Accessibility ---------- */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .boot-line { width: 30ch; border-right: none; }
  .term-btn, .term-btn-img { opacity: 1; transform: none; }
  .bg-loop { animation: none; }
}