/* ─────────────────────────────────────────
   SILENCE — SS25
   style.css
   ───────────────────────────────────────── */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  touch-action: manipulation;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
  background: #080808;
}

img {
  max-width: 100%;
  display: block;
}

/* ─── DESKTOP ─── */
#desk {
  width: 100vw;
  height: 100vh;
  background: url("assets/bg.png") center/cover no-repeat;
  position: relative;
  overflow: hidden;
}

#desk::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
  pointer-events: none;
}

#wall {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

#wall .bg-s {
  font-size: clamp(120px, 25vw, 220px);
  font-weight: 700;
  color: #111;
  letter-spacing: -8px;
}

/* ─── ICONS CONTAINER ─── */
#icons-container {
  position: absolute;
  top: 40px;
  left: 0;
  right: 0;
  bottom: 80px;
}

/* ─── MENU BAR ─── */
#mbar {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 28px;
  background: rgba(8,8,8,0.92);
  backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 0.5px solid #1e1e1e;
  z-index: 200;
}

#mbar .left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.mbrand {
  font-weight: 600;
  font-size: 13px;
  color: #fff;
  letter-spacing: .1em;
}

.mitem {
  font-size: 12px;
  color: #aaa;
  cursor: pointer;
  transition: color .15s;
}

.mitem:hover { color: #fff; }

#clock {
  font-size: 12px;
  color: #aaa;
}

/* ─── WINDOWS ─── */
.win {
  position: absolute;
  background: #0f0f0f;
  border: 0.5px solid #252525;
  border-radius: 12px;
  overflow: hidden;
  z-index: 10;
  box-shadow: 0 24px 64px rgba(0,0,0,.9);
  min-width: 300px;
  max-width: 95vw;
  max-height: 88vh;
  display: flex;            /* header fisso + corpo scrollabile */
  flex-direction: column;
}

.wh {
  height: 36px;
  background: #161616;
  display: flex;
  align-items: center;
  padding: 0 14px;
  gap: 8px;
  cursor: grab;
  border-bottom: 0.5px solid #222;
  flex-shrink: 0;
}

.wh:active { cursor: grabbing; }

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
}

.dr { background: #ff5f57; }
.dy { background: #febc2e; }
.dg { background: #28c840; }

.wtitle {
  flex: 1;
  text-align: center;
  font-size: 12px;
  color: #555;
  font-weight: 400;
  letter-spacing: .05em;
}

.wb {
  padding: 20px;
  color: #e0e0e0;
  overflow-y: auto;
  flex: 1 1 auto;           /* occupa lo spazio rimasto sotto l'header */
  min-height: 0;            /* indispensabile perché lo scroll funzioni in flex */
}

/* ─── DESKTOP ICONS ─── */
.ico {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: background .15s;
  width: 120px;
}

.ico:hover { background: rgba(255,255,255,.06); }
.ico:active { background: rgba(255,255,255,.1); cursor: grabbing; }

.ibox {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
}

.ibox img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  pointer-events: none;
}

.ico span {
  font-size: 11px;
  color: #ccc;
  text-align: center;
  text-shadow: 0 1px 3px rgba(0,0,0,.8);
}

/* ─── ICON POSITIONS (desktop layout) ─── */
#ico-store    { top: 60px; left: 120px; }
#ico-term     { top: 60px; left: 220px; }
#ico-photo    { top: 60px; left: 320px; }
#ico-music    { top: 60px; left: 420px; }
#ico-folder   { top: 60px; left: 520px; }
#ico-calendar { top: 60px; left: 620px; }
#ico-browser  { top: 60px; left: 820px; }
#ico-notes    { top: 200px; left: 120px; }
#ico-weather  { top: 200px; left: 220px; }
#ico-radio    { top: 200px; left: 320px; }
#ico-vault    { top: 200px; left: 420px; }
#ico-cross    { top: 200px; left: 520px; }

/* icona Browser: box bianco, immagine originale senza filtri */
#ico-browser .ibox {
  background: #fff;
  border-color: #fff;
}

/* ─── ICON BOX COLOR VARIANTS ─── */
.ibox-black { background: #000;    border: 0.5px solid #333; }
.ibox-dark  { background: #1a1a1a; border: 0.5px solid #333; }

/* ─── ICON IMAGE SIZES ─── */
.iimg-sm { width: 50px; height: 50px; object-fit: contain; }
.iimg    { width: 56px; height: 56px; object-fit: contain; }

/* ─── DOCK ─── */
#dock {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255,255,255,.07);
  backdrop-filter: blur(20px);
  border: 0.5px solid rgba(255,255,255,.1);
  border-radius: 18px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 200;
  max-width: calc(100vw - 20px);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  transition: transform .3s ease, opacity .3s ease;
}

/* dock nascosto (mobile, quando una finestra è aperta):
   scivola sotto il bordo e svanisce, senza intercettare i tocchi */
#dock.dock-hidden {
  transform: translateX(-50%) translateY(90px);
  opacity: 0;
  pointer-events: none;
}


#dock::-webkit-scrollbar { display: none; }

.di {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  cursor: pointer;
  transition: transform .15s;
  position: relative;
  flex-shrink: 0;
}

.di:hover { transform: scale(1.25) translateY(-6px); }

.da {
  position: absolute;
  bottom: 1px;
  width: 16px;
  height: 3px;
  border-radius: 2px;
  background: rgba(255,255,255,.85);
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
}

.di img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  pointer-events: none;
}

/* ─── NOTIFICATION ─── */
.notif {
  position: fixed;
  top: 38px;
  right: 12px;
  background: #1a1a1a;
  border: 0.5px solid #333;
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 12px;
  color: #e0e0e0;
  width: 260px;
  z-index: 500;
  opacity: 0;
  transition: opacity .3s;
  pointer-events: none;
}

.ntitle {
  font-weight: 600;
  font-size: 12px;
  color: #fff;
  margin-bottom: 3px;
}

/* ─── INPUTS / BUTTONS ─── */
input[type=text] {
  background: #0f0f0f;
  border: 0.5px solid #333;
  border-radius: 6px;
  padding: 7px 12px;
  font-size: 12px;
  color: #fff;
  outline: none;
  user-select: text;
  transition: border-color .15s;
}

input[type=text]:focus { border-color: #555; }

.btn {
  background: #fff;
  color: #000;
  border: none;
  border-radius: 6px;
  padding: 7px 16px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: .05em;
}

.btn:hover { background: #ddd; }

.btn-ghost {
  background: transparent;
  color: #aaa;
  border: 0.5px solid #333;
  border-radius: 6px;
  padding: 7px 16px;
  font-size: 11px;
  cursor: pointer;
  letter-spacing: .05em;
}

.btn-ghost:hover { color: #fff; border-color: #555; }

/* ─── TERMINAL ─── */
.term-body {
  background: #000;
  font-family: 'SF Mono', Monaco, 'Courier New', monospace;
  font-size: 12px;
  color: #00ff41;
  padding: 16px;
  display: flex;
  flex-direction: column;
  min-height: 240px;
  max-height: 320px;
}

/* il log scorre, il resto (input + pulsanti) resta in fondo */
.term-log {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

.term-log-line {
  margin-bottom: 4px;
  opacity: 0;
  animation: term-fade-in .4s ease-out forwards;
  word-break: break-word;
}

/* il comando digitato dall'utente (più chiaro) */
.term-cmd { color: #aaffcc; }

/* le risposte ai comandi (verde tenue) */
.term-reply { color: #6ad98a; }

@keyframes term-fade-in {
  from { opacity: 0; transform: translateY(2px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* avviso fisso: resta visibile mentre il log scorre */
.term-alert {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex-shrink: 0;
  margin-top: 10px;
  padding: 9px 11px;
  border: 0.5px solid #6b4d00;
  border-radius: 6px;
  background: rgba(254,188,46,.07);
  color: #d9a420;
  font-size: 11.5px;
  line-height: 1.5;
}

.term-alert-mark {
  font-weight: 700;
  color: #febc2e;
  flex-shrink: 0;
}

.term-alert.term-alert-done { display: none; }

/* comando cliccabile dentro il log */
.term-inline-cmd {
  background: rgba(0,255,65,.1);
  border: 0.5px solid #1f5c32;
  border-radius: 4px;
  color: #00ff41;
  font-family: inherit;
  font-size: inherit;
  padding: 1px 7px;
  margin: 0 2px;
  cursor: pointer;
}

.term-inline-cmd:hover {
  background: rgba(0,255,65,.22);
  border-color: #00ff41;
}

.term-cmd-desc {
  color: #6ad98a;
  margin-left: 8px;
}

/* riga di input */
.term-inputline {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  flex-shrink: 0;
}

.term-prompt {
  color: #00ff41;
  flex-shrink: 0;
}

.term-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #00ff41;
  font-family: inherit;
  font-size: 12px;
  caret-color: #00ff41;
  padding: 2px 0;
  user-select: text;
}

.term-input::placeholder { color: #2f7d47; }

/* pulsanti-scorciatoia */
.term-hints {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
  flex-shrink: 0;
}

.term-hint {
  background: transparent;
  border: 0.5px solid #1f5c32;
  color: #4fbf76;
  font-family: inherit;
  font-size: 11px;
  padding: 5px 11px;
  border-radius: 6px;
  cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
}

.term-hint:hover {
  color: #00ff41;
  border-color: #00ff41;
  background: rgba(0,255,65,.08);
}

body.reduce-motion .term-log-line {
  animation: none;
  opacity: 1;
}

/* ─── MUSIC PLAYER ─── */
.player {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.player-art {
  width: 56px;
  height: 56px;
  background: #fff;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  color: #000;
  flex-shrink: 0;
  overflow: hidden;
}

/* copertina con immagine */
.player-art.has-cover {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: transparent;        /* nasconde l'eventuale "S" residua */
}

.player-track {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}

.player-artist {
  font-size: 11px;
  color: #666;
  margin-top: 2px;
}

.player-progress {
  height: 4px;
  background: #222;
  border-radius: 2px;
  cursor: pointer;
  margin-bottom: 8px;
  position: relative;
}

.player-progress-fill {
  height: 100%;
  width: 0%;
  background: #fff;
  border-radius: 2px;
}

.player-time {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: #555;
  margin-bottom: 18px;
}

.player-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-bottom: 18px;
}

/* bottoni precedente / successiva */
.player-btn-side {
  background: transparent;
  border: none;
  color: #ccc;
  font-size: 18px;
  cursor: pointer;
  padding: 6px;
  line-height: 1;
  transition: color .15s, transform .12s;
}

.player-btn-side:hover { color: #fff; }
.player-btn-side:active { transform: scale(.88); }

.player-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #fff;
  color: #000;
  border: none;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* PLAY: triangolo nero disegnato con i bordi (stato di default) */
.player-btn::before {
  content: "";
  display: block;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 7px 0 7px 12px;
  border-color: transparent transparent transparent #000;
  margin-left: 2px;          /* ottico: centra il triangolo nel cerchio */
}

/* PAUSE: due stanghette nere quando la traccia è in riproduzione */
.player-btn.playing::before {
  width: 12px;
  height: 14px;
  border: 0;                  /* annulla il triangolo */
  margin-left: 0;
  /* due barre verticali nere create con un gradiente */
  background: linear-gradient(#000, #000) left / 4px 100% no-repeat,
              linear-gradient(#000, #000) right / 4px 100% no-repeat;
}

.player-btn:hover { background: #ddd; }

.player-volume {
  display: flex;
  align-items: center;
  gap: 10px;
}

.player-vol-icon {
  font-size: 9px;
  color: #555;
  letter-spacing: .1em;
}

.player-volume input[type=range] {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 3px;
  background: #222;
  border-radius: 2px;
  outline: none;
}

.player-volume input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
}

.player-volume input[type=range]::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  border: none;
  cursor: pointer;
}

/* ─── PLAYLIST (lista tracce) ─── */
.player-playlist {
  margin-top: 18px;
  border-top: 0.5px solid #1c1c1c;
  padding-top: 8px;
}

.playlist-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .12s;
}

.playlist-item:hover { background: rgba(255,255,255,.05); }
.playlist-item.active { background: rgba(255,255,255,.09); }

.playlist-eq {
  font-size: 9px;
  color: #28c840;
  width: 22px;
  flex-shrink: 0;
  letter-spacing: 1px;
}

.playlist-item:not(.active) .playlist-eq { color: #555; }

.playlist-title {
  font-size: 12px;
  color: #eee;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.playlist-item.active .playlist-title { font-weight: 600; }

.playlist-artist {
  font-size: 10px;
  color: #666;
  flex-shrink: 0;
}

/* ─── WINDOW INITIAL POSITIONS / SIZES ─── */
#w-about    { width: 360px; top: 80px;  left: 60px; }
#w-term     { width: 420px; top: 100px; left: 440px; }
#w-music    { width: 300px; top: 160px; left: 260px; }
#w-folder   { width: 420px; top: 120px; left: 200px; }
#w-photo    { width: 380px; top: 100px; left: 420px; }
#w-calendar { width: 260px; top: 140px; left: 520px; }
#w-docs     { width: 360px; top: 90px;  left: 140px; }
#w-settings { width: 300px; top: 110px; left: 320px; }
#w-browser  { width: 420px; top: 90px;  left: 480px; }
#w-message  { width: 300px; top: 120px; left: 200px; }
#w-weather  { width: 300px; top: 120px; left: 360px; }
#w-radio    { width: 300px; top: 140px; left: 420px; }
#w-vault    { width: 300px; top: 160px; left: 480px; }
#w-cross    { width: 380px; top: 100px; left: 400px; }

.hidden { display: none !important; }

/* ─── ABOUT WINDOW CONTENT ─── */
.about-header { text-align: center; margin-bottom: 20px; }

.about-avatar {
  width: 56px;
  height: 56px;
  background: #fff;
  border-radius: 14px;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  color: #000;
}

.about-title { font-size: 18px; font-weight: 600; color: #fff; }
.about-sub   { font-size: 10px; color: #444; }
.about-desc  { font-size: 12px; color: #666; line-height: 1.8; }

/* ─── ABOUT: LEGGENDA DELLA CACCIA ─── */
.about-legend {
  margin-top: 6px;
  padding-top: 0;
  border-top: none;
  text-align: left;
}

.about-legend-title {
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  letter-spacing: .25em;
  text-align: center;
  margin-bottom: 12px;
}

/* regole del gioco: numerate, allineate a sinistra, leggibili su mobile */
.about-legend-rules {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}

.about-legend-rule {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 12px;
  color: #aaa;
  line-height: 1.6;
  text-align: left;
}

.about-legend-num {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border: 0.5px solid #333;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: #888;
  margin-top: 1px;
}

/* divisore "GLI INDIZI" */
.about-legend-divider {
  font-size: 10px;
  color: #555;
  letter-spacing: .2em;
  text-align: center;
  margin: 4px 0 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.about-legend-divider::before,
.about-legend-divider::after {
  content: "";
  flex: 1;
  height: 0.5px;
  background: #1c1c1c;
}

.about-legend-text {
  font-size: 12px;
  color: #888;
  line-height: 1.7;
  text-align: center;
  margin-bottom: 14px;
}

.about-legend-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 auto 16px;
  max-width: 260px;
}

.about-legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: #aaa;
  line-height: 1.5;
}

.about-legend-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #fff;
  flex-shrink: 0;
  opacity: .6;
}

/* link al Vault dentro il testo */
.about-legend-vault {
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 1px solid #555;
  transition: border-color .15s;
}

.about-legend-vault:hover { border-color: #fff; }

.about-legend-hint {
  font-size: 11px;
  color: #555;
  font-style: italic;
  text-align: center;
}

/* ─── FOLDER / FILES ─── */
.folder-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.file {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 10px;
  border-radius: 8px;
  transition: background .15s;
}

.file:hover { background: rgba(255,255,255,.06); }

.file-icon { font-size: 28px; }

.file span {
  font-size: 11px;
  color: #aaa;
  text-align: center;
}

.hidden-img { display: none; }

/* ─── GALLERY ─── */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.gallery-grid img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  transition: opacity .15s;
}

.gallery-grid img:hover { opacity: .85; }

/* ─── MOBILE GRID DRAG ─── */
.mobile-ico-ghost {
  position: fixed;
  z-index: 9800;
  pointer-events: none;
  opacity: .85;
  transform: scale(1.12);
  transition: none;
}

.mobile-ico-held {
  transform: scale(0.95);
  opacity: .6;
  transition: transform .15s, opacity .15s;
}

.ico.drop-target .ibox {
  outline: 1.5px solid rgba(255,255,255,.6);
  border-radius: 14px;
}

/* ─── MOBILE CLOSE BUTTON (rimosso: si chiude col pallino rosso) ─── */
.mobile-close-btn { display: none; }

/* ─── IMAGE VIEWER ─── */
#img-viewer {
  width: 440px;
  top: 90px;
  left: 360px;
}

.img-viewer-body {
  padding: 0;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
}

.img-viewer-body img {
  max-width: 100%;        /* non supera la larghezza della finestra */
  max-height: 70vh;       /* né l'altezza disponibile */
  width: auto;            /* mantiene le proporzioni reali */
  height: auto;
  object-fit: contain;
  display: block;
}

/* ─── NOTES APP ─── */
#w-notes { width: 540px; top: 90px; left: 300px; }

#w-notes .wb.notes-wb {
  padding: 0;
  display: flex;
  flex-direction: row;
  height: 420px;
  max-height: 72vh;
}

/* colonna lista */
.notes-sidebar {
  flex: 0 0 200px;
  border-right: 0.5px solid #1c1c1c;
  background: #0d0d0d;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.notes-sidebar-head {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  padding: 16px 16px 10px;
}

.note-item {
  padding: 12px 16px;
  border-bottom: 0.5px solid #161616;
  cursor: pointer;
  transition: background .12s;
}

.note-item:hover { background: rgba(255,255,255,.03); }

.note-item.active { background: rgba(255,255,255,.07); }

.note-item-title {
  font-size: 13px;
  font-weight: 600;
  color: #f0f0f0;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.note-item-preview {
  font-size: 11px;
  color: #666;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.note-item-date {
  color: #888;
  margin-right: 6px;
}

/* colonna dettaglio */
.notes-main {
  flex: 1 1 auto;
  min-width: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 20px 22px;
  background: #0a0a0a;
}

.notes-back {
  display: none;            /* visibile solo su mobile */
  background: transparent;
  border: none;
  color: #febc2e;
  font-size: 14px;
  cursor: pointer;
  padding: 0 0 12px;
}

.note-detail-date {
  font-size: 10px;
  color: #555;
  text-align: center;
  letter-spacing: .04em;
  margin-bottom: 14px;
}

.note-detail-title {
  font-size: 19px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 12px;
  line-height: 1.2;
}

.note-detail-body {
  font-size: 13px;
  color: #c8c8c8;
  line-height: 1.7;
  white-space: pre-wrap;     /* mantiene gli a-capo del testo */
  word-wrap: break-word;
}

/* ─── WEATHER & RADIO ICONS (disegnate in CSS, sostituibili con img) ─── */
.weather-ico {
  display: block;
  width: 40px;
  height: 26px;
  position: relative;
}
/* nuvola */
.weather-ico::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 6px;
  width: 30px;
  height: 14px;
  background: #cfd6dd;
  border-radius: 10px;
  box-shadow: 8px -6px 0 -2px #cfd6dd, -6px -2px 0 -3px #cfd6dd;
}
/* righe di nebbia */
.weather-ico::after {
  content: "";
  position: absolute;
  left: 2px;
  bottom: 0;
  width: 34px;
  height: 7px;
  background:
    linear-gradient(#9aa3ab,#9aa3ab) left 0 / 34px 1.5px no-repeat,
    linear-gradient(#9aa3ab,#9aa3ab) left 4px / 26px 1.5px no-repeat,
    linear-gradient(#9aa3ab,#9aa3ab) left 8px / 30px 1.5px no-repeat;
}

.radio-ico {
  display: block;
  width: 36px;
  height: 30px;
  position: relative;
}
/* corpo radio */
.radio-ico::before {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 36px;
  height: 20px;
  border: 2px solid #cfd6dd;
  border-radius: 5px;
  box-sizing: border-box;
}
/* antenna + manopola */
.radio-ico::after {
  content: "";
  position: absolute;
  left: 7px;
  bottom: 7px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #cfd6dd;
  box-shadow: 20px -22px 0 -4px #cfd6dd, 14px 0 0 -1px #cfd6dd;
}

/* ─── WEATHER APP ─── */
.weather-wb {
  text-align: center;
}

.weather-city {
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 2px;
}

.weather-cond {
  font-size: 12px;
  color: #8a929a;
  margin-bottom: 14px;
}

/* glifo nebbia animato */
.weather-glyph {
  width: 80px;
  height: 50px;
  margin: 0 auto 10px;
  position: relative;
}
.weather-glyph::before {
  content: "";
  position: absolute;
  left: 14px; top: 8px;
  width: 52px; height: 22px;
  background: #b9c1c9;
  border-radius: 16px;
  box-shadow: 16px -8px 0 -4px #b9c1c9, -12px -4px 0 -6px #b9c1c9;
}
.weather-glyph::after {
  content: "";
  position: absolute;
  left: 8px; bottom: 0;
  width: 64px; height: 12px;
  background:
    linear-gradient(#7d858d,#7d858d) left 0 / 64px 2px no-repeat,
    linear-gradient(#7d858d,#7d858d) left 5px / 48px 2px no-repeat,
    linear-gradient(#7d858d,#7d858d) left 10px / 58px 2px no-repeat;
  animation: fog-drift 4s ease-in-out infinite;
}
@keyframes fog-drift {
  0%,100% { transform: translateX(-3px); opacity: .7; }
  50%     { transform: translateX(3px);  opacity: 1; }
}
body.reduce-motion .weather-glyph::after { animation: none; }

.weather-temp {
  font-size: 48px;
  font-weight: 200;
  color: #fff;
  line-height: 1;
}

.weather-range {
  font-size: 11px;
  color: #666;
  margin-bottom: 18px;
}

.weather-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}

.weather-cell {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px;
  border: 0.5px solid #1c1c1c;
  border-radius: 10px;
  background: #0d0d0d;
}

.weather-cell-k {
  font-size: 10px;
  color: #666;
  letter-spacing: .05em;
}

.weather-cell-v {
  font-size: 15px;
  color: #e8e8e8;
}

/* previsioni 5 giorni */
.weather-forecast {
  display: flex;
  justify-content: space-between;
  gap: 4px;
  margin-bottom: 16px;
  padding-top: 14px;
  border-top: 0.5px solid #1c1c1c;
}

.fc-day {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.fc-name {
  font-size: 9px;
  color: #666;
  letter-spacing: .1em;
}

.fc-icon {
  font-size: 16px;
  color: #cfd6dd;
  line-height: 1;
}

.fc-temp {
  font-size: 10px;
  color: #888;
  white-space: nowrap;
}

.weather-note {
  font-size: 11px;
  color: #555;
  font-style: italic;
}

/* ─── RADIO APP ─── */
.radio-wb {
  text-align: center;
}

.radio-station {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  letter-spacing: .08em;
  margin-bottom: 2px;
}

.radio-freq {
  font-family: 'SF Mono', Monaco, 'Courier New', monospace;
  font-size: 12px;
  color: #28c840;
  margin-bottom: 18px;
}

/* onde: barre che pulsano quando la radio è accesa */
.radio-wave {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 60px;
  margin-bottom: 16px;
}

.radio-wave span {
  width: 3px;
  height: 6px;
  background: #333;
  border-radius: 2px;
  transition: background .2s;
}

.radio-wave.active span {
  background: #28c840;
  animation: radio-bar 0.9s ease-in-out infinite;
}

.radio-wave.active span:nth-child(odd)  { animation-duration: 0.7s; }
.radio-wave.active span:nth-child(3n)   { animation-duration: 1.1s; }
.radio-wave.active span:nth-child(3n+1) { animation-delay: .15s; }
.radio-wave.active span:nth-child(2n)   { animation-delay: .3s; }

@keyframes radio-bar {
  0%, 100% { height: 6px; }
  50%      { height: 46px; }
}

body.reduce-motion .radio-wave.active span {
  animation: none;
  height: 24px;
}

.radio-now {
  font-size: 11px;
  color: #888;
  font-family: 'SF Mono', Monaco, 'Courier New', monospace;
  margin-bottom: 18px;
}

.radio-controls {
  display: flex;
  justify-content: center;
  margin-bottom: 18px;
}

.radio-btn {
  min-width: 70px;
  padding: 10px 18px;
  border-radius: 20px;
  background: transparent;
  border: 0.5px solid #444;
  color: #ccc;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
  cursor: pointer;
  transition: all .15s;
}

.radio-btn.on {
  background: #28c840;
  border-color: #28c840;
  color: #000;
}

.radio-tune {
  display: flex;
  align-items: center;
  gap: 10px;
}

.radio-tune-k {
  font-size: 9px;
  color: #555;
  letter-spacing: .1em;
}

.radio-tune input[type=range] {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 3px;
  background: #222;
  border-radius: 2px;
  outline: none;
}

.radio-tune input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #28c840;
  cursor: pointer;
}

.radio-tune input[type=range]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #28c840;
  border: none;
  cursor: pointer;
}

/* ─── VAULT ─── */

/* icona lucchetto disegnata in CSS */
.vault-ico {
  display: block;
  width: 30px;
  height: 28px;
  position: relative;
}
.vault-ico::before {
  /* corpo del lucchetto */
  content: "";
  position: absolute;
  left: 3px;
  bottom: 0;
  width: 24px;
  height: 16px;
  background: #fff;
  border-radius: 4px;
}
.vault-ico::after {
  /* staffa */
  content: "";
  position: absolute;
  left: 8px;
  bottom: 14px;
  width: 14px;
  height: 14px;
  border: 3px solid #fff;
  border-bottom: none;
  border-radius: 10px 10px 0 0;
}

.vault-wb {
  text-align: center;
}

.vault-lock {
  width: 44px;
  height: 40px;
  margin: 4px auto 14px;
  position: relative;
}
.vault-lock::before {
  content: "";
  position: absolute;
  left: 4px;
  bottom: 0;
  width: 36px;
  height: 22px;
  background: #e8e8e8;
  border-radius: 6px;
}
.vault-lock::after {
  content: "";
  position: absolute;
  left: 11px;
  bottom: 19px;
  width: 22px;
  height: 20px;
  border: 4px solid #e8e8e8;
  border-bottom: none;
  border-radius: 14px 14px 0 0;
}

.vault-title {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 4px;
}

.vault-sub {
  font-size: 11px;
  color: #666;
  margin-bottom: 20px;
}

.vault-inputline {
  margin-bottom: 12px;
}

.vault-input {
  width: 100%;
  background: #0a0a0a;
  border: 0.5px solid #333;
  border-radius: 8px;
  padding: 12px 14px;
  font-family: 'SF Mono', Monaco, 'Courier New', monospace;
  font-size: 16px;
  letter-spacing: .18em;
  text-align: center;
  text-transform: uppercase;
  color: #fff;
  outline: none;
}

.vault-input:focus { border-color: #666; }

/* ─── Vault bloccato: finché mancano frammenti non si digita ─── */
.vault-input:disabled {
  opacity: .4;
  cursor: not-allowed;
  letter-spacing: .3em;
}

.vault-submit:disabled {
  background: #2a2a2a;
  color: #666;
  cursor: not-allowed;
}

/* lucchetto visibilmente "chiuso" quando mancano frammenti */
#w-vault.vault-locked .vault-lock {
  opacity: .35;
  filter: grayscale(1);
}

#w-vault.vault-locked .vault-sub {
  color: #ff5f57;
}

.vault-input::placeholder {
  letter-spacing: .1em;
  color: #444;
}

/* scuote la casella in caso di codice errato */
@keyframes vault-shake-kf {
  0%, 100% { transform: translateX(0); }
  20%      { transform: translateX(-6px); }
  40%      { transform: translateX(6px); }
  60%      { transform: translateX(-4px); }
  80%      { transform: translateX(4px); }
}

.vault-shake { animation: vault-shake-kf .35s ease; }

body.reduce-motion .vault-shake { animation: none; }

.vault-submit {
  width: 100%;
  padding: 11px;
  background: #fff;
  color: #000;
  border: none;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  cursor: pointer;
}

.vault-submit:hover { background: #ddd; }

.vault-msg {
  margin-top: 12px;
  font-size: 11px;
  min-height: 14px;
}

.vault-msg.vault-ok { color: #28c840; }
.vault-msg.vault-error { color: #ff5f57; }

/* ─── VAULT UNLOCK SEQUENCE ─── */
#vault-unlock-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;           /* sopra tutto, incluso il boot */
  background: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 34px;
  opacity: 0;
  transition: opacity .4s ease;
}

#vault-unlock-overlay.vu-zoom { opacity: 1; }

/* lucchetto gigante costruito in CSS */
.vu-lock {
  position: relative;
  width: 120px;
  height: 130px;
  transform: scale(.15);
  transition: transform 1.2s cubic-bezier(.2,.8,.2,1);
}

#vault-unlock-overlay.vu-zoom .vu-lock {
  transform: scale(1);
}

.vu-body {
  position: absolute;
  left: 10px;
  bottom: 0;
  width: 100px;
  height: 64px;
  background: #e8e8e8;
  border-radius: 14px;
}

/* buco della serratura */
.vu-body::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 18px;
  transform: translateX(-50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #000;
  box-shadow: 0 16px 0 -4px #000;
}

.vu-shackle {
  position: absolute;
  left: 28px;
  bottom: 56px;
  width: 64px;
  height: 58px;
  border: 12px solid #e8e8e8;
  border-bottom: none;
  border-radius: 40px 40px 0 0;
  transform-origin: left bottom;
  transition: transform .45s cubic-bezier(.3,1.4,.5,1);
}

/* staffa che scatta aperta: ruota e si alza */
#vault-unlock-overlay.vu-open .vu-shackle {
  transform: rotate(-28deg) translateY(-10px);
}

.vu-text {
  font-family: 'SF Mono', Monaco, 'Courier New', monospace;
  font-size: 15px;
  letter-spacing: .35em;
  color: #fff;
  opacity: 0;
  transition: opacity .4s ease .2s;
}

#vault-unlock-overlay.vu-open .vu-text { opacity: 1; }

/* fase glitch: l'overlay stesso trema e si sdoppia */
#vault-unlock-overlay.vu-glitch {
  animation: vu-shake .12s steps(2, jump-none) infinite;
}

#vault-unlock-overlay.vu-glitch .vu-lock {
  filter: drop-shadow(4px 0 0 rgba(255,0,64,.8))
          drop-shadow(-4px 0 0 rgba(0,255,249,.8));
}

#vault-unlock-overlay.vu-glitch .vu-text {
  animation: vu-text-glitch .18s steps(2, jump-none) infinite;
}

@keyframes vu-shake {
  0%   { transform: translate(0,0); }
  25%  { transform: translate(-6px,3px); }
  50%  { transform: translate(5px,-4px); }
  75%  { transform: translate(-4px,-2px); }
  100% { transform: translate(3px,4px); }
}

@keyframes vu-text-glitch {
  0%,100% { text-shadow: 3px 0 rgba(255,0,64,.9), -3px 0 rgba(0,255,249,.9); }
  50%     { text-shadow: -3px 0 rgba(255,0,64,.9), 3px 0 rgba(0,255,249,.9); }
}

/* ─── EVENTI DEL CALENDARIO (giorni colorati) ─── */
/* festività: rosso */
.cal-day.ev-fest {
  border-color: rgba(255,95,87,.5);
  background: rgba(255,95,87,.1);
  color: #ff5f57;
  cursor: pointer;
}
.cal-day.ev-fest:hover { background: rgba(255,95,87,.22); }

/* appuntamenti brand: bianco */
.cal-day.ev-brand {
  border-color: rgba(255,255,255,.4);
  background: rgba(255,255,255,.08);
  color: #eee;
  cursor: pointer;
}
.cal-day.ev-brand:hover { background: rgba(255,255,255,.18); }

/* spedizioni/consegne: giallo */
.cal-day.ev-ship {
  border-color: rgba(254,188,46,.5);
  background: rgba(254,188,46,.1);
  color: #febc2e;
  cursor: pointer;
}
.cal-day.ev-ship:hover { background: rgba(254,188,46,.22); }

/* varie: blu */
.cal-day.ev-misc {
  border-color: rgba(90,160,255,.5);
  background: rgba(90,160,255,.1);
  color: #5aa0ff;
  cursor: pointer;
}
.cal-day.ev-misc:hover { background: rgba(90,160,255,.22); }

/* giorno del drop: verde, MIMETIZZATO tra gli altri eventi.
   Niente pulsazione, niente grassetto: stesso peso visivo degli
   altri giorni colorati. Solo chi sa cosa cerca lo distingue. */
.cal-day.drop-day {
  border-color: rgba(40,200,64,.5);
  background: rgba(40,200,64,.1);
  color: #28c840;
  cursor: pointer;
}
.cal-day.drop-day:hover { background: rgba(40,200,64,.22); }

/* ─── FRAGMENT REVEAL (frammento trovato) ─── */
.fragment-overlay {
  position: fixed;
  inset: 0;
  z-index: 99000;
  background: rgba(0,0,0,.88);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 26px;
  opacity: 0;
  transition: opacity .3s ease;
  pointer-events: none;      /* non blocca i tocchi sotto */
}

.fragment-overlay.show { opacity: 1; }
.fragment-overlay.out  { opacity: 0; transition: opacity .5s ease; }

.fragment-label {
  font-family: 'SF Mono', Monaco, 'Courier New', monospace;
  font-size: 12px;
  letter-spacing: .4em;
  color: #666;
}

.fragment-char {
  font-family: 'SF Mono', Monaco, 'Courier New', monospace;
  font-size: clamp(90px, 24vw, 160px);
  font-weight: 700;
  color: #fff;
  line-height: 1;
  transform: scale(.7);
  transition: transform .5s cubic-bezier(.2,.9,.3,1.2);
}

.fragment-overlay.show .fragment-char { transform: scale(1); }

/* flash glitch quando il carattere si fissa */
.fragment-overlay.glitch .fragment-char {
  animation: fragment-glitch .3s steps(2, jump-none) 3;
  text-shadow: 5px 0 rgba(255,0,64,.85), -5px 0 rgba(0,255,249,.85);
}

@keyframes fragment-glitch {
  0%, 100% { transform: scale(1) translate(0,0); }
  33%      { transform: scale(1.02) translate(-4px,2px); }
  66%      { transform: scale(.99) translate(4px,-2px); }
}

/* esplosione sul giorno del drop quando viene cliccato */
.cal-day.drop-day-burst {
  animation: drop-burst .6s cubic-bezier(.2,.9,.3,1.4);
}

@keyframes drop-burst {
  0%   { transform: scale(1);   box-shadow: 0 0 0 0 rgba(40,200,64,.7); }
  40%  { transform: scale(1.5); box-shadow: 0 0 24px 10px rgba(40,200,64,.5); }
  100% { transform: scale(1);   box-shadow: 0 0 0 0 rgba(40,200,64,0); }
}

body.reduce-motion .cal-day.drop-day-burst { animation: none; }

/* ─── MICRO-ANIMAZIONI DI SISTEMA ─── */

/* apertura finestra: scale-in morbido */
.win.win-opening {
  animation: win-open .24s cubic-bezier(.2,.9,.3,1.1);
}

@keyframes win-open {
  from { transform: scale(.95); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

body.reduce-motion .win.win-opening { animation: none; }

/* radio warming: all'accensione le barre "prendono segnale"
   partendo compresse e con colore spento, poi tornano libere */
.radio-wave.warming span {
  animation-duration: 2.2s !important;
  background: #1a7a34;
}

/* ─── FRAGMENT TRACKER (promemoria in alto a destra) ─── */
.fragment-tracker {
  position: fixed;
  top: 38px;
  right: 16px;
  z-index: 40;               /* come il countdown: sotto le finestre */
  background: #0f0f0f;
  border: 0.5px solid #2a2a2a;
  border-radius: 12px;
  padding: 8px 14px;
  text-align: center;
}

.ft-label {
  font-size: 9px;
  color: #555;
  letter-spacing: .2em;
  margin-bottom: 5px;
}

.ft-slots {
  display: flex;
  gap: 7px;
  justify-content: center;
  font-family: 'SF Mono', Monaco, 'Courier New', monospace;
}

.ft-slot {
  min-width: 14px;
  font-size: 14px;
  color: #3a3a3a;            /* slot vuoto: quasi invisibile */
  font-weight: 700;
}

.ft-slot.found {
  color: #28c840;            /* frammento trovato: verde sistema */
}

/* animazione quando un frammento si sblocca */
.ft-slot.just-found {
  animation: ft-pop .6s cubic-bezier(.2,1.6,.4,1);
}

@keyframes ft-pop {
  0%   { transform: scale(.4); opacity: 0; }
  60%  { transform: scale(1.4); }
  100% { transform: scale(1); opacity: 1; }
}

body.reduce-motion .ft-slot.just-found { animation: none; }

/* ─── CROSSWORD / ENIGMA ─── */

/* icona: mini-griglia crossword in CSS */
.cross-ico {
  display: block;
  width: 32px;
  height: 32px;
  background:
    linear-gradient(#cfd6dd, #cfd6dd) 0 0 / 100% 2px no-repeat,
    linear-gradient(#cfd6dd, #cfd6dd) 0 10px / 100% 2px no-repeat,
    linear-gradient(#cfd6dd, #cfd6dd) 0 20px / 100% 2px no-repeat,
    linear-gradient(#cfd6dd, #cfd6dd) 0 30px / 100% 2px no-repeat,
    linear-gradient(#cfd6dd, #cfd6dd) 0 0 / 2px 100% no-repeat,
    linear-gradient(#cfd6dd, #cfd6dd) 10px 0 / 2px 100% no-repeat,
    linear-gradient(#cfd6dd, #cfd6dd) 20px 0 / 2px 100% no-repeat,
    linear-gradient(#cfd6dd, #cfd6dd) 30px 0 / 2px 100% no-repeat;
  position: relative;
}
.cross-ico::after {
  content: "";
  position: absolute;
  right: 2px;
  top: 2px;
  width: 8px;
  height: 8px;
  background: #cfd6dd;
}

.cross-wb { text-align: center; }

.cw-title {
  font-size: 12px;
  color: #888;
  margin-bottom: 14px;
  font-style: italic;
}

.cw-grid {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 10px;
}

.cw-row {
  display: flex;
  gap: 2px;
}

.cw-cell {
  width: 32px;
  height: 32px;
  position: relative;
  background: #161616;
  border: 0.5px solid #2a2a2a;
  border-radius: 4px;
}

.cw-cell.cw-black {
  background: transparent;
  border-color: transparent;
}

.cw-num {
  position: absolute;
  top: 1px;
  left: 3px;
  font-size: 8px;
  color: #666;
  pointer-events: none;
  z-index: 1;
}

.cw-input {
  width: 100%;
  height: 100%;
  background: transparent;
  border: none;
  outline: none;
  text-align: center;
  font-family: 'SF Mono', Monaco, 'Courier New', monospace;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  caret-color: #28c840;
  user-select: text;
  -webkit-user-select: text;
  border-radius: 4px;
}

/* parola attiva evidenziata (nella direzione di compilazione) */
.cw-input.cw-hl {
  background: rgba(255,255,255,.05);
}

.cw-input:focus {
  background: rgba(255,255,255,.12);
}

/* stato risolto: celle verdi */
.cw-input.cw-solved {
  color: #28c840;
  animation: cw-solve .5s ease;
}

@keyframes cw-solve {
  0%   { background: rgba(40,200,64,.4); }
  100% { background: transparent; }
}

body.reduce-motion .cw-input.cw-solved { animation: none; }

.cw-msg {
  font-size: 11px;
  min-height: 14px;
  margin-bottom: 10px;
}

.cw-msg.cw-ok  { color: #28c840; }
.cw-msg.cw-err { color: #ff5f57; }

.cw-clues {
  display: flex;
  gap: 18px;
  text-align: left;
  border-top: 0.5px solid #1c1c1c;
  padding-top: 12px;
}

.cw-clues-col { flex: 1; }

.cw-clues-head {
  font-size: 9px;
  color: #555;
  letter-spacing: .15em;
  margin-bottom: 8px;
}

.cw-clue {
  font-size: 11px;
  color: #999;
  line-height: 1.5;
  margin-bottom: 6px;
}

.cw-clue b { color: #ccc; }

/* ─── GLITCH ALERT (avviso centrale durante il glitch) ─── */
.glitch-alert {
  position: fixed;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  z-index: 9100;              /* sopra il desk, sotto menu bar */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 26px 38px;
  background: rgba(8,8,8,.92);
  border: 0.5px solid #2a2a2a;
  border-radius: 14px;
  box-shadow: 0 24px 80px rgba(0,0,0,.8);
  pointer-events: none;       /* scenografia: non intercetta nulla */
  animation: ga-in .15s steps(2, jump-none),
             ga-shake .3s steps(2, jump-none) infinite;
}

@keyframes ga-in {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(1.15); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@keyframes ga-shake {
  0%, 100% { transform: translate(-50%, -50%); }
  25%      { transform: translate(calc(-50% - 3px), calc(-50% + 2px)); }
  50%      { transform: translate(calc(-50% + 3px), calc(-50% - 2px)); }
  75%      { transform: translate(calc(-50% - 2px), calc(-50% - 1px)); }
}

/* triangolo warning: grande, lampeggia con sdoppiamento rosso/ciano */
.ga-warn {
  position: relative;
  font-size: 52px;
  line-height: 1;
  color: #febc2e;
  animation: ga-blink .5s steps(2, jump-none) infinite;
}

.ga-warn::before,
.ga-warn::after {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 0;
}

.ga-warn::before { color: rgba(255,0,64,.8);  transform: translateX(-4px); }
.ga-warn::after  { color: rgba(0,255,249,.8); transform: translateX(4px); }

@keyframes ga-blink {
  0%, 100% { opacity: 1; }
  50%      { opacity: .25; }
}

/* titolo con sdoppiamento glitch */
.ga-title {
  position: relative;
  font-family: 'SF Mono', Monaco, 'Courier New', monospace;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .25em;
  color: #fff;
}

.ga-title::before,
.ga-title::after {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
}

.ga-title::before {
  color: rgba(255,0,64,.7);
  animation: ga-title-shift .28s steps(2, jump-none) infinite;
}

.ga-title::after {
  color: rgba(0,255,249,.7);
  animation: ga-title-shift .28s steps(2, jump-none) infinite reverse;
}

@keyframes ga-title-shift {
  0%, 100% { transform: translate(0,0); }
  50%      { transform: translate(3px,-1px); }
}

.ga-lines {
  font-family: 'SF Mono', Monaco, 'Courier New', monospace;
  font-size: 11px;
  color: #888;
  text-align: center;
  line-height: 1.8;
}

.ga-hex {
  color: #555;
  font-size: 10px;
  margin-top: 4px;
}

/* mobile: pannello più compatto */
@media (max-width: 768px) {
  .glitch-alert { padding: 20px 24px; width: min(300px, 84vw); }
  .ga-warn  { font-size: 44px; }
  .ga-title { font-size: 13px; letter-spacing: .18em; }
}

/* ─── MESSAGES APP ─── */
/* La finestra messaggi usa una colonna: contatto in alto, thread che
   scorre, barra di invio finta in fondo. Niente interazione: la barra
   è puramente scenografica. */
#w-message .wb.msg-wb {
  padding: 0;
  display: flex;
  flex-direction: column;
  height: 420px;
  max-height: 70vh;
}

.msg-contact {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 14px 16px 12px;
  border-bottom: 0.5px solid #1c1c1c;
  background: #0f0f0f;
}

.msg-contact-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #1a1a1a;
  border: 0.5px solid #333;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 600;
  color: #666;
  margin-bottom: 4px;
}

.msg-contact-name {
  font-size: 13px;
  font-weight: 600;
  color: #eee;
}

.msg-contact-status {
  font-size: 10px;
  color: #28c840;
  letter-spacing: .04em;
}

.msg-thread {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #0a0a0a;
}

.msg-day,
.msg-time {
  align-self: center;
  font-size: 10px;
  color: #555;
  letter-spacing: .05em;
  margin: 6px 0;
}

.msg-time { margin-top: 8px; }

.msg-bubble {
  max-width: 75%;
  padding: 9px 13px;
  font-size: 13px;
  line-height: 1.35;
  border-radius: 16px;
  word-wrap: break-word;
}

/* messaggi ricevuti (sinistra) */
.msg-bubble.in {
  align-self: flex-start;
  background: #1c1c1c;
  color: #e8e8e8;
  border-bottom-left-radius: 5px;
}

/* messaggi inviati (destra) */
.msg-bubble.out {
  align-self: flex-end;
  background: #fff;
  color: #000;
  border-bottom-right-radius: 5px;
}

/* barra di invio finta: visibile ma non interattiva */
.msg-inputbar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-top: 0.5px solid #1c1c1c;
  background: #0f0f0f;
  pointer-events: none;       /* nessun click/tap possibile */
  user-select: none;
}

.msg-input-fake {
  flex: 1;
  padding: 9px 14px;
  font-size: 13px;
  color: #555;
  background: #161616;
  border: 0.5px solid #2a2a2a;
  border-radius: 18px;
}

.msg-send {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #2a2a2a;
  color: #777;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ─── ICON CONTEXT MENU (mobile long-press) ─── */
.icon-context-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9400;
  background: transparent;
}

.icon-context-menu {
  position: fixed;
  z-index: 9500;
  width: 160px;
  background: #161616;
  border: 0.5px solid #333;
  border-radius: 10px;
  padding: 8px;
  box-shadow: 0 12px 32px rgba(0,0,0,.6);
}

.icon-context-title {
  font-size: 11px;
  color: #666;
  padding: 4px 8px 8px;
  border-bottom: 0.5px solid #222;
  margin-bottom: 4px;
}

.icon-context-btn {
  display: block;
  width: 100%;
  background: transparent;
  border: none;
  color: #eee;
  font-size: 13px;
  text-align: left;
  padding: 10px 8px;
  border-radius: 6px;
  cursor: pointer;
}

.icon-context-btn:active { background: rgba(255,255,255,.08); }


/* ─── DOCS ─── */
.doc-section { margin-bottom: 22px; }
.doc-section:last-child { margin-bottom: 0; }

.doc-title {
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  letter-spacing: .1em;
  margin-bottom: 8px;
}

.doc-text {
  font-size: 12px;
  color: #888;
  line-height: 1.7;
}

.doc-table {
  margin-top: 10px;
  border-top: 0.5px solid #222;
}

.doc-table div {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 0.5px solid #222;
  font-size: 12px;
  color: #aaa;
}

/* ─── SETTINGS ─── */
.settings-section { margin-bottom: 22px; }
.settings-section:last-child { margin-bottom: 0; }

.settings-label {
  font-size: 10px;
  color: #444;
  letter-spacing: .12em;
  margin-bottom: 10px;
}

.settings-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: #ccc;
  cursor: pointer;
}

.settings-toggle input[type=checkbox] {
  width: 16px;
  height: 16px;
  accent-color: #fff;
  cursor: pointer;
}

.settings-info {
  font-size: 11px;
  color: #555;
  line-height: 1.6;
}

/* ─── BROWSER ─── */
.browser-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  background: #161616;
  border-bottom: 0.5px solid #222;
}

.browser-nav-btn {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  background: transparent;
  border: 0.5px solid #333;
  border-radius: 6px;
  color: #aaa;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.browser-nav-btn:hover { color: #fff; border-color: #555; }

.browser-address {
  flex: 1;
  background: #0f0f0f;
  border: 0.5px solid #333;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 11px;
  color: #ccc;
  outline: none;
}

.browser-address:focus { border-color: #555; }

/* ─── BROWSER: barra di caricamento ─── */
.browser-loadbar {
  height: 2px;
  width: 0;
  background: #28c840;
  opacity: 0;
}

.browser-loadbar.loading {
  animation: browser-load .5s ease-out;
}

@keyframes browser-load {
  0%   { width: 0;    opacity: 1; }
  70%  { width: 80%;  opacity: 1; }
  100% { width: 100%; opacity: 0; }
}

/* ─── BROWSER: start page ─── */
.browser-home {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 0;
}

.bh-clock {
  font-family: 'SF Mono', Monaco, 'Courier New', monospace;
  font-size: 12px;
  color: #444;
  margin-bottom: 18px;
}

.bh-search {
  width: 100%;
  max-width: 320px;
  margin: 16px 0 22px;
}

.bh-search-input {
  width: 100%;
  background: #0a0a0a;
  border: 0.5px solid #333;
  border-radius: 20px;
  padding: 11px 18px;
  font-size: 13px;
  color: #fff;
  outline: none;
  text-align: center;
  user-select: text;
  -webkit-user-select: text;
}

.bh-search-input:focus { border-color: #666; }
.bh-search-input::placeholder { color: #444; }

.bh-tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  width: 100%;
  max-width: 320px;
}

.bh-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 8px;
  background: #111;
  border: 0.5px solid #222;
  border-radius: 12px;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .1s;
  font-size: 11px;
  color: #ccc;
}

.bh-tile:hover {
  background: #161616;
  border-color: #383838;
}

.bh-tile:active { transform: scale(.94); }

.bh-tile-ico {
  font-size: 20px;
  color: #cfd6dd;
  line-height: 1;
}

.bh-footer {
  margin-top: 24px;
  font-size: 10px;
  color: #333;
  letter-spacing: .15em;
  font-style: italic;
}

/* ─── BROWSER: News ─── */
.bh-news { display: flex; flex-direction: column; gap: 16px; }

.bh-news-item {
  border-left: 2px solid #28c840;
  padding-left: 12px;
}

.bh-news-date {
  font-family: 'SF Mono', Monaco, 'Courier New', monospace;
  font-size: 9px;
  color: #28c840;
  letter-spacing: .15em;
  margin-bottom: 4px;
}

.bh-news-title {
  font-size: 13px;
  font-weight: 600;
  color: #eee;
  margin-bottom: 3px;
}

.bh-news-text {
  font-size: 11px;
  color: #888;
  line-height: 1.6;
}

/* ─── BROWSER: 404 e void ─── */
.bh-404, .bh-void {
  text-align: center;
  padding: 30px 10px;
}

.bh-404-code {
  font-family: 'SF Mono', Monaco, 'Courier New', monospace;
  font-size: 52px;
  font-weight: 700;
  color: #222;
  letter-spacing: .1em;
}

.bh-404-text, .bh-void-text {
  font-size: 13px;
  color: #aaa;
  margin-top: 10px;
}

.bh-404-sub, .bh-void-sub {
  font-size: 11px;
  color: #555;
  margin-top: 6px;
  font-style: italic;
}

.bh-void-text { font-size: 16px; }

.browser-page {
  height: 280px;
  overflow-y: auto;
  padding: 20px;
  background: #0a0a0a;
}

.browser-home-logo {
  text-align: center;
  margin-bottom: 20px;
}

.browser-home-logo .mark {
  font-size: 26px;
  font-weight: 700;
  color: #fff;
  letter-spacing: .12em;
}

.browser-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.browser-link {
  font-size: 11px;
  color: #aaa;
  border: 0.5px solid #333;
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
}

.browser-link:hover { color: #fff; border-color: #555; }

.browser-page-title {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 10px;
}

.browser-page-text {
  font-size: 12px;
  color: #888;
  line-height: 1.7;
}

.browser-result {
  border-bottom: 0.5px solid #1c1c1c;
  padding: 10px 0;
  cursor: pointer;
}

.browser-result:hover .browser-result-title { color: #fff; }

.browser-result-title {
  font-size: 12px;
  color: #ccc;
  margin-bottom: 2px;
}

.browser-result-url {
  font-size: 10px;
  color: #555;
}

/* ─── GLITCH (automatico, a schermo intero) ─── */

#glitch-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  pointer-events: none;
  opacity: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(255,255,255,0.04) 0px,
    rgba(255,255,255,0.04) 1px,
    transparent 1px,
    transparent 3px
  );
}

#glitch-overlay.active {
  opacity: 1;
  animation: glitch-flicker .4s steps(2, jump-none) infinite;
}

@keyframes glitch-flicker {
  0%   { opacity: .85; }
  50%  { opacity: .35; }
  100% { opacity: .7; }
}

#desk.glitching {
  animation:
    glitch-shake .25s steps(2, jump-none) infinite,
    glitch-hue 1.2s linear infinite;
}

@keyframes glitch-shake {
  0%   { transform: translate(0, 0); }
  20%  { transform: translate(-3px, 1px); }
  40%  { transform: translate(2px, -2px); }
  60%  { transform: translate(-2px, 2px); }
  80%  { transform: translate(3px, -1px); }
  100% { transform: translate(0, 0); }
}

@keyframes glitch-hue {
  0%   { filter: hue-rotate(0deg) saturate(1); }
  25%  { filter: hue-rotate(60deg) saturate(1.5); }
  50%  { filter: hue-rotate(-40deg) saturate(2); }
  75%  { filter: hue-rotate(20deg) saturate(1.2); }
  100% { filter: hue-rotate(0deg) saturate(1); }
}

/* Respect the "reduce animations" preference: keep only the
   text effect, drop the screen shake/hue distortion. */
body.reduce-motion #desk.glitching {
  animation: none;
}

/* ─── DROP COUNTDOWN ─── */
.drop-countdown {
  position: fixed;
  top: 38px;                       /* subito sotto il menu bar (28px) */
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  z-index: 40;                     /* sotto le finestre aperte (z-index 60/70) */
  background: #0f0f0f;
  border: 0.5px solid #2a2a2a;
  border-radius: 12px;
  padding: 10px 20px;
  box-shadow: 0 12px 32px rgba(0,0,0,.6);
}

.drop-label {
  font-size: 10px;
  color: #555;
  letter-spacing: .15em;
  margin-bottom: 4px;
}

.drop-timer {
  font-family: 'SF Mono', Monaco, 'Courier New', monospace;
  font-size: 13px;
  color: #fff;
  letter-spacing: .05em;
}

/* ─── CALENDAR ─── */
#calendar-box {
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  color: #ddd;
  font-size: 12px;
}

.cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.cal-arrow {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  background: transparent;
  border: 0.5px solid #333;
  border-radius: 6px;
  color: #aaa;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color .15s, border-color .15s;
}

.cal-arrow:hover { color: #fff; border-color: #555; }

.cal-header {
  flex: 1;
  color: #aaa;
  font-size: 12px;
  text-align: center;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  font-size: 11px;
}

.cal-day {
  padding: 6px;
  text-align: center;
  border: 1px solid #222;
  border-radius: 4px;
  color: #888;
  background: transparent;
}

.cal-day.today {
  color: #000;
  background: #fff;
}

/* ═══════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════ */

/* ─── TABLET (max 900px) ─── */
@media (max-width: 900px) {
  .win { max-width: 92vw; }
  .folder-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ─── MOBILE (max 768px) ─── */
@media (max-width: 768px) {

  /* About / leggenda: più respiro su schermi stretti */
  .about-legend { padding-top: 0; margin-top: 6px; }

  /* cruciverba su mobile: celle compatte, la griglia da 9 colonne deve starci */
  .cw-cell { width: 30px; height: 30px; }
  .cw-input { font-size: 14px; }
  .cw-clues { flex-direction: column; gap: 10px; }
  .cw-clue { font-size: 12px; }

  /* regole numerate: più leggibili su mobile */
  .about-legend-rule { font-size: 13px; }
  .about-legend-num { width: 20px; height: 20px; font-size: 11px; }

  /* Fragment tracker su mobile: compatto, sotto la barra */
  .fragment-tracker {
    top: 50px;
    right: 10px;
    padding: 6px 10px;
    border-radius: 10px;
  }

  .ft-label { font-size: 8px; margin-bottom: 3px; }
  .ft-slot { font-size: 12px; min-width: 11px; }
  .ft-slots { gap: 5px; }

  .about-legend-list {
    max-width: 100%;          /* usa tutta la larghezza disponibile */
    gap: 10px;
  }

  .about-legend-item {
    font-size: 13px;          /* più leggibile col dito/occhio da mobile */
    align-items: flex-start;  /* pallino in alto se il testo va a capo */
  }

  .about-legend-dot { margin-top: 6px; }

  .about-legend-text { font-size: 13px; }
  .about-legend-hint { font-size: 12px; }

  /* pulsanti del terminale: più grandi per il dito */
  .term-hint {
    font-size: 12px;
    padding: 9px 14px;
  }

  /* App Note: una colonna alla volta. Di default la lista; quando si
     seleziona una nota, scivola al dettaglio con il bottone "indietro". */
  #w-notes .wb.notes-wb {
    position: relative;
    height: 70vh;
  }

  .notes-sidebar {
    flex: 1 1 auto;
    border-right: none;
  }

  .notes-main {
    position: absolute;
    inset: 0;
    transform: translateX(100%);    /* fuori schermo a destra */
    transition: transform .25s ease;
    background: #0a0a0a;
  }

  #w-notes.show-detail .notes-main {
    transform: translateX(0);        /* entra in vista */
  }

  .notes-back { display: block; }

  body.reduce-motion .notes-main { transition: none; }

  /* Menu bar */
  #mbar { height: 42px; padding: 0 12px; }
  .mitem { display: none; }
  .mbrand { font-size: 12px; }
  #clock { font-size: 11px; }

  /* Drop countdown: diventa una fascia statica sopra la griglia,
     niente più badge fluttuante che rischia di sovrapporsi alle icone */
  .drop-countdown {
    position: static;
    width: max-content;
    max-width: calc(100% - 24px);
    display: block;
    margin: 4px auto 12px;        /* auto = centrato orizzontalmente */
    text-align: center;
    padding: 8px 18px;
    transform: none;
    /* box nero compatto, non a tutta larghezza */
    background: #0f0f0f;
    border: 0.5px solid #2a2a2a;
    border-radius: 12px;
    box-shadow: none;
  }

  /* Desktop layout */
  #desk {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    padding-top: 60px;
    height: auto;
    min-height: 100vh;
  }

  /* Icons container: griglia fissa */
  #icons-container {
    position: static;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    justify-items: center;       /* centra ogni icona nella sua cella */
    gap: 12px;
    padding: 12px 12px 140px;
  }

  /* Icone: relative nel flusso */
  .ico {
    position: relative !important;
    left: auto !important;
    top: auto !important;
    width: 100%;                 /* riempie la cella così il testo si centra */
    max-width: 88px;
    align-items: center;
    padding: 10px;
    gap: 8px;
  }

  .ibox {
    width: 68px;
    height: 68px;
    border-radius: 16px;
  }

  .ibox img {
    width: 56px !important;
    height: 56px !important;
  }

  .ico span { font-size: 10px; }

  /* Windows */
  .win {
    width: calc(100vw - 20px) !important;
    min-width: unset;
    left: 10px !important;
    top: 70px !important;
    max-height: calc(100vh - 120px);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
  }

  .wh { height: 42px; padding: 0 12px; gap: 10px; flex-shrink: 0; }
  .dot { width: 22px; height: 22px; }

  .wb {
    padding: 14px;
    flex: 1 1 auto;            /* prende lo spazio disponibile ma cede al bottone */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    min-height: 0; /* needed for flex children to shrink correctly */
  }

  /* Dock */
  /* dock ancorato allo schermo: resta visibile qualunque sia
     il numero di icone (il desk mobile scrolla, il dock no) */
  #dock {
    position: fixed;
    bottom: 18px;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 22px;
  }
  .di { width: 52px; height: 52px; }
  .di img { width: 48px; height: 48px; }

  /* Folder */
  .folder-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }

  /* Calendar */
  .cal-day { width: 100%; height: 28px; font-size: 10px; }

  /* Notification */
  .notif { width: calc(100vw - 20px); right: 10px; }

  /* Browser: bottoni più grandi per il dito, area contenuto più bassa */
  .browser-nav-btn { width: 36px; height: 36px; font-size: 16px; }
  .browser-address { padding: 8px 10px; font-size: 12px; }
  .browser-page { height: 220px; }

  /* Volume slider: thumb più grande per il touch */
  .player-volume input[type=range]::-webkit-slider-thumb { width: 18px; height: 18px; }
  .player-volume input[type=range]::-moz-range-thumb { width: 18px; height: 18px; }
}

/* ─── SMALL MOBILE (max 480px) ─── */
@media (max-width: 480px) {

  #icons-container { grid-template-columns: repeat(3, 1fr); }

  .ibox { width: 60px; height: 60px; }
  .ibox img { width: 48px !important; height: 48px !important; }
  .ico { width: 74px; }
  .ico span { font-size: 9px; }

  .folder-grid { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: 1fr; }
  .gallery-grid img { max-height: 60vw; }

  .di { width: 46px; height: 46px; }
  .di img { width: 42px; height: 42px; }
}

/* ─────────────────────────────────────────
   SILENCE — SS25
   login.css  ·  schermata di accesso
   Da accodare a style.css (o linkato dopo)
   ───────────────────────────────────────── */

#login {
  position: fixed;
  inset: 0;
  z-index: 99998;              /* sopra tutto il resto */
  background: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  opacity: 1;
  transition: opacity .7s ease, transform .7s ease;
}

/* sfondo del desktop, sfocato e spento */
#login::before {
  content: "";
  position: absolute;
  inset: -40px;
  background: url("assets/bg.png") center/cover no-repeat;
  filter: blur(22px) brightness(.28) grayscale(.4);
  transform: scale(1.06);
  pointer-events: none;
}

#login::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(0,0,0,.25) 0%, rgba(0,0,0,.85) 100%);
  pointer-events: none;
}

#login.login-done {
  opacity: 0;
  transform: scale(1.04);
  pointer-events: none;
}

/* ─── orologio in alto ─── */
.login-clock {
  position: absolute;
  top: clamp(48px, 12vh, 110px);
  left: 0; right: 0;
  text-align: center;
  z-index: 2;
}

.login-time {
  font-size: clamp(46px, 9vw, 72px);
  font-weight: 200;
  color: #fff;
  letter-spacing: -.02em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.login-date {
  margin-top: 8px;
  font-size: 13px;
  color: #8a8a8a;
  letter-spacing: .04em;
}

/* ─── blocco account ─── */
.login-user {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: clamp(60px, 14vh, 120px);
}

.login-avatar {
  position: relative;
  width: 104px;
  height: 104px;
  border-radius: 50%;
  background: #141414;
  border: 0.5px solid rgba(255,255,255,.18);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-size: 40px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -.04em;
  box-shadow: 0 12px 48px rgba(0,0,0,.8);
}

.login-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.login-name {
  margin-top: 16px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  letter-spacing: .16em;
}

.login-role {
  margin-top: 4px;
  font-size: 11px;
  color: #6e6e6e;
  letter-spacing: .12em;
  text-transform: uppercase;
}

/* ─── campo password ─── */
.login-field {
  margin-top: 26px;
  width: 260px;
  height: 40px;
  padding: 0 8px 0 16px;
  border-radius: 20px;
  background: rgba(255,255,255,.07);
  backdrop-filter: blur(20px);
  border: 0.5px solid rgba(255,255,255,.14);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: border-color .3s ease, opacity .5s ease, background .3s ease;
}

.login-field.filled {
  border-color: rgba(255,255,255,.3);
}

.login-field.locked {
  opacity: .35;
}

.login-dots {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  height: 100%;
}

.login-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fff;
  flex-shrink: 0;
  animation: login-dot-in .18s ease-out backwards;
}

@keyframes login-dot-in {
  from { transform: scale(.2); opacity: 0; }
  to   { transform: scale(1);  opacity: 1; }
}

.login-ph {
  font-size: 13px;
  color: rgba(255,255,255,.35);
  letter-spacing: .02em;
}

.login-caret {
  width: 1px;
  height: 16px;
  background: #fff;
  animation: login-blink 1s step-end infinite;
}

@keyframes login-blink {
  0%, 49%   { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.login-go {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  color: #fff;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  opacity: .3;
  transition: opacity .3s ease, background .3s ease;
}

.login-field.filled .login-go {
  opacity: 1;
  background: rgba(255,255,255,.22);
}

/* ─── riga di stato (linguaggio del boot) ─── */
.login-status {
  position: relative;
  z-index: 2;
  margin-top: 20px;
  height: 18px;
  font-family: 'SF Mono', Monaco, 'Courier New', monospace;
  font-size: 12px;
  letter-spacing: .06em;
  color: #00ff41;
  opacity: 0;
  transition: opacity .25s ease;
}

.login-status.show { opacity: 1; }
.login-status.err  { color: #ff3b30; }

.login-spin {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 7px;
  border: 1.5px solid rgba(0,255,65,.25);
  border-top-color: #00ff41;
  border-radius: 50%;
  animation: login-spin .7s linear infinite;
  vertical-align: -1px;
}

@keyframes login-spin { to { transform: rotate(360deg); } }

/* ─── piè di pagina ─── */
.login-foot {
  position: absolute;
  bottom: 26px;
  left: 0; right: 0;
  text-align: center;
  z-index: 2;
  font-size: 10px;
  letter-spacing: .22em;
  color: #4a4a4a;
  text-transform: uppercase;
}

/* ─── accessibilità: riduci animazioni ─── */
body.reduce-motion #login { transition: opacity .2s ease; }
body.reduce-motion .login-caret,
body.reduce-motion .login-spin { animation: none; }
body.reduce-motion .login-dot  { animation: none; }
body.reduce-motion #login.login-done { transform: none; }

/* ─── mobile ─── */
@media (max-width: 768px) {
  .login-clock  { top: clamp(40px, 9vh, 80px); }
  .login-user   { margin-top: clamp(50px, 12vh, 90px); }
  .login-avatar { width: 88px; height: 88px; font-size: 34px; }
  .login-field  { width: 230px; }
}