* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --green: #b8ff00;
  --red: #ff4b3e;
  --white: #f5f5f2;
  --gray: #b8b8b1;
  --dark: #050605;
}

html,
body {
  width: 100%;
  min-height: 100%;
}

body {
  background: var(--dark);
  color: var(--white);
  font-family: "Inter", sans-serif;
  overflow: hidden;
}


/* =====================================================
   SFONDO
===================================================== */

.background {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;

  background:
    radial-gradient(
      circle at 50% 45%,
      rgba(184, 255, 0, 0.09),
      transparent 52%
    ),
    #050605;
}


/* griglia */

.background::before {
  content: "";
  position: absolute;
  inset: -50%;

  background-image:
    linear-gradient(
      rgba(184, 255, 0, 0.035) 1px,
      transparent 1px
    ),
    linear-gradient(
      90deg,
      rgba(184, 255, 0, 0.035) 1px,
      transparent 1px
    );

  background-size: 70px 70px;

  transform:
    perspective(500px)
    rotateX(55deg);
}


/* circuiti */

.circuits {
  position: absolute;
  inset: 0;

  opacity: 0.6;

  background-image:
    linear-gradient(
      90deg,
      transparent 0 17%,
      rgba(184,255,0,.48) 17.1% 17.25%,
      transparent 17.35%
    ),
    linear-gradient(
      0deg,
      transparent 0 30%,
      rgba(184,255,0,.45) 30.1% 30.25%,
      transparent 30.35%
    ),
    linear-gradient(
      90deg,
      transparent 0 80%,
      rgba(184,255,0,.4) 80.1% 80.25%,
      transparent 80.35%
    ),
    linear-gradient(
      0deg,
      transparent 0 72%,
      rgba(184,255,0,.4) 72.1% 72.25%,
      transparent 72.35%
    );
}


/* punti */

.circuits::before {
  content: "";
  position: absolute;
  inset: 0;

  background:
    radial-gradient(
      circle at 17% 30%,
      var(--green) 0 3px,
      transparent 5px
    ),
    radial-gradient(
      circle at 80% 72%,
      var(--green) 0 3px,
      transparent 5px
    ),
    radial-gradient(
      circle at 80% 30%,
      var(--green) 0 2px,
      transparent 4px
    ),
    radial-gradient(
      circle at 30% 72%,
      var(--green) 0 2px,
      transparent 4px
    ),
    radial-gradient(
      circle at 88% 44%,
      var(--red) 0 2px,
      transparent 4px
    );
}


/* codice laterale */

.code-stream {
  position: absolute;
  top: -100%;

  width: 170px;

  color: var(--green);

  font-family: "Space Mono", monospace;
  font-size: 9px;
  line-height: 2.5;

  opacity: .07;

  white-space: nowrap;

  animation:
    codeScroll 30s linear infinite;
}

.code-left {
  left: 2%;
}

.code-right {
  right: 2%;
  animation-delay: -15s;
}

@keyframes codeScroll {
  from {
    transform: translateY(0);
  }

  to {
    transform: translateY(220%);
  }
}


/* =====================================================
   SCHERMATE
===================================================== */

.screen {
  position: fixed;
  inset: 0;

  width: 100%;
  height: 100%;

  z-index: 10;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 24px;

  opacity: 0;
  visibility: hidden;
  pointer-events: none;

  transform: scale(.985);

  transition:
    opacity .65s ease,
    transform .65s ease,
    visibility .65s ease;
}

.screen.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;

  transform: scale(1);
}


/* =====================================================
   PRIMA SCHERMATA
   NON CAMBIATA NELLO STILE
===================================================== */

.intro-content {
  width: 100%;
  max-width: 650px;
  text-align: center;
}

.event-small {
  color: var(--green);

  font-family: "Space Mono", monospace;

  font-size: 10px;
  letter-spacing: 4px;

  margin-bottom: 15px;
}

.event-line {
  width: 55px;
  height: 2px;

  margin: 0 auto 27px;

  background: var(--red);

  box-shadow:
    0 0 12px rgba(255,59,48,.6);
}

.intro-content h1 {
  font-size: clamp(52px, 15vw, 105px);

  line-height: .88;

  letter-spacing: -5px;

  font-weight: 800;
}

.intro-content h1 span {
  color: var(--green);

  text-shadow:
    0 0 25px rgba(184,255,0,.2);
}

.graduation-icon {
  font-size: 30px;
  margin: 25px 0 18px;
}

.intro-subtitle {
  color: #d4d4cf;

  font-size: 16px;
  line-height: 1.6;
}

.intro-loader {
  width: 180px;
  height: 2px;

  margin: 32px auto 13px;

  background: rgba(255,255,255,.12);

  overflow: hidden;
}

.intro-loader-bar {
  width: 0;
  height: 100%;

  background: var(--green);

  box-shadow:
    0 0 12px var(--green);

  animation:
    introLoad 6s linear forwards;
}

@keyframes introLoad {
  from {
    width: 0;
  }

  to {
    width: 100%;
  }
}

.loading-text {
  color: #8fbd00;

  font-family: "Space Mono", monospace;

  font-size: 9px;

  opacity: .8;
}


/* =====================================================
   PANNELLO LOGIN
===================================================== */

.login-panel {
  width: min(94vw, 650px);

  padding: 42px 48px 38px;

  background:
    linear-gradient(
      145deg,
      rgba(10,13,9,.97),
      rgba(5,7,5,.97)
    );

  border:
    1px solid rgba(184,255,0,.28);

  box-shadow:
    0 25px 90px rgba(0,0,0,.78),
    0 0 45px rgba(184,255,0,.06);

  position: relative;
}


/* linea rossa */

.login-panel::before,
.dedication-panel::before {
  content: "";

  position: absolute;

  top: 0;
  left: 0;

  width: 80px;
  height: 2px;

  background: var(--red);

  box-shadow:
    0 0 12px rgba(255,59,48,.55);
}


/* testata */

.panel-top {
  display: flex;

  align-items: center;
  justify-content: space-between;

  margin-bottom: 30px;

  color: var(--green);

  font-family: "Space Mono", monospace;

  font-size: 10px;

  letter-spacing: 1.5px;
}

.status-dot {
  width: 7px;
  height: 7px;

  border-radius: 50%;

  background: var(--green);

  box-shadow:
    0 0 12px var(--green);

  animation: blink 1.8s infinite;
}

@keyframes blink {
  50% {
    opacity: .25;
  }
}


/* titolo */

.small-label {
  color: var(--green);

  font-family: "Space Mono", monospace;

  font-size: 10px;

  letter-spacing: 2.5px;

  margin-bottom: 10px;
}

.login-panel h2 {
  font-size: 38px;
  line-height: 1.1;

  margin-bottom: 20px;
}


/* testo */

.intro-text {
  max-width: 560px;

  color: #cecec8;

  font-size: 15px;

  line-height: 1.75;

  margin-bottom: 13px;
}

.intro-text strong {
  color: var(--white);
}


/* separatore */

.login-separator {
  width: 100%;
  height: 1px;

  margin: 27px 0;

  background:
    linear-gradient(
      90deg,
      transparent,
      rgba(184,255,0,.22),
      transparent
    );
}


/* =====================================================
   BOX CREDENZIALI
===================================================== */

.credentials-info {
  display: flex;

  align-items: flex-start;

  gap: 16px;

  padding: 17px 18px;

  margin-bottom: 28px;

  background:
    rgba(184,255,0,.035);

  border:
    1px solid rgba(184,255,0,.15);
}

.credentials-icon {
  font-size: 24px;

  flex-shrink: 0;
}

.credentials-info strong {
  display: block;

  color: white;

  font-size: 14px;

  line-height: 1.4;

  margin-bottom: 7px;
}

.credentials-info p {
  color: #a4a49d;

  font-size: 12px;

  line-height: 1.6;

  margin-bottom: 5px;
}

.credentials-info p:last-child {
  margin-bottom: 0;
}


/* =====================================================
   FORM
===================================================== */

#loginForm {
  display: flex;

  flex-direction: column;

  width: 100%;
}

#loginForm label {
  color: var(--green);

  font-family: "Space Mono", monospace;

  font-size: 10px;

  letter-spacing: 2px;

  margin-bottom: 9px;
}

#loginForm input {
  display: block;

  width: 100%;
  height: 55px;

  padding: 0 17px;

  margin-bottom: 20px;

  background:
    rgba(255,255,255,.045);

  border:
    1px solid rgba(255,255,255,.16);

  color: white;

  outline: none;

  font-family: "Space Mono", monospace;

  font-size: 14px;

  transition:
    border .25s ease,
    box-shadow .25s ease;
}

#loginForm input:focus {
  border-color: var(--green);

  box-shadow:
    0 0 18px rgba(184,255,0,.09);
}

#loginForm input::placeholder {
  color: #666660;
}


/* bottone */

#loginBtn {
  display: flex;

  align-items: center;
  justify-content: center;

  width: 100%;
  height: 56px;

  margin-top: 3px;

  border: none;

  background: var(--green);

  color: #050505;

  font-family: "Space Mono", monospace;

  font-size: 12px;

  font-weight: 700;

  letter-spacing: 1.5px;

  cursor: pointer;

  transition:
    transform .25s ease,
    box-shadow .25s ease;
}

#loginBtn span {
  margin-left: 10px;

  font-size: 18px;
}

#loginBtn:hover {
  transform: translateY(-2px);

  box-shadow:
    0 0 28px rgba(184,255,0,.3);
}

#loginBtn:disabled {
  opacity: .55;

  cursor: wait;

  transform: none;
}

.error-message {
  min-height: 20px;

  margin-top: 12px;

  color: #ff665e;

  font-size: 12px;

  text-align: center;
}

.tiny-code {
  margin-top: 20px;

  color: var(--green);

  font-family: "Space Mono", monospace;

  font-size: 8px;

  text-align: center;

  opacity: .3;
}


/* =====================================================
   CARICAMENTO
   LASCIATO BELLO E PULITO
===================================================== */

.loading-panel {
  position: relative;

  width: min(94vw, 450px);

  padding: 40px 32px;

  text-align: center;

  background:
    rgba(7,9,7,.96);

  border:
    1px solid rgba(184,255,0,.28);

  box-shadow:
    0 25px 80px rgba(0,0,0,.75);
}

.loading-panel::before {
  content: "";

  position: absolute;

  top: 0;
  left: 0;

  width: 65px;
  height: 2px;

  background: var(--red);
}

.loading-icon {
  font-size: 45px;

  margin-bottom: 18px;

  animation:
    beerMove 1.4s ease-in-out infinite alternate;
}

@keyframes beerMove {
  from {
    transform: rotate(-3deg) translateY(0);
  }

  to {
    transform: rotate(3deg) translateY(-5px);
  }
}

.loading-title {
  color: white;

  font-size: 14px;

  font-weight: 700;

  letter-spacing: 1px;

  margin-bottom: 10px;
}

.loading-code {
  color: var(--green);

  font-family: "Space Mono", monospace;

  font-size: 9px;

  line-height: 1.8;

  margin-bottom: 27px;
}

.loading-code span {
  color: #888880;
}

.progress-top {
  display: flex;

  justify-content: space-between;

  color: var(--green);

  font-family: "Space Mono", monospace;

  font-size: 9px;

  margin-bottom: 8px;
}

.progress-bar {
  width: 100%;
  height: 8px;

  padding: 1px;

  background:
    rgba(255,255,255,.04);

  border:
    1px solid rgba(184,255,0,.3);
}

#progressFill {
  width: 70%;
  height: 100%;

  background: var(--green);

  box-shadow:
    0 0 14px rgba(184,255,0,.6);
}

.loading-funny {
  min-height: 18px;

  margin-top: 17px;

  color: #888880;

  font-family: "Space Mono", monospace;

  font-size: 9px;
}


/* =====================================================
   DEDICA
===================================================== */

.dedication-panel {
  position: relative;

  width: min(94vw, 720px);

  max-height: 90vh;

  overflow-y: auto;

  padding: 45px 52px;

  background:
    linear-gradient(
      145deg,
      rgba(9,12,8,.98),
      rgba(5,7,5,.98)
    );

  border:
    1px solid rgba(184,255,0,.28);

  box-shadow:
    0 25px 100px rgba(0,0,0,.8),
    0 0 45px rgba(184,255,0,.06);

  scrollbar-width: thin;

  scrollbar-color:
    var(--green)
    transparent;
}


/* connessione */

.connection-message {
  display: flex;

  align-items: center;

  justify-content: center;

  gap: 9px;

  color: var(--green);

  font-family: "Space Mono", monospace;

  font-size: 18px;

  letter-spacing: .5px;

  margin-bottom: 34px;
}

.connection-symbol {
  font-size: 16px;
}


/* introduzione */

.dedication-intro {
  text-align: center;

  max-width: 590px;

  margin: 0 auto;
}

.dedication-intro p {
  color: #cecec8;

  font-size: 16px;

  line-height: 1.75;

  margin-bottom: 11px;
}


/* =====================================================
   NOME
===================================================== */

.name-block {
  display: flex;

  align-items: center;

  gap: 16px;

  margin: 36px 0 32px;
}

.name-line {
  flex: 1;

  height: 1px;

  background:
    linear-gradient(
      90deg,
      transparent,
      rgba(184,255,0,.35)
    );
}

.name-line:last-child {
  background:
    linear-gradient(
      90deg,
      rgba(184,255,0,.35),
      transparent
    );
}

.name-block h2 {
  flex-shrink: 0;

  color: var(--green);

  font-size: clamp(26px, 6vw, 40px);

  font-weight: 800;

  letter-spacing: .5px;

  text-align: center;

  text-shadow:
    0 0 18px rgba(184,255,0,.12);
}


/* =====================================================
   MESSAGGIO PERSONALE
===================================================== */

.dedication-text {
  max-width: 590px;

  margin: 0 auto 34px;

  color: #f0f0eb;

  font-size: 17px;

  line-height: 1.9;

  text-align: center;

  white-space: pre-wrap;
}


/* =====================================================
   RINGRAZIAMENTO FESTA
===================================================== */

.final-thanks {
  max-width: 590px;

  margin: 0 auto;

  padding-top: 28px;

  border-top:
    1px solid rgba(184,255,0,.17);

  color: #bdbdb6;

  font-size: 14px;

  line-height: 1.8;

  text-align: center;
}

.final-thanks p {
  margin-bottom: 12px;
}

.final-thanks strong {
  color: white;
}

.signature {
  margin-top: 25px;

  color: #9a9a93;
}

.signature strong {
  display: inline-block;

  margin-top: 5px;

  color: var(--green);

  font-size: 18px;
}


/* chiudi */

.logout-btn {
  display: block;

  margin: 30px auto 0;

  padding: 10px 16px;

  background: transparent;

  border:
    1px solid rgba(255,255,255,.12);

  color: #777;

  font-family: "Space Mono", monospace;

  font-size: 8px;

  cursor: pointer;
}


/* =====================================================
   SMARTPHONE
===================================================== */

@media (max-width: 600px) {

  .screen {
    padding: 14px;
  }


  /* LOGIN */

  .login-panel {
    width: 100%;

    max-height: 94vh;

    padding: 30px 21px 25px;
  }

  .panel-top {
    margin-bottom: 23px;
  }

  .login-panel h2 {
    font-size: 31px;
  }

  .intro-text {
    font-size: 13.5px;

    line-height: 1.65;
  }

  .credentials-info {
    padding: 14px;

    gap: 12px;
  }

  .credentials-info strong {
    font-size: 12px;
  }

  .credentials-info p {
    font-size: 10px;

    line-height: 1.55;
  }

  #loginForm input {
    height: 52px;

    font-size: 13px;
  }


  /* DEDICA */

  .dedication-panel {
    width: 100%;

    max-height: 94vh;

    padding: 31px 21px;
  }

  .connection-message {
    font-size: 9px;

    margin-bottom: 25px;
  }

  .dedication-intro p {
    font-size: 14px;

    line-height: 1.7;
  }

  .name-block {
    margin: 28px 0 25px;

    gap: 9px;
  }

  .name-block h2 {
    font-size: clamp(23px, 7vw, 31px);
  }

  .dedication-text {
    font-size: 15px;

    line-height: 1.8;

    margin-bottom: 28px;
  }

  .final-thanks {
    font-size: 13px;

    line-height: 1.7;
  }


  /* SFONDO */

  .code-stream {
    width: 80px;

    font-size: 7px;

    opacity: .055;
  }

  .circuits {
    opacity: .6;
  }
}


/* =====================================================
   TELEFONI MOLTO PICCOLI
===================================================== */

@media (max-height: 650px) {

  .login-panel {
    padding-top: 22px;
    padding-bottom: 20px;
  }

  .dedication-panel {
    padding-top: 25px;
    padding-bottom: 25px;
  }

  .intro-content h1 {
    font-size: 54px;
  }

  .graduation-icon {
    margin: 15px 0;
  }
}
/* FIX MOBILE - PULSANTE LOGIN */

@media (max-width: 700px) {

  .screen {
    overflow-y: auto;
    overflow-x: hidden;
    align-items: center;
    padding: 20px 0 40px;
  }

  .login-panel {
    width: calc(100% - 32px);
    margin: 0 auto;
    padding: 28px 22px 32px;
  }

  .login-btn {
    width: 100%;
    min-height: 58px;
    margin-top: 24px;
    position: relative;
    z-index: 10;
  }

}

/* TESTO CONNESSIONE PIÙ GRANDE SU SMARTPHONE */

@media (max-width: 700px) {

  .connection-message {
    font-size: 22px !important;
    line-height: 1.5;
  }

  .connection-symbol {
    font-size: 26px !important;
  }

}

/* ==============================
   MATRIX RAIN - SFONDO ANIMATO
   ============================== */

#matrixRain {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 1;
  opacity: 0.32;
  display: block;
}

/* Tutte le schermate sopra il Matrix */
.screen {
  position: fixed;
  z-index: 10;
}

/* Ombra su tutto il contenuto della prima schermata */
#welcomeScreen * {
  text-shadow:
    0 2px 8px rgba(0, 0, 0, 0.95),
    0 0 14px rgba(0, 0, 0, 0.9);
}

/* OTTIMIZZAZIONE SMARTPHONE - TUTTI I BROWSER */

@media (max-width: 700px) {

  html,
  body {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
  }

  .screen {
    width: 100%;
    min-width: 0;
    min-height: 100svh;
    height: auto;
    box-sizing: border-box;
    padding: 20px 16px 30px;
  }

  /* Prima schermata */
  #welcomeScreen {
    justify-content: center;
    align-items: center;
    text-align: center;
  }

  /* Schermata caricamento */
  #loadingScreen {
    justify-content: center;
    align-items: center;
    text-align: center;
  }

  /* Schermata dedica */
  #dedicaScreen {
    justify-content: center;
    align-items: center;
    overflow-y: auto;
  }

  .dedication-panel {
    width: 100%;
    max-width: 720px;
    max-height: calc(100svh - 40px);
    box-sizing: border-box;
  }

  /* Evita zoom/overflow sui contenuti */
  img,
  canvas,
  input,
  button {
    max-width: 100%;
  }

  input,
  textarea,
  select {
    font-size: 16px;
  }
}

/* =====================================================
   NUOVE SEZIONI - HOME HUB, SFIDE, CLASSIFICA, GALLERIA, MENU
===================================================== */

.home-panel,
.section-panel {
  width: min(94vw, 650px);
  max-height: 90vh;
  overflow-y: auto;
  padding: 40px 30px 34px;
  background: linear-gradient(145deg, rgba(10,13,9,.97), rgba(5,7,5,.97));
  border: 1px solid rgba(184,255,0,.28);
  box-shadow: 0 25px 90px rgba(0,0,0,.78), 0 0 45px rgba(184,255,0,.06);
  position: relative;
  scrollbar-width: thin;
  scrollbar-color: var(--green) transparent;
}

.home-panel::before,
.section-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 80px;
  height: 2px;
  background: var(--red);
  box-shadow: 0 0 12px rgba(255,59,48,.55);
}

.home-panel h2,
.section-panel h2 {
  font-size: 30px;
  line-height: 1.15;
  margin-bottom: 16px;
}

/* GRIGLIA HUB */

.hub-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 26px 0 30px;
}

.hub-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px 10px;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(184,255,0,.18);
  color: var(--white);
  cursor: pointer;
  transition: border-color .2s ease, transform .2s ease, background .2s ease;
  font-family: "Inter", sans-serif;
}

.hub-card:hover,
.hub-card:active {
  border-color: var(--green);
  background: rgba(184,255,0,.06);
  transform: translateY(-2px);
}

.hub-icon {
  font-size: 28px;
}

.hub-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .3px;
  text-align: center;
}

/* PULSANTE INDIETRO */

.back-btn {
  display: inline-block;
  margin-bottom: 18px;
  padding: 8px 14px;
  background: transparent;
  border: 1px solid rgba(255,255,255,.16);
  color: var(--green);
  font-family: "Space Mono", monospace;
  font-size: 11px;
  cursor: pointer;
}

.back-btn:hover {
  border-color: var(--green);
}

/* LISTA CARD (SFIDE) */

.card-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 18px 0;
}

.card {
  padding: 16px;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(184,255,0,.15);
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.card-emoji {
  font-size: 22px;
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--white);
}

.card-desc {
  font-size: 12.5px;
  color: #a4a49d;
  line-height: 1.5;
  margin-bottom: 12px;
}

.card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.card-points {
  color: var(--green);
  font-family: "Space Mono", monospace;
  font-size: 12px;
  font-weight: 700;
}

.upload-btn {
  display: inline-block;
  padding: 9px 14px;
  background: rgba(184,255,0,.08);
  border: 1px solid var(--green);
  color: var(--green);
  font-family: "Space Mono", monospace;
  font-size: 11px;
  cursor: pointer;
  transition: background .2s ease;
}

.upload-btn:hover {
  background: rgba(184,255,0,.18);
}

/* BADGE DIFFICOLTA' */

.badge {
  padding: 3px 9px;
  font-family: "Space Mono", monospace;
  font-size: 9px;
  letter-spacing: 1px;
  border: 1px solid currentColor;
}

.badge-facile { color: var(--green); }
.badge-media { color: #f5f5f2; }
.badge-difficile { color: #ff9f45; border-color: #ff9f45; }
.badge-impossibile { color: var(--red); }

.badge-stato-in_attesa { color: #f5f5f2; }
.badge-stato-approvata { color: var(--green); }
.badge-stato-rifiutata { color: var(--red); }

/* PROVE CARICATE */

.prova-card {
  display: flex;
  gap: 12px;
  align-items: center;
}

.prova-thumb {
  width: 56px;
  height: 56px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(184,255,0,.25);
}

.prova-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* CLASSIFICA */

.rank-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 18px;
}

.rank-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.1);
  font-family: "Space Mono", monospace;
  font-size: 13px;
}

.rank-item-me {
  border-color: var(--green);
  background: rgba(184,255,0,.06);
}

.rank-position {
  color: var(--green);
  width: 34px;
  flex-shrink: 0;
}

.rank-name {
  flex: 1;
  color: var(--white);
  font-family: "Inter", sans-serif;
  font-size: 14px;
  font-weight: 600;
}

.rank-points {
  color: var(--green);
  font-weight: 700;
}

/* TABS GALLERIA */

.tabs {
  display: flex;
  gap: 8px;
  margin: 18px 0 20px;
}

.tab-btn {
  flex: 1;
  padding: 10px;
  background: transparent;
  border: 1px solid rgba(255,255,255,.16);
  color: #a4a49d;
  font-family: "Space Mono", monospace;
  font-size: 11px;
  cursor: pointer;
}

.tab-btn.active {
  border-color: var(--green);
  color: var(--green);
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.gallery-photo {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border: 1px solid rgba(184,255,0,.15);
}

/* MENU */

.menu-block {
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(184,255,0,.12);
}

.menu-block:last-child {
  border-bottom: none;
}

.menu-block h3 {
  color: var(--green);
  font-family: "Space Mono", monospace;
  font-size: 13px;
  letter-spacing: 1.5px;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.menu-block p {
  color: #d4d4cf;
  font-size: 14.5px;
  line-height: 1.7;
}

/* STATO VUOTO */

.empty-state {
  color: #77776f;
  font-size: 13px;
  font-style: italic;
  text-align: center;
  padding: 14px 0;
}

/* SMARTPHONE */

@media (max-width: 600px) {

  .home-panel,
  .section-panel {
    width: 100%;
    max-height: 94vh;
    padding: 28px 18px 26px;
  }

  .hub-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .hub-card {
    padding: 20px 8px;
  }

  .photo-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .card-bottom {
    flex-direction: column;
    align-items: stretch;
  }

  .upload-btn {
    text-align: center;
  }
}


/* =====================================================
   UTILITY
===================================================== */

.hidden { display: none !important; }


/* =====================================================
   TOAST
===================================================== */

.toast-container {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(92vw, 380px);
  pointer-events: none;
}

.toast {
  padding: 12px 16px;
  background: rgba(10,13,9,.97);
  border: 1px solid var(--green);
  color: var(--white);
  font-family: "Inter", sans-serif;
  font-size: 13px;
  box-shadow: 0 10px 30px rgba(0,0,0,.5);
  opacity: 0;
  transform: translateY(-14px);
  transition: opacity .25s ease, transform .25s ease;
}

.toast.show { opacity: 1; transform: translateY(0); }
.toast-error { border-color: var(--red); }


/* =====================================================
   COUNTDOWN DEDICA
===================================================== */

.countdown-timer {
  font-family: "Space Mono", monospace;
  font-size: 40px;
  font-weight: 700;
  color: var(--green);
  text-align: center;
  letter-spacing: 3px;
  margin: 22px 0;
  text-shadow: 0 0 20px rgba(184,255,0,.35);
}


/* =====================================================
   UPLOAD BUTTON - VERSIONE PIU' DINAMICA
===================================================== */

.upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: linear-gradient(135deg, rgba(184,255,0,.14), rgba(184,255,0,.04));
  border: 1px solid var(--green);
  border-radius: 999px;
  color: var(--green);
  font-family: "Space Mono", monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .5px;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .2s ease;
  box-shadow: 0 0 0 rgba(184,255,0,0);
}

.upload-btn:hover {
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 4px 18px rgba(184,255,0,.25);
  background: linear-gradient(135deg, rgba(184,255,0,.24), rgba(184,255,0,.06));
}

.upload-btn:active { transform: scale(.97); }

.upload-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(184,255,0,.15);
  font-size: 13px;
}

.upload-btn.uploading {
  opacity: .75;
  cursor: wait;
  pointer-events: none;
}

.upload-btn.uploading .upload-icon {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}


/* =====================================================
   MENU DINAMICO (lato invitato)
===================================================== */

.menu-tabs { flex-wrap: wrap; }

.menu-tab-btn {
  flex: 1;
  min-width: 44%;
  padding: 10px;
  background: transparent;
  border: 1px solid rgba(255,255,255,.16);
  color: #a4a49d;
  font-family: "Space Mono", monospace;
  font-size: 11px;
  cursor: pointer;
  transition: border-color .2s ease, color .2s ease;
}

.menu-tab-btn.active {
  border-color: var(--green);
  color: var(--green);
}

.menu-dishes {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}

.dish-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: rgba(255,255,255,.03);
  border-left: 2px solid var(--green);
  opacity: 0;
  transform: translateX(-14px);
  animation: dishIn .45s ease forwards;
}

@keyframes dishIn {
  to { opacity: 1; transform: translateX(0); }
}

.dish-number {
  font-family: "Space Mono", monospace;
  color: var(--green);
  font-size: 12px;
  flex-shrink: 0;
}

.dish-name {
  color: var(--white);
  font-size: 15px;
  font-weight: 600;
}


/* =====================================================
   PANNELLO ADMIN
===================================================== */

.admin-panel {
  text-align: left;
}

.admin-tabs {
  flex-wrap: wrap;
  gap: 6px;
}

.admin-tab-btn {
  flex: 1;
  min-width: 30%;
  padding: 9px 6px;
  background: transparent;
  border: 1px solid rgba(255,255,255,.16);
  color: #a4a49d;
  font-family: "Space Mono", monospace;
  font-size: 10.5px;
  cursor: pointer;
}

.admin-tab-btn.active {
  border-color: var(--green);
  color: var(--green);
  background: rgba(184,255,0,.06);
}

.admin-tab-content {
  margin-top: 20px;
}

.admin-add-btn {
  width: 100%;
  padding: 12px;
  margin-bottom: 16px;
  background: rgba(184,255,0,.08);
  border: 1px dashed var(--green);
  color: var(--green);
  font-family: "Space Mono", monospace;
  font-size: 12px;
  cursor: pointer;
}

.admin-add-btn:hover { background: rgba(184,255,0,.16); }

.admin-form {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 20px;
  padding: 16px;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(184,255,0,.2);
}

.admin-form label {
  font-family: "Space Mono", monospace;
  font-size: 10px;
  color: var(--green);
  margin-top: 10px;
  letter-spacing: .5px;
}

.admin-form input,
.admin-form textarea,
.admin-form select {
  padding: 10px;
  background: rgba(0,0,0,.35);
  border: 1px solid rgba(255,255,255,.15);
  color: var(--white);
  font-family: "Inter", sans-serif;
  font-size: 13px;
  resize: vertical;
}

.admin-form input:focus,
.admin-form textarea:focus,
.admin-form select:focus {
  outline: none;
  border-color: var(--green);
}

.admin-form-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.admin-form-actions button {
  flex: 1;
  padding: 10px;
  font-family: "Space Mono", monospace;
  font-size: 11px;
  cursor: pointer;
  border: 1px solid var(--green);
  background: var(--green);
  color: #0a0d09;
  font-weight: 700;
}

.admin-form-actions button[type="button"] {
  background: transparent;
  color: var(--green);
}

.admin-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-item {
  padding: 14px;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(184,255,0,.15);
}

.admin-item-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  flex-wrap: wrap;
  gap: 6px;
}

.admin-username {
  font-family: "Space Mono", monospace;
  color: var(--green);
  font-size: 11px;
}

.admin-item-dedica {
  font-size: 12.5px;
  color: #a4a49d;
  line-height: 1.5;
  margin-bottom: 10px;
}

.admin-item-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.mini-btn {
  padding: 7px 11px;
  background: transparent;
  border: 1px solid rgba(255,255,255,.2);
  color: var(--white);
  font-family: "Space Mono", monospace;
  font-size: 10px;
  cursor: pointer;
}

.mini-btn:hover { border-color: var(--green); color: var(--green); }

.mini-btn-danger:hover { border-color: var(--red); color: var(--red); }

.admin-photo-item {
  display: flex;
  gap: 12px;
}

.admin-photo-thumb {
  width: 70px;
  height: 70px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(184,255,0,.25);
}

.admin-item-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--white);
}

#adminImpostazioni label,
#adminMenu label {
  display: block;
  font-family: "Space Mono", monospace;
  font-size: 10px;
  color: var(--green);
  margin-top: 14px;
  margin-bottom: 6px;
  letter-spacing: .5px;
}

#adminImpostazioni input,
#adminMenu textarea {
  width: 100%;
  padding: 10px;
  background: rgba(0,0,0,.35);
  border: 1px solid rgba(255,255,255,.15);
  color: var(--white);
  font-family: "Inter", sans-serif;
  font-size: 13px;
}


/* =====================================================
   NAVIGAZIONE SCHERMATA + LOGOUT RAPIDO
===================================================== */

.screen-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.quick-logout-btn {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid rgba(255,59,48,.4);
  color: var(--red);
  border-radius: 50%;
  font-size: 14px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .2s ease, transform .15s ease;
}

.quick-logout-btn:hover {
  background: rgba(255,59,48,.12);
  transform: scale(1.05);
}


/* =====================================================
   LOGOUT GLOBALE FISSO (sempre visibile, anche da cellulare)
===================================================== */

.quick-logout-btn { display: none !important; }

.global-logout-btn {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: rgba(10,13,9,.92);
  border: 1px solid var(--red);
  border-radius: 999px;
  color: var(--red);
  font-family: "Space Mono", monospace;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,.5);
}

.global-logout-btn:active { transform: scale(.95); }


/* =====================================================
   GALLERIA GENERALE CON DIDASCALIA (autore + sfida)
===================================================== */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.gallery-item {
  display: flex;
  flex-direction: column;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(184,255,0,.15);
  overflow: hidden;
}

.gallery-item img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}

.gallery-caption {
  padding: 7px 9px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.gallery-caption strong {
  font-size: 11px;
  color: var(--green);
  font-family: "Space Mono", monospace;
}

.gallery-caption span {
  font-size: 10px;
  color: #a4a49d;
}


/* =====================================================
   BARRA SPAZIO ARCHIVIAZIONE (admin)
===================================================== */

.storage-bar-wrap {
  margin: 10px 0 20px;
  padding: 14px;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(184,255,0,.15);
}

.storage-bar-label {
  display: flex;
  justify-content: space-between;
  font-family: "Space Mono", monospace;
  font-size: 11px;
  color: var(--green);
  margin-bottom: 8px;
}

.storage-bar-track {
  width: 100%;
  height: 10px;
  background: rgba(255,255,255,.08);
  overflow: hidden;
}

.storage-bar-fill {
  height: 100%;
  background: var(--green);
  transition: width .4s ease;
}

.storage-bar-fill.warning { background: #ff9f45; }
.storage-bar-fill.danger { background: var(--red); }
