/* Progressi: dark, aurora, vetro sottile, bento grid. Nessuna risorsa esterna (CSP del sito). */
:root {
  --bg: #07060f;
  --text: #ece9f7; --muted: #8c88a6; --dim: #5d5a78;
  --accent: #a78bfa; --accent-2: #7c3aed; --pink: #e879f9; --cyan: #22d3ee; --ok: #34d399;
  --glass: linear-gradient(160deg, rgba(255,255,255,.075), rgba(255,255,255,.025));
  --line: rgba(255,255,255,.09); --line-hi: rgba(167,139,250,.55);
  --r-comune: #9ca3af; --r-raro: #60a5fa; --r-epico: #c084fc; --r-leggendario: #fbbf24;
  --ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Tahoma, Verdana, sans-serif;
  --radius: 20px;

  /* Elementi che cambiano col tema */
  color-scheme: dark;
  --fill-1: rgba(255,255,255,.03); --fill-2: rgba(255,255,255,.06); --fill-3: rgba(255,255,255,.09);
  --on-tint: #f3eeff; --gold: #fde68a; --err: #fca5a5; --rim: rgba(255,255,255,.28);
  --modal-bg: #14112a; --num-grad: linear-gradient(180deg, #fff, var(--accent));
  --card-edge: var(--line); --card-shadow: none; --dock-bg: rgba(20,16,38,.94); --scrim: rgba(4,3,12,.72);
  --aurora: radial-gradient(55vmax 55vmax at 92% -8%, rgba(124,58,237,.34), transparent 70%), radial-gradient(50vmax 50vmax at -6% 108%, rgba(232,121,249,.16), transparent 70%), radial-gradient(30vmax 30vmax at 55% 55%, rgba(34,211,238,.06), transparent 70%);
}

/* ── Tema chiaro: carta perlata, schede bianche rialzate dall'ombra, viola piu' profondo per il testo ── */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f0fc;
  --text: #1a1633; --muted: #5f5a7c; --dim: #8a85a6;
  --accent: #6d35e8; --accent-2: #7c3aed; --pink: #c026d3; --cyan: #0891b2; --ok: #047857;
  --glass: linear-gradient(160deg, rgba(255,255,255,.96), rgba(255,255,255,.78));
  --line: rgba(60,40,130,.12); --line-hi: rgba(109,53,232,.45);
  --r-comune: #6b7280; --r-raro: #2563eb; --r-epico: #9333ea; --r-leggendario: #b45309;
  --fill-1: rgba(60,40,130,.035); --fill-2: rgba(60,40,130,.06); --fill-3: rgba(60,40,130,.09);
  --on-tint: #3b1d8a; --gold: #92400e; --err: #be123c; --rim: rgba(60,40,130,.22);
  --modal-bg: #ffffff; --num-grad: linear-gradient(180deg, #1a1633, #6d35e8);
  --card-edge: rgba(255,255,255,.9); --dock-bg: rgba(255,255,255,.94); --scrim: rgba(26,22,51,.4);
  --card-shadow: 0 1px 2px rgba(50,30,120,.07), 0 14px 32px -14px rgba(50,30,120,.26);
  --aurora: radial-gradient(55vmax 55vmax at 92% -8%, rgba(139,92,246,.2), transparent 70%), radial-gradient(50vmax 50vmax at -6% 108%, rgba(244,114,182,.13), transparent 70%), radial-gradient(34vmax 34vmax at 50% 45%, rgba(34,211,238,.09), transparent 70%);
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); color: var(--text); font-family: var(--ui); line-height: 1.45; overflow-x: hidden; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
a { color: var(--accent); }
button { font-family: inherit; }

/* ── Aurora di sfondo: gradienti statici (niente blur ne' animazioni: erano la causa dei rallentamenti) ── */
.aurora { position: fixed; inset: 0; z-index: 0; pointer-events: none; background: var(--aurora); }
.aurora i { display: none; }

.glass { background: var(--glass); border: 1px solid var(--card-edge); box-shadow: var(--card-shadow); }

.brand { display: flex; flex-direction: column; gap: 2px; }
.brand-mark { font-size: 11px; letter-spacing: .22em; font-weight: 800; background: linear-gradient(90deg, var(--accent), var(--pink)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-name { font-size: 24px; font-weight: 800; letter-spacing: -.02em; }

.btn { display: inline-block; background: linear-gradient(135deg, var(--accent-2), #9d5cf5); color: #fff; text-decoration: none; padding: 11px 20px; border-radius: 12px; font-weight: 700; border: 0; cursor: pointer; transition: transform .15s, box-shadow .15s; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 8px 26px rgba(124,58,237,.45); }
.link { color: var(--muted); font-size: 13px; text-decoration: none; }
.link:hover { color: var(--text); }
.link-btn { background: none; border: 0; color: var(--muted); font-size: 13px; cursor: pointer; padding: 0; text-align: left; }
.link-btn:hover { color: var(--text); }

.gate { position: relative; z-index: 1; min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.gate-card { border-radius: var(--radius); padding: 30px; max-width: 390px; display: flex; flex-direction: column; gap: 16px; }
.gate-card p { margin: 0; color: var(--muted); }

/* ── Struttura ── */
.app { position: relative; z-index: 1; display: grid; grid-template-columns: 250px 1fr; gap: 20px; min-height: 100vh; padding: 20px; }
.side { border-radius: var(--radius); padding: 24px 16px; display: flex; flex-direction: column; gap: 26px; position: sticky; top: 20px; height: calc(100vh - 40px); }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-btn { display: flex; align-items: center; gap: 12px; background: none; border: 1px solid transparent; text-align: left; font-size: 14px; font-weight: 600; color: var(--muted); padding: 11px 12px; border-radius: 12px; cursor: pointer; transition: background .2s, color .2s, border-color .2s, transform .15s; }
.nav-btn svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-label { flex: 1; }
.nav-btn:hover { background: var(--fill-2); color: var(--text); transform: translateX(2px); }
.nav-btn[aria-pressed="true"] { background: linear-gradient(90deg, rgba(167,139,250,.22), rgba(167,139,250,.06)); border-color: rgba(167,139,250,.3); color: var(--on-tint); }
.badge { background: linear-gradient(135deg, var(--pink), var(--accent-2)); color: #fff; font-size: 11px; font-weight: 800; padding: 1px 8px; border-radius: 99px; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.me { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 700; }
.avatar { border-radius: 50%; background: var(--fill-3); object-fit: cover; }

.main { min-width: 0; max-width: 1040px; width: 100%; padding: 8px 8px 60px; }
.head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.head h1 { margin: 0; font-size: 30px; font-weight: 800; letter-spacing: -.03em; }
.icon-btn { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; border: 1px solid var(--line); background: var(--fill-2); color: var(--muted); cursor: pointer; transition: color .2s, background .2s, border-color .2s; }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn:hover { color: var(--text); border-color: var(--line-hi); }
.icon-btn[aria-pressed="true"] { color: var(--accent); }
.icon-btn[aria-pressed="true"] .off, .icon-btn[aria-pressed="false"] .on { display: none; }
.status { min-height: 22px; margin: 4px 0 18px; color: var(--muted); font-size: 13px; }
.view > * { animation: rise .38s cubic-bezier(.23,1,.32,1) both; }
.view > *:nth-child(2) { animation-delay: .04s; } .view > *:nth-child(3) { animation-delay: .08s; } .view > *:nth-child(4) { animation-delay: .12s; } .view > *:nth-child(n+5) { animation-delay: .16s; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.tile { position: relative; border-radius: var(--radius); padding: 18px 20px; overflow: hidden; transition: transform .2s, border-color .2s; }
@media (hover: hover) { .tile:hover { transform: translateY(-2px); border-color: var(--line-hi); } }
.k { color: var(--muted); font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; }
.v { font-size: 34px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; margin-top: 4px; line-height: 1.1; }
.v small { font-size: 14px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.sub { color: var(--muted); font-size: 13px; margin-top: 4px; }
.ico { position: absolute; top: 16px; right: 16px; width: 22px; height: 22px; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; opacity: .8; }

/* ── Bento ── */
.bento { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: minmax(128px, auto); gap: 14px; }
.t-hero { grid-column: span 2; grid-row: span 2; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 14px; padding: 26px; background: radial-gradient(120% 90% at 50% 0%, rgba(124,58,237,.28), transparent 70%), var(--glass); }
.t-wide { grid-column: span 2; }
.ring { position: relative; width: 200px; height: 200px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .trk { fill: none; stroke: var(--fill-3); }
.ring .fill { fill: none; stroke-linecap: round; transition: stroke-dashoffset 1s cubic-bezier(.2,.8,.3,1); }
.ring-mid { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-mid .lv { font-size: 12px; letter-spacing: .2em; color: var(--muted); font-weight: 700; }
.ring-mid .num { font-size: 60px; font-weight: 800; letter-spacing: -.04em; line-height: 1; background: var(--num-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ring.mini { width: 74px; height: 74px; flex: none; }
.ring.mini .num { font-size: 20px; letter-spacing: -.02em; }
.pill { display: inline-block; padding: 4px 12px; border-radius: 99px; background: rgba(167,139,250,.16); border: 1px solid rgba(167,139,250,.35); color: var(--on-tint); font-size: 12.5px; font-weight: 700; }
.hero-line { font-size: 15px; font-weight: 700; }
.row { display: flex; align-items: center; gap: 16px; }
.grow { flex: 1; min-width: 0; }

.bar { height: 8px; background: var(--fill-3); border-radius: 99px; overflow: hidden; margin-top: 8px; }
.bar > span { display: block; height: 100%; width: 100%; transform: scaleX(0); transform-origin: left center; background: linear-gradient(90deg, var(--accent-2), var(--pink)); border-radius: 99px; transition: transform .8s cubic-bezier(.2,.8,.3,1); }
.bar.done > span { background: linear-gradient(90deg, #10b981, var(--ok)); }
.bar-label { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; margin-top: 6px; font-variant-numeric: tabular-nums; }
.mini-mission { padding: 8px 0; }
.mini-mission + .mini-mission { border-top: 1px solid var(--line); }
.mm-top { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; font-weight: 700; }

/* ── Missioni ── */
.group { margin-bottom: 26px; }
.group-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.group-head h2 { margin: 0; font-size: 16px; font-weight: 800; }
.group-head span { color: var(--muted); font-size: 12.5px; }
.list { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.mission { display: block; }
.mission-top { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.mission-title { font-weight: 800; }
.mission-desc { color: var(--muted); font-size: 13px; margin-top: 2px; }
.xp { color: var(--accent); font-size: 12px; font-weight: 800; white-space: nowrap; }
.check { color: var(--ok); font-weight: 800; font-size: 12.5px; }

/* ── Achievement ── */
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.chip { background: var(--fill-2); border: 1px solid var(--line); color: var(--muted); font-size: 12.5px; font-weight: 700; padding: 7px 14px; border-radius: 99px; cursor: pointer; transition: color .2s, background .2s, border-color .2s; }
.chip:hover { color: var(--text); }
.chip[aria-pressed="true"] { border-color: var(--accent); color: var(--on-tint); background: rgba(167,139,250,.18); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 14px; }
.r-comune { --rc: var(--r-comune); } .r-raro { --rc: var(--r-raro); } .r-epico { --rc: var(--r-epico); } .r-leggendario { --rc: var(--r-leggendario); }
.ach { border-top: 2px solid var(--rc, var(--r-comune)); }
.ach.locked { opacity: .6; }
.ach.unlocked { background: linear-gradient(160deg, color-mix(in srgb, var(--rc) 16%, transparent), rgba(255,255,255,.03)); }
.ach.unlocked::after { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 40%, rgba(255,255,255,.09) 50%, transparent 60%); transform: translateX(-120%); pointer-events: none; }
@media (hover: hover) { .ach.unlocked:hover::after { transform: translateX(120%); transition: transform .9s ease; } }
.ach-rarity { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; color: var(--rc, var(--r-comune)); }
.ach-title { font-weight: 800; margin-top: 3px; font-size: 16px; }
.ach-desc { color: var(--muted); font-size: 13px; margin: 3px 0 6px; }
.ach .bar > span { background: var(--rc, var(--accent)); }

/* ── Classifica ── */
.podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; gap: 14px; align-items: end; margin-bottom: 18px; }
.pod { text-align: center; padding: 20px 12px 18px; }
.pod.p1 { padding-top: 30px; padding-bottom: 26px; border-color: rgba(251,191,36,.45); }
.pod .medal { width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 800; font-size: 15px; color: #1b1530; margin-bottom: 8px; }
.pod.p1 .medal { background: linear-gradient(135deg, #fde68a, #f59e0b); } .pod.p2 .medal { background: linear-gradient(135deg, #f1f5f9, #94a3b8); } .pod.p3 .medal { background: linear-gradient(135deg, #fdba74, #c2410c); }
.pod .avatar { width: 56px; height: 56px; display: block; margin: 0 auto 8px; }
.pod-name { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pod-xp { color: var(--accent); font-weight: 800; font-size: 20px; margin-top: 2px; font-variant-numeric: tabular-nums; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--line); font-size: 14px; }
.table tr:last-child td { border-bottom: 0; }
.table th { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
@media (hover: hover) { .table tbody tr:hover td { background: var(--fill-2); } }
.table tr.you td { background: rgba(167,139,250,.14); }
.who { display: flex; align-items: center; gap: 10px; }
.who .avatar { width: 26px; height: 26px; }

/* ── Notifiche ── */
.notif-list { display: grid; gap: 10px; }
.notif { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; }
.notif.unread { border-color: rgba(167,139,250,.5); background: linear-gradient(160deg, rgba(167,139,250,.16), rgba(255,255,255,.03)); }
.notif-kind { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: var(--accent); min-width: 84px; padding-top: 2px; }
.notif-time { color: var(--muted); font-size: 12px; margin-left: auto; white-space: nowrap; }
.empty { color: var(--muted); font-style: italic; padding: 14px 2px; }

/* ── Mobile: barra in basso come su un telefono ── */
@media (max-width: 860px) {
  .bento { grid-template-columns: repeat(2, 1fr); }
  .t-hero { grid-column: span 2; }
}
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; padding: 12px 12px 88px; gap: 12px; }
  .side { position: fixed; z-index: 5; left: 10px; right: 10px; bottom: 10px; top: auto; height: auto; padding: 6px; border-radius: 22px; flex-direction: row; gap: 0; background: var(--dock-bg); }
  .side .brand, .side-foot { display: none; }
  .nav { flex-direction: row; width: 100%; justify-content: space-around; gap: 0; }
  .nav-btn { flex-direction: column; gap: 3px; padding: 8px 6px; font-size: 10.5px; border-radius: 16px; position: relative; flex: 1; align-items: center; text-align: center; }
  .nav-btn:hover { transform: none; }
  .nav-label { flex: none; }
  .nav-btn .badge { position: absolute; top: 2px; right: 14%; font-size: 10px; padding: 0 6px; }
  .main { padding: 4px 2px 20px; }
  .head h1 { font-size: 26px; }
  .podium { grid-template-columns: 1fr; }
  .ring { width: 170px; height: 170px; }
  .ring-mid .num { font-size: 52px; }
}
@media (prefers-reduced-motion: reduce) {
  .view > * { animation: none; }
  .ring .fill, .bar > span { transition: none; }
  .overlay, .modal, .overlay.out, .overlay.out .modal { animation-duration: .01ms; }
  .t-hero.fx-level .ring::after, .t-hero.fx-level .ring .num, .status.flash { animation: none; }
}

/* ── Shop ── */
.shop-head { display: grid; grid-template-columns: minmax(230px, 300px) 1fr; gap: 14px; align-items: start; margin-bottom: 16px; }
.shop-balance .v { color: var(--gold); }
.shop-chips { margin: 0; align-content: flex-start; }
.shop-blurb { color: var(--muted); margin: 0 0 12px; font-size: 14px; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.prod { display: flex; flex-direction: column; gap: 8px; padding: 16px; }
.prod.locked { opacity: .82; }
.prod.owned { border-color: rgba(52,211,153,.4); }
.prod-tag { position: absolute; top: 12px; left: 14px; font-size: 10.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.prod-art { height: 74px; display: grid; place-items: center; margin-top: 10px; }
.prod-emoji { font-size: 44px; line-height: 1; }
.prod-emoji.small { font-size: 20px; }
.swatch { width: 58px; height: 58px; border-radius: 50%; border: 3px solid var(--rim); display: inline-block; }
.swatch.small { width: 22px; height: 22px; border-width: 2px; }
.role-chip { display: inline-block; padding: 5px 14px; border-radius: 99px; border: 1.5px solid var(--accent); font-weight: 700; font-size: 14px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prod-name { font-weight: 800; }
.prod-desc { color: var(--muted); font-size: 12.5px; flex: 1; }
.prod-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; }
.prod-price { font-weight: 800; color: var(--gold); font-variant-numeric: tabular-nums; }
.prod-why { font-size: 12px; color: var(--muted); }
.prod-why.ok { color: var(--ok); }
.buy-btn { background: linear-gradient(135deg, var(--accent-2), #9d5cf5); color: #fff; border: 0; border-radius: 10px; padding: 8px 14px; font: inherit; font-size: 13px; font-weight: 800; cursor: pointer; transition: transform .15s cubic-bezier(.23,1,.32,1), opacity .15s; }
.buy-btn:hover:not(:disabled) { transform: translateY(-1px); }
.buy-btn:disabled { background: var(--fill-3); color: var(--muted); cursor: not-allowed; }
.buy-btn.big { padding: 11px 20px; font-size: 14px; }
.ghost-btn { background: transparent; border: 1px solid var(--line); color: var(--muted); border-radius: 10px; padding: 10px 16px; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.ghost-btn:hover { color: var(--text); border-color: var(--line-hi); }

.overlay { position: fixed; inset: 0; z-index: 50; background: var(--scrim); display: grid; place-items: center; padding: 16px; overflow-y: auto; animation: fade-in .18s ease-out both; }
.overlay.out { animation: fade-out .12s ease-out forwards; pointer-events: none; }
.overlay.out .modal { animation: modal-out .12s ease-out forwards; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes modal-in { from { opacity: 0; transform: scale(.96) translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes modal-out { to { opacity: 0; transform: scale(.97); } }
.modal { width: min(460px, 100%); border-radius: var(--radius); padding: 22px; display: flex; flex-direction: column; gap: 14px; background: var(--modal-bg); border: 1px solid var(--line-hi); animation: modal-in .22s cubic-bezier(.23,1,.32,1) both; }
.modal-top { display: flex; gap: 14px; align-items: center; }
.modal-title { font-size: 18px; font-weight: 800; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; flex-wrap: wrap; }
.modal-err { color: var(--err); font-size: 13px; min-height: 0; }
.modal-err:empty { display: none; }
.role-preview { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--fill-2); border: 1px dashed var(--line); }
.title-prev { font-style: italic; color: var(--muted); }
.f { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; }
.f input[type="text"], .f textarea, .equip-row + .group input, .modal input[type="text"], .modal textarea, .shop-body input[type="text"] { background: var(--fill-2); border: 1px solid var(--line); color: var(--text); border-radius: 10px; padding: 10px 12px; font: inherit; font-size: 14px; width: 100%; }
.modal input:focus, .modal textarea:focus, .shop-body input:focus { outline: none; border-color: var(--accent); }
.hint { color: var(--muted); font-size: 12px; font-weight: 400; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sw { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--rim); cursor: pointer; padding: 0; }
.sw:hover { transform: scale(1.12); }
.swatches input[type="color"] { width: 34px; height: 30px; border: 0; background: none; padding: 0; cursor: pointer; }
.opts { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.opt-row { display: flex; gap: 8px; width: 100%; }
.sw-x { background: none; border: 1px solid var(--line); color: var(--muted); border-radius: 8px; width: 34px; cursor: pointer; }
.equip-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.equip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--fill-2); color: var(--muted); font: inherit; font-weight: 700; cursor: pointer; }
.equip.on { border-color: var(--accent); color: var(--on-tint); background: rgba(167,139,250,.18); }
.shop-body .row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

@media (max-width: 860px) { .shop-head { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .shop-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); } .modal { padding: 18px; } }

/* ── Rifiniture: pressione, momento di festa, dettagli del browser ── */
.buy-btn:active:not(:disabled), .ghost-btn:active, .chip:active, .btn:active { transform: scale(0.97); }
.icon-btn:active, .nav-btn:active { transform: scale(0.95); }
.icon-btn, .nav-btn, .ghost-btn, .btn { transition-property: color, background-color, border-color, transform, box-shadow; transition-duration: .2s, .2s, .2s, .12s, .2s; transition-timing-function: ease, ease, ease, cubic-bezier(.23,1,.32,1), ease; }
@media (hover: none) { .tile:hover, .buy-btn:hover:not(:disabled) { transform: none; } }

/* Salita di livello: dopo il conteggio, un'onda parte dall'anello e il numero si assesta */
.t-hero.fx-level .ring::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--accent); opacity: 0; pointer-events: none; animation: lv-wave 1.1s cubic-bezier(.23,1,.32,1) .9s both; }
.t-hero.fx-level .ring .num { animation: lv-pop .5s cubic-bezier(.23,1,.32,1) .9s both; }
@keyframes lv-wave { 0% { opacity: .8; transform: scale(1); } 100% { opacity: 0; transform: scale(1.5); } }
@keyframes lv-pop { 0% { transform: scale(1); } 40% { transform: scale(1.14); } 100% { transform: scale(1); } }
.status.flash { animation: st-flash 1.4s ease-out both; border-radius: 8px; }
@keyframes st-flash { 0% { background: rgba(167,139,250,.28); color: var(--text); } 100% { background: transparent; } }

::selection { color: #fff; background: rgba(139, 92, 246, .55); }
* { scrollbar-width: thin; scrollbar-color: rgba(167,139,250,.35) transparent; }
input, textarea, select { caret-color: var(--accent); accent-color: var(--accent-2); }

/* Pulsante del tema: l'icona mostra l'azione (sole = passa al chiaro, luna = passa allo scuro) */
.theme-btn .i-moon { display: none; }
:root[data-theme="light"] .theme-btn .i-sun { display: none; }
:root[data-theme="light"] .theme-btn .i-moon { display: block; }
:root[data-theme="light"] ::selection { background: rgba(109, 53, 232, .7); }
:root[data-theme="light"] * { scrollbar-color: rgba(91, 33, 182, .35) transparent; }
.head-actions { display: flex; gap: 8px; flex: none; }
:root.theme-anim, :root.theme-anim *, :root.theme-anim *::before, :root.theme-anim *::after { transition: background-color .28s ease, color .28s ease, border-color .28s ease, box-shadow .28s ease, fill .28s ease, stroke .28s ease !important; }
@media (prefers-reduced-motion: reduce) { :root.theme-anim, :root.theme-anim * { transition: none !important; } }

/* Tema chiaro: gli achievement bloccati restano leggibili, quelli sbloccati prendono solo un velo del colore di rarita' */
:root[data-theme="light"] .ach.locked { opacity: .8; }
:root[data-theme="light"] .ach.unlocked { background: linear-gradient(160deg, color-mix(in srgb, var(--rc) 11%, #fff), #fff); }

/* ── La mia stanza (stanze vocali temporanee) ── */
.room-hero { grid-row: span 1; align-items: stretch; justify-content: flex-start; text-align: left; gap: 14px; padding: 20px 22px; }
.room-top { display: flex; gap: 16px; align-items: center; }
.room-owner { position: relative; flex: none; }
.room-owner .avatar { width: 64px; height: 64px; display: block; box-shadow: 0 0 0 3px var(--accent), 0 0 24px rgba(167,139,250,.45); }
.room-owner .crown { position: absolute; right: -6px; bottom: -4px; font-size: 18px; line-height: 1; filter: drop-shadow(0 1px 2px rgba(0,0,0,.55)); }
.room-title { font-size: 22px; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; overflow-wrap: anywhere; margin-top: 2px; }
.room-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.pill.st-ok { background: rgba(52,211,153,.14); border-color: rgba(52,211,153,.4); color: var(--ok); }
.pill.st-bad { background: rgba(244,63,94,.14); border-color: rgba(244,63,94,.45); color: var(--err); }
.pill.st-warn { background: rgba(251,191,36,.14); border-color: rgba(251,191,36,.45); color: var(--gold); }
.pill.st-chill { background: #f5f5f8; border-color: #ffffff; color: #0b0b14; }
.pill.st-flame { background: #0b0b14; border-color: rgba(255,255,255,.25); color: #f3f3f6; }
.room-empty { display: flex; flex-direction: column; gap: 8px; max-width: 640px; }
.room-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.people { display: grid; gap: 8px; margin-top: 12px; }
.person { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--fill-1); border: 1px solid var(--line); color: var(--text); font: inherit; text-align: left; }
.person .avatar { width: 30px; height: 30px; flex: none; }
.person .grow { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person .sub { margin-top: 0; }
.person.pick { cursor: pointer; width: 100%; transition: border-color .15s; }
.person.pick:hover { border-color: var(--line-hi); }
.pick-list { display: grid; gap: 6px; max-height: 300px; overflow-y: auto; }
.mini-btn { background: var(--fill-2); border: 1px solid var(--line); color: var(--text); border-radius: 10px; padding: 7px 12px; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; transition: border-color .15s, transform .15s cubic-bezier(.23,1,.32,1); }
.mini-btn:hover { border-color: var(--line-hi); }
.mini-btn:active { transform: scale(0.97); }
.mini-btn.danger { color: var(--err); }
.mini-btn[data-sure="1"] { border-color: var(--err); }
.person .mini-btn { padding: 5px 10px; font-size: 12px; }
.modal input[type="number"], .modal input[type="search"] { background: var(--fill-2); border: 1px solid var(--line); color: var(--text); border-radius: 10px; padding: 10px 12px; font: inherit; font-size: 14px; width: 100%; }
.modal input[type="number"]:focus, .modal input[type="search"]:focus { outline: none; border-color: var(--accent); }
@media (max-width: 720px) { .room-hero { grid-column: span 2; } .person { flex-wrap: wrap; } }
