:root {
  --bg: #0b1020;
  --bg2: #111833;
  --card: #171f3a;
  --card2: #1d2647;
  --line: rgba(255, 255, 255, 0.10);
  --text: #f4f1e8;
  --muted: #a9b0c6;
  --gold: #e8bd4f;
  --gold2: #f8dc84;
  --ok: #2fcf8a;
  --bad: #ef5367;
  --opt-0: #e0455b;
  --opt-1: #3b7ddd;
  --opt-2: #e6b94c;
  --opt-3: #2fb67c;
  --opt-4: #9a5be8;
  --opt-5: #f08a3c;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: radial-gradient(1200px 800px at 10% -10%, #1b2550 0%, var(--bg) 55%),
              radial-gradient(900px 600px at 110% 110%, #2a1f3f 0%, transparent 60%), var(--bg);
  color: var(--text);
  font-family: ui-rounded, -apple-system, BlinkMacSystemFont, "SF Pro Rounded", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--gold2); }
h1, h2, h3 { margin: 0 0 0.4em; line-height: 1.15; }
.muted { color: var(--muted); }
.gold { color: var(--gold); }
.ok { color: var(--ok); }
.bad { color: var(--bad); }
.hidden { display: none !important; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 18px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--card2); color: var(--text); cursor: pointer; font-weight: 600;
  transition: transform 0.08s ease, background 0.15s ease, opacity 0.15s ease;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { background: #253058; }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn-primary { background: linear-gradient(180deg, var(--gold2), var(--gold)); color: #231a05; border-color: transparent; }
.btn-primary:hover { background: linear-gradient(180deg, #ffe79a, #f0c85c); }
.btn-danger { background: rgba(239, 83, 103, 0.15); border-color: rgba(239, 83, 103, 0.45); color: #ffb3bd; }
.btn-danger:hover { background: rgba(239, 83, 103, 0.3); }
.btn-ok { background: rgba(47, 207, 138, 0.15); border-color: rgba(47, 207, 138, 0.45); color: #a9f3d0; }
.btn-sm { padding: 7px 12px; font-size: 0.9rem; }
.btn-lg { padding: 16px 28px; font-size: 1.15rem; }

input[type=text], input[type=number], input[type=password], input[type=url], textarea, select {
  width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.25); color: var(--text); font-size: 16px; outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(232, 189, 79, 0.2); }
textarea { resize: vertical; min-height: 90px; }
label { display: block; font-size: 0.9rem; color: var(--muted); margin-bottom: 6px; }
.field { margin-bottom: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1 1 auto; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  background: var(--card2); border: 1px solid var(--line); font-weight: 600; font-size: 0.95rem;
}
.dot { width: 9px; height: 9px; border-radius: 50%; background: #5a6283; display: inline-block; }
.dot.on { background: var(--ok); box-shadow: 0 0 8px var(--ok); }

.opt-color-0 { background: var(--opt-0); }
.opt-color-1 { background: var(--opt-1); }
.opt-color-2 { background: var(--opt-2); }
.opt-color-3 { background: var(--opt-3); }
.opt-color-4 { background: var(--opt-4); }
.opt-color-5 { background: var(--opt-5); }

.letter {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
  width: 2.2em; height: 2.2em; border-radius: 12px; font-weight: 800; color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: #2a1f3f; border: 1px solid var(--line); color: var(--text);
  padding: 12px 18px; border-radius: 12px; box-shadow: var(--shadow); z-index: 50;
  max-width: 90vw; opacity: 0; transition: opacity 0.2s ease; pointer-events: none;
}
.toast.show { opacity: 1; }
.toast.error { border-color: rgba(239, 83, 103, 0.6); }

.bar { height: 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.bar > div { height: 100%; background: linear-gradient(90deg, var(--gold2), var(--gold)); border-radius: 999px; width: 100%; }
.bar.warn > div { background: linear-gradient(90deg, #ff9b7a, var(--bad)); }

@keyframes pop { 0% { transform: scale(0.9); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
.pop { animation: pop 0.25s ease-out both; }
.pulse { animation: pulse 1.4s ease-in-out infinite; }
