:root {
  --bg: #07060b;
  --ink: #f6f4fb;
  --muted: #a7a2b8;
  --cyan: #36c5f0;
  --magenta: #e4187d;
  --yellow: #f6e61b;
  --purple: #9b2a7c;
  --gold: #f2c14e;
  --panel: rgba(22, 19, 32, 0.78);
  --line: rgba(255, 255, 255, 0.12);
  --grad: linear-gradient(100deg, var(--cyan), var(--magenta) 45%, var(--yellow) 75%, var(--purple));
  --font: "Avenir Next", "Montserrat", "Segoe UI", Roboto, system-ui, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font-family: var(--font); }
body { -webkit-font-smoothing: antialiased; overscroll-behavior: none; }
button, input, select { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .6em;
  min-height: 56px; padding: 0 28px; border-radius: 999px; border: 1px solid var(--line);
  background: rgba(255,255,255,.06); font-weight: 700; font-size: 18px; letter-spacing: .02em;
  cursor: pointer; transition: transform .15s ease, box-shadow .2s ease, background .2s;
  user-select: none; text-decoration: none; color: var(--ink); white-space: nowrap;
}
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .6; pointer-events: none; }
.btn, .icon-btn { touch-action: manipulation; }
.btn-primary {
  border: 0; color: #fff;
  background: linear-gradient(120deg, var(--magenta), var(--purple) 60%, #5a1d6e);
  box-shadow: 0 10px 30px -8px rgba(228, 24, 125, .7), inset 0 1px 0 rgba(255,255,255,.25);
}
.btn-primary:hover { box-shadow: 0 14px 40px -8px rgba(228, 24, 125, .9), inset 0 1px 0 rgba(255,255,255,.3); }
.btn-gold {
  border: 0; color: #2b1600;
  background: linear-gradient(180deg, #ffe7a0, #f2c14e 45%, #c98a12);
  box-shadow: inset 0 2px 0 rgba(255,255,255,.6), inset 0 -3px 0 rgba(0,0,0,.15);
}
.btn-ghost { background: transparent; }
.btn-lg { min-height: 72px; padding: 0 clamp(22px, 5vw, 44px); font-size: clamp(20px, 3vw, 24px); }

.icon-btn {
  width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--line); background: rgba(10, 8, 16, .45); backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px); cursor: pointer; color: var(--ink); transition: transform .15s, background .2s;
}
.icon-btn:active { transform: scale(.92); }
.icon-btn:hover { background: rgba(255,255,255,.12); }
.icon-btn svg { width: 26px; height: 26px; }

.field { display: grid; gap: 8px; text-align: left; font-size: 14px; color: var(--muted); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.field input {
  height: 56px; border-radius: 14px; border: 1px solid var(--line); background: rgba(0,0,0,.35);
  padding: 0 18px; font-size: 18px; text-transform: none; letter-spacing: 0; outline: none; transition: border-color .2s, box-shadow .2s;
}
.field input:focus { border-color: var(--cyan); box-shadow: 0 0 0 4px rgba(54, 197, 240, .18); }
.form-error { min-height: 1.2em; margin: 0; color: #ff6b9a; font-weight: 600; font-size: 15px; }

.modal-backdrop {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px;
  background: rgba(4, 3, 8, .6); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  opacity: 0; transition: opacity .25s;
}
.modal-backdrop.open { opacity: 1; }
.modal {
  width: min(440px, 100%); max-height: calc(100dvh - 32px); overflow: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: 26px; padding: 30px;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.8); display: grid; gap: 18px; text-align: center;
  transform: translateY(16px) scale(.97); transition: transform .3s cubic-bezier(.2,.9,.3,1.2);
}
.modal-backdrop.open .modal { transform: none; }
.modal h2 { margin: 0; font-size: 24px; }
.modal-icon { justify-self: center; width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: var(--grad); color: #fff; }
.modal-actions { display: flex; gap: 12px; justify-content: flex-end; flex-wrap: wrap; }
.modal-actions .btn { flex: 1; }

.shake { animation: shake .45s; }
@keyframes shake { 20%, 60% { transform: translateX(-10px); } 40%, 80% { transform: translateX(10px); } }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
