/* ===================== DANIELE OS · STILE ===================== */
:root {
  --desk-1: #12a3a3;
  --desk-2: #008080;
  --desk-3: #006666;
  --face: #c0c0c0;
  --light: #dfdfdf;
  --hi: #ffffff;
  --shadow: #808080;
  --dark: #0a0a0a;
  --title-1: #000080;
  --title-2: #1084d0;
  --title-off-1: #808080;
  --title-off-2: #b5b5b5;
  --sel: #000080;
  --paper: #ffffff;
  --tip: #ffffe1;
  --term-green: #39ff14;
  --font-ui: Tahoma, Verdana, "Segoe UI", sans-serif;
  --font-pixel: "Press Start 2P", monospace;
  --font-term: "VT323", "Courier New", monospace;
  --taskbar-h: 38px;

  --raised: inset -1px -1px var(--dark), inset 1px 1px var(--hi), inset -2px -2px var(--shadow), inset 2px 2px var(--light);
  --sunken: inset -1px -1px var(--hi), inset 1px 1px var(--shadow), inset -2px -2px var(--light), inset 2px 2px var(--dark);
  --pressed: inset -1px -1px var(--hi), inset 1px 1px var(--dark), inset -2px -2px var(--light), inset 2px 2px var(--shadow);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.45;
  color: #000;
  background: var(--desk-2);
  overflow: hidden;
  -webkit-font-smoothing: none;
}
button { font: inherit; color: inherit; touch-action: manipulation; }
[hidden] { display: none !important; }
.pix { display: block; flex: none; }

.skip-link {
  position: absolute; left: 8px; top: -40px; z-index: 10000;
  background: var(--tip); padding: 6px 10px; border: 1px solid #000;
}
.skip-link:focus { top: 8px; }

/* ---------- Elementi base Win95 ---------- */
.btn {
  background: var(--face);
  border: 0;
  box-shadow: var(--raised);
  padding: 6px 16px;
  min-height: 30px;
  min-width: 80px;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  text-decoration: none; color: #000;
}
.btn:active { box-shadow: var(--pressed); padding: 7px 15px 5px 17px; }
.btn.default { box-shadow: 0 0 0 1px #000, var(--raised); }
.btn:focus-visible, .tb-btn:focus-visible, .task:focus-visible, .startbtn:focus-visible,
.fitem:focus-visible, .tab:focus-visible, .linkbtn:focus-visible, .lang button:focus-visible, .soundbtn:focus-visible {
  outline: 1px dotted #000; outline-offset: -5px;
}
.linkbtn {
  background: none; border: 0; padding: 2px 0; cursor: pointer;
  color: var(--sel); text-decoration: underline; font-weight: bold;
}
.field {
  background: var(--paper); border: 0; box-shadow: var(--sunken);
  padding: 7px 8px; font: inherit; width: 100%; color: #000;
}
.field:focus { outline: 1px dotted #000; outline-offset: -4px; }
.field[readonly] { background: var(--face); }
textarea.field { resize: vertical; min-height: 120px; }

/* ---------- Desktop ---------- */
.desktop {
  position: fixed; inset: 0 0 var(--taskbar-h) 0;
  background: radial-gradient(ellipse at 35% 25%, var(--desk-1) 0%, var(--desk-2) 55%, var(--desk-3) 100%);
  overflow: hidden;
}
.desktop.has-wall {
  background-color: #2a62bd;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.icons {
  position: absolute; top: 10px; left: 8px; bottom: 10px;
  display: grid; grid-auto-flow: column;
  grid-template-rows: repeat(auto-fill, 96px);
  grid-auto-columns: 96px;
  gap: 2px 6px;
  outline: none;
}
.dicon {
  background: none; border: 0; padding: 6px 2px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  color: #fff; cursor: pointer; text-align: center;
  font-size: 13px; line-height: 1.2;
}
.dicon .dlabel { padding: 1px 3px; text-shadow: 1px 1px 0 #000; }
.dicon:hover .dlabel { background: rgba(0, 0, 128, .55); }
.dicon:focus-visible { outline: none; }
.dicon:focus-visible .dlabel, .dicon.selected .dlabel {
  background: var(--sel); outline: 1px dotted #fff; text-shadow: none;
}
.dicon:focus-visible .pix, .dicon.selected .pix { filter: brightness(.75) sepia(1) hue-rotate(190deg) saturate(3); }

.copyright, .builtwith {
  position: absolute; right: 14px; bottom: 6px; margin: 0;
  color: rgba(255, 255, 255, .8); font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, .5);
}
.builtwith { right: auto; left: 14px; }

/* ---------- Popup ---------- */
.fact {
  position: absolute; top: 12px; right: 12px; width: 330px;
  background: var(--tip); border: 1px solid #000;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, .35);
  padding: 8px 10px 10px; font-size: 13px;
}
.fact-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.fact-title { color: var(--sel); font-size: 13px; }
.fact-text { margin: 4px 0 6px; }
.fact-close { background: transparent; box-shadow: none; }

.notice {
  position: absolute !important; right: 12px; bottom: 30px; width: 310px; z-index: 1;
}
.notice-body { padding: 10px 12px 12px; font-size: 13px; }
.notice-body p { margin: 0 0 4px; }
.notice-strong { font-weight: bold; margin-bottom: 12px !important; }

/* ---------- Finestre ---------- */
.windows { position: fixed; inset: 0 0 var(--taskbar-h) 0; pointer-events: none; isolation: isolate; z-index: 10; }
.window {
  position: absolute;
  background: var(--face);
  box-shadow: var(--raised), 3px 3px 0 rgba(0, 0, 0, .45);
  padding: 3px;
  display: flex; flex-direction: column;
  min-width: 280px; min-height: 160px;
  pointer-events: auto;
}
.windows .window { resize: both; overflow: hidden; }
.window.maximized { left: 0 !important; top: 0 !important; width: 100% !important; height: 100% !important; resize: none; box-shadow: var(--raised); }
.titlebar {
  display: flex; align-items: center; gap: 6px;
  height: 26px; padding: 0 3px 0 5px; flex: none;
  background: linear-gradient(90deg, var(--title-1), var(--title-2));
  color: #fff; user-select: none; touch-action: none;
}
.window:not(.active) .titlebar { background: linear-gradient(90deg, var(--title-off-1), var(--title-off-2)); color: #e8e8e8; }
.tb-icon { display: flex; }
.tb-title { flex: 1; margin: 0; font-size: 13px; font-weight: bold; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-btns { display: flex; gap: 2px; }
.tb-btn {
  width: 22px; height: 20px; padding: 0; border: 0;
  background: var(--face); box-shadow: var(--raised);
  display: grid; place-items: center; cursor: pointer;
}
.tb-btn:active { box-shadow: var(--pressed); }
.tb-btn[data-act="close"] { margin-left: 2px; }
.win-body { flex: 1; min-height: 0; display: flex; flex-direction: column; margin-top: 3px; overflow: hidden; }

.pane { background: var(--paper); box-shadow: var(--sunken); flex: 1; min-height: 0; overflow: auto; }
.pane.pad { padding: 14px 16px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 4px 2px 6px; }
.intro { margin: 0 0 6px; padding: 2px 4px; font-size: 13px; }
.statusbar { display: flex; gap: 3px; margin-top: 3px; font-size: 12px; flex: none; }
.statusbar span { box-shadow: var(--sunken); padding: 3px 8px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Griglia cartella */
.fgrid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 10px 6px; padding: 14px 10px; align-content: start;
}
.fitem {
  background: none; border: 0; padding: 6px 4px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-size: 13px; line-height: 1.25; text-align: center; overflow-wrap: anywhere;
}
.fitem .flabel { padding: 1px 3px; }
.fitem:hover .flabel, .fitem:focus-visible .flabel { background: var(--sel); color: #fff; }


/* Widget contatore */
.widget { display: flex; align-items: center; gap: 14px; padding: 8px 10px; margin-bottom: 6px; box-shadow: var(--raised); flex-wrap: wrap; }
.counter {
  font-family: var(--font-term); font-size: 40px; line-height: 1;
  color: var(--term-green); background: #000; padding: 6px 14px 4px;
  box-shadow: var(--sunken); letter-spacing: 2px; font-variant-numeric: tabular-nums;
}
.widget-label { font-weight: bold; }
.widget-note { font-size: 12px; margin: 2px 0 0; max-width: 420px; }

/* Documento / dettaglio */
.doc h3 { margin: 0 0 2px; font-size: 18px; }
.doc .meta { margin: 0 0 12px; color: #333; font-size: 13px; }
.doc h4 { margin: 16px 0 4px; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--sel); }
.doc p { margin: 0 0 8px; max-width: 68ch; }

/* Media player */
.media {
  aspect-ratio: 16 / 9; width: 100%; background: #000; flex: none;
  box-shadow: var(--sunken); display: grid; place-items: center; overflow: hidden; position: relative;
}
.media iframe, .media video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
/* YouTube disegnato grande e rimpicciolito (js/youtube-hd.js): misure e scala sono impostate dallo script */
.yt-hd { transform-origin: 0 0; }
.media-ph { text-align: center; color: #c0c0c0; font-family: var(--font-term); font-size: 26px; letter-spacing: 2px; }
.media-ph .pix { margin: 0 auto 8px; }
.noise {
  position: absolute; inset: 0; opacity: .12; pointer-events: none;
  background-image: repeating-linear-gradient(0deg, #fff 0 1px, transparent 1px 3px);
}
.viewer-info { padding: 12px 4px 4px; overflow: auto; }
.viewer-scroll { flex: 1; min-height: 0; overflow: auto; }
.viewer-scroll .viewer-info { overflow: visible; padding: 12px 8px 12px; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-top: 8px; }
.thumb { background: none; border: 0; padding: 4px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 13px; text-align: center; }
.thumb-frame { width: 100%; aspect-ratio: 4 / 3; background: var(--paper); box-shadow: var(--sunken); padding: 5px; display: grid; place-items: center; overflow: hidden; }
.thumb-frame img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.thumb-frame.missing img, .imgview.missing img { display: none; }
.thumb-frame.missing::after, .imgview.missing::after { content: attr(data-missing); font-family: var(--font-term); font-size: 20px; color: var(--shadow); letter-spacing: 1px; }
.thumb .flabel { padding: 1px 3px; }
.thumb:hover .flabel, .thumb:focus-visible .flabel { background: var(--sel); color: #fff; }
.thumb:focus-visible { outline: none; }
.imgview { flex: 1; min-height: 0; background: var(--shadow); box-shadow: var(--sunken); display: grid; place-items: center; overflow: auto; padding: 12px; }
.imgview img { max-width: 100%; max-height: 100%; object-fit: contain; background: var(--paper); box-shadow: 3px 3px 0 #000; }
.imgview.missing::after { color: var(--light); }
/* post: ogni immagine riempie il visualizzatore, piccola o grande che sia */
.imgview.fit { grid-template: minmax(0, 1fr) / minmax(0, 1fr); overflow: hidden; }
.imgview.fit img { width: 100%; height: 100%; max-width: none; max-height: none; object-fit: contain; background: none; box-shadow: none; filter: drop-shadow(3px 3px 0 #000); }
.btn[disabled] { color: var(--shadow); text-shadow: 1px 1px 0 var(--hi); cursor: default; }

/* Tab (Proprietà del sistema) */
.tabs { display: flex; padding: 6px 6px 0; gap: 0; flex: none; }
.tab {
  background: var(--face); border: 0; cursor: pointer; padding: 5px 12px;
  box-shadow: inset 1px 1px var(--hi), inset -1px 0 var(--dark), inset -2px 0 var(--shadow);
  border-radius: 3px 3px 0 0; position: relative; top: 2px;
}
.tab[aria-selected="true"] { top: 0; padding-bottom: 8px; z-index: 1; font-weight: bold; }
.tabpanel { flex: 1; min-height: 0; overflow: auto; margin: 0 6px 6px; padding: 16px; box-shadow: var(--raised); }
.sys { display: grid; grid-template-columns: 150px 1fr; gap: 18px; align-items: start; }
.avatar {
  width: 150px; aspect-ratio: 1; background: var(--desk-2); box-shadow: var(--sunken);
  display: grid; place-items: center; color: #fff; font-family: var(--font-pixel); font-size: 12px;
  overflow: hidden; padding: 3px;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sys h3 { margin: 0 0 2px; font-size: 16px; }
.sys dl { margin: 12px 0 0; display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; font-size: 13px; }
.sys dt { color: #333; }
.sys dd { margin: 0; font-weight: bold; }
.bio { margin: 16px 0 0; max-width: 68ch; }
.tree, .tree ul { list-style: none; margin: 0; padding: 0; }
.tree ul { margin-left: 14px; padding-left: 14px; border-left: 1px dotted #000; }
.tree li { padding: 3px 0; display: block; }
.tree .node { display: flex; align-items: center; gap: 6px; font-weight: bold; }
.tree .leaf { display: flex; align-items: center; gap: 6px; }
.tree .leaf::before { content: ""; width: 10px; border-top: 1px dotted #000; }
.tree-box { background: var(--paper); box-shadow: var(--sunken); padding: 10px 12px; }

/* Curriculum stile WordPad */
.cv-wrap { background: var(--shadow); box-shadow: var(--sunken); flex: 1; overflow: auto; padding: 14px; }
.page { background: var(--paper); max-width: 660px; margin: 0 auto; padding: 34px 38px; box-shadow: 3px 3px 0 #3a3a3a; }
.page h1 { font-size: 22px; margin: 0; letter-spacing: .02em; }
.page .role { margin: 2px 0 4px; font-weight: bold; color: var(--sel); }
.page .contacts { margin: 0 0 16px; font-size: 13px; color: #333; }
.page h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; border-bottom: 2px solid #000; padding-bottom: 2px; margin: 20px 0 10px; }
.job { margin-bottom: 14px; }
.job-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-weight: bold; }
.job-head span:last-child { font-weight: normal; color: #333; white-space: nowrap; }
.job p { margin: 2px 0 4px; }
.job ul { margin: 0; padding-left: 20px; }
.job li { margin-bottom: 2px; }

/* Musica stile Winamp */
.player { background: #23232f; box-shadow: var(--sunken); padding: 10px; color: var(--term-green); display: flex; flex-direction: column; gap: 8px; flex: 1; min-height: 0; overflow-y: auto; }
.player > * { flex-shrink: 0; } /* se lo spazio non basta si scorre, senza schiacciare le parti */
.lcd { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; background: #000; padding: 8px; box-shadow: var(--sunken); }
.lcd-left { display: flex; align-items: center; gap: 8px; }
.lcd-state { font-family: var(--font-term); font-size: 22px; line-height: 1; width: 22px; text-align: center; }
.lcd-time { font-family: var(--font-term); font-size: 34px; line-height: 1; font-variant-numeric: tabular-nums; }
/* "monitor" con il video originale di YouTube (almeno 200 px di altezza, come chiede YouTube) */
.mp-screen { position: relative; background: #000; box-shadow: var(--sunken); padding: 3px; flex: none; }
.mp-screen iframe, .mp-video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; min-height: 200px; border: 0; }
.mp-screen[data-msg]::after {
  content: attr(data-msg); position: absolute; inset: 3px; display: grid; place-items: center; padding: 16px;
  text-align: center; font-family: var(--font-term); font-size: 20px; color: var(--term-green); background: #000;
}
.mp-seek { display: flex; align-items: center; gap: 8px; font-family: var(--font-term); font-size: 18px; }
.mp-seek input { flex: 1; min-width: 0; accent-color: var(--term-green); }
.lcd canvas { width: 100%; height: 36px; display: block; image-rendering: pixelated; }
.marquee { overflow: hidden; white-space: nowrap; background: #000; padding: 4px 8px; font-family: var(--font-term); font-size: 20px; box-shadow: var(--sunken); }
.marquee span { display: inline-block; padding-left: 100%; animation: marquee 12s linear infinite; }
.marquee.paused span { animation: none; padding-left: 0; }
@keyframes marquee { to { transform: translateX(-100%); } }
.controls { display: flex; gap: 3px; align-items: center; }
.controls .tb-btn { width: 34px; height: 26px; }
.controls label { margin-left: auto; display: flex; align-items: center; gap: 6px; color: #c0c0c0; font-size: 12px; }
.controls input[type="range"] { width: 90px; accent-color: var(--term-green); }
.playlist { list-style: none; margin: 0; padding: 2px 0; background: #000; box-shadow: var(--sunken); font-family: var(--font-term); font-size: 19px; flex: none; }
.playlist button { width: 100%; text-align: left; background: none; border: 0; color: var(--term-green); padding: 1px 8px; cursor: pointer; }
.playlist button[aria-current="true"] { background: #1c3fa8; color: #fff; }
.playlist button:focus-visible { outline: 1px dotted var(--term-green); outline-offset: -2px; }


/* Digital Marketing: esplora risorse */
.explorer { flex: 1; min-height: 0; display: grid; grid-template-columns: 220px 1fr; gap: 3px; }
.ex-tree { background: var(--paper); box-shadow: var(--sunken); overflow: auto; padding: 6px 4px; display: flex; flex-direction: column; gap: 1px; }
.ex-folder { display: flex; align-items: center; gap: 6px; background: none; border: 0; padding: 4px 6px; text-align: left; cursor: pointer; font-size: 13px; color: #000; }
.ex-folder span { padding: 1px 3px; }
.ex-folder[aria-current="true"] span { background: var(--sel); color: #fff; }
.ex-folder:hover span { text-decoration: underline; }
.ex-folder:focus-visible { outline: none; }
.ex-folder:focus-visible span { outline: 1px dotted #000; }
.ex-main { overflow: auto; }
.ex-head { padding: 10px 14px 0; }
.ex-head h3 { margin: 0; font-size: 15px; }
.ex-head p { margin: 2px 0 6px; font-size: 12px; color: #333; }
.mgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px 12px; padding: 10px 14px 16px; }
.mitem { background: none; border: 0; padding: 4px; cursor: pointer; display: flex; flex-direction: column; gap: 6px; font-size: 13px; line-height: 1.3; text-align: center; }
.mitem .flabel { padding: 1px 3px; align-self: center; }
.mitem:hover .flabel, .mitem:focus-visible .flabel { background: var(--sel); color: #fff; }
.mitem:focus-visible { outline: none; }
.mthumb { position: relative; aspect-ratio: 16 / 9; background: var(--desk-2); box-shadow: var(--sunken); display: grid; place-items: center; overflow: hidden; }
.mitem.is-post .mthumb { aspect-ratio: 1; background: var(--paper); }
.mthumb img { position: absolute; inset: 3px; width: calc(100% - 6px); height: calc(100% - 6px); object-fit: cover; }
.mthumb-ph { position: relative; }
.mplay { position: relative; z-index: 1; width: 34px; height: 26px; background: var(--face); box-shadow: var(--raised); display: grid; place-items: center; }
.mitem:hover .mplay { background: var(--light); }

/* Carosello dei post statici: un post per volta, sempre nella stessa cornice centrata */
.carousel { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 6px 10px 12px; }
.car-arrow, .car-arrow:active { min-width: 0; width: 30px; height: 72px; padding: 0; }
.car-arrow:active .pix { transform: translate(1px, 1px); }
.car-arrow[disabled] .pix { opacity: .35; }
.car-view { min-width: 0; }
.car-track {
  display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
  scrollbar-width: none; padding: 4px 0 6px;
}
.car-track::-webkit-scrollbar { display: none; }
.car-track:focus-visible { outline: 1px dotted #000; outline-offset: 2px; }
.car-slide {
  flex: 0 0 100%; scroll-snap-align: start; background: none; border: 0; padding: 0; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 13px; line-height: 1.3; text-align: center; color: #000;
}
.car-frame {
  width: min(100%, 320px); aspect-ratio: 4 / 5; background: var(--paper); box-shadow: var(--sunken); padding: 6px;
  /* riga e colonna di misura fissa: l'immagine prende l'altezza della cornice e i post più alti si vedono interi */
  display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); place-items: center; overflow: hidden;
}
.car-frame img { width: 100%; height: 100%; object-fit: contain; }
.car-slide .flabel { padding: 1px 3px; align-self: center; }
.car-slide:hover .flabel, .car-slide:focus-visible .flabel { background: var(--sel); color: #fff; }
.car-slide:focus-visible { outline: none; }
.car-count { grid-column: 1 / -1; margin: 0; text-align: center; font-size: 12px; font-variant-numeric: tabular-nums; }
.media.vertical { aspect-ratio: 9 / 16; width: min(100%, 340px); margin: 0 auto; }
.media-link { position: absolute; inset: 0; display: grid; place-items: center; text-decoration: none; color: #000; }
.media-link img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.media-link-cta { position: relative; display: flex; align-items: center; gap: 8px; background: var(--face); box-shadow: var(--raised); padding: 9px 16px; font-weight: bold; }
.media-link:hover .media-link-cta { background: var(--light); }
.media-link:focus-visible .media-link-cta { outline: 1px dotted #000; outline-offset: -5px; }
/* post esterni (LinkedIn): l'anteprima occupa tutto il riquadro, niente bande nere, pulsante in basso */
.media.is-post { aspect-ratio: auto; width: min(100%, 420px); margin: 0 auto; display: block; background: #fff; }
.media.is-post .media-link { position: relative; display: block; }
.media.is-post .media-link img { position: static; display: block; width: 100%; height: auto; background: none; }
.media.is-post .media-link-cta { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); white-space: nowrap; }

/* Snake (telefono anni '90) */
.nokia {
  flex: 1; min-height: 0; overflow: auto;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: 16px 12px; background: linear-gradient(160deg, #3b5078, #1d2a44);
  box-shadow: var(--sunken);
}
.nokia-screen {
  position: relative; width: 100%; max-width: 330px; padding: 8px 10px 10px;
  background: #c7f0d8; border-radius: 8px;
  box-shadow: 0 0 0 4px #121b2c, inset 2px 2px 6px rgba(0, 0, 0, .25);
}
.nokia-screen canvas { display: block; width: 100%; height: auto; image-rendering: pixelated; cursor: pointer; }
.snake-hud { display: flex; justify-content: space-between; font-family: var(--font-term); font-size: 20px; line-height: 1; color: #43523d; margin-bottom: 6px; font-variant-numeric: tabular-nums; }
.snake-msg {
  position: absolute; left: 18px; right: 18px; top: 50%; transform: translateY(-30%);
  margin: 0; padding: 4px 6px; text-align: center;
  font-family: var(--font-term); font-size: 21px; line-height: 1.1; color: #43523d;
  background: #c7f0d8; border: 2px solid #43523d;
}
.keypad { display: grid; grid-template-columns: repeat(3, 66px); grid-template-areas: ". up ." "left ok right" ". down ."; gap: 8px; }
.keypad button {
  height: 46px; border: 0; border-radius: 12px; cursor: pointer;
  background: linear-gradient(#f1f4f7, #b7c2cc); color: #1d2a44;
  box-shadow: 0 3px 0 #0b1322, inset 0 1px 0 #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  font-weight: bold; font-size: 16px; line-height: 1;
}
.keypad button small { font-size: 10px; color: #4a5a6a; }
.keypad button[data-k="ok"] { background: linear-gradient(#cfe9ff, #8fb4d6); }
.keypad button:active { transform: translateY(3px); box-shadow: 0 0 0 #0b1322, inset 0 1px 0 #fff; }
.keypad button:focus-visible { outline: 2px dotted #fff; outline-offset: 2px; }
.snake-hint { margin: 0; max-width: 330px; text-align: center; color: #dfe6ef; font-size: 12px; }
.snake-motto { margin: 0; max-width: 330px; text-align: center; color: #fff; font-size: 13px; font-style: italic; }

/* Contatti */
.mailform { display: grid; grid-template-columns: 80px 1fr; gap: 8px 10px; align-items: center; padding: 12px; }
.mailform label { text-align: right; }
.mailform .full { grid-column: 1 / -1; }
.mailform .span2 { grid-column: 2; }
.mail-note { font-size: 12px; margin: 0; }
.mail-links { display: flex; gap: 8px; flex-wrap: wrap; }

/* Dialog */
.dialogs { position: fixed; inset: 0; z-index: 8000; pointer-events: none; }
.dialogs:has(.window) { pointer-events: auto; background: rgba(0, 0, 0, .15); }
.dialog { left: 50%; top: 42%; transform: translate(-50%, -50%); width: min(420px, calc(100% - 24px)); min-height: 0; }
.dialog-body { display: flex; gap: 14px; padding: 16px 14px 10px; align-items: flex-start; }
.dialog-body p { margin: 4px 0 0; }
.dialog-btns { display: flex; justify-content: center; gap: 8px; padding: 6px 0 12px; }

/* ---------- Taskbar ---------- */
.taskbar {
  position: fixed; left: 0; right: 0; bottom: 0; height: var(--taskbar-h); z-index: 6000;
  background: var(--face); box-shadow: inset 0 1px var(--light), inset 0 2px var(--hi);
  display: flex; align-items: center; gap: 4px; padding: 4px 4px 3px;
}
.startbtn {
  height: 100%; padding: 0 10px 0 6px; border: 0; background: var(--face); box-shadow: var(--raised);
  display: flex; align-items: center; gap: 6px; cursor: pointer;
  font-family: var(--font-pixel); font-size: 11px; color: var(--sel);
}
.startbtn[aria-expanded="true"] { box-shadow: var(--pressed); }
.tasks { flex: 1; min-width: 0; display: flex; gap: 3px; height: 100%; }
.task {
  flex: 0 1 180px; min-width: 0; height: 100%; border: 0; background: var(--face); box-shadow: var(--raised);
  display: flex; align-items: center; gap: 6px; padding: 0 8px; cursor: pointer; font-size: 12px;
}
.task span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task.active {
  box-shadow: var(--pressed); font-weight: bold;
  background: repeating-conic-gradient(var(--hi) 0 25%, var(--face) 0 50%) 0 0 / 2px 2px;
}
.tray { height: 100%; display: flex; align-items: center; gap: 4px; padding: 0 8px 0 4px; box-shadow: var(--sunken); font-size: 12px; }
.lang { display: flex; }
.lang button { background: none; border: 0; padding: 4px 5px; cursor: pointer; color: #444; }
.lang button[aria-pressed="true"] { color: #000; font-weight: bold; text-decoration: underline; }
.soundbtn { background: none; border: 0; padding: 4px; cursor: pointer; display: grid; place-items: center; }
.clock { padding-left: 4px; font-variant-numeric: tabular-nums; }

/* ---------- Menu Start ---------- */
.startmenu {
  position: fixed; left: 2px; bottom: calc(var(--taskbar-h) - 2px); z-index: 7000;
  width: 270px; background: var(--face); box-shadow: var(--raised), 2px 2px 0 rgba(0, 0, 0, .4);
  display: flex; padding: 3px;
}
.start-side {
  width: 32px; background: linear-gradient(0deg, var(--title-1), var(--title-2));
  color: #fff; writing-mode: vertical-rl; transform: rotate(180deg);
  font-family: var(--font-pixel); font-size: 12px; padding: 10px 7px; display: flex; gap: 6px; align-items: center;
}
.start-side span { color: #c0c0c0; }
.start-items { flex: 1; padding: 2px 0; }
.smi {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: none; border: 0; padding: 6px 12px 6px 8px; cursor: pointer; text-align: left; color: #000; text-decoration: none;
}
.smi:hover, .smi:focus-visible { background: var(--sel); color: #fff; outline: none; }
.start-sep { height: 0; margin: 3px 4px; border-top: 1px solid var(--shadow); border-bottom: 1px solid var(--hi); }

/* ---------- Avvio e spegnimento ---------- */
.boot {
  position: fixed; inset: 0; z-index: 9000; background: #000; color: #c0c0c0;
  font-family: var(--font-term); font-size: 22px; padding: 24px 28px; cursor: pointer;
}
.boot-bios p { margin: 0; }
.boot-logo { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px; text-align: center; }
.boot-name { font-family: var(--font-pixel); font-size: 26px; color: #fff; margin: 12px 0 0; }
.boot-edition { margin: 0; color: #c0c0c0; }
.boot-bar { width: 240px; height: 22px; box-shadow: var(--sunken); background: var(--face); padding: 4px; margin-top: 14px; }
.boot-bar span {
  display: block; height: 100%; width: 0;
  background: repeating-linear-gradient(90deg, var(--sel) 0 10px, transparent 10px 12px);
  transition: width 1.1s steps(12);
}
.boot-skip { position: absolute; left: 0; right: 0; bottom: 20px; text-align: center; margin: 0; color: #808080; font-size: 18px; }
.shutdown {
  position: fixed; inset: 0; z-index: 9000; background: #000; color: #ff8a00;
  display: grid; place-content: center; text-align: center; cursor: pointer; padding: 24px;
  font-family: var(--font-term); font-size: 34px;
}
.shutdown p { margin: 0; }
.shutdown-hint { color: #808080; font-size: 20px; margin-top: 16px !important; }

/* ---------- Telefono (verticale) ---------- */
@media (max-width: 767px) {
  :root { --taskbar-h: 50px; }
  body { font-size: 15px; }
  .desktop { overflow-y: auto; }
  .icons {
    position: static; grid-auto-flow: row; grid-template-rows: none; grid-auto-columns: auto;
    grid-template-columns: repeat(4, 1fr); gap: 14px 4px; padding: 18px 8px 200px;
  }
  .dicon { font-size: 13px; }
  .fact { display: none; }
  .notice { left: 12px; right: 12px !important; width: auto; bottom: 12px; }
  .copyright, .builtwith { display: none; }
  .windows .window {
    left: 0 !important; top: 0 !important; width: 100% !important; height: 100% !important;
    resize: none; box-shadow: var(--raised);
  }
  .tb-max { display: none !important; }
  .titlebar { height: 40px; }
  .tb-title { font-size: 15px; }
  .tb-btn { width: 38px; height: 32px; }
  .task { flex-basis: 110px; }
  .task span { display: none; }
  .task { flex: 0 0 44px; justify-content: center; }
  .startbtn { font-size: 10px; }
  .startmenu { width: min(320px, calc(100% - 8px)); }
  .smi { padding: 10px 12px 10px 8px; }
  .lang button { padding: 8px 6px; }
  .sys { grid-template-columns: 1fr; }
  .avatar { width: 120px; }
  .page { padding: 22px 18px; }
  .mailform { grid-template-columns: 1fr; }
  .mailform label { text-align: left; }
  .mailform .span2 { grid-column: 1; }
  .explorer { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .ex-tree { flex-direction: row; overflow-x: auto; padding: 4px; }
  .ex-folder { white-space: nowrap; padding: 8px 6px; }
  .mgrid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); padding: 10px; }
  .dialog { top: 40%; }
  .fgrid { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  .marquee span { animation: none; padding-left: 0; }
  .boot-bar span { transition: none; }
}
