:root {
  --page: #f7f8fc;
  --surface: #ffffff;
  --surface-soft: #f0f2f8;
  --text: #161829;
  --muted: #686c7e;
  --line: #e2e5ee;
  --primary: #6558e8;
  --primary-dark: #4d42c8;
  --santa: #c8323f;
  --santa-dark: #a32631;
  --santa-soft: #fdeceb;
  --pine: #1e6b52;
  --pine-soft: #e3f4ec;
  --gold: #e3a93b;
  --danger: #a43f4c;
  --shadow: 0 24px 70px rgba(40, 42, 70, .11);
  --radius: 20px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 6% 0%, rgba(200, 50, 63, .10), transparent 26rem),
    radial-gradient(circle at 96% 10%, rgba(30, 107, 82, .11), transparent 30rem),
    var(--page);
  font-family: 'Manrope', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
button, input, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.shell { width: min(880px, calc(100% - 32px)); margin: 0 auto; }

.topbar { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; font-size: 17px; letter-spacing: -.4px; }
.brand-mark { position: relative; width: 32px; height: 32px; border-radius: 10px; background: linear-gradient(145deg, #7569f5, #5145cf); box-shadow: 0 8px 20px rgba(101,88,232,.25); overflow: hidden; }
.brand-mark::before, .brand-mark::after { content: ''; position: absolute; border-radius: 50%; background: #fff; }
.brand-mark::before { width: 11px; height: 11px; left: 6px; top: 6px; }
.brand-mark::after { width: 8px; height: 8px; right: 5px; bottom: 6px; opacity: .68; }
.brand-game { color: var(--muted); font-weight: 700; }
.account-chip { display: inline-flex; align-items: center; min-height: 38px; padding: 0 14px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); font-size: 13px; font-weight: 700; text-decoration: none; max-width: 50vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 20px; border: 0; border-radius: 13px;
  background: var(--santa); color: #fff; font-weight: 800; font-size: 14px;
  text-decoration: none; cursor: pointer; transition: transform .15s ease, background .15s ease, box-shadow .15s ease;
  box-shadow: 0 10px 24px rgba(200, 50, 63, .22);
}
.btn:hover { background: var(--santa-dark); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn.secondary { background: var(--surface); color: var(--text); border: 1px solid var(--line); box-shadow: none; }
.btn.secondary:hover { background: var(--surface-soft); }
.btn.ghost { background: transparent; color: var(--muted); box-shadow: none; padding: 0 12px; }
.btn.ghost:hover { color: var(--text); background: var(--surface-soft); }
.btn.dark { background: var(--text); box-shadow: 0 10px 24px rgba(22,24,41,.18); }
.btn.dark:hover { background: #2a2d45; }
.btn.danger { background: var(--danger); box-shadow: none; }
.btn.small { min-height: 36px; padding: 0 13px; font-size: 13px; border-radius: 10px; }
.btn.block { width: 100%; }

.input {
  width: 100%; min-height: 48px; padding: 0 15px;
  border: 1px solid var(--line); border-radius: 13px; background: var(--surface);
  font-size: 15px; outline: none; transition: border-color .15s, box-shadow .15s;
}
textarea.input { padding: 12px 15px; min-height: 120px; resize: vertical; line-height: 1.5; }
.input:focus { border-color: var(--santa); box-shadow: 0 0 0 4px rgba(200, 50, 63, .12); }
.code-input { text-transform: uppercase; letter-spacing: 3px; font-weight: 800; text-align: center; font-size: 19px; }

.card {
  padding: clamp(20px, 4vw, 30px);
  border: 1px solid var(--line); border-radius: var(--radius);
  background: rgba(255,255,255,.9); box-shadow: var(--shadow);
}
.eyebrow { margin: 0 0 6px; color: var(--santa); font-size: 12px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; }
.muted { color: var(--muted); }
.small-text { font-size: 13px; }
h1, h2, h3 { margin: 0; letter-spacing: -.03em; }

.notice { padding: 13px 15px; border-radius: 13px; font-size: 14px; font-weight: 600; line-height: 1.5; }
.notice.ok { background: var(--pine-soft); color: var(--pine); }
.notice.warn { background: #fff4de; color: #85590e; }
.notice.error { background: var(--santa-soft); color: var(--santa-dark); }

.toast {
  position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 20px);
  padding: 12px 18px; border-radius: 12px; background: var(--text); color: #fff; font-weight: 700; font-size: 14px;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 50; max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--santa); border-radius: 50%; animation: spin .8s linear infinite; margin: 40px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

.footer { padding: 40px 0 calc(30px + env(safe-area-inset-bottom, 0px)); color: var(--muted); font-size: 12px; text-align: center; }
