/* --- BASE & VARIABLES --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* GameDevs Console Chassis Palette */
  --chassis-body: #49505a;
  --chassis-dark: #373d46;
  --chassis-light: #5d6673;
  --chassis-shadow: rgba(0, 0, 0, 0.45);
  
  /* Bezel Glass & Accents */
  --bezel-glass: #0b0d10;
  --bezel-frame: #16191f;
  --chromatic-txt: #e2e8f0;
  
  /* Buttons */
  --btn-dpad: #21252b;
  --btn-dpad-highlight: #3a414c;
  --btn-glossy: #111417;
  --btn-pill: #1f2329;

  /* Screen 16-Bit Colors */
  --screen-bg: #0d1326;
  --screen-text: #ffffff;
  --c-yellow: #ffd32a;
  --c-cyan: #00d2d3;
  --c-pink: #ff3f34;
  --c-magenta: #ff5e7e;
  --c-green: #0be881;
  --c-purple: #a55eea;
  --c-blue: #3867d6;

  /* Typography */
  --font-pixel: 'Press Start 2P', monospace;
  --font-silkscreen: 'Silkscreen', monospace;
  --font-ui: 'Outfit', sans-serif;
}

body {
  background-color: #0f1319;
  background-image: 
    radial-gradient(ellipse at top, #1e2638 0%, #0d1117 70%),
    radial-gradient(#252d3d 1px, transparent 1px);
  background-size: 100% 100%, 28px 28px;
  color: #e2e8f0;
  font-family: var(--font-ui);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 25px 15px;
}

.chromatic-layout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 50px;
  max-width: 1350px;
  width: 100%;
  margin: auto;
}

/* --- SIDE PANELS (EDITORIAL & GUIDES) --- */
.side-panel {
  flex: 1;
  max-width: 320px;
}

.left-side {
  text-align: left;
}

.badge-tag {
  font-size: 11px;
  letter-spacing: 2px;
  font-weight: 700;
  color: #8190a6;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.hero-title {
  font-size: 40px;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -1.5px;
  margin-bottom: 16px;
  color: #fff;
}

.gradient-text {
  background: linear-gradient(135deg, #00d2d3, #ff5e7e, #ffd32a);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  font-size: 15px;
  line-height: 1.6;
  color: #a0aec0;
  margin-bottom: 24px;
}

.feature-pills {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.f-pill {
  font-size: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 8px 14px;
  border-radius: 20px;
  color: #cbd5e0;
  letter-spacing: 0.5px;
  backdrop-filter: blur(4px);
  width: fit-content;
}

/* Colonna destra */
.right-side .panel-card {
  background: rgba(26, 32, 44, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 22px 24px;
  border-radius: 18px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.5);
  backdrop-filter: blur(12px);
}

.panel-title {
  font-family: var(--font-silkscreen);
  font-size: 13px;
  letter-spacing: 1px;
  color: var(--c-cyan);
  margin-bottom: 18px;
}

.key-guide {
  margin-bottom: 14px;
}

.key-box {
  display: inline-block;
  font-family: var(--font-pixel);
  font-size: 8.5px;
  background: #10141d;
  color: #ffd32a;
  padding: 5px 9px;
  border-radius: 6px;
  border: 1px solid #2d3748;
  margin-bottom: 4px;
}

.key-guide p {
  font-size: 13px;
  color: #a0aec0;
}

.sound-switch-row {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sound-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #2b3240;
  color: #fff;
  border: 1px solid #4a5568;
  padding: 9px 16px;
  border-radius: 30px;
  cursor: pointer;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 1px;
  transition: all 0.2s;
}

.sound-btn:hover {
  background: #374151;
  border-color: var(--c-cyan);
}

/* --- THE GAMEDEVS DEVICE SHELL --- */
.console-stage {
  perspective: 1000px;
  display: flex;
  justify-content: center;
}

.chromatic-device {
  width: 380px;
  background: linear-gradient(175deg, var(--chassis-light) 0%, var(--chassis-body) 40%, var(--chassis-dark) 100%);
  border-radius: 20px 20px 30px 30px;
  padding: 20px 20px 32px 20px;
  position: relative;
  box-shadow:
    0 35px 70px -15px rgba(0, 0, 0, 0.75),
    0 12px 25px rgba(0, 0, 0, 0.5),
    inset 0 2px 3px rgba(255, 255, 255, 0.4),
    inset 0 -4px 8px rgba(0, 0, 0, 0.5),
    inset 2px 0 4px rgba(255, 255, 255, 0.25),
    inset -2px 0 4px rgba(0, 0, 0, 0.35);
  border: 1px solid #5a6370;
  user-select: none;
}

/* --- BEZEL DI VETRO NERO --- */
.glass-bezel {
  background: var(--bezel-glass);
  border-radius: 12px 12px 6px 6px;
  padding: 15px 14px 14px 14px;
  box-shadow:
    inset 0 3px 6px #000,
    inset 0 -2px 4px #262c38,
    0 1px 2px rgba(255, 255, 255, 0.15);
  border: 2px solid #1a1e26;
  margin-bottom: 12px;
  position: relative;
}

/* Logo GIANLUCA VUONO DEVELOPER in alto centrato */
.bezel-brand {
  text-align: center;
  font-family: var(--font-ui);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 1.8px;
  color: #dbe3ee;
  margin-bottom: 11px;
  text-transform: uppercase;
}

/* --- SCHERMO A COLORI 16-BIT BRILLANTE --- */
.color-screen {
  position: relative;
  width: 100%;
  height: 265px; /* Aumentata l'altezza per far respirare i menu */
  background-color: var(--screen-bg);
  border-radius: 4px;
  overflow: hidden;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.9);
  border: 2px solid #06080a;
  display: flex;
  flex-direction: column;
}

/* Effetto Scanlines e Pixel IPS */
.screen-scanlines {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.12) 0px,
    rgba(0, 0, 0, 0.12) 1px,
    transparent 1px,
    transparent 2px
  );
  pointer-events: none;
  z-index: 20;
}

/* HUD Top */
.screen-hud {
  height: 20px;
  background: rgba(0, 0, 0, 0.65);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
  font-family: var(--font-silkscreen);
  font-size: 7.5px;
  color: #a0aec0;
  z-index: 5;
  flex-shrink: 0;
}

.hud-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--c-green);
  border-radius: 50%;
  margin-right: 5px;
  box-shadow: 0 0 6px var(--c-green);
}

/* Screen Viewport Interno con scroll fluido */
.screen-viewport {
  flex: 1;
  position: relative;
  overflow-y: auto;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
  padding: 8px 10px 14px 10px;
  color: #fff;
  z-index: 5;
}

/* Stile scrollbar compatto */
.screen-viewport::-webkit-scrollbar {
  width: 3px;
}
.screen-viewport::-webkit-scrollbar-thumb {
  background: rgba(255, 211, 42, 0.4);
  border-radius: 2px;
}

/* Bottom Screen Helper */
.screen-bottom-bar {
  height: 22px;
  background: rgba(0, 0, 0, 0.75);
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  font-family: var(--font-pixel);
  font-size: 6.5px;
  color: #ffd32a;
  z-index: 5;
  flex-shrink: 0;
}

/* --- ELEMENTI GRAFICI DI GIOCO A COLORI NELLO SCHERMO --- */

/* Home Screen: Arcade Neon & Mascot */
.home-screen {
  display: flex;
  flex-direction: column;
}

.title-arcade-box {
  text-align: center;
  margin-bottom: 8px;
}

.tetris-arcade-logo {
  display: inline-block;
  font-family: var(--font-pixel);
  font-size: 13.5px;
  font-weight: 900;
  letter-spacing: 2px;
  color: #ffffff;
  padding: 3px 10px;
  border: 2px solid #4a90e2;
  box-shadow:
    0 0 8px #00d2d3,
    inset 0 0 8px #00d2d3;
  text-shadow: 2px 2px #ff3f34, -2px -2px #3867d6;
  background: #111b33;
  border-radius: 4px;
}

.pixel-art-showcase {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 9px;
  background: rgba(255, 255, 255, 0.04);
  padding: 5px 8px;
  border-radius: 6px;
  border: 1px dashed rgba(255, 255, 255, 0.2);
}

.cute-mascot {
  width: 32px;
  height: 32px;
  animation: bounceMascot 1s infinite alternate ease-in-out;
  flex-shrink: 0;
}

@keyframes bounceMascot {
  from { transform: translateY(0); }
  to { transform: translateY(-3px); }
}

.mascot-speech {
  font-family: var(--font-pixel);
  font-size: 6.5px;
  line-height: 1.4;
  color: #e2e8f0;
}

.mascot-speech strong {
  color: var(--c-yellow);
}

/* Menu Items colorati */
.color-menu {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding-bottom: 10px;
}

.color-menu-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  font-family: var(--font-pixel);
  font-size: 7.5px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.12s ease;
  color: #cbd5e0;
}

.color-menu-option.active {
  background: linear-gradient(90deg, #ff3f34 0%, #ff5e7e 100%);
  color: #ffffff;
  border-color: #ffd32a;
  box-shadow: 0 0 8px rgba(255, 63, 52, 0.6);
  transform: translateX(3px);
}

.color-menu-option .menu-bullet {
  color: #ffd32a;
  margin-right: 5px;
  visibility: hidden;
}

.color-menu-option.active .menu-bullet {
  visibility: visible;
}

/* Dettagli Schermate (Chi Sono, Software, Contatti) */
.view-title {
  font-family: var(--font-pixel);
  font-size: 8.5px;
  color: var(--c-yellow);
  text-shadow: 1px 1px #000;
  border-bottom: 2px solid var(--c-cyan);
  padding-bottom: 4px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
}

.about-text {
  font-family: var(--font-silkscreen);
  font-size: 8px;
  line-height: 1.6;
  color: #f1f2f6;
}
.about-text p {
  margin-bottom: 7px;
}
.about-tag {
  color: var(--c-cyan);
  font-weight: bold;
}

/* Card Progetti Software a colori */
.project-card-rgb {
  background: #141c2e;
  border-left: 4px solid var(--c-green);
  padding: 6px 8px;
  margin-bottom: 6px;
  border-radius: 2px;
  font-family: var(--font-silkscreen);
  transition: all 0.15s ease;
  cursor: pointer;
}

.project-card-rgb.current {
  border-left: 4px solid var(--c-pink);
  background: #1f2a47;
  box-shadow: 0 0 8px rgba(0, 210, 211, 0.3);
  transform: translateX(2px);
}

.proj-title {
  font-family: var(--font-pixel);
  font-size: 7.5px;
  color: #fff;
  margin-bottom: 3px;
  display: flex;
  justify-content: space-between;
}

.proj-badge {
  font-size: 6px;
  color: var(--c-yellow);
}

.proj-desc {
  font-size: 7px;
  color: #cbd5e0;
  line-height: 1.4;
}

/* Contatti a colori */
.contact-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #162035;
  padding: 7px 9px;
  border-radius: 4px;
  margin-bottom: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-family: var(--font-silkscreen);
  font-size: 8px;
  cursor: pointer;
  transition: all 0.12s;
}

.contact-item.active-contact {
  background: linear-gradient(90deg, #3867d6, #00d2d3);
  color: #ffffff;
  border-color: #ffd32a;
  transform: translateX(2px);
}

/* --- LOGO GAMEDEVS & GRIGLIA BARRE --- */
.chromatic-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  padding: 0 4px;
}

.chromatic-title {
  font-family: var(--font-ui);
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 2px;
  color: var(--chromatic-txt);
}

.tm-symbol {
  font-size: 7px;
  margin-left: 2px;
  vertical-align: top;
}

.grid-bars {
  display: flex;
  gap: 3px;
}

.grid-bars span {
  display: inline-block;
  width: 9px;
  height: 10px;
  background: #252a32;
  border-radius: 1px;
}

.grid-bars span:nth-last-child(1) {
  height: 14px;
  border-top-right-radius: 5px;
}
.grid-bars span:nth-last-child(2) {
  height: 12px;
}

/* --- CONTROLLI FISICI: DPAD & TASTI LUCIDI --- */
.controls-area {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  padding: 0 6px;
}

/* D-PAD A CROCE CON INCAVO CENTRALE */
.dpad-container {
  width: 104px;
  height: 104px;
  position: relative;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.5));
}

.dpad-dir {
  position: absolute;
  background: var(--btn-dpad);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #111417;
  transition: all 0.08s;
  box-shadow:
    inset 1px 1px 1px rgba(255, 255, 255, 0.15),
    inset -1px -1px 2px rgba(0, 0, 0, 0.8);
}

.dpad-dir:active, .dpad-dir.pressed {
  background: #14171a;
  box-shadow: inset 0 2px 4px #000;
}

.dpad-up {
  top: 0; left: 35px; width: 34px; height: 35px;
  border-radius: 5px 5px 0 0;
}
.dpad-down {
  bottom: 0; left: 35px; width: 34px; height: 35px;
  border-radius: 0 0 5px 5px;
}
.dpad-left {
  top: 35px; left: 0; width: 35px; height: 34px;
  border-radius: 5px 0 0 5px;
}
.dpad-right {
  top: 35px; right: 0; width: 35px; height: 34px;
  border-radius: 0 5px 5px 0;
}

.dpad-core {
  position: absolute;
  top: 35px; left: 35px; width: 34px; height: 34px;
  background: var(--btn-dpad);
}

.dpad-core::after {
  content: "";
  position: absolute;
  top: 8px; left: 8px; width: 18px; height: 18px;
  background: #15181c;
  border-radius: 50%;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.9);
}

.arrow-shape {
  font-size: 10px;
  opacity: 0.3;
}

/* PULSANTI B E A NERI LUCIDI (DOMED BUTTONS) */
.action-buttons-wrap {
  display: flex;
  gap: 16px;
  transform: rotate(-25deg);
  transform-origin: center right;
  margin-top: -12px;
}

.action-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.glossy-btn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #444c56, #16191d 65%, #080a0c 100%);
  border: 1px solid #23272e;
  cursor: pointer;
  box-shadow:
    0 5px 10px rgba(0, 0, 0, 0.6),
    inset 0 2px 2px rgba(255, 255, 255, 0.45),
    inset 0 -3px 4px #000;
  transition: all 0.08s;
  position: relative;
}

.glossy-btn:active, .glossy-btn.pressed {
  transform: translateY(2px);
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.7),
    inset 0 3px 5px #000;
}

.btn-caption {
  font-family: var(--font-ui);
  font-weight: 800;
  font-size: 12px;
  color: #cfd6e0;
  transform: rotate(25deg);
  letter-spacing: 0.5px;
}

/* SELECT & START BUTTONS */
.pill-controls {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 22px;
}

.pill-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transform: rotate(-25deg);
}

.pill-switch {
  width: 44px;
  height: 12px;
  background: #1d2127;
  border-radius: 6px;
  border: 1px solid #14161b;
  cursor: pointer;
  box-shadow:
    0 3px 5px rgba(0, 0, 0, 0.4),
    inset 0 1px 1px rgba(255, 255, 255, 0.2),
    inset 0 -1px 2px #000;
  transition: all 0.08s;
}

.pill-switch:active, .pill-switch.pressed {
  transform: translateY(1px);
  box-shadow: inset 0 2px 3px #000;
}

.pill-text {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 8.5px;
  color: #cfd6e0;
  letter-spacing: 0.8px;
}

/* BADGE ICONICO IN BASSO A SINISTRA */
.modretro-badge {
  position: absolute;
  bottom: 14px;
  left: 14px;
  width: 42px;
  height: 42px;
  pointer-events: none;
}

.badge-stripe {
  position: absolute;
  width: 52px;
  height: 8px;
  background: #252a32;
  transform: rotate(-45deg);
  bottom: 14px;
  left: -10px;
}

.badge-triangle {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 0 16px 16px;
  border-color: transparent transparent #eaeef4 transparent;
  border-bottom-left-radius: 4px;
}

/* --- RESPONSIVE DESIGN --- */
@media (max-width: 1080px) {
  .chromatic-layout {
    flex-direction: column;
    gap: 35px;
  }
  .side-panel {
    max-width: 420px;
    text-align: center;
  }
  .left-side {
    text-align: center;
  }
  .feature-pills {
    align-items: center;
  }
}

@media (max-width: 420px) {
  .chromatic-device {
    width: 330px;
    padding: 16px 14px 26px 14px;
  }
  .color-screen {
    height: 235px;
  }
  .dpad-container {
    width: 90px;
    height: 90px;
  }
  .dpad-up, .dpad-down, .dpad-left, .dpad-right, .dpad-core {
    width: 30px;
    height: 30px;
  }
  .dpad-up { left: 30px; }
  .dpad-down { left: 30px; }
  .dpad-left { top: 30px; }
  .dpad-right { top: 30px; }
  .glossy-btn {
    width: 40px;
    height: 40px;
  }
}
