/* PWR design system — condiviso da launcher desktop, store web e pannello admin */
:root {
  --bg: #07090c;
  --bg-2: #0b0d11;
  --sidebar: #0a0c10;
  --panel: #0d1014;
  --panel-2: #11151a;
  --elev: #151920;
  --line: #1c2027;
  --line-2: #262b33;
  --line-3: #343a44;
  --text: #eceef1;
  --text-2: #b7bcc4;
  --muted: #7d838c;
  --dim: #565c66;
  --accent: #4cc2ff;
  --accent-2: #1e9be0;
  --accent-soft: rgba(76, 194, 255, 0.12);
  --green: #34d27b;
  --green-soft: rgba(52, 210, 123, 0.12);
  --amber: #f5b84a;
  --amber-soft: rgba(245, 184, 74, 0.12);
  --red: #ff5d5d;
  --red-soft: rgba(255, 93, 93, 0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --mono: 'JetBrains Mono', 'Cascadia Code', Consolas, ui-monospace, monospace;
  --sans: 'Inter', 'Segoe UI Variable', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --titlebar: 38px;
  --sidebar-w: 216px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 13px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
::selection { background: rgba(76, 194, 255, 0.3); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #1f242c; border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #2b313a; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- Shell ---------- */
.app { display: grid; grid-template-rows: var(--titlebar) 1fr; height: 100vh; }
.app.web { grid-template-rows: minmax(0, 1fr); }
.titlebar {
  display: flex; align-items: center; gap: 10px; padding-left: 16px;
  border-bottom: 1px solid var(--line); background: var(--bg);
  -webkit-app-region: drag; user-select: none;
}
.app.web .titlebar { display: none; }
.titlebar .tb-brand { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 12px; }
.titlebar .tb-sep { width: 1px; height: 12px; background: var(--line-2); margin: 0 6px; }
.titlebar .tb-sub { font-size: 10px; letter-spacing: .22em; color: var(--dim); text-transform: uppercase; }
.titlebar .tb-controls { margin-left: auto; display: flex; height: 100%; -webkit-app-region: no-drag; }
.titlebar .tb-btn {
  width: 46px; height: 100%; border: 0; background: transparent; color: var(--text-2);
  display: grid; place-items: center; cursor: pointer;
}
.titlebar .tb-btn:hover { background: #161a20; color: var(--text); }
.titlebar .tb-btn.close:hover { background: #c42b1c; color: #fff; }

.body { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 0; }
.sidebar {
  background: var(--sidebar); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 22px 16px 16px; min-height: 0; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 22px; }
.brand-mark { width: 30px; height: 30px; flex: none; }
.brand-name { font-size: 17px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand > div { min-width: 0; }
.brand-sub { font-size: 8.5px; letter-spacing: .28em; color: var(--muted); text-transform: uppercase; margin-top: 6px; }

.ws-card {
  display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line-2);
  background: var(--panel); border-radius: var(--radius-sm); cursor: pointer; margin-bottom: 26px;
  transition: border-color .15s;
}
.ws-card:hover { border-color: var(--line-3); }
.ws-card .ws-meta { min-width: 0; flex: 1; }
.ws-card .ws-label { font-size: 8.5px; letter-spacing: .22em; color: var(--muted); text-transform: uppercase; }
.ws-card .ws-name { font-weight: 700; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.nav-label { font-size: 9px; letter-spacing: .24em; color: var(--dim); text-transform: uppercase; padding: 0 12px 10px; }
.nav { display: flex; flex-direction: column; gap: 2px; margin-bottom: 18px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: var(--radius-sm);
  color: var(--text-2); cursor: pointer; border: 1px solid transparent; position: relative; font-size: 12.5px;
}
.nav-item:hover { color: var(--text); background: #0f1216; }
.nav-item.active { background: #161a20; border-color: var(--line-2); color: var(--text); font-weight: 600; }
.nav-item.active::after {
  content: ''; margin-left: auto; width: 6px; height: 6px; border-right: 1.5px solid var(--text-2);
  border-top: 1.5px solid var(--text-2); transform: rotate(45deg);
}
.nav-item .icon { color: var(--muted); }
.nav-item.active .icon { color: var(--text); }
.nav-item .badge { margin-left: auto; }
.nav-item.active .badge + * { display: none; }

.conn { margin-top: auto; padding-top: 18px; }
.conn-row { display: flex; align-items: center; gap: 8px; padding: 6px 12px; font-size: 10.5px; color: var(--text-2); }
.conn-row .val { margin-left: auto; color: var(--dim); font-size: 9.5px; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--dim); flex: none; }
.dot.on { background: var(--green); box-shadow: 0 0 8px rgba(52, 210, 123, .6); }
.dot.warn { background: var(--amber); }
.dot.off { background: var(--red); }

.user-card {
  display: flex; align-items: center; gap: 10px; margin-top: 14px; padding: 14px 8px 2px;
  border-top: 1px solid var(--line);
}
.user-card .u-name { font-size: 11.5px; font-weight: 600; }
.user-card .u-sub { font-size: 9.5px; color: var(--dim); }
.user-card .u-btn { margin-left: auto; color: var(--muted); cursor: pointer; background: none; border: 0; padding: 4px; border-radius: 6px; }
.user-card .u-btn:hover { color: var(--text); background: #161a20; }

.avatar {
  width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--panel-2);
  display: grid; place-items: center; font-weight: 700; font-size: 12px; flex: none; text-transform: uppercase;
}
.avatar.sm { width: 26px; height: 26px; border-radius: 7px; font-size: 11px; }

/* ---------- Main ---------- */
.main { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.topbar {
  display: flex; align-items: center; gap: 12px; padding: 0 36px; height: 56px; flex: none;
  border-bottom: 1px solid var(--line);
}
.crumbs { display: flex; align-items: center; gap: 12px; font-size: 11px; color: var(--muted); }
.crumbs .sep { color: var(--dim); }
.crumbs .cur { color: var(--text); font-weight: 500; }
.topbar .tb-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.status-pill { display: flex; align-items: center; gap: 6px; font-size: 9.5px; letter-spacing: .16em; color: var(--muted); text-transform: uppercase; }
.icon-btn {
  position: relative; width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line-2);
  background: var(--panel); display: grid; place-items: center; cursor: pointer; color: var(--text-2);
}
.icon-btn:hover { color: var(--text); border-color: var(--line-3); }
.icon-btn .pip {
  position: absolute; top: -3px; right: -3px; min-width: 15px; height: 15px; padding: 0 4px; border-radius: 8px;
  background: var(--accent); color: #031018; font-size: 9px; font-weight: 700; display: grid; place-items: center;
}

.content { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 30px 36px 48px; min-height: 0; }
.content-inner { max-width: 1320px; margin: 0 auto; min-height: 100%; }
.eyebrow { font-size: 9.5px; letter-spacing: .24em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.page-title { font-size: 28px; font-weight: 700; letter-spacing: -.02em; margin: 0 0 8px; line-height: 1.15; }
.page-desc { color: var(--text-2); font-size: 12.5px; margin: 0 0 26px; max-width: 760px; }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.page-head .page-desc { margin-bottom: 0; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

.muted { color: var(--muted); }
.dim { color: var(--dim); }
.mono { font-family: var(--mono); }
.small { font-size: 11px; }
.nowrap { white-space: nowrap; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 10px; }
.spacer { flex: 1; }
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid.stats { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.mt { margin-top: 16px; } .mt-lg { margin-top: 28px; } .mb { margin-bottom: 16px; }
.hidden { display: none !important; }

/* ---------- Cards / panels ---------- */
.card { background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--radius); }
.card.pad { padding: 20px; }
.card.narrow { max-width: 460px; padding: 32px; }
.card-head {
  display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line);
}
.card-head h3 { margin: 0; font-size: 13px; font-weight: 600; }
.card-head .actions { margin-left: auto; display: flex; gap: 8px; }
.card-body { padding: 18px; }
.section-label { font-size: 9.5px; letter-spacing: .22em; color: var(--accent); text-transform: uppercase; }

.stat { padding: 18px; }
.stat .stat-label { font-size: 9.5px; letter-spacing: .2em; color: var(--muted); text-transform: uppercase; display: flex; align-items: center; gap: 8px; }
.stat .stat-value { font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin-top: 8px; }
.stat .stat-sub { font-size: 11px; color: var(--dim); margin-top: 2px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 14px;
  border-radius: var(--radius-sm); border: 1px solid var(--line-2); background: var(--panel-2);
  color: var(--text); font-weight: 600; font-size: 12.5px; cursor: pointer; white-space: nowrap;
  transition: background .12s, border-color .12s, color .12s, opacity .12s;
}
.btn:hover { border-color: var(--line-3); background: #161b21; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12px; }
.btn.lg { height: 44px; padding: 0 22px; font-size: 13.5px; }
.btn.block { width: 100%; }
.btn.primary { background: var(--text); color: #0a0c10; border-color: var(--text); }
.btn.primary:hover { background: #fff; }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #03131d; }
.btn.accent:hover { background: #72d0ff; }
.btn.success { background: var(--green); border-color: var(--green); color: #03140a; }
.btn.success:hover { background: #55e194; }
.btn.warn { background: var(--amber); border-color: var(--amber); color: #1d1300; }
.btn.danger { color: var(--red); }
.btn.danger:hover { background: var(--red-soft); border-color: rgba(255, 93, 93, .45); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: #12161b; color: var(--text); }
.btn.square { width: 36px; padding: 0; }
.btn.sm.square { width: 30px; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label, .label { font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.field .hint { font-size: 11px; color: var(--dim); }
.input, .select, .textarea {
  width: 100%; height: 38px; padding: 0 12px; border-radius: var(--radius-sm); border: 1px solid var(--line-2);
  background: var(--bg-2); color: var(--text); outline: none; transition: border-color .12s, box-shadow .12s;
}
.textarea { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus { border-color: #3a4350; box-shadow: 0 0 0 3px rgba(76, 194, 255, .08); }
.input::placeholder, .textarea::placeholder { color: var(--dim); }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 17px) 16px, calc(100% - 12px) 16px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
.input-group { display: flex; gap: 8px; }
.input-group .input { flex: 1; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 16px; }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 12.5px; color: var(--text-2); margin-bottom: 12px; user-select: none; }
.check input { display: none; }
.check .toggle { width: 34px; height: 20px; border-radius: 20px; background: var(--line-2); position: relative; transition: background .15s; flex: none; }
.check .toggle::after { content: ''; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #8a9099; transition: transform .15s, background .15s; }
.check input:checked + .toggle { background: var(--accent-2); }
.check input:checked + .toggle::after { transform: translateX(14px); background: #fff; }
.form-error { color: var(--red); font-size: 12px; min-height: 18px; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 8px; border-radius: 6px;
  font-size: 9.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  background: #161a20; color: var(--text-2); border: 1px solid var(--line-2); white-space: nowrap;
}
.badge.green { background: var(--green-soft); color: var(--green); border-color: rgba(52, 210, 123, .25); }
.badge.blue { background: var(--accent-soft); color: var(--accent); border-color: rgba(76, 194, 255, .25); }
.badge.amber { background: var(--amber-soft); color: var(--amber); border-color: rgba(245, 184, 74, .25); }
.badge.red { background: var(--red-soft); color: var(--red); border-color: rgba(255, 93, 93, .25); }
.badge.count { background: var(--accent); color: #03131d; border: 0; letter-spacing: 0; padding: 0 6px; height: 17px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-size: 9.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--dim);
  font-weight: 600; padding: 12px 18px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table td { padding: 12px 18px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #0f1317; }
.table tr.clickable { cursor: pointer; }
.table .actions { display: flex; gap: 6px; justify-content: flex-end; }

/* ---------- Progress ---------- */
.progress { height: 6px; border-radius: 6px; background: #1a1f26; overflow: hidden; position: relative; }
.progress > span {
  position: absolute; inset: 0 auto 0 0; border-radius: 6px; width: 0;
  background: linear-gradient(90deg, var(--accent-2), var(--accent)); transition: width .35s ease;
}
.progress.green > span { background: var(--green); }
.progress.indeterminate > span { width: 35% !important; animation: indet 1.3s ease-in-out infinite; }
.progress.lg { height: 10px; }
@keyframes indet { 0% { left: -35%; } 100% { left: 100%; } }

/* ---------- Terminal-like panel (stile screenshot) ---------- */
.console {
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--radius);
  font-family: var(--mono); font-size: 12px; color: var(--text-2); overflow: hidden;
}
.console .console-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); font-family: var(--sans); }
.console .console-body { padding: 16px; max-height: 280px; overflow-y: auto; }
.console .line { padding: 2px 0; white-space: pre-wrap; word-break: break-word; }
.console .line .ok { color: var(--green); } .console .line .err { color: var(--red); } .console .line .acc { color: var(--accent); }

/* ---------- Store ---------- */
.hero {
  position: relative; border-radius: 16px; overflow: hidden; border: 1px solid var(--line-2); min-height: 340px;
  display: flex; align-items: flex-end; background: #0b0f14; margin-bottom: 30px;
}
.hero .hero-bg { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: .9; transform: scale(1.02); }
/* Lo scrim laterale deve coprire bene la meta' sinistra: le copertine spesso hanno
   gia' logo e scritte disegnati dentro, che altrimenti finiscono sotto al titolo. */
.hero::after {
  content: ''; position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(5, 7, 10, .99) 0%, rgba(5, 7, 10, .97) 42%, rgba(5, 7, 10, .88) 60%, rgba(5, 7, 10, .45) 80%, rgba(5, 7, 10, .08) 100%),
    linear-gradient(0deg, rgba(5, 7, 10, .92) 0%, rgba(5, 7, 10, .3) 46%, transparent 72%);
}
.hero .hero-content { position: relative; z-index: 1; padding: 36px 40px; max-width: 620px; }
.hero h2 { font-size: 36px; margin: 6px 0 10px; letter-spacing: -.03em; line-height: 1.05; }
.hero p { color: var(--text-2); margin: 0 0 22px; font-size: 13.5px; }

.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }
.search { position: relative; flex: 1; min-width: 220px; max-width: 380px; }
.search .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--dim); }
.search .input { padding-left: 34px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { height: 30px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line-2); background: transparent; color: var(--text-2); cursor: pointer; font-size: 12px; }
.chip:hover { color: var(--text); border-color: var(--line-3); }
.chip.active { background: var(--text); color: #0a0c10; border-color: var(--text); font-weight: 600; }

.games-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }
.game-card {
  background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column; cursor: pointer; transition: transform .18s, border-color .18s, box-shadow .18s;
}
.game-card:hover { transform: translateY(-3px); border-color: var(--line-3); box-shadow: 0 16px 40px rgba(0, 0, 0, .45); }
.cover { position: relative; aspect-ratio: 3 / 4; background: linear-gradient(135deg, #121821, #0b0e13); overflow: hidden; }
.cover.wide { aspect-ratio: 16 / 9; }
.cover img { width: 100%; height: 100%; object-fit: cover; }
.cover .cover-fallback { position: absolute; inset: 0; display: grid; place-items: center; font-size: 42px; font-weight: 800; color: rgba(255, 255, 255, .16); letter-spacing: -.04em; }
.cover .cover-badges { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.cover .cover-badges .badge { background: rgba(7, 9, 12, .78); backdrop-filter: blur(8px); }
.game-card .gc-body { padding: 14px 14px 16px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.game-card .gc-title { font-weight: 700; font-size: 14px; }
.game-card .gc-sub { color: var(--muted); font-size: 11.5px; min-height: 18px; }
.game-card .gc-foot { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.price { font-weight: 700; font-size: 13px; }
.price.free { color: var(--green); }
.game-card .gc-foot .btn { margin-left: auto; }
.game-card .gc-progress { margin-top: 10px; }

.detail-hero { position: relative; height: 380px; margin: -30px -36px 0; overflow: hidden; border-bottom: 1px solid var(--line); }
.detail-hero .bg { position: absolute; inset: 0; background-size: cover; background-position: center; }
.detail-hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(0deg, var(--bg) 0%, rgba(7, 9, 12, .6) 50%, rgba(7, 9, 12, .25) 100%); }
.detail-hero .back { position: absolute; top: 20px; left: 36px; z-index: 2; }
.detail-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; margin-top: -120px; position: relative; z-index: 1; }
.detail-wrap h1 { font-size: 40px; margin: 6px 0 8px; letter-spacing: -.03em; line-height: 1.05; }
.detail-desc { color: var(--text-2); white-space: pre-wrap; line-height: 1.7; font-size: 13.5px; }
.buy-box { padding: 20px; position: sticky; top: 0; }
.buy-box .price { font-size: 26px; margin: 4px 0 16px; letter-spacing: -.02em; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.kv:last-child { border-bottom: 0; }
.kv .k { color: var(--muted); }
.kv .v { text-align: right; }
.changelog { border-left: 2px solid var(--line-2); padding: 2px 0 2px 16px; margin-bottom: 18px; }
.changelog .cl-head { display: flex; gap: 10px; align-items: center; margin-bottom: 6px; }
.changelog pre { margin: 0; white-space: pre-wrap; font-family: var(--sans); color: var(--text-2); font-size: 12.5px; }

/* ---------- Library / downloads ---------- */
.lib-list { display: flex; flex-direction: column; gap: 10px; }
.lib-item {
  display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; gap: 18px; align-items: center;
  padding: 12px; background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--radius);
}
.lib-item .cover { aspect-ratio: 16 / 9; border-radius: 8px; }
.lib-item .li-title { font-weight: 700; font-size: 14px; cursor: pointer; }
.lib-item .li-meta { display: flex; gap: 14px; color: var(--muted); font-size: 11.5px; margin-top: 4px; flex-wrap: wrap; }
.lib-item .li-actions { display: flex; gap: 8px; align-items: center; }

.dl-item { padding: 18px; }
.dl-item .dl-top { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.dl-item .dl-title { font-weight: 700; font-size: 14px; }
.dl-item .dl-stats { display: flex; gap: 18px; font-size: 11.5px; color: var(--muted); margin-top: 10px; flex-wrap: wrap; font-family: var(--mono); }
.dl-item .dl-stats b { color: var(--text-2); font-weight: 500; }

/* ---------- Banner / empty ---------- */
.banner {
  display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: var(--radius);
  border: 1px solid rgba(76, 194, 255, .25); background: linear-gradient(90deg, rgba(76, 194, 255, .1), rgba(76, 194, 255, .03));
  margin-bottom: 18px;
}
.banner.amber { border-color: rgba(245, 184, 74, .3); background: linear-gradient(90deg, rgba(245, 184, 74, .1), rgba(245, 184, 74, .03)); }
.banner .b-text { flex: 1; min-width: 0; }
.banner .b-title { font-weight: 600; }
.banner .b-sub { color: var(--muted); font-size: 11.5px; }
.banner .progress { margin-top: 8px; }
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty .icon { color: var(--dim); margin: 0 auto 12px; }
.empty h3 { color: var(--text); margin: 0 0 6px; font-size: 15px; }

/* ---------- Auth ---------- */
.auth { height: 100%; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-side {
  position: relative; overflow: hidden; border-right: 1px solid var(--line); padding: 48px;
  display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(1200px 500px at -10% 110%, rgba(76, 194, 255, .14), transparent 60%), radial-gradient(700px 400px at 110% -10%, rgba(52, 210, 123, .06), transparent 60%), var(--sidebar);
}
.auth-side h1 { font-size: 44px; letter-spacing: -.035em; line-height: 1.02; margin: 0 0 14px; }
.auth-side p { color: var(--text-2); max-width: 420px; }
.auth-form { display: grid; place-items: center; padding: 40px; overflow-y: auto; }
.auth-form .card { width: 100%; max-width: 400px; padding: 30px; }
.tabs { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--line-2); border-radius: 10px; margin-bottom: 22px; background: var(--bg-2); }
.tab { flex: 1; height: 32px; border-radius: 7px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-weight: 600; }
.tab.active { background: var(--elev); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.center-page { display: grid; place-items: center; min-height: 100vh; padding: 24px; overflow: auto; }

/* ---------- Mascot ---------- */
.mascot { position: fixed; right: 26px; bottom: 22px; width: 84px; pointer-events: none; z-index: 5; animation: float 4s ease-in-out infinite; filter: drop-shadow(0 10px 20px rgba(76, 194, 255, .25)); }
@keyframes float { 50% { transform: translateY(-6px); } }
.mascot-bubble {
  position: fixed; right: 104px; bottom: 92px; z-index: 6; max-width: 240px; padding: 10px 14px; border-radius: 12px;
  background: var(--elev); border: 1px solid var(--line-2); box-shadow: 0 10px 30px rgba(0, 0, 0, .45); font-size: 11.5px;
}
.mascot-bubble b { display: block; font-size: 11.5px; }

/* ---------- Toasts / modal ---------- */
.toasts { position: fixed; right: 20px; top: 52px; z-index: 1000; display: flex; flex-direction: column; gap: 8px; width: 340px; }
.toast {
  display: flex; gap: 10px; padding: 12px 14px; background: var(--elev); border: 1px solid var(--line-2); border-radius: 10px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .5); animation: toast-in .2s ease-out; font-size: 12.5px;
}
.toast .t-icon { flex: none; margin-top: 1px; }
.toast.success .t-icon { color: var(--green); } .toast.error .t-icon { color: var(--red); } .toast.info .t-icon { color: var(--accent); } .toast.warn .t-icon { color: var(--amber); }
.toast .t-title { font-weight: 600; }
.toast .t-body { color: var(--muted); font-size: 11.5px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-6px); } }

.modal-backdrop { position: fixed; inset: 0; z-index: 900; background: rgba(2, 3, 5, .72); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 24px; animation: fade .15s; }
.modal { width: 100%; max-width: 520px; max-height: calc(100vh - 48px); display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: 0 30px 80px rgba(0, 0, 0, .6); }
.modal.wide { max-width: 760px; }
.modal-head { display: flex; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 15px; }
.modal-head .btn { margin-left: auto; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); }
@keyframes fade { from { opacity: 0; } }

.dropdown { position: absolute; right: 0; top: calc(100% + 8px); width: 360px; max-height: 460px; overflow-y: auto; z-index: 800; background: var(--panel); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: 0 20px 50px rgba(0, 0, 0, .55); }
.notif { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.notif:last-child { border-bottom: 0; }
.notif.unread { background: rgba(76, 194, 255, .04); }
.notif .n-icon { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--panel-2); border: 1px solid var(--line-2); flex: none; color: var(--accent); }
.notif .n-title { font-weight: 600; font-size: 12.5px; }
.notif .n-body { color: var(--muted); font-size: 11.5px; }
.notif .n-time { color: var(--dim); font-size: 10.5px; margin-top: 2px; }

.icon { display: inline-grid; place-items: center; flex: none; }
.icon svg { display: block; }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.dropzone {
  border: 1.5px dashed var(--line-3); border-radius: var(--radius); padding: 28px; text-align: center; color: var(--muted);
  cursor: pointer; transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.img-slot { position: relative; border-radius: 10px; overflow: hidden; border: 1px solid var(--line-2); background: var(--bg-2); display: grid; place-items: center; color: var(--dim); cursor: pointer; }
.img-slot img { width: 100%; height: 100%; object-fit: cover; }
.img-slot .img-actions { position: absolute; bottom: 8px; right: 8px; display: flex; gap: 6px; }

.bars { display: flex; align-items: flex-end; gap: 6px; height: 120px; }
.bars .bar { flex: 1; background: linear-gradient(0deg, var(--accent-2), var(--accent)); border-radius: 4px 4px 0 0; min-height: 2px; position: relative; opacity: .85; }
.bars .bar:hover { opacity: 1; }
.bars-x { display: flex; gap: 6px; margin-top: 6px; }
.bars-x span { flex: 1; text-align: center; font-size: 9px; color: var(--dim); }

/* ---- Chat degli utenti connessi ----------------------------------------- */
.chat-layout { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 18px; height: calc(100vh - 210px); min-height: 380px; }
.chat-panel { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.chat-scroll { flex: 1; overflow-y: auto; padding: 14px 18px; display: flex; flex-direction: column; gap: 2px; }
.chat-older { display: grid; place-items: center; padding: 2px 0 12px; }

.chat-msg { display: grid; grid-template-columns: 30px minmax(0, 1fr) 24px; gap: 10px; padding: 5px 6px; border-radius: 8px; }
.chat-msg:hover { background: #0f1317; }
.chat-msg.grouped { padding-top: 1px; }
.chat-msg-side { display: grid; place-items: center; padding-top: 2px; }
.chat-hover-time { font-size: 9px; color: var(--dim); font-family: var(--mono); opacity: 0; }
.chat-msg:hover .chat-hover-time { opacity: 1; }
.chat-msg-main { min-width: 0; }
.chat-msg-head { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; }
.chat-author { font-weight: 700; font-size: 12.5px; }
.chat-msg.mine .chat-author { color: var(--accent); }
.chat-time { font-size: 9.5px; color: var(--dim); font-family: var(--mono); }
.chat-body { font-size: 13px; color: var(--text-2); line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-body.deleted { color: var(--dim); font-style: italic; }
.chat-del { opacity: 0; align-self: start; background: none; border: 0; padding: 2px; border-radius: 6px; color: var(--muted); cursor: pointer; }
.chat-msg:hover .chat-del { opacity: 1; }
.chat-del:hover { color: var(--red); background: var(--red-soft); }

.chat-composer { display: flex; align-items: flex-end; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--line); }
.chat-composer.disabled { align-items: center; gap: 8px; color: var(--muted); }
.chat-input { flex: 1; min-height: 38px; height: 38px; max-height: 120px; padding: 9px 12px; resize: none; }
.chat-counter { align-self: center; min-width: 0; text-align: right; font-size: 9.5px; color: var(--amber); font-family: var(--mono); }
.chat-composer .btn { flex: none; }

.chat-people { display: flex; flex-direction: column; min-height: 0; }
.chat-people-list { flex: 1; overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.chat-person { display: flex; align-items: center; gap: 9px; padding: 7px 10px; border-radius: 8px; }
.chat-person:hover { background: #0f1317; }
.chat-person .cp-meta { min-width: 0; }
.chat-person .cp-name { font-size: 12px; font-weight: 600; }
.chat-person .cp-sub { font-size: 9.5px; color: var(--dim); }

@media (max-width: 1000px) {
  .detail-wrap { grid-template-columns: 1fr; }
  .auth { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .chat-layout { grid-template-columns: 1fr; height: auto; }
  .chat-scroll { height: 52vh; }
  .chat-people-list { max-height: 200px; }
}
@media (max-width: 760px) {
  :root { --sidebar-w: 0px; }
  .sidebar { display: none; }
  .content { padding: 20px 16px 40px; }
  .topbar { padding: 0 16px; }
  .detail-hero { margin: -20px -16px 0; }
  .lib-item { grid-template-columns: 90px 1fr; }
  .lib-item .li-actions { grid-column: 1 / -1; }
  body.web-mobile .sidebar { display: flex; }
}

/* ---------- Presenza (stile Steam) ---------- */
/* Bordo dell'avatar: verde in gioco, blu online, grigio offline. */
.avatar.pres { --pres: var(--line-3); box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--pres); border-color: transparent; }
.avatar.pres.ingame { --pres: var(--green); background: var(--green-soft); color: var(--green); }
.avatar.pres.online { --pres: var(--accent); background: var(--accent-soft); color: var(--accent); }
.avatar.pres.offline { color: var(--dim); }
.avatar.pres.ingame { animation: pres-glow 2.6s ease-in-out infinite; }
@keyframes pres-glow {
  50% { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--pres), 0 0 14px 2px rgba(52, 210, 123, .35); }
}
.pres-text.ingame { color: var(--green); }
.pres-text.ingame b { font-weight: 650; }
.pres-text.online { color: var(--accent); }
.pres-text.offline { color: var(--dim); }
.play-time { font-variant-numeric: tabular-nums; }

.ws-card .ws-status { font-size: 10px; margin-top: 1px; }
.nav-item .nav-meta { margin-left: auto; font-size: 10.5px; color: var(--dim); font-variant-numeric: tabular-nums; }
.nav-item.active .nav-meta { display: none; }
.chat-person .avatar.pres { margin: 3px; }

/* ---------- Community ---------- */
.community { display: flex; flex-direction: column; gap: 16px; max-width: 880px; }
.cm-section .card-head h3 { display: flex; align-items: center; gap: 9px; }
.cm-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line-3); }
.cm-dot.ingame { background: var(--green); box-shadow: 0 0 8px rgba(52, 210, 123, .6); }
.cm-dot.online { background: var(--accent); box-shadow: 0 0 8px rgba(76, 194, 255, .5); }
.cm-list { display: flex; flex-direction: column; padding: 6px; }
.cm-row { display: flex; align-items: center; gap: 14px; padding: 10px 12px; border-radius: 9px; }
.cm-row:hover { background: #0f1317; }
.cm-row .avatar.pres { margin: 3px; }
.cm-row.offline .cm-name { color: var(--muted); }
.cm-meta { min-width: 0; flex: 1; }
.cm-name { font-weight: 650; font-size: 13px; display: flex; align-items: center; gap: 7px; }
.cm-sub { font-size: 11.5px; margin-top: 2px; }
.cm-game { width: 112px; flex: none; border-radius: 7px; overflow: hidden; cursor: pointer; border: 1px solid var(--line-2); transition: border-color .15s; }
.cm-game:hover { border-color: var(--green); }

@media (prefers-reduced-motion: reduce) {
  .avatar.pres.ingame { animation: none; }
}

/* ---------- Amici ---------- */
.fr-tag {
  margin-left: auto; display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px;
  border: 1px solid var(--line-2); border-radius: 10px; background: var(--panel);
}
.fr-tag b { font-size: 12.5px; letter-spacing: .02em; }
.fr-tabs { max-width: 880px; }
.fr-tabs .tab { display: flex; align-items: center; justify-content: center; gap: 8px; }
.fr-count { font-size: 11px; color: var(--dim); font-variant-numeric: tabular-nums; }
.fr-usertag { font-family: var(--mono); font-size: 10.5px; font-weight: 500; color: var(--dim); }
.fr-search { max-width: none; }
.fr-remove { opacity: 0; transition: opacity .15s; }
.cm-row:hover .fr-remove, .fr-remove:focus-visible { opacity: 1; }
.fr-remove:hover { color: var(--red); border-color: var(--red); }
.chat-person .fr-btn { margin-left: auto; width: 24px; height: 24px; opacity: 0; transition: opacity .15s; }
.chat-person:hover .fr-btn, .chat-person .fr-btn:focus-visible { opacity: 1; }
.chat-person .fr-btn.success { opacity: 1; color: var(--green); border-color: var(--green); }
.chat-person .fr-btn:disabled { cursor: default; }
@media (hover: none) {
  .fr-remove, .chat-person .fr-btn { opacity: 1; }
}

/* ---------- Avatar con immagine ---------- */
.avatar { overflow: hidden; }
.avatar .avatar-img { width: 100%; height: 100%; object-fit: cover; }
.avatar.pres.offline .avatar-img { filter: grayscale(.7); opacity: .75; }
.avatar.lg { width: 44px; height: 44px; border-radius: 11px; font-size: 16px; }
.avatar.xl { width: 104px; height: 104px; border-radius: 18px; font-size: 38px; }

/* ---------- Messaggi privati ---------- */
.dm-layout { grid-template-columns: 270px minmax(0, 1fr); }
.dm-conv { cursor: pointer; }
.dm-conv.active { background: #161a20; box-shadow: inset 0 0 0 1px var(--line-2); }
.dm-conv .cp-sub.unread { color: var(--text); font-weight: 600; }
.dm-when { font-size: 9px; color: var(--dim); white-space: nowrap; }
.dm-head { gap: 10px; }
.dm-peer { display: flex; align-items: center; gap: 10px; min-width: 0; cursor: pointer; }
.dm-peer-name { font-weight: 700; font-size: 13px; }

.dm-msg { display: flex; align-items: flex-start; gap: 6px; padding: 3px 2px; }
.dm-msg.mine { flex-direction: row-reverse; }
.dm-msg.grouped { padding-top: 0; }
.dm-bubble {
  max-width: min(560px, 74%); padding: 8px 12px 6px; border-radius: 14px;
  background: var(--panel-2); border: 1px solid var(--line-2);
}
.dm-msg.mine .dm-bubble { background: rgba(76, 194, 255, .13); border-color: rgba(76, 194, 255, .3); }
.dm-bubble .chat-body { color: var(--text); }
.dm-time { display: flex; align-items: center; gap: 4px; justify-content: flex-end; margin-top: 3px; font-size: 9px; color: var(--dim); font-family: var(--mono); }
.dm-check { color: var(--dim); display: inline-flex; }
.dm-check.read { color: var(--accent); }
.dm-msg .chat-del { align-self: center; }

/* ---------- Profilo ---------- */
.profile-page { position: relative; min-height: 100%; }
.pf-content { position: relative; z-index: 1; max-width: 1000px; }
.profile-page .card { background: rgba(13, 16, 20, .84); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.pf-hero {
  position: relative; border-radius: 16px; overflow: hidden; border: 1px solid var(--line-2);
  min-height: 250px; display: flex; align-items: flex-end; background: rgba(11, 15, 20, .55) center/cover no-repeat;
}
/* Senza copertina il banner e' solo un pannello: lo sfondo si vede attraverso. */
.pf-hero.no-cover { min-height: 150px; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.pf-hero.no-cover .pf-hero-scrim { display: none; }
.pf-hero-scrim { position: absolute; inset: 0; background: linear-gradient(0deg, rgba(5,7,10,.95) 0%, rgba(5,7,10,.5) 60%, rgba(5,7,10,.18) 100%); }
.pf-hero-content { position: relative; z-index: 1; display: flex; align-items: flex-end; gap: 20px; padding: 26px 28px; width: 100%; flex-wrap: wrap; }
.pf-id { min-width: 0; flex: 1; }
.pf-name { display: flex; align-items: center; gap: 10px; font-size: 27px; font-weight: 700; letter-spacing: -.02em; }
.pf-name .fr-usertag { font-size: 13px; }
.pf-status { margin-top: 6px; font-size: 13px; }
.pf-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pf-points-badge {
  display: inline-flex; align-items: center; gap: 5px; margin-top: 8px; padding: 3px 10px; border-radius: 999px;
  background: var(--amber-soft); color: var(--amber); font-size: 12px; font-weight: 600;
}

/* Punti del giocatore */
.pf-points-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pf-points-v { display: flex; align-items: center; gap: 8px; font-size: 30px; font-weight: 700; letter-spacing: -.02em; color: var(--amber); }
.pf-points-rules { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.pf-points-rule { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--panel); }
.pf-points-rule > svg { color: var(--amber); flex: none; margin-top: 2px; }
.pf-points-bar { height: 5px; border-radius: 999px; background: var(--line-2); overflow: hidden; margin-top: 8px; }
.pf-points-bar span { display: block; height: 100%; background: var(--amber); border-radius: inherit; }
.pf-name-form { display: grid; grid-template-columns: minmax(0, 320px) auto auto; gap: 10px; align-items: center; justify-content: start; }

.pf-body { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.pf-wide, .pf-stats { grid-column: 1 / -1; }
.pf-bio { margin: 0; color: var(--text-2); white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; }
.pf-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.pf-stat { border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--panel); padding: 16px 18px; }
.pf-stat-v { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.pf-stat-k { font-size: 9.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--dim); margin-top: 4px; }
.pf-games { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.pf-game { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--panel); cursor: pointer; }
.pf-game:hover { border-color: var(--line-3); }
.pf-game.big { padding: 12px; }
.pf-game-cover { width: 62px; height: 36px; border-radius: 6px; overflow: hidden; background: var(--panel-2); display: grid; place-items: center; color: var(--dim); flex: none; }
.pf-game.big .pf-game-cover { width: 96px; height: 56px; }
.pf-game-cover img { width: 100%; height: 100%; object-fit: cover; }
.pf-game-meta { min-width: 0; }
.pf-game-title { font-weight: 600; font-size: 13px; }
.pf-game-hours { color: var(--accent); font-size: 12px; margin-top: 2px; }
.pf-editor { margin-top: 14px; }
.pf-edit-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.pf-chip.active { color: #06121c; }

/* Sfondi pronti per il profilo */
.pbg-aurora { background-image: linear-gradient(135deg, #0b2a3d 0%, #124b63 45%, #1f8f7a 100%); }
.pbg-ember  { background-image: linear-gradient(135deg, #2b1008 0%, #6b2412 50%, #c2561f 100%); }
.pbg-abyss  { background-image: linear-gradient(135deg, #05070d 0%, #10203d 50%, #29527f 100%); }
.pbg-violet { background-image: linear-gradient(135deg, #1b0f2e 0%, #43206b 50%, #8b5cf6 100%); }
.pbg-forest { background-image: linear-gradient(135deg, #0a1a10 0%, #16402a 50%, #3f8f5b 100%); }
.pbg-mono   { background-image: linear-gradient(135deg, #0a0c10 0%, #22262e 50%, #4a515c 100%); }

@media (max-width: 1100px) {
  .pf-body, .pf-edit-row, .pf-points-rules { grid-template-columns: 1fr; }
  .dm-layout { grid-template-columns: 220px minmax(0, 1fr); }
}

/* ---------- Vetrine del profilo ---------- */
.pf-showcase-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.pf-showcase-head .section-label { margin: 0; }

.pf-fav { display: grid; grid-template-columns: minmax(0, 260px) minmax(0, 1fr); overflow: hidden; cursor: pointer; transition: border-color .15s; }
.pf-fav:hover { border-color: var(--accent); }
.pf-fav-art { background: linear-gradient(135deg, #17324a, #0d1014) center/cover no-repeat; min-height: 132px; }
.pf-fav-body { padding: 18px 20px; display: flex; flex-direction: column; justify-content: center; gap: 8px; }
.pf-fav-title { margin: 0; font-size: 21px; letter-spacing: -.02em; }

.pf-shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.pf-shot { position: relative; aspect-ratio: 16 / 9; border-radius: 9px; overflow: hidden; border: 1px solid var(--line-2); cursor: pointer; background: var(--panel-2); }
.pf-shot:hover { border-color: var(--accent); }
.pf-shot img { width: 100%; height: 100%; object-fit: cover; }
.pf-shot-game {
  position: absolute; left: 6px; bottom: 6px; max-width: calc(100% - 12px); padding: 3px 8px; border-radius: 999px;
  background: rgba(5,7,10,.78); font-size: 10px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pf-shot-del { position: absolute; top: 6px; right: 6px; opacity: 0; transition: opacity .15s; }
.pf-shot:hover .pf-shot-del { opacity: 1; }
.pf-shot-del:hover { color: var(--red); border-color: var(--red); }
.pf-shot-form { display: grid; grid-template-columns: minmax(0, 200px) minmax(0, 1fr) auto; gap: 8px; margin: 10px 0 14px; align-items: center; }

.shot-viewer { display: flex; flex-direction: column; gap: 10px; }
.shot-full { width: 100%; max-height: 62vh; object-fit: contain; border-radius: 10px; background: #05070a; }
.shot-caption { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; color: var(--text-2); font-size: 12.5px; }

/* Selettore dello sfondo */
.pf-edit-block { padding-top: 16px; margin-top: 16px; border-top: 1px solid var(--line); }
.pf-edit-block:first-of-type { padding-top: 0; margin-top: 12px; border-top: 0; }
.pf-bggrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 8px; margin-top: 8px; }
.pf-bgthumb {
  position: relative; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; cursor: pointer;
  border: 1px solid var(--line-2); background: var(--panel-2) center/cover no-repeat; color: var(--text);
  display: flex; align-items: flex-end; padding: 0;
}
.pf-bgthumb span {
  width: 100%; padding: 5px 8px; font-size: 10.5px; text-align: left;
  background: linear-gradient(0deg, rgba(5,7,10,.88), transparent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pf-bgthumb:hover { border-color: var(--line-3); }
.pf-bgthumb.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }

@media (max-width: 760px) {
  .pf-fav { grid-template-columns: 1fr; }
  .pf-shot-form { grid-template-columns: 1fr; }
}

/* ---------- Sfondo a tutto launcher ---------- */
/* Un solo livello dietro l'intera finestra: lo usa il profilo. */
.app-bg {
  position: fixed; inset: 0; z-index: 0; background: center/cover no-repeat fixed; background-color: #0b0f14;
}
.app-bg::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(5, 7, 10, .58) 0%, rgba(5, 7, 10, .74) 45%, rgba(5, 7, 10, .88) 100%);
}
body.has-page-bg .app { position: relative; z-index: 1; background: transparent; }
body.has-page-bg .sidebar { background: rgba(10, 12, 16, .66); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
body.has-page-bg .titlebar { background: rgba(7, 9, 12, .62); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
body.has-page-bg .topbar { background: rgba(7, 9, 12, .38); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
body.has-page-bg .ws-card,
body.has-page-bg .icon-btn { background: rgba(13, 16, 20, .7); }

/* ---------- Download stile launcher gacha (hero + dock) ---------- */
.detail-hero.gs { height: 460px; }
.detail-hero.gs::after { background: linear-gradient(0deg, var(--bg) 0%, rgba(7, 9, 12, .55) 28%, rgba(7, 9, 12, 0) 60%), linear-gradient(90deg, rgba(7, 9, 12, .75) 0%, rgba(7, 9, 12, .2) 45%, rgba(7, 9, 12, 0) 70%); }
.detail-hero.gs + .detail-wrap { margin-top: 24px; }
.detail-hero .hero-info { position: absolute; left: 36px; bottom: 44px; z-index: 2; max-width: min(560px, 52%); text-shadow: 0 2px 18px rgba(0, 0, 0, .55); }
.detail-hero .hero-ver { font-size: 12px; font-weight: 700; letter-spacing: .18em; color: rgba(255, 255, 255, .85); }
.detail-hero .hero-info h1 { font-size: 46px; line-height: 1.02; letter-spacing: -.03em; margin: 6px 0 10px; color: #fff; }
.detail-hero .hero-tagline { margin: 0 0 14px; color: rgba(255, 255, 255, .82); font-size: 14.5px; }
.detail-hero .hero-chip { font-size: 11px; padding: 3px 10px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .35); color: #fff; background: rgba(0, 0, 0, .18); backdrop-filter: blur(6px); }
.detail-hero .hero-actions { position: absolute; right: 36px; bottom: 44px; z-index: 2; }

.btn.hero-action { height: 56px; min-width: 230px; padding: 0 34px; border-radius: 999px; font-size: 16px; font-weight: 700; letter-spacing: .01em; justify-content: center; box-shadow: 0 12px 30px rgba(0, 0, 0, .45); }
.btn.hero-action .icon svg { width: 18px; height: 18px; }
.btn.hero-action:not(.accent):not(.success):not(.warn):not(.primary) { background: rgba(10, 12, 16, .82); border-color: rgba(255, 255, 255, .12); backdrop-filter: blur(14px); }

.dl-cluster { display: flex; align-items: center; gap: 10px; }
.dl-pill {
  position: relative; display: flex; align-items: center; gap: 12px; height: 56px; min-width: 250px; max-width: 360px; padding: 0 24px 0 8px;
  border-radius: 999px; background: rgba(10, 12, 16, .84); border: 1px solid rgba(255, 255, 255, .1); backdrop-filter: blur(16px);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .5); color: #fff;
}
.dl-pill.clickable { cursor: pointer; }
.dl-pill.clickable:hover { border-color: rgba(255, 255, 255, .2); }
.dl-pill .dl-text { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.dl-pill .dl-eyebrow { font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: rgba(255, 255, 255, .5); display: flex; gap: 6px; }
.dl-pill .dl-more { color: var(--accent); }
.dl-pill .dl-l1 { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13.5px; white-space: nowrap; }
.dl-pill .dl-l2 { display: flex; align-items: center; gap: 6px; font: 11.5px var(--mono); color: rgba(255, 255, 255, .62); white-space: nowrap; min-width: 0; }
.dl-pill .dl-dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .6; }
.dl-pill.error .dl-l1 { color: var(--red); }
.dl-pill.paused .dl-l1 { color: var(--amber); }

.ring { position: relative; flex: none; border-radius: 50%; background: rgba(0, 0, 0, .35); }
.ring .ring-svg, .ring .ring-svg svg { display: block; width: 100%; height: 100%; }
.ring .ring-svg svg { transform: rotate(-90deg); }
.ring .track { stroke: rgba(255, 255, 255, .14); }
.ring .bar { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset .4s ease; filter: drop-shadow(0 0 4px rgba(76, 194, 255, .6)); }
.ring.paused .bar { stroke: var(--amber); filter: none; }
.ring.error .bar { stroke: var(--red); filter: none; }
.ring.verify .bar { stroke: var(--green); filter: drop-shadow(0 0 4px rgba(52, 210, 123, .5)); }
.ring.indeterminate .ring-svg svg { animation: ring-spin 1.1s linear infinite; }
@keyframes ring-spin { from { transform: rotate(-90deg); } to { transform: rotate(270deg); } }
.ring .ring-center { position: absolute; inset: 0; display: grid; place-items: center; font: 600 11.5px var(--mono); color: #fff; }
.ring .ring-center > span { grid-area: 1 / 1; display: grid; place-items: center; }
.ring .rc-hover { display: none !important; }
.ring.clickable { cursor: pointer; }
.ring.clickable:hover .rc-main { display: none; }
.ring.clickable:hover .rc-hover { display: grid !important; }
.ring.clickable:hover { background: rgba(255, 255, 255, .1); }

.dl-pop {
  position: absolute; right: 0; bottom: calc(100% + 12px); width: 280px; padding: 14px 16px; border-radius: 14px; cursor: default;
  background: rgba(13, 16, 20, .96); border: 1px solid var(--line-2); box-shadow: 0 18px 40px rgba(0, 0, 0, .55);
  opacity: 0; transform: translateY(6px); pointer-events: none; transition: opacity .15s, transform .15s;
}
.dl-pill:hover .dl-pop { opacity: 1; transform: none; }
.dl-pop .pop-title { font-weight: 700; margin-bottom: 10px; display: flex; gap: 8px; align-items: baseline; }
.dl-pop .pop-ver { font: 11px var(--mono); color: var(--muted); font-weight: 400; }
.dl-pop .progress { margin-bottom: 10px; }
.dl-pop .pop-row { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--muted); padding: 2px 0; }
.dl-pop .pop-row b { color: var(--text); font: 500 11.5px var(--mono); }

.dl-menu-btn {
  width: 52px; height: 52px; flex: none; border-radius: 50%; display: grid; place-items: center; cursor: pointer; color: #fff;
  background: rgba(10, 12, 16, .78); border: 1px solid rgba(255, 255, 255, .1); backdrop-filter: blur(14px); box-shadow: 0 12px 30px rgba(0, 0, 0, .45);
}
.dl-menu-btn:hover { background: rgba(30, 36, 44, .9); }
.dl-menu-pop { position: fixed; z-index: 900; min-width: 220px; padding: 6px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line-2); box-shadow: 0 20px 50px rgba(0, 0, 0, .55); animation: fade .12s ease-out; }
.dl-menu-pop .item { display: flex; align-items: center; gap: 10px; width: 100%; height: 36px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; text-align: left; color: var(--text-2); }
.dl-menu-pop .item:hover { background: var(--elev); color: var(--text); }
.dl-menu-pop .item.danger { color: var(--red); }
.dl-menu-pop .item.danger:hover { background: var(--red-soft); }
.dl-menu-pop .sep { height: 1px; margin: 5px 6px; background: var(--line-2); }
.dl-menu-pop .sep:first-child, .dl-menu-pop .sep:last-child { display: none; }

.dl-dock { position: fixed; right: 26px; bottom: 22px; z-index: 40; animation: toast-in .2s ease-out; }
.app.web .dl-dock { display: none; }

@media (max-width: 1000px) {
  .detail-hero .hero-info { max-width: calc(100% - 72px); bottom: 120px; }
  .detail-hero .hero-actions { left: 36px; right: auto; bottom: 36px; }
}
@media (max-width: 760px) {
  .detail-hero .hero-info { left: 16px; }
  .detail-hero .hero-actions { left: 16px; }
  .detail-hero .hero-info h1 { font-size: 34px; }
}
