/* App HB (/app): si aggiunge a style.css solo sulle pagine delle app e sull'overlay del timer. */

/* ---------- Griglia ---------- */
.apps-grid { list-style: none; margin: 28px 0 0; padding: 0; display: grid; gap: 16px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 980px) { .apps-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 600px) { .apps-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }
.apps-grid > li { display: flex; min-width: 0; }
.apps-tile {
  position: relative; flex: 1; display: flex; flex-direction: column; gap: 8px; min-width: 0;
  padding: 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line);
  color: var(--text); text-decoration: none; transition: transform .15s ease, border-color .15s ease;
}
.apps-tile::before {
  content: ""; position: absolute; left: 20px; right: 20px; top: -1px; height: 2px; border-radius: 2px;
  background: var(--brand); opacity: .8;
}
.apps-tile:hover, .apps-tile:focus-visible { transform: translateY(-2px); border-color: var(--violet); color: var(--text); }
.apps-tile--off { opacity: .72; }
.apps-tile--off::before { background: var(--line); }
.apps-tile__icon {
  display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px;
  background: var(--surface-2); color: var(--cyan); border: 1px solid var(--line);
}
.apps-icon { width: 30px; height: 30px; }
.apps-tile__name { font-family: var(--font-title); font-weight: 600; font-size: 1.05rem; line-height: 1.3; }
.apps-tile__desc { color: var(--muted); font-size: .92rem; line-height: 1.45; flex: 1; }
.apps-tile__tags { display: flex; flex-wrap: wrap; gap: 6px; }
.apps-badge { font-size: .78rem; }
.apps-badge--free { color: #7dffb0; border-color: rgba(125, 255, 176, .45); }
.apps-badge--member { color: #e9b3ff; border-color: rgba(214, 60, 240, .55); }
.apps-badge--soon { color: var(--muted); }
@media (max-width: 600px) {
  .apps-tile { padding: 14px; gap: 6px; }
  .apps-tile::before { left: 14px; right: 14px; }
  .apps-tile__icon { width: 44px; height: 44px; border-radius: 12px; }
  .apps-icon { width: 26px; height: 26px; }
  .apps-tile__name { font-size: .98rem; }
  .apps-tile__desc { font-size: .85rem; }
}
@media (prefers-reduced-motion: reduce) { .apps-tile, .apps-tile:hover { transition: none; transform: none; } }
.apps-foot { margin-top: 28px; }

/* ---------- Pagina di un'app ---------- */
/* .btn e i selettori hanno un display proprio: l'attributo hidden deve vincere */
.apps-panel [hidden], .apps-cols [hidden] { display: none !important; }
.apps-back { margin: 0 0 16px; }
.apps-back a { text-decoration: none; font-weight: 600; }
.apps-private {
  margin: 0 0 24px; padding: 12px 16px; border-radius: 12px;
  background: rgba(125, 255, 176, .07); border: 1px solid rgba(125, 255, 176, .4);
}
.apps-private--big { font-size: 1.05rem; padding: 16px 20px; }
.apps-cols { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); align-items: start; }
.apps-panel { padding: 22px; min-width: 0; }
.apps-panel h2 { font-size: 1.2rem; margin: 0 0 12px; }
.apps-form { display: grid; gap: 14px; }
.apps-form .field input { width: 100%; }
.apps-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.apps-form .apps-row { margin-bottom: 0; }
.apps-select { display: flex; gap: 8px; align-items: center; font-size: .92rem; color: var(--muted); min-width: 0; max-width: 100%; }
.apps-select select { min-width: 0; max-width: 16rem; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font: inherit; }
.apps-color { display: inline-flex; gap: 8px; align-items: center; font-size: .92rem; color: var(--muted); }
.apps-color input { width: 44px; height: 34px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); cursor: pointer; }
.apps-head-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 16px; }
.apps-head-row p { margin: 0; }
.apps-note { color: var(--muted); }
.apps-steps { padding-left: 1.3em; margin: 16px 0 8px; }
.apps-steps li { margin-bottom: .4em; }

/* anteprima bloccata */
.apps-locked { max-width: 44rem; }
.apps-locked__icon { margin-bottom: 16px; width: 64px; height: 64px; }
.apps-locked__icon .apps-icon { width: 38px; height: 38px; }
.apps-cta { margin-top: 24px; }
.apps-cta h2 { font-size: 1.25rem; margin: 0 0 8px; }
.apps-cta .btns { margin-top: 12px; }

/* ---------- Test webcam e microfono ---------- */
.apps-video { border-radius: 12px; overflow: hidden; background: #000; aspect-ratio: 16 / 9; margin-bottom: 14px; }
.apps-video video { width: 100%; height: 100%; object-fit: contain; display: block; }
.apps-facts { display: grid; gap: 8px; margin: 0 0 12px; }
.apps-facts > div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.apps-facts dt { color: var(--muted); }
.apps-facts dd { margin: 0; font-family: var(--font-title); font-weight: 600; font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 10px; }
.apps-meter { display: inline-block; width: 90px; height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.apps-meter span { display: block; height: 100%; width: 0; background: var(--brand); }
/* la scala colorata è fissa; la parte ancora vuota la copre lo span (larghezza = 100% − livello) */
.apps-vu { position: relative; height: 18px; border-radius: 999px; overflow: hidden; margin: 10px 0 14px;
  background: linear-gradient(90deg, #7dffb0 0%, #7dffb0 62%, #ffd25e 82%, #ff6b8b 100%); }
.apps-vu span { position: absolute; top: 0; right: 0; bottom: 0; width: 100%; background: var(--surface-2); }
.apps-vu i { position: absolute; top: 0; bottom: 0; width: 3px; left: 0; background: #fff; opacity: .85; }
.apps-tips { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.apps-tips li { padding: 10px 14px; border-radius: 10px; background: var(--surface-2); border-left: 3px solid var(--cyan); }
.apps-tips li.is-warn { border-left-color: #ffd25e; }
.apps-tips li.is-bad { border-left-color: #ff6b8b; }
.apps-tips li.is-ok { border-left-color: #7dffb0; }

/* ---------- Verso l'affiliazione ---------- */
.apps-goals { display: grid; gap: 14px; }
.apps-goal__head { display: flex; justify-content: space-between; gap: 10px; font-size: .95rem; }
.apps-goal__head strong { font-family: var(--font-title); font-weight: 600; }
.apps-goal__val { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.apps-goal__track { height: 12px; margin-top: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.apps-goal__fill { display: block; height: 100%; width: 0; border-radius: 999px; background: var(--brand); transition: width .25s ease; }
.apps-goal.is-done .apps-goal__fill { background: #7dffb0; }
.apps-goal.is-done .apps-goal__val { color: #7dffb0; }
.apps-verdict { font-family: var(--font-title); font-weight: 600; font-size: 1.1rem; margin: 18px 0 10px; }

/* ---------- Pannelli e programma ---------- */
.apps-canvas { display: grid; place-items: center; padding: 12px; border-radius: 10px; margin-bottom: 14px; }
.apps-canvas canvas { max-width: 100%; height: auto; display: block; border-radius: 6px; }
.apps-canvas--tall canvas { max-height: 70vh; width: auto; }
.apps-icons { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.apps-icons legend { font-family: var(--font-title); font-weight: 600; font-size: .95rem; margin-bottom: 6px; padding: 0; }
.apps-icon-pick { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; border: 1px solid var(--line); font-size: .88rem; cursor: pointer; }
.apps-icon-pick input { accent-color: var(--violet); margin: 0; }
.apps-icon-pick:has(input:checked) { border-color: var(--violet); background: var(--surface-2); }
.apps-week { display: grid; gap: 8px; }
.apps-day { display: grid; grid-template-columns: 8.5rem 8rem minmax(0, 1fr); gap: 8px; align-items: center; }
.apps-day input[type=time], .apps-day .pg-game {
  width: 100%; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font: inherit;
}
.apps-day .check { margin: 0; }
@media (max-width: 600px) {
  .apps-day { grid-template-columns: 1fr 8rem; }
  .apps-day .pg-game { grid-column: 1 / -1; }
}
.apps-tabs { margin-bottom: 12px; }

/* ---------- Chi raidare ---------- */
.apps-live { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.apps-live__item {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 16px; align-items: center;
  padding: 14px 16px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line);
}
.apps-live__item.is-me { border-color: var(--violet); }
.apps-live__item p { margin: 0; }
.apps-live__item .apps-live__title { margin-top: 4px; }
.apps-live__name { font-family: var(--font-title); font-weight: 600; font-size: 1.05rem; overflow-wrap: anywhere; }
.apps-live__meta { color: var(--muted); font-size: .9rem; overflow-wrap: anywhere; }
.apps-live__viewers { font-variant-numeric: tabular-nums; color: var(--text); font-weight: 600; }
.apps-live__dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #ff4f6d; margin-right: 6px; vertical-align: 1px; }
@media (max-width: 600px) { .apps-live__item { grid-template-columns: 1fr; } .apps-live__item .btn { justify-self: start; } }

/* ---------- Timer per OBS ---------- */
/* l'overlay non carica style.css: font e colori servono anche qui */
@font-face { font-family: "Poppins"; font-weight: 600; font-style: normal; font-display: swap; src: url("../fonts/poppins-600.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 700; font-style: normal; font-display: swap; src: url("../fonts/poppins-700.woff2") format("woff2"); }
.apps-timer-preview { padding: 24px; }
.obs-timer { text-align: center; color: #fff; font-family: "Poppins", "Segoe UI", system-ui, sans-serif; text-shadow: 0 2px 10px rgba(0, 0, 0, .6); }
.obs-timer__text { margin: 0 0 4px; font-weight: 600; font-size: 1.6rem; line-height: 1.2; }
.obs-timer__text:empty { display: none; }
.obs-timer__clock { margin: 0; font-weight: 700; font-size: 4.5rem; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.obs-body { background: transparent !important; min-height: 100vh; display: grid; place-items: center; margin: 0; overflow: hidden; }
.obs-body .obs-timer__text { font-size: 9vh; }
.obs-body .obs-timer__clock { font-size: 30vh; }
