/* === BASE === */
html, body {
    margin: 0;
    padding: 0;
    font-family: 'Orbitron', sans-serif;
    background-color: transparent;
    color: white;
    overflow-x: hidden;
    height: 100%;
    min-height: 100vh;
}

/* === SFONDO === */
.background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    min-height: 100vh;
    background: url('../img/sfondo.jpeg') no-repeat center center fixed;
    background-size: cover;
    opacity: 0.65;
    z-index: -2;
    display: block;
}

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  backdrop-filter: blur(6px);
  background: rgba(0, 0, 0, 0.5); /* ← da bianco chiaro a nero scuro */
  z-index: -1;
}

/* === CONTENITORE === */
.container {
    max-width: 600px;
    margin: 3rem auto;
    background: rgba(0, 0, 0, 0.4);
    padding: 2rem;
    border-radius: 20px;
    color: white;
    box-shadow: 0 0 35px rgba(255, 215, 0, 0.75);
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 1;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

/* === TITOLI === */
h1 {
    text-align: center;
    color: gold;
    font-size: 2.2rem;
    margin-bottom: 1rem;
    text-shadow: 1px 1px 6px #000;
}

.section h2 {
    color: #ffffff;
    font-size: 1.4rem;
    margin-top: 1.2rem;
    margin-bottom: 0.8rem;
    border-left: 4px solid gold;
    padding-left: 0.6rem;
    text-shadow: 1px 1px 4px #000;
}

/* === LOGO === */
.logo {
    display: block;
    max-width: 150px;
    margin: 0 auto 1rem auto;
    border-radius: 20px;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
    transition: transform 0.3s ease;
}
.logo:hover {
    transform: scale(1.05);
}

/* === SOTTOTITOLO === */
.subtext {
    text-align: center;
    font-size: 1rem;
    color: #ffe97f;
    margin-top: -10px;
    margin-bottom: 1.5rem;
    text-shadow: 1px 1px 3px #000;
}

/* === BLOCCO SELETTORE LINGUA === */
.language-select {
    text-align: center;
    margin-bottom: 1.2rem;
}
.language-select label {
    font-size: 0.95rem;
    color: #ffe97f;
    text-shadow: 1px 1px 3px #000;
    margin-right: 0.5rem;
}

/* === FOOTER === */
.footer {
  text-align: center;
  font-size: 0.9rem;
  color: #e0e0e0;
  padding: 25px 10px 10px 10px;
  margin-top: 40px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-family: 'Orbitron', sans-serif;
}

.footer strong {
  color: #ffd700;
}

.footer small,
.version-info {
  display: block;
  margin-top: 6px;
  font-size: 0.8rem;
  color: #bbbbbb;
}
/* Colori dinamici per il footer */
body.dark-mode .footer {
  color: #e0e0e0;
}

body.light-mode .footer {
  color: #333;
}

body.light-mode .footer strong {
  color: #b8860b; /* Oro scuro per light mode */
}

body.dark-mode .footer strong {
  color: #ffd700; /* Oro brillante per dark mode */
}

/* === INPUT & SELECT === */
input, select {
    width: 100%;
    padding: 0.75rem;
    margin-top: 0.5rem;
    margin-bottom: 1.2rem;
    border-radius: 10px;
    border: none;
    font-size: 1rem;
    background-color: rgba(255, 255, 255, 0.08);
    color: white;
    backdrop-filter: blur(4px);
    transition: all 0.3s ease-in-out;
    box-shadow: inset 0 0 5px rgba(255, 215, 0, 0.2);
}
input:focus, select:focus {
    outline: none;
    background-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 8px gold;
}

/* === LABEL === */
label {
    display: block;
    margin-top: 0.6rem;
    margin-bottom: 0.35rem; /* spazio sufficiente per evitare sovrapposizioni su mobile */
    font-size: 0.95rem;
    color: #ffe97f;
    text-shadow: 1px 1px 3px #000;
    line-height: 1.25; /* aumenta l'altezza della riga della label su iOS */
}

/* === SELECT CUSTOM === */
#langSelect {
    width: auto;
    display: inline-block;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    margin-left: 0.5rem;
    background-color: rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* === LISTA PRODUZIONE === */
#productionList li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    margin-bottom: 12px;
    border-radius: 12px;
    background: rgba(20, 20, 20, 0.85);
    border: 1px solid rgba(255, 215, 0, 0.2);
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.2);
}
#productionList li strong {
    font-weight: 500;
    font-size: 1.05rem;
    color: #ffe97f;
    text-shadow: 0 0 4px #ffdf00aa;
}
#productionList li .value {
    font-weight: bold;
    font-size: 1.25rem;
    color: #ffbf00; /* oro più scuro = più leggibile */
    text-shadow:
        1px 1px 2px #222,    /* bordo scuro delicato */
        0 0 4px #fff4,       /* glow bianco molto lieve */
        0 0 8px #ffd70022;   /* glow oro mooolto soft */
    min-width: 100px;
    text-align: right;
    letter-spacing: 0.2px;
}

/* === TEMPO PER OBIETTIVO === */
#timeToReach {
    font-size: 1.15rem;
    color: #00ffbf;
    background-color: rgba(0, 0, 0, 0.3);
    padding: 0.7rem;
    border-radius: 12px;
    margin-top: 1rem;
    text-align: center;
    font-weight: bold;
    text-shadow: 1px 1px 2px #000;
    box-shadow: 0 0 8px rgba(0, 255, 191, 0.4);
}

/* === BOTTONI === */
.btn, .button {
    position: relative;
    background: linear-gradient(135deg, #f7d774, #f0c93f);
    color: #111;
    border: none;
    padding: 14px 22px;
    font-family: 'Orbitron', sans-serif;
    font-size: 15px;
    font-weight: bold;
    margin-top: 10px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
    box-shadow: 0 0 12px rgba(247, 215, 116, 0.6);
    display: block;
    width: 100%;
    margin-bottom: 1.5rem;
    text-shadow: 0 0 1px rgba(255, 255, 255, 0.6);
    overflow: hidden;
}

.btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: -75%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        120deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.4) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: skewX(-20deg);
    animation: shimmer 2.5s infinite;
}

@keyframes shimmer {
    0% {
        left: -75%;
    }
    100% {
        left: 125%;
    }
}

.btn:hover, .button:hover {
    background: linear-gradient(135deg, #f0c93f, #f7d774);
    transform: scale(1.05);
    box-shadow: 0 0 18px rgba(247, 215, 116, 0.8);
}

/* === TOGGLE TEMA === */
.theme-toggle {
  position: absolute;
  top: 70px;
  right: 20px;
  z-index: 10;
}

.button.small-btn {
    width: auto;
    padding: 8px 12px;
    font-size: 1.1rem;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    backdrop-filter: blur(4px);
    transition: all 0.3s ease;
}
.button.small-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

/* === VERSION BADGE === */
.version-badge {
  position: absolute;
  top: 20px;
  right: 20px;
  background: linear-gradient(to right, #ffd700, #ffa500);
  color: #222;
  font-size: 0.8rem;
  font-weight: bold;
  padding: 6px 12px;
  border-radius: 20px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  font-family: 'Orbitron', sans-serif;
  z-index: 10;
}

/* === ANIMAZIONE GLOW === */
@keyframes glow {
    from {
        text-shadow: 0 0 5px #ffd700, 0 0 10px #ffd700;
    }
    to {
        text-shadow: 0 0 10px #ffff33, 0 0 20px #ffff33;
    }
}

/* === COMPACT ROW: Gold/sec + Unit === */
/* === COMPACT ROW: Gold/sec + Unit === */
.input-group--compact{
  display: flex;
  flex-direction: column;
  gap: 6px; /* spazio minimo tra label e campo */
}
.input-group--compact label{
  margin-top: 0.15rem;
  margin-bottom: 0.25rem;
}
.input-group--compact input,
.input-group--compact select{
  margin-top: 0;
  margin-bottom: 0.15rem;
}

/* === COMPACT ROW: Target + Unit === */
/* === COMPACT ROW: Target + Unit === */
.input-group--compact-target-unit {
  display: flex;
  flex-direction: column;
  gap: 6px; /* spazio minimo tra elementi */
}
.input-group--compact-target-unit label {
  margin-top: 0.15rem;
  margin-bottom: 0.25rem;
}
.input-group--compact-target-unit input,
.input-group--compact-target-unit select {
  margin-top: 0;
  margin-bottom: 0.15rem;
}

/* === BUTTON GLOW ANIMATION === */
.button--glow {
  position: relative;
  overflow: hidden;
  animation: ring 2.6s ease-in-out infinite;
}
.button--glow::after {
  content: "";
  position: absolute;
  top: 0;
  left: -60%;
  width: 40%;
  height: 100%;
  background: linear-gradient(
    120deg,
    rgba(255,255,255,0) 0%,
    rgba(255,255,255,0.35) 50%,
    rgba(255,255,255,0) 100%
  );
  transform: skewX(-20deg);
  animation: shimmer 2.8s infinite;
  pointer-events: none;
}
@keyframes ring {
  0%, 100% {
    box-shadow: 0 0 12px rgba(247, 215, 116, 0.6), 0 0 0px rgba(247, 215, 116, 0.25);
  }
  50% {
    box-shadow: 0 0 20px rgba(247, 215, 116, 0.9), 0 0 14px rgba(247, 215, 116, 0.45);
  }
}
@media (prefers-reduced-motion: reduce) {
  .button--glow { animation: none; }
  .button--glow::after { animation: none; }
}

/* === TOGGLE SHEEN (riflesso avanti-indietro) === */
.sheen-anim {
  position: relative;
  overflow: hidden; /* necessario per mascherare il riflesso */
  border-radius: inherit;
  animation: sheen-glow 3s ease-in-out infinite; /* leggero respiro del glow */
}
.sheen-anim::after {
  content: "";
  position: absolute;
  top: 0;
  left: -70%;
  width: 45%;
  height: 100%;
  background: linear-gradient(120deg,
    rgba(255,255,255,0) 0%,
    rgba(255,255,255,0.36) 50%,
    rgba(255,255,255,0) 100%);
  transform: skewX(-20deg);
  pointer-events: none;
  animation: sheen-scan 2.2s ease-in-out infinite alternate; /* avanti ↔ indietro */
}
@keyframes sheen-scan {
  0%   { left: -70%; }
  100% { left: 120%; }
}
@keyframes sheen-glow {
  0%, 100% { box-shadow: 0 0 6px rgba(255,255,255,0.20); }
  50%       { box-shadow: 0 0 12px rgba(255,255,255,0.40); }
}

/* Rispetta riduzione movimento */
@media (prefers-reduced-motion: reduce) {
  .sheen-anim { animation: none; }
  .sheen-anim::after { animation: none; }
}

/* === RESPONSIVE === */
@media (max-width: 640px) {
    .container {
        margin: 1rem;
        padding: 1.5rem;
    }
    h1 {
        font-size: 1.7rem;
    }
    .logo {
        max-width: 120px;
    }
    .btn, .button {
        font-size: 13px;
        padding: 10px 16px;
    }
    #langSelect {
        margin-top: 0.5rem;
        font-size: 0.9rem;
    }
}

/* === LIGHT MODE === */
body.light-mode {
  background-color: #f4efe3;
  color: #1a1a1a;
}
body.light-mode .container {
  border: 2px solid transparent;
  background-clip: padding-box;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow:
  inset 0 0 4px rgba(255, 215, 0, 0.2),
  0 0 20px rgba(255, 215, 0, 0.1);
}

body.light-mode h1, body.light-mode h2, body.light-mode .subtext, body.light-mode label {
  color: #222;
  text-shadow: none;
}
body.light-mode input, body.light-mode select {
  background-color: #fff;
  color: #222;
  border: 1px solid #ccc;
}
body.light-mode .button {
  background: linear-gradient(135deg, #fcd34d, #fbbf24);
  color: #1a1a1a;
  font-weight: bold;
}
body.light-mode #productionList li {
  background-color: #ffffffcc;
  color: #222;
}
/* Scritte numeri e label produzione */
#productionList li strong,
#productionList li .value {
    font-weight: bold;
    font-size: 1.25rem;
    color: #ffbf00;
    text-shadow:
        2px 2px 4px #111,
        0 0 2px #fff6;
    letter-spacing: 0.5px;
}
#productionList li .value {
    min-width: 100px;
    text-align: right;
}

/* Label e sottotitoli oro scuro */
body.light-mode label,
body.light-mode .subtext,
body.light-mode .language-select label {
  color: #b38d00;
  text-shadow: 1px 1px 2px #0003;
}
body.light-mode #langSelect {
  background-color: #ffffff;
  color: #1a1a1a;
  border: 1px solid #ccc;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.1);
}
body.light-mode .language-switcher label {
  color: #1a1a1a;
}
.gold-coin-logo {
  height: 1.4em;
  width: auto;
  vertical-align: middle;
  margin-right: 0.5em;
  filter: drop-shadow(0 0 6px #FFD70088);
}
.gold-icon {
  width: 18px;
  height: 18px;
  vertical-align: middle;         /* o 'sub' per un test */
  margin-right: 10px;             /* più spazio tra icona e testo */
  transform: translateY(2px);     /* leggero abbassamento per centrarla col testo */
  filter: brightness(1.2);        /* facoltativo, per uniformare saturazione */
}
.inline-coin {
  width: 24px;
  height: 24px;
  vertical-align: middle;
  margin-right: 4px;
  transform: translateY(-1px);
}
.title-separator {
  margin: 20px auto 30px auto;
  height: 2px;
  max-width: 300px;
  background: linear-gradient(to right, #ffcc00, transparent);
  border-radius: 1px;
}
/* Colori dinamici per il footer */
body.dark-mode .footer {
  color: #e0e0e0;
}

body.light-mode .footer {
  color: #333;
}
.input-row {
  display: flex;
  flex-direction: column; /* Forza disposizione verticale */
  gap: 12px;
  margin-bottom: 1rem;
}

.input-block {
  flex: 1 1 45%;
  min-width: 220px;
  display: flex;
  flex-direction: column;
}

.input-block input,
.input-block select {
  width: 100%;
  padding: 10px 14px;
  font-size: 1rem;
  border-radius: 8px;
  border: 1px solid #ccc;
}
.input-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.input-unified {
  width: 100%;
  padding: 14px;
  font-size: 1rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  color: #fff;
  box-sizing: border-box;
  line-height: 1.2; /* previene clipping e migliora l'allineamento del testo */
}
label + .input-unified { margin-top: 0.2rem; }
.production-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.production-list li {
  background-color: rgba(255, 255, 255, 0.08);
  padding: 14px;
  border-radius: 10px;
  font-size: 1rem;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  width: 100%;
  box-sizing: border-box;
}
.emoji-lottie {
  width: 40px;
  height: 40px;
  display: inline-block;
  vertical-align: middle;
  margin-right: 8px;
}
.splash-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #111;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.splash-logo {
  width: 120px;
  height: auto;
  border-radius: 12px;
  margin-bottom: 20px;
}

.splash-text {
  font-size: 1.2rem;
  font-family: 'Orbitron', sans-serif;
}
.app-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('img/sfondo.jpeg') no-repeat center center / cover;
  z-index: -2;
}

.app-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  backdrop-filter: blur(6px);
  background-color: rgba(0, 0, 0, 0.4);
  z-index: -1;
}
.glass {
  background: rgba(0, 0, 0, 0.35);
  box-shadow:
    0 0 0 2px rgba(255, 200, 0, 0.2),
    0 0 12px rgba(255, 200, 0, 0.3),
    0 0 24px rgba(255, 200, 0, 0.15);
  border: 2px solid rgba(255, 200, 0, 0.5);
  border-radius: 20px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: white;
  padding: 20px;
  animation: fadeInUp 0.8s ease-out;
}
@keyframes fadeInUp {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (max-width: 768px) {
  .glass {
    margin: 10px;
    padding: 15px;
  }
}
/* === INPUT ERROR STYLE (DARK + LIGHT MODE) === */
.input-error {
    border: 2px solid #ff6464 !important;
    background-color: #2c0015 !important;
    color: #fff !important;
}

body.light-mode .input-error {
    background-color: #fff1f0 !important;
    color: #b80000 !important;
    border: 2px solid #ff6464 !important;
}
/* Stile base per il testo errore */
.error-text {
  color: #b80000;      /* scuro di default */
  font-weight: bold;
  font-size: 1em;
  letter-spacing: 0.2px;
  display: flex;
  align-items: center;
  margin: 4px 0 0 2px;
}

/* In dark mode resta oro chiaro come ora */
body.dark-mode .error-text {
  color: #ffd0a2;
}
.countup {
  animation: glow-gold 1.2s ease-in;
  font-variant-numeric: tabular-nums;
}
@keyframes glow-gold {
  0% { text-shadow: 0 0 0 gold; }
  60% { text-shadow: 0 0 12px gold, 0 0 24px #ffe97f; }
  100% { text-shadow: 0 0 2px #ffdf00; }
}
#muteBtn {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  margin-left: 5px;
  transition: transform 0.15s ease;
}

#muteBtn:hover {
  transform: scale(1.2);
}

/* Effetto vibrazione */
#muteBtn.vibrate {
  animation: vibrate 0.2s linear;
}

@keyframes vibrate {
  0% { transform: translateX(0); }
  25% { transform: translateX(-2px); }
  50% { transform: translateX(2px); }
  75% { transform: translateX(-2px); }
  100% { transform: translateX(0); }
}

/* Respiro quando suono attivo */
#muteBtn.breathing {
  animation: breathing 1.5s ease-in-out infinite;
}

@keyframes breathing {
  0%, 100% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(1.1); filter: brightness(1.3); }
}
/* Vibrazione su errore */
.vibrate-error {
  animation: vibrate 0.3s linear;
}

@keyframes vibrate {
  0% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  50% { transform: translateX(3px); }
  75% { transform: translateX(-3px); }
  100% { transform: translateX(0); }
}
/* Pulsanti normali */
#btnCalcolaProduzione, #btnCalcolaTempo {
  background: #4CAF50;
  color: white;
  border: none;
  padding: 10px 20px;
  margin: 5px;
  font-size: 16px;
  cursor: pointer;
  border-radius: 5px;
  transition: transform 0.15s ease;
}

#btnCalcolaProduzione:hover, #btnCalcolaTempo:hover {
  transform: scale(1.05);
}

/* Effetto vibrazione */
.vibrate {
  animation: vibrate 0.3s linear;
}

@keyframes vibrate {
  0% { transform: translateX(0); }
  25% { transform: translateX(-2px); }
  50% { transform: translateX(2px); }
  75% { transform: translateX(-2px); }
  100% { transform: translateX(0); }
}
/* 🎯 Stile generale pulsante muto */
#muteBtn {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  margin-left: 5px;
  transition: transform 0.15s ease;
}

#muteBtn:hover {
  transform: scale(1.2);
}

/* Effetto vibrazione */
#muteBtn.vibrate {
  animation: vibrate 0.2s linear;
}

@keyframes vibrate {
  0% { transform: translateX(0); }
  25% { transform: translateX(-2px); }
  50% { transform: translateX(2px); }
  75% { transform: translateX(-2px); }
  100% { transform: translateX(0); }
}

/* Effetto respiro quando il suono è attivo */
#muteBtn.breathing {
  animation: breathing 1.5s ease-in-out infinite;
}

@keyframes breathing {
  0%, 100% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(1.1); filter: brightness(1.3); }
}

/* ------------------------
   🎯 PULSANTI PRINCIPALI
------------------------- */
button {
  cursor: pointer;
  transition: transform 0.1s ease, background-color 0.2s ease;
}

/* Hover generico */
button:hover {
  transform: scale(1.05);
}

/* Effetto pressione reale sui pulsanti principali (anche mobile) */
/* rimuove ritardi e highlight blu su iOS/Safari */
button, .button, .btn { 
  -webkit-tap-highlight-color: transparent; 
  touch-action: manipulation; 
}

/* transizioni brevi per dare feeling fisico */
.btn, .button, #calculateBtn, #timeBtn {
  transition: transform 0.06s ease, filter 0.06s ease, box-shadow 0.06s ease;
  will-change: transform;
}

/* stato premuto: leggero schiacciamento + ombra interna */
.btn:active, .button:active, #calculateBtn:active, #timeBtn:active {
  transform: translateY(1.5px) scale(0.985);
  filter: brightness(0.95);
  box-shadow: inset 0 3px 10px rgba(0,0,0,0.35);
}

/* alternativa da forzare via JS: .button--pressed */
.button--pressed {
  transform: translateY(1.5px) scale(0.985) !important;
  filter: brightness(0.95) !important;
  box-shadow: inset 0 3px 10px rgba(0,0,0,0.35) !important;
}

/* Effetto vibrazione per errori */
.vibrate-error {
  animation: vibrate 0.3s linear;
}

/* === UTILITY: Square rounded button (mute) === */
.btn-square-rounded {
  width: 44px;
  height: 44px;
  padding: 6px;
  border-radius: 10px; /* angoli arrotondati ma non cerchio */
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Focus ring accessibile */
.button:focus-visible,
#muteBtn:focus-visible,
#themeBtn:focus-visible,
select:focus-visible,
input:focus-visible {
  outline: 2px solid #ffd24d;
  outline-offset: 2px;
}

/* === RESPONSIVE MEDIA QUERIES (TABLET & MOBILE) === */
@media (max-width: 1024px) {
  /* Compact input groups: keep a minimum gap and improved label spacing */
  .input-group--compact,
  .input-group--compact-target-unit {
    gap: 4px !important; /* mantieni un minimo di aria */
  }
  .input-group--compact label,
  .input-group--compact-target-unit label {
    margin-top: 0.1rem !important;
    margin-bottom: 0.2rem !important;
    line-height: 1.2 !important;
  }
  .input-group--compact input,
  .input-group--compact select,
  .input-group--compact-target-unit input,
  .input-group--compact-target-unit select {
    margin-top: 0 !important;
    margin-bottom: 0.15rem !important;
  }
  .btn-square-rounded {
    width: 42px !important;
    height: 42px !important;
  }
  .btn,
  .button,
  .button.small-btn {
    padding: 10px 14px !important;
    font-size: 0.9rem !important;
  }
}

@media (max-width: 480px) {
  .btn,
  .button,
  .button.small-btn {
    padding: 8px 12px !important;
    font-size: 0.85rem !important;
  }
  .logo {
    max-width: 90px !important;
  }
  h1 {
    font-size: 1.5rem !important;
  }
  .container {
    padding: 1rem !important;
  }
  .production-list li,
  #productionList li {
    padding: 10px !important;
  }
  input,
  select {
    min-height: 38px !important;
  }
  .input-group label { line-height: 1.25; }
}

/* =============================
   📱 ULTRA-COMPACT for small phones (width ≤480px or height ≤700px)
   ============================= */
@media (max-width: 480px), (max-height: 700px) {
  /* Ultra-compact: keep minimal gap and avoid label/input overlap */
  .input-group--compact,
  .input-group--compact-target-unit,
  .input-group { gap: 2px !important; }

  .input-group--compact label,
  .input-group--compact-target-unit label {
    margin-top: 0 !important;
    margin-bottom: 0.15rem !important; /* evita sovrapposizione label/input */
    line-height: 1.25 !important;
  }

  .input-group--compact input,
  .input-group--compact select,
  .input-group--compact-target-unit input,
  .input-group--compact-target-unit select {
    margin-top: 0 !important;
    margin-bottom: 0.15rem !important;
  }

  /* Input compatti ma tappabili */
  .input-unified,
  input.input-unified,
  select.input-unified { padding: 0.45rem 0.55rem !important; min-height: 38px !important; }

  /* Avvicina il pulsante all'ultima barra */
  #calculateBtn, #timeBtn { margin-top: 6px !important; }
}
