:root {
  color-scheme: dark;
  --bg: #0a0814;
  --panel: #141022;
  --panel-2: #1b1630;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --text: #f6f4fb;
  --muted: #a49fb8;
  --muted-2: #6f6a86;
  --pink: #ff2d55;
  --cyan: #25f4ee;
  --violet: #7a5cff;
  --gold: #ffd25e;
  --ok: #3ef0b4;
  --warn: #ffbf5c;
  --bad: #ff6b85;
  --radius: 20px;
  --display: 'Luckiest Guy', 'Segoe UI Black', sans-serif;
  font-family: 'Outfit', 'Segoe UI Variable Text', 'Segoe UI', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); }
body { font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--cyan); }
h1, h2, h3, p { margin: 0; }
button, input { font: inherit; color: inherit; }
.hidden, [hidden] { display: none !important; }

.backdrop { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.backdrop i { position: absolute; width: 46rem; height: 46rem; border-radius: 50%; filter: blur(140px); opacity: 0.16; animation: drift 24s ease-in-out infinite alternate; }
.backdrop i:nth-child(1) { left: -14rem; top: -10rem; background: var(--pink); }
.backdrop i:nth-child(2) { right: -16rem; top: 20rem; background: var(--cyan); animation-delay: -8s; opacity: 0.1; }
.backdrop i:nth-child(3) { left: 30%; bottom: -26rem; background: var(--violet); animation-delay: -16s; }
@keyframes drift { to { transform: translate(6rem, 4rem) scale(1.15); } }

.eyebrow { margin-bottom: 8px; color: var(--gold); font-size: 11px; font-weight: 800; letter-spacing: 0.18em; text-transform: uppercase; }
.tiny { color: var(--muted); font-size: 13px; line-height: 1.45; }
.tiny b { color: var(--text); font-weight: 700; }
.center { text-align: center; }

/* ---------- buttons & inputs ---------- */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: none;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease, opacity 0.2s;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(1px) scale(0.98); }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn-primary {
  background: linear-gradient(135deg, #ff2d55, #ff5f7e 55%, #ff8a5c);
  color: #fff;
  box-shadow: 0 10px 30px rgba(255, 45, 85, 0.3), inset 0 1px rgba(255, 255, 255, 0.3);
}
.btn-primary:hover:not(:disabled) { box-shadow: 0 14px 36px rgba(255, 45, 85, 0.42), inset 0 1px rgba(255, 255, 255, 0.3); }
.btn-ghost { border-color: var(--line-2); background: rgba(255, 255, 255, 0.04); color: var(--text); }
.btn-ghost:hover:not(:disabled) { border-color: rgba(255, 255, 255, 0.28); background: rgba(255, 255, 255, 0.07); }
.btn-link { min-height: 36px; padding: 0 6px; color: var(--muted); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.btn-link:hover { color: var(--text); }
.btn-sm { min-height: 36px; padding: 0 14px; border-radius: 11px; font-size: 13px; }
.btn-block { width: 100%; }
.btn.busy span { opacity: 0; }
.btn.busy::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.btn.done { background: linear-gradient(135deg, #12b886, #3ef0b4); box-shadow: 0 10px 30px rgba(62, 240, 180, 0.3); color: #04251a; }
@keyframes spin { to { transform: rotate(360deg); } }

.field { display: grid; gap: 7px; min-width: 0; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: 0.02em; }
input:not([type="range"]):not([type="checkbox"]) {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line-2);
  border-radius: 13px;
  outline: none;
  background: #0c0a16;
  font-size: 15px;
  font-weight: 600;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
input::placeholder { color: #565170; font-weight: 500; }
input:focus { border-color: rgba(255, 45, 85, 0.7); background: #100d1c; box-shadow: 0 0 0 4px rgba(255, 45, 85, 0.14); }

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 10px;
  margin: 10px 0 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--pink) 0 var(--fill, 25%), rgba(255, 255, 255, 0.1) var(--fill, 25%) 100%);
  outline: none;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, #ffe6ec 40%, #ff9fb2);
  border: 3px solid var(--pink);
  box-shadow: 0 4px 14px rgba(255, 45, 85, 0.5);
  transition: transform 0.15s;
}
input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.18); }
input[type="range"]::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 3px solid var(--pink); }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch-ui {
  position: relative;
  flex: 0 0 auto;
  width: 46px;
  height: 27px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  transition: background 0.25s;
}
.switch-ui::after {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  transition: transform 0.3s cubic-bezier(0.3, 1.5, 0.5, 1);
}
.switch input:checked + .switch-ui { background: linear-gradient(135deg, #12b886, #3ef0b4); }
.switch input:checked + .switch-ui::after { transform: translateX(19px); }
.switch input:focus-visible + .switch-ui { box-shadow: 0 0 0 4px rgba(62, 240, 180, 0.25); }
.switch-label { font-size: 13px; font-weight: 700; color: var(--muted); }
.switch.big .switch-label { display: grid; color: var(--text); font-size: 14px; }
.switch.big small { color: var(--muted); font-weight: 500; font-size: 12px; }

/* ---------- gates ---------- */

.gate {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  place-items: center;
  padding: 20px;
  background: rgba(10, 8, 20, 0.82);
  backdrop-filter: blur(18px);
}
body.need-login #authGate { display: grid; }
body.pass-locked #passLock { display: grid; }
body.need-login .shell, body.pass-locked .shell { filter: blur(4px); pointer-events: none; }
body.booting .shell { opacity: 0; }

.gate-card {
  position: relative;
  display: grid;
  gap: 14px;
  width: min(430px, 100%);
  padding: 34px 30px 26px;
  border: 1px solid var(--line-2);
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 30%), var(--panel);
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6);
  animation: rise 0.6s cubic-bezier(0.2, 1.3, 0.3, 1);
}
.gate-card h1 { font: 400 32px/1.05 var(--display); letter-spacing: 0.01em; }
.gate-card .eyebrow { margin: 0; }
.gate-copy { color: var(--muted); }
.gate-foot { color: var(--muted); font-size: 13px; text-align: center; }
.form-error { padding: 10px 12px; border-radius: 11px; background: rgba(255, 107, 133, 0.12); color: var(--bad); font-size: 13px; font-weight: 700; animation: nudge 0.35s; }
@keyframes nudge { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@keyframes rise { from { opacity: 0; transform: translateY(24px) scale(0.96); } to { opacity: 1; transform: none; } }

.seg { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 13px; background: rgba(255, 255, 255, 0.05); }
.seg button { height: 38px; border: 0; border-radius: 10px; background: none; color: var(--muted); font-weight: 800; cursor: pointer; transition: background 0.2s, color 0.2s; }
.seg button.on { background: rgba(255, 255, 255, 0.1); color: var(--text); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3); }

.mini-wheel {
  position: absolute;
  top: -38px;
  left: 50%;
  width: 76px;
  height: 76px;
  margin-left: -38px;
  border-radius: 50%;
  padding: 5px;
  background: linear-gradient(180deg, #fff3c2, #ffd25e 30%, #b9790f 70%, #ffd96b);
  box-shadow: 0 10px 30px rgba(255, 45, 85, 0.35);
}
.mini-wheel span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: conic-gradient(#ff2d55 0 60deg, #19d9d2 60deg 120deg, #6b52f0 120deg 180deg, #ff2d55 180deg 240deg, #19d9d2 240deg 300deg, #6b52f0 300deg 360deg);
  animation: spin 6s linear infinite;
}
.mini-wheel::after { content: ''; position: absolute; left: 50%; top: 50%; width: 16px; height: 16px; margin: -8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 3px #3a2410; }
.mini-wheel.locked span { filter: grayscale(0.8) brightness(0.6); animation-duration: 30s; }
.gate-card > .eyebrow { margin-top: 22px; }

/* ---------- shell ---------- */

.shell { width: min(1240px, calc(100% - 40px)); margin: 0 auto; transition: opacity 0.4s, filter 0.3s; }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 76px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; }
.brand-wheel {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 3px solid var(--gold);
  background: conic-gradient(#ff2d55 0 60deg, #19d9d2 60deg 120deg, #6b52f0 120deg 180deg, #ff2d55 180deg 240deg, #19d9d2 240deg 300deg, #6b52f0 300deg 360deg);
  box-shadow: 0 0 0 2px #3a2410, 0 6px 20px rgba(255, 45, 85, 0.35);
  animation: spin 14s linear infinite;
}
.brand:hover .brand-wheel { animation-duration: 1.2s; }
.brand-text { display: grid; line-height: 1.1; }
.brand-text strong { font: 400 22px/1 var(--display); letter-spacing: 0.02em; }
.brand-text small { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.topbar-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.user-chip { padding: 7px 12px; border-radius: 999px; background: rgba(255, 255, 255, 0.05); color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: 0.06em; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted-2); }
.pill[data-state="connected"] { color: var(--ok); border-color: rgba(62, 240, 180, 0.35); background: rgba(62, 240, 180, 0.08); }
.pill[data-state="connected"] i { background: var(--ok); animation: beat 1.6s ease-out infinite; }
.pill[data-state="waiting"], .pill[data-state="connecting"] { color: var(--warn); border-color: rgba(255, 191, 92, 0.3); background: rgba(255, 191, 92, 0.07); }
.pill[data-state="waiting"] i, .pill[data-state="connecting"] i { background: var(--warn); animation: beat 1.6s ease-out infinite; --beat: rgba(255, 191, 92, 0.6); }
.pill[data-state="error"] { color: var(--bad); border-color: rgba(255, 107, 133, 0.35); }
.pill[data-state="error"] i { background: var(--bad); }
@keyframes beat { 0% { box-shadow: 0 0 0 0 var(--beat, rgba(62, 240, 180, 0.6)); } 100% { box-shadow: 0 0 0 9px rgba(0, 0, 0, 0); } }

/* ---------- hero ---------- */

.hero { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 30px; align-items: end; padding: 26px 0 26px; }
.hero h1 { font: 400 clamp(40px, 5.6vw, 68px)/0.98 var(--display); letter-spacing: 0.01em; }
.hero h1 span { color: transparent; background: linear-gradient(95deg, var(--pink), #ff8a5c 45%, var(--gold)); -webkit-background-clip: text; background-clip: text; }
.hero-copy { max-width: 600px; margin-top: 14px; color: var(--muted); font-size: 16px; }

.progress-card { padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255, 255, 255, 0.03); }
.progress-top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.progress-top strong { font-size: 16px; }
.progress-top span { color: var(--muted); font-size: 13px; }
.progress-bar { height: 10px; margin: 12px 0 12px; border-radius: 999px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.progress-bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--pink), var(--gold) 60%, var(--ok)); transition: width 0.8s cubic-bezier(0.3, 1.2, 0.4, 1); }
.progress-dots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 0; padding: 0; list-style: none; }
.progress-dots li { display: flex; align-items: center; gap: 6px; color: var(--muted-2); font-size: 12px; font-weight: 800; }
.progress-dots li::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: rgba(255, 255, 255, 0.14); transition: background 0.3s, box-shadow 0.3s; }
.progress-dots li.done { color: var(--text); }
.progress-dots li.done::before { background: var(--ok); box-shadow: 0 0 10px var(--ok); }

.allset {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  padding: 14px 18px;
  border: 1px solid rgba(62, 240, 180, 0.35);
  border-radius: 16px;
  background: linear-gradient(90deg, rgba(62, 240, 180, 0.12), rgba(62, 240, 180, 0.03));
  animation: rise 0.6s cubic-bezier(0.2, 1.3, 0.3, 1);
}
.allset-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--ok); color: #04251a; font-weight: 900; }

/* ---------- layout ---------- */

.layout { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 26px; align-items: start; }
.steps { display: grid; gap: 18px; }

.step {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 40%), var(--panel);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  opacity: 0;
  transform: translateY(16px);
  animation: rise 0.6s cubic-bezier(0.2, 1.2, 0.3, 1) forwards;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.step:nth-child(2) { animation-delay: 0.06s; }
.step:nth-child(3) { animation-delay: 0.12s; }
.step:nth-child(4) { animation-delay: 0.18s; }
.step.current { border-color: rgba(255, 45, 85, 0.45); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 0 0 4px rgba(255, 45, 85, 0.08); }
.step.done { border-color: rgba(62, 240, 180, 0.22); }

.step-head { display: flex; gap: 16px; align-items: center; padding: 22px 24px 0; }
.step-head h2 { font-size: 20px; font-weight: 800; letter-spacing: -0.01em; }
.step-head p { color: var(--muted); font-size: 14px; }
.step-num {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line-2);
  font-weight: 900;
  font-size: 17px;
  transition: background 0.35s, border-color 0.35s, transform 0.35s cubic-bezier(0.3, 1.6, 0.5, 1);
}
.step.current .step-num { background: linear-gradient(135deg, var(--pink), #ff8a5c); border-color: transparent; color: #fff; }
.step-num svg { position: absolute; width: 24px; height: 24px; fill: none; stroke: #04251a; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 24; stroke-dashoffset: 24; transition: stroke-dashoffset 0.5s 0.15s ease; }
.step.done .step-num { background: var(--ok); border-color: transparent; transform: rotate(-8deg) scale(1.04); }
.step.done .step-num b { opacity: 0; }
.step.done .step-num svg { stroke-dashoffset: 0; }
.step-body { display: grid; gap: 16px; padding: 18px 24px 24px 82px; }

.row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }

/* step 1 */
.connect-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: end; }
.connect-actions { display: flex; gap: 10px; }
.at-input { position: relative; display: block; }
.at-input em { position: absolute; left: 14px; top: 12px; color: var(--muted-2); font-style: normal; font-weight: 800; font-size: 16px; }
.at-input input { padding-left: 32px !important; }

.live-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.25);
  transition: border-color 0.3s, background 0.3s;
}
.live-text { display: grid; min-width: 0; flex: 1; }
.live-text strong { font-size: 15px; }
.live-text small { color: var(--muted); font-size: 13px; }
.live-orb { position: relative; display: grid; place-items: center; flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%; background: rgba(255, 255, 255, 0.06); }
.live-orb i { width: 12px; height: 12px; border-radius: 50%; background: var(--muted-2); }
.live-card[data-state="connected"] { border-color: rgba(62, 240, 180, 0.4); background: rgba(62, 240, 180, 0.06); }
.live-card[data-state="connected"] .live-orb { background: rgba(62, 240, 180, 0.14); }
.live-card[data-state="connected"] .live-orb i { background: var(--ok); animation: beat 1.4s ease-out infinite; }
.live-card[data-state="waiting"], .live-card[data-state="connecting"] { border-color: rgba(255, 191, 92, 0.32); background: rgba(255, 191, 92, 0.05); }
.live-card[data-state="waiting"] .live-orb i, .live-card[data-state="connecting"] .live-orb i { background: var(--warn); animation: beat 1.6s ease-out infinite; --beat: rgba(255, 191, 92, 0.6); }
.live-card[data-state="error"] { border-color: rgba(255, 107, 133, 0.38); background: rgba(255, 107, 133, 0.05); }
.live-card[data-state="error"] .live-orb i { background: var(--bad); }

.receipt { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 13px; background: rgba(255, 255, 255, 0.04); color: var(--muted); font-size: 13px; animation: rise 0.4s ease; }
.receipt img { width: 26px; height: 26px; object-fit: contain; }
.receipt b { color: var(--text); }
.receipt .tag { margin-left: auto; padding: 3px 9px; border-radius: 999px; background: rgba(255, 45, 85, 0.16); color: #ff9db1; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; }

/* step 2 */
.gift-current {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 12px 16px 12px 12px;
  border: 1px dashed rgba(255, 210, 94, 0.4);
  border-radius: 16px;
  background: rgba(255, 210, 94, 0.04);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
}
.gift-current:hover { border-color: rgba(255, 210, 94, 0.8); background: rgba(255, 210, 94, 0.08); }
.gift-current.chosen { border-style: solid; }
.gift-icon { display: grid; place-items: center; flex: 0 0 auto; width: 58px; height: 58px; border-radius: 14px; background: radial-gradient(circle, rgba(255, 210, 94, 0.18), rgba(0, 0, 0, 0.3)); font-size: 26px; }
.gift-icon img { width: 48px; height: 48px; object-fit: contain; animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-3px) rotate(4deg); } }
.gift-text { display: grid; flex: 1; min-width: 0; }
.gift-text strong { font-size: 17px; }
.gift-text small { color: var(--muted); font-size: 13px; }
.gift-change { color: var(--gold); font-size: 13px; font-weight: 800; }

.gift-browser { display: grid; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: rgba(0, 0, 0, 0.22); animation: rise 0.35s ease; }
.gift-search { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.gift-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; max-height: min(520px, 60vh); overflow-y: auto; overscroll-behavior: contain; padding: 2px 6px 2px 2px; }
.gift-tile {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 10px 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  text-align: center;
  cursor: pointer;
  animation: pop 0.3s cubic-bezier(0.3, 1.5, 0.5, 1) backwards;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}
.gift-tile:hover { border-color: rgba(255, 210, 94, 0.6); background: rgba(255, 210, 94, 0.07); transform: translateY(-2px); }
.gift-tile.on { border-color: var(--gold); background: rgba(255, 210, 94, 0.12); }
.gift-tile img { width: 44px; height: 44px; object-fit: contain; }
.gift-tile b { overflow: hidden; max-width: 100%; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.gift-tile small { color: var(--gold); font-size: 11px; font-weight: 800; }
@keyframes pop { from { opacity: 0; transform: scale(0.85); } }

/* step 3 */
.tune { display: grid; gap: 4px; }
.tune.two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: center; }
.tune-label { display: flex; justify-content: space-between; align-items: baseline; font-weight: 800; }
.tune-label b { font: 400 22px/1 var(--display); color: var(--gold); letter-spacing: 0.02em; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.chips button {
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  font-weight: 800;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}
.chips button:hover { border-color: rgba(255, 255, 255, 0.3); }
.chips button.on { border-color: transparent; background: linear-gradient(135deg, var(--pink), #ff8a5c); color: #fff; transform: translateY(-1px); box-shadow: 0 6px 18px rgba(255, 45, 85, 0.35); }
.input-unit { position: relative; display: inline-block; width: 110px; }
.input-unit input { height: 40px !important; padding-right: 40px !important; }
.input-unit em { position: absolute; right: 12px; top: 11px; color: var(--muted-2); font-size: 11px; font-style: normal; font-weight: 800; text-transform: uppercase; }
.volume-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.save-state { min-height: 20px; color: var(--muted); font-size: 13px; font-weight: 700; }
.save-state.ok { color: var(--ok); }
.save-state.err { color: var(--bad); }

/* step 4 */
.url-box { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 8px 8px 16px; border: 1px solid var(--line-2); border-radius: 16px; background: #0c0a16; }
.url-box code { overflow: hidden; color: var(--text); font: 600 13px/1.4 ui-monospace, 'Cascadia Code', Consolas, monospace; text-overflow: ellipsis; white-space: nowrap; }
.url-box.small { padding: 6px 6px 6px 14px; }
.presence { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; font-weight: 700; }
.presence-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--warn); animation: beat 1.6s ease-out infinite; --beat: rgba(255, 191, 92, 0.6); }
.presence[data-on="1"] { color: var(--ok); }
.presence[data-on="1"] .presence-dot { background: var(--ok); --beat: rgba(62, 240, 180, 0.6); }

.tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 13px; background: rgba(255, 255, 255, 0.05); justify-self: start; }
.tabs button { height: 36px; padding: 0 14px; border: 0; border-radius: 10px; background: none; color: var(--muted); font-weight: 800; cursor: pointer; }
.tabs button.on { background: rgba(255, 255, 255, 0.1); color: var(--text); }
.tab-panel { animation: rise 0.35s ease; }
.howto { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; counter-reset: how; }
.howto li { position: relative; padding-left: 34px; color: var(--muted); font-size: 14px; counter-increment: how; }
.howto li::before { content: counter(how); position: absolute; left: 0; top: 0; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; background: rgba(255, 210, 94, 0.14); color: var(--gold); font-size: 12px; font-weight: 900; }
.howto b { color: var(--text); }
.howto.compact li { font-size: 13px; }

.advanced { border: 1px solid var(--line); border-radius: 16px; background: rgba(0, 0, 0, 0.2); }
.advanced summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; font-weight: 800; cursor: pointer; list-style: none; }
.advanced summary::-webkit-details-marker { display: none; }
.advanced summary::after { content: '▾'; color: var(--muted); transition: transform 0.25s; }
.advanced[open] summary::after { transform: rotate(180deg); }
.advanced summary em { margin-left: auto; padding: 3px 9px; border-radius: 999px; background: rgba(122, 92, 255, 0.18); color: #b9a8ff; font-size: 11px; font-style: normal; text-transform: uppercase; letter-spacing: 0.06em; }
.advanced-body { display: grid; gap: 14px; padding: 0 16px 16px; }
.obs-grid { display: grid; grid-template-columns: minmax(0, 1fr) 110px; gap: 10px; }
.obs-grid .wide { grid-column: 1 / -1; }
.danger-row { justify-content: flex-end; }

/* ---------- preview ---------- */

.preview { position: sticky; top: 18px; }
.preview-card { overflow: hidden; border: 1px solid var(--line-2); border-radius: 22px; background: var(--panel); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4); animation: rise 0.7s 0.1s cubic-bezier(0.2, 1.2, 0.3, 1) backwards; }
.preview-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.preview-head strong { display: flex; align-items: center; gap: 8px; }
.preview-head strong::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--pink); box-shadow: 0 0 10px var(--pink); animation: beat 1.6s ease-out infinite; --beat: rgba(255, 45, 85, 0.6); }
.icon-btn { width: 36px; height: 36px; border: 1px solid var(--line-2); border-radius: 11px; background: rgba(255, 255, 255, 0.04); cursor: pointer; font-size: 16px; }
.icon-btn[aria-pressed="true"] { border-color: rgba(62, 240, 180, 0.5); background: rgba(62, 240, 180, 0.1); }
.preview-frame {
  position: relative;
  aspect-ratio: 1 / 1.08;
  background:
    radial-gradient(circle at 30% 20%, rgba(122, 92, 255, 0.25), transparent 60%),
    repeating-conic-gradient(rgba(255, 255, 255, 0.025) 0 25%, transparent 0 50%) 0 0 / 22px 22px,
    #0e0b1a;
}
/* must match the overlay page's (light, it sets none) or Chrome paints the iframe solid white */
.preview-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: transparent; color-scheme: light; }
.preview-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted-2); font-size: 13px; font-weight: 700; pointer-events: none; }
.preview-actions { display: grid; gap: 8px; padding: 14px 16px 16px; }
.test-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 8px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; font-weight: 800; }
.test-row span { margin-right: auto; }

.foot { padding: 40px 0 30px; color: var(--muted-2); font-size: 12px; text-align: center; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 60;
  padding: 12px 18px;
  border-radius: 14px;
  background: #221b38;
  border: 1px solid var(--line-2);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  font-size: 14px;
  font-weight: 700;
  opacity: 0;
  transform: translate(-50%, 20px);
  transition: opacity 0.25s, transform 0.35s cubic-bezier(0.3, 1.4, 0.5, 1);
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.ok { border-color: rgba(62, 240, 180, 0.5); }
.toast.err { border-color: rgba(255, 107, 133, 0.5); }

/* ---------- small screens ---------- */

@media (max-width: 1080px) {
  .layout { grid-template-columns: 1fr; }
  .preview { position: static; order: -1; }
  .preview-card { max-width: 520px; margin: 0 auto; }
  .hero { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .shell { width: calc(100% - 28px); }
  .topbar { min-height: 64px; }
  .brand-text small, .user-chip { display: none; }
  .step-head { padding: 18px 16px 0; }
  .step-body { padding: 16px; }
  .connect-row, .tune.two, .gift-search, .url-box { grid-template-columns: 1fr; }
  .connect-actions .btn { flex: 1; }
  .url-box { padding: 12px; }
  .live-card { flex-wrap: wrap; }
  .gate-card { padding: 34px 20px 22px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ---------- gift image for the stream (a transparent PNG sticker, shared by every tool) ----------
   Quiet on purpose: it sits under the gift picker and must not compete with it. */
.sticker-card {
  display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 14px; align-items: center;
  margin-top: 10px; padding: 10px 12px; border-radius: 14px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.025);
}
.sticker-thumb {
  display: grid; place-items: center; width: 64px; height: 64px; padding: 4px; border-radius: 10px; overflow: hidden;
  background: conic-gradient(#221c34 25%, #18132a 0 50%, #221c34 0 75%, #18132a 0) 0 0 / 12px 12px;   /* see-through check */
}
.sticker-thumb canvas { display: block; max-width: 100%; max-height: 100%; }
.sticker-text { display: grid; gap: 2px; min-width: 0; }
.sticker-text strong { font-size: 13.5px; font-weight: 800; line-height: 1.25; }
.sticker-text p { color: var(--muted); font-size: 12px; line-height: 1.4; }
.sticker-actions { display: flex; margin-top: 6px; }
/* the card under each of two side-by-side gift pickers */
.sticker-card.compact { grid-template-columns: 56px minmax(0, 1fr); gap: 12px; }
.sticker-card.compact .sticker-thumb { width: 56px; height: 56px; }
@media (max-width: 560px) {
  .sticker-card { grid-template-columns: 56px minmax(0, 1fr); }
  .sticker-card .sticker-thumb { width: 56px; height: 56px; }
}