:root {
  --sfondo: #0b1020;
  --sfondo-2: #121a33;
  --carta: #161f3d;
  --bordo: #26315a;
  --testo: #eef1fb;
  --testo-2: #a3abc9;
  --online: #3ddc84;
  --offline: #ff5c5c;
  --attesa: #f5b942;
  --raggio: 18px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  min-height: 100vh;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--testo);
  background:
    radial-gradient(1200px 600px at 10% -10%, #2a1f6b55, transparent 60%),
    radial-gradient(900px 500px at 110% 10%, #0f6b6b44, transparent 60%),
    var(--sfondo);
  background-attachment: fixed;
  padding: max(24px, env(safe-area-inset-top)) 16px 32px;
}

.testata, main, .piede { max-width: 1040px; margin: 0 auto; }

.testata {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}

.logo {
  width: 56px;
  height: 56px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 16px;
  font-weight: 900;
  font-size: 30px;
  background: linear-gradient(135deg, #7c5cff, #22b8a7);
  box-shadow: 0 8px 24px #7c5cff55;
}

h1 { margin: 0; font-size: 28px; letter-spacing: .5px; }

.titoli { flex: 1; min-width: 0; }

.bottone.account { flex: none; }

.sottotitolo { margin: 2px 0 0; color: var(--testo-2); }

.griglia {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 16px;
}

.app {
  --colore: #7c5cff;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  border-radius: var(--raggio);
  background: linear-gradient(180deg, var(--sfondo-2), var(--carta));
  border: 1px solid var(--bordo);
  overflow: hidden;
  transition: transform .15s ease, border-color .15s ease;
}

.app::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: var(--colore);
}

.app:hover { transform: translateY(-2px); border-color: var(--colore); }

.app.spenta { opacity: .6; }
.app.spenta:hover { transform: none; border-color: var(--bordo); }

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

.icona {
  width: 48px;
  height: 48px;
  flex: none;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 22px;
  background: var(--colore);
  overflow: hidden;
}

.icona img { width: 100%; height: 100%; object-fit: cover; }

.nome { margin: 0; font-size: 20px; }

.stato {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--testo-2);
}

.punto {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--attesa);
}

.stato.online .punto { background: var(--online); box-shadow: 0 0 8px var(--online); }
.stato.offline .punto { background: var(--offline); }
.stato.neutro .punto { background: var(--testo-2); }

.descrizione { margin: 0; color: var(--testo-2); line-height: 1.45; flex: 1; }

.azioni { display: flex; flex-wrap: wrap; gap: 8px; }

.bottone {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  color: var(--testo);
  background: #ffffff10;
  border: 1px solid var(--bordo);
}

.bottone:hover { background: #ffffff1c; }

.bottone.principale {
  background: var(--colore);
  border-color: transparent;
  color: #fff;
}

.bottone.principale:hover { filter: brightness(1.1); }

.bottone:focus-visible { outline: 2px solid var(--testo); outline-offset: 2px; }

.nota { font-size: 13px; color: var(--testo-2); }

.piede {
  margin-top: 28px;
  text-align: center;
  font-size: 13px;
  color: var(--testo-2);
}

@media (max-width: 480px) {
  h1 { font-size: 24px; }
  .testata { flex-wrap: wrap; }
  .bottone.account { width: 100%; }
  .griglia { grid-template-columns: 1fr; }
}

.legale { margin-top: 8px; }
.legale a { color: var(--testo-2); }
