/* Dashboard: violet smoked glass over the AeroShards background.
   Self-contained (no ../styles.css) so it matches the store's newer look. */
:root {
  --bg: #150d1c;
  --text: #ecd6ff;
  --muted: #a9a3b6;
  --faint: #6f6a7a;
  --accent: #e7cbff;
  --violet: #dab0ff;
  --accent-soft: rgba(218, 176, 255, .18);
  --line: rgba(255, 255, 255, .08);
  --card: rgba(24, 16, 31, .66);
  --input: rgba(12, 7, 16, .7);
  --ok: #7df5b0;
  --warn: #f5d98b;
  --danger: #ff7a8a;
  --font-display: "Inter Tight", "Inter", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--bg); }
body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  color: var(--text); background: var(--bg);
  min-height: 100vh; -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
[hidden] { display: none !important; }

/* ---- Background ------------------------------------------------------ */
.aero-bg {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(90% 60% at 50% 0%, #211030 0%, #150d1c 70%);
}
.aero-bg > div { width: 100%; height: 100%; }
.aero-shards { position: relative; width: 100%; height: 100%; overflow: hidden; }
.aero-shards-canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }

/* ---- Buttons --------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 999px; cursor: pointer;
  padding: 9px 18px; font-size: 14px; font-weight: 600; white-space: nowrap;
  transition: filter .2s, box-shadow .25s, border-color .25s, transform .15s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn-primary {
  color: #26103f; background: linear-gradient(180deg, #dcb4ff, #dbb1ff);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 8px 24px -10px rgba(218, 176, 255, .8);
}
.btn-primary:hover { filter: brightness(1.1); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 0 26px rgba(218, 176, 255, .55); }
.btn-ghost { color: var(--text); background: rgba(41, 33, 48, .8); border-color: rgba(255, 255, 255, .12); }
.btn-ghost:hover { border-color: rgba(231, 203, 255, .6); box-shadow: 0 0 20px rgba(218, 176, 255, .3); }
.btn-block { width: 100%; padding: 11px 18px; }

/* ---- Top bar --------------------------------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(12, 7, 16, .45); border-bottom: 1px solid rgba(255, 255, 255, .06);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
}
.topbar-inner {
  max-width: 1160px; margin: 0 auto; height: 56px; padding: 0 24px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 9px; }
.brand-logo { width: 28px; height: 28px; object-fit: contain; filter: drop-shadow(0 0 10px rgba(218, 176, 255, .6)); }
.brand-name { font-weight: 800; font-size: 18px; letter-spacing: -.02em; }
.topnav {
  display: flex; gap: 2px; padding: 3px; border-radius: 999px;
  background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .08);
}
.topnav a { padding: 5px 13px; border-radius: 999px; font-size: 13px; font-weight: 500; color: var(--muted); transition: color .2s, background .2s; }
.topnav a:hover { color: var(--text); }
.topnav a.is-active { color: #26103f; background: linear-gradient(180deg, #e9d0ff, #e2c0ff); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 0 16px rgba(228, 198, 255, .45); }
.topbar-actions { display: flex; gap: 8px; justify-self: end; }
.topbar-actions .btn { padding: 6px 15px; font-size: 13.5px; }

/* ---- Loading --------------------------------------------------------- */
.dash-loading {
  position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; gap: 12px;
  color: var(--muted); padding: 140px 24px; font-size: 15px;
}
.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(231, 203, 255, .25); border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Layout ---------------------------------------------------------- */
.dash { position: relative; z-index: 1; max-width: 1160px; margin: 0 auto; padding: 44px 24px 72px; }

.hello { display: flex; align-items: center; gap: 20px; margin-bottom: 28px; animation: rise .6s cubic-bezier(.22, 1, .36, 1) backwards; }
.hello-avatar {
  width: 68px; height: 68px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
  border: 2px solid rgba(231, 203, 255, .55); box-shadow: 0 0 0 4px rgba(218, 176, 255, .12), 0 0 30px rgba(218, 176, 255, .35);
}
.hello-text { min-width: 0; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.hello-title {
  font-family: var(--font-display); font-size: clamp(26px, 3.2vw, 38px); font-weight: 700;
  letter-spacing: -.03em; line-height: 1.1; margin-top: 4px; overflow-wrap: anywhere;
}
.hello-sub { color: var(--muted); font-size: 14.5px; margin-top: 6px; overflow-wrap: anywhere; }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.side { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

/* ---- Cards ----------------------------------------------------------- */
.card {
  position: relative; min-width: 0;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 22px;
  -webkit-backdrop-filter: blur(18px) saturate(1.2); backdrop-filter: blur(18px) saturate(1.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), 0 30px 60px -30px rgba(0, 0, 0, .8);
  animation: rise .7s cubic-bezier(.22, 1, .36, 1) backwards;
}
.library { animation-delay: .08s; padding: 24px; }
.side .card:nth-child(1) { animation-delay: .14s; }
.side .card:nth-child(2) { animation-delay: .2s; }
.side .card:nth-child(3) { animation-delay: .26s; }
.side .card:nth-child(4) { animation-delay: .32s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.card-head.tight { align-items: center; margin-bottom: 12px; }
.card-title { font-family: var(--font-display); font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.card-sub { color: var(--muted); font-size: 13.5px; line-height: 1.55; margin-top: 4px; }
.label { font-size: 11.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.pill {
  flex-shrink: 0; font-size: 12px; font-weight: 600; color: #ecd6ff; white-space: nowrap;
  padding: 4px 10px; border-radius: 999px; background: rgba(218, 176, 255, .16); border: 1px solid rgba(231, 203, 255, .3);
}

/* Plan card gets the glowing top edge */
.plan { border-color: rgba(218, 176, 255, .38); background: linear-gradient(180deg, rgba(47, 26, 66, .78), rgba(25, 16, 32, .72)); }
.plan::before {
  content: ""; position: absolute; left: 10%; right: 10%; top: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, #ebd5ff 30%, #fff 50%, #ebd5ff 70%, transparent);
  box-shadow: 0 0 12px 1px rgba(220, 180, 255, .9);
}
.plan-name {
  font-family: var(--font-display); font-size: 34px; font-weight: 700; letter-spacing: -.03em; margin-top: 6px;
  background: linear-gradient(180deg, #fff, #ecd6ff); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.plan-meta { color: var(--muted); font-size: 13.5px; margin: 4px 0 18px; }

/* Setup checklist */
.progress { height: 4px; border-radius: 999px; background: rgba(255, 255, 255, .07); overflow: hidden; margin-bottom: 16px; }
.progress span { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #dbb1ff, #ebd5ff); box-shadow: 0 0 10px rgba(218, 176, 255, .8); transition: width .6s cubic-bezier(.22, 1, .36, 1); }
.steps { list-style: none; display: flex; flex-direction: column; gap: 14px; }
.steps li { display: flex; gap: 12px; align-items: flex-start; }
.steps strong { display: block; font-size: 14px; font-weight: 600; }
.steps small { display: block; color: var(--faint); font-size: 12.5px; margin-top: 2px; }
.tick {
  flex-shrink: 0; width: 20px; height: 20px; margin-top: 1px; border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, .2); display: grid; place-items: center; transition: background .3s, border-color .3s;
}
.steps li.done .tick { background: linear-gradient(180deg, #dcb4ff, #dbb1ff); border-color: transparent; box-shadow: 0 0 12px rgba(218, 176, 255, .6); }
.steps li.done .tick::after { content: ""; width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: translateY(-1px) rotate(45deg); }
.steps li.done strong { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(255, 255, 255, .25); }

/* Inputs */
.input {
  width: 100%; min-width: 0; font-family: inherit; font-size: 14.5px; color: var(--text);
  background: var(--input); border: 1px solid rgba(255, 255, 255, .1); border-radius: 9px;
  padding: 10px 13px; transition: border-color .2s, box-shadow .2s;
}
.input::placeholder { color: var(--faint); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
select.input { appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23a9a3b6' stroke-width='1.6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center; }
select.input option { background: #1d1424; }

.zen .card-sub { margin-bottom: 14px; }
.serial-row { display: flex; gap: 8px; }
.serial-row .input { flex: 1; font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: 13.5px; letter-spacing: .03em; }
.serial-row .btn { border-radius: 9px; padding: 9px 16px; }
.serial-msg { font-size: 13px; min-height: 18px; margin-top: 10px; color: var(--muted); }
.serial-msg.error { color: var(--danger); }
.serial-msg.success { color: var(--ok); }

/* Account */
.kv { list-style: none; margin-top: 10px; }
.kv li { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.kv li:last-child { border-bottom: 0; padding-bottom: 0; }
.kv span { color: var(--muted); flex-shrink: 0; }
.kv strong { font-weight: 600; text-align: right; min-width: 0; overflow-wrap: anywhere; }

/* ---- Game library ---------------------------------------------------- */
.game-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.game-tile {
  position: relative; display: block; width: 100%; padding: 0; border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 12px; overflow: hidden; aspect-ratio: 16 / 10; cursor: pointer; text-align: left;
  background: #0f0a14; color: #fff;
  transition: transform .3s cubic-bezier(.22, 1, .36, 1), box-shadow .3s, border-color .3s;
}
.game-tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s cubic-bezier(.22, 1, .36, 1), filter .3s; }
.game-tile::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(to top, rgba(10, 5, 14, .9) 0%, rgba(10, 5, 14, .2) 50%, transparent 70%);
}
.game-tile:not(.locked):hover, .game-tile:not(.locked):focus-visible {
  transform: translateY(-3px); border-color: rgba(231, 203, 255, .7);
  box-shadow: 0 20px 44px -18px rgba(218, 176, 255, .8), 0 0 0 1px rgba(231, 203, 255, .35);
}
.game-tile:not(.locked):hover img { transform: scale(1.06); }
.game-tile:focus-visible { outline: none; }

.game-name { position: absolute; left: 14px; bottom: 12px; z-index: 2; font-family: var(--font-display); font-weight: 700; font-size: 17px; letter-spacing: -.01em; }
.game-tile:not(.locked) .game-name::after {
  content: "Download ↓"; position: absolute; left: 0; bottom: 100%; margin-bottom: 2px; white-space: nowrap;
  font-family: "Inter", sans-serif; font-size: 12px; font-weight: 500; color: #ecd6ff;
  opacity: 0; transform: translateY(4px); transition: opacity .25s, transform .25s;
}
.game-tile:not(.locked):hover .game-name::after { opacity: 1; transform: none; }

.badge {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  font-size: 11px; font-weight: 700; padding: 4px 9px; border-radius: 999px; line-height: 1.2;
}
.badge.owned { background: linear-gradient(180deg, #dcb4ff, #dbb1ff); color: #26103f; }
.badge.ready { background: rgba(8, 24, 16, .85); color: var(--ok); border: 1px solid rgba(125, 245, 176, .4); }
.badge.pending { background: rgba(28, 22, 6, .85); color: var(--warn); border: 1px solid rgba(245, 217, 139, .35); }
.badge.lock { background: rgba(10, 5, 14, .7); border: 1px solid rgba(255, 255, 255, .12); font-size: 10px; padding: 4px 7px; }

.game-tile.locked { cursor: not-allowed; }
.game-tile.locked img { filter: grayscale(1) brightness(.4); }

.game-note { margin-top: 16px; color: var(--muted); font-size: 13.5px; min-height: 18px; }
.game-note.ok { color: var(--ok); }
.game-note.warn { color: var(--warn); }
.game-note strong { color: var(--text); font-weight: 700; }
.dl-link { color: var(--accent); font-weight: 600; text-decoration: underline; }

/* ---- Footer ---------------------------------------------------------- */
.dash-foot { margin-top: 36px; display: flex; gap: 12px; justify-content: center; color: var(--faint); font-size: 13.5px; }
.dash-foot a { color: var(--muted); transition: color .2s; }
.dash-foot a:hover { color: var(--accent); }

/* ---- Build questionnaire modal --------------------------------------- */
.modal {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px;
  background: rgba(8, 4, 12, .66); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.modal-card {
  position: relative; width: 100%; max-width: 460px; padding: 28px;
  background: linear-gradient(180deg, rgba(41, 24, 56, .96), rgba(23, 15, 30, .97));
  border: 1px solid rgba(218, 176, 255, .38); border-radius: 14px;
  box-shadow: 0 0 60px -20px rgba(218, 176, 255, .55), 0 40px 80px -30px rgba(0, 0, 0, .9);
  animation: rise .35s cubic-bezier(.22, 1, .36, 1);
}
.modal-close {
  position: absolute; top: 12px; right: 14px; width: 32px; height: 32px; border-radius: 50%;
  background: none; border: 0; color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer;
}
.modal-close:hover { color: var(--text); background: rgba(255, 255, 255, .06); }
.modal-title { font-family: var(--font-display); font-size: 22px; font-weight: 700; letter-spacing: -.02em; padding-right: 30px; }
.modal-sub { color: var(--muted); font-size: 14px; line-height: 1.55; margin: 6px 0 20px; }
.q-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.q-field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.q-field span { font-size: 13px; font-weight: 600; }
.modal-result { font-size: 13px; line-height: 1.55; margin-top: 14px; min-height: 18px; color: var(--muted); }
.modal-result.ok { color: var(--ok); }
.modal-result.error { color: var(--danger); }
.modal-result strong { color: var(--text); }

/* ---- Responsive ------------------------------------------------------ */
@media (max-width: 960px) {
  .dash-grid { grid-template-columns: minmax(0, 1fr); }
  .side { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
}
@media (max-width: 720px) {
  .topbar-inner { grid-template-columns: 1fr auto; padding: 0 16px; }
  .topnav { display: none; }
  .dash { padding: 28px 16px 56px; }
  .hello { gap: 14px; }
  .hello-avatar { width: 54px; height: 54px; }
  .side { grid-template-columns: minmax(0, 1fr); }
  .library { padding: 18px; }
}
@media (max-width: 460px) {
  .topbar-actions .btn-ghost:first-child { display: none; }
  .game-grid { gap: 10px; }
  .game-name { font-size: 15px; left: 11px; bottom: 9px; }
  .q-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .hello, .card, .modal-card { animation: none; }
  .game-tile, .game-tile img, .progress span { transition: none; }
}
