/*
 * Mobile-first spin trader UI. Copier tokens + data-copier-theme (see /copier/theme.js).
 * Fluid type: clamp(); wheel: min(vmin, rem); safe-area padding for notched devices.
 */
:root {
  color-scheme: dark;
  --bg: #0b1020;
  --panel: rgba(255, 255, 255, 0.06);
  --panel2: rgba(255, 255, 255, 0.04);
  --border: rgba(255, 255, 255, 0.12);
  --text: #e8edf8;
  --muted: rgba(232, 237, 248, 0.72);
  --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans";
  --accent: #7c5cff;
  --accent2: #26d1ff;
  --danger: #ff4d6d;
  --ok: #2ee59d;
}

/* Embedded in /webterminal: parent supplies Demo/Real, tabs, auth — hide duplicate chrome. */
html.spin-embed header.topbar,
html.spin-embed #spinSubtabs {
  display: none !important;
}
html.spin-embed .copier-theme-switch {
  display: none !important;
}

html[data-copier-theme="light"] {
  color-scheme: light;
  --bg: #f4f6fb;
  --panel: rgba(15, 23, 42, 0.06);
  --panel2: rgba(15, 23, 42, 0.04);
  --border: rgba(15, 23, 42, 0.12);
  --text: #0f172a;
  --muted: rgba(15, 23, 42, 0.65);
  --accent: #5b4cdb;
  --accent2: #0ea5e9;
  --danger: #e11d48;
  --ok: #059669;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: clamp(0.9rem, 2.8vw, 1.05rem);
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  padding: max(10px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
}

.bg {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(1200px 600px at 10% 10%, rgba(124, 92, 255, 0.18), transparent 60%),
    radial-gradient(900px 520px at 90% 20%, rgba(38, 209, 255, 0.14), transparent 55%);
  pointer-events: none;
  z-index: 0;
}

html[data-copier-theme="light"] .bg {
  background:
    radial-gradient(900px 480px at 12% 8%, rgba(124, 92, 255, 0.12), transparent 58%),
    radial-gradient(800px 420px at 88% 18%, rgba(14, 165, 233, 0.1), transparent 52%);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  margin: 0 0 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--panel);
  backdrop-filter: blur(12px);
}

.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.logo {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 800;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.35), rgba(38, 209, 255, 0.2));
}
.logo.logo--img {
  padding: 0;
  overflow: hidden;
  background: var(--panel2);
}
.logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  color: var(--accent, #a78bfa);
}
.brand-title { font-weight: 700; font-size: clamp(1rem, 3.2vw, 1.15rem); }
.brand-sub { font-size: clamp(0.75rem, 2.2vw, 0.85rem); color: var(--muted); }

.topbar-modes {
  flex: 1 1 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 0;
  order: 0;
}
.segmented--top .seg {
  min-height: 38px;
  min-width: 76px;
  padding: 0 12px;
  font-size: clamp(0.85rem, 2.4vw, 0.95rem);
}
.topbar-logout {
  min-height: 40px;
  padding: 8px 14px;
  font-size: 0.9rem;
}

.topbar-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: 0 1 auto;
  min-width: 0;
}
.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: clamp(0.72rem, 2.2vw, 0.82rem);
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--panel2);
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pill--mode {
  background: rgba(124, 92, 255, 0.22);
  border-color: rgba(124, 92, 255, 0.35);
}
.pill--session { font-weight: 500; }
.pill--session.is-ok {
  border-color: rgba(46, 229, 157, 0.45);
  background: rgba(46, 229, 157, 0.12);
  color: var(--ok);
}
.pill--session.is-warn {
  border-color: rgba(255, 77, 109, 0.45);
  background: rgba(255, 77, 109, 0.1);
  color: var(--danger);
}

.topbar-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* [hidden] must win over .btn / .btn--icon display (otherwise Sign in stays visible). */
#btnSignInTop[hidden],
#btnLogoutTop[hidden] {
  display: none !important;
}

#pillSession[hidden] {
  display: none !important;
}

/* Belt-and-suspenders: JS toggles this class with [hidden] for top bar controls. */
#btnSignInTop.spin-topbar-btn--off,
#btnLogoutTop.spin-topbar-btn--off,
#pillSession.spin-topbar-btn--off {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.live-strip {
  position: relative;
  z-index: 4;
  width: min(96vw, 72rem);
  margin: 0 auto 10px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(135deg, rgba(8, 12, 28, 0.92) 0%, rgba(18, 24, 48, 0.88) 50%, rgba(12, 20, 40, 0.92) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(10px);
}
.live-strip__accounts {
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  color: #c8d4f0;
  font-size: clamp(0.66rem, 1.85vw, 0.78rem);
}
html[data-copier-theme="light"] .live-strip {
  border-color: rgba(15, 23, 42, 0.35);
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.92) 0%, rgba(30, 41, 59, 0.9) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
html[data-copier-theme="light"] .live-strip__accounts {
  color: #e2e8f0;
}

html.spin-auth-open .live-strip {
  visibility: hidden;
  pointer-events: none;
}

.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

.page-layout {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  width: min(96vw, 72rem);
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.auth-msg {
  margin: 10px 0 0;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
}
.auth-msg--progress { color: var(--accent2); }
.auth-msg--ok { color: var(--ok); }

.main {
  position: relative;
  z-index: 1;
  max-width: 28rem;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.page-main--wheel {
  max-width: min(96vw, 26rem);
  margin-left: auto;
  margin-right: auto;
  align-items: center;
}
.page-layout .main {
  margin: 0;
  width: 100%;
}
@media (min-width: 900px) {
  .page-layout--spin {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    width: min(96vw, 56rem);
  }
  .page-layout--spin .page-main--wheel {
    max-width: min(48vw, 28rem);
    margin-left: auto;
    margin-right: auto;
  }
}
@media (min-width: 900px) {
  .page-layout {
    flex-direction: row;
    align-items: flex-start;
    justify-content: center;
    gap: 16px;
  }
  .page-layout .main {
    max-width: 28rem;
    flex: 0 0 auto;
  }
}

.panel {
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--panel2);
}

.row.spread { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.muted { color: var(--muted); }
.small { font-size: 0.9em; }
.h2 { margin: 0 0 8px; font-size: clamp(1.05rem, 3vw, 1.2rem); }
.hint { margin: 8px 0 0; font-size: clamp(0.82rem, 2.5vw, 0.92rem); color: var(--muted); }
.disclaimer-line { margin: 6px 0 0; }
.link-btn {
  display: inline;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent2);
  font: inherit;
  font-size: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  touch-action: manipulation;
}
.link-btn:hover { color: var(--accent); }

.disc-modal {
  margin: auto;
  padding: 0;
  border: none;
  max-width: min(520px, 94vw);
  width: 100%;
  background: transparent;
  color: inherit;
}
.disc-modal::backdrop {
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
}
.disc-modal__box {
  padding: 18px 20px 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}
.disc-modal__title { margin: 0 0 12px; }
.disc-modal__body {
  margin: 0 0 16px;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: clamp(0.88rem, 2.6vw, 1rem);
  line-height: 1.45;
  color: var(--text);
  max-height: min(50vh, 22rem);
  overflow-y: auto;
}

.result-modal {
  margin: auto;
  padding: 0;
  border: none;
  max-width: min(400px, 92vw);
  width: 100%;
  background: transparent;
  color: inherit;
}
.result-modal::backdrop {
  background: rgba(3, 8, 22, 0.65);
  backdrop-filter: blur(6px);
}
.result-modal__box {
  padding: 22px 22px 18px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--panel2);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
  text-align: center;
}
.result-modal__box--win {
  border-color: rgba(124, 92, 255, 0.55);
  background: linear-gradient(160deg, rgba(124, 92, 255, 0.22) 0%, rgba(38, 209, 255, 0.12) 45%, var(--panel2) 100%);
  animation: resultWinPulse 2.2s ease-in-out infinite;
}
.result-modal__box--lose {
  border-color: rgba(148, 163, 184, 0.35);
  background: var(--panel2);
}
@keyframes resultWinPulse {
  0%, 100% {
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45), 0 0 0 0 rgba(124, 92, 255, 0.35);
  }
  50% {
    box-shadow: 0 28px 72px rgba(124, 92, 255, 0.35), 0 0 32px rgba(38, 209, 255, 0.25);
  }
}
.result-modal__title {
  margin: 0 0 12px;
  font-size: clamp(1.15rem, 3.5vw, 1.35rem);
  font-weight: 800;
}
.result-modal__box--win .result-modal__title {
  background: linear-gradient(90deg, #c4b5fd, #7dd3fc, #f9a8d4, #c4b5fd);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: resultTitleShine 3s linear infinite;
}
@keyframes resultTitleShine {
  0% { background-position: 0% center; }
  100% { background-position: 200% center; }
}
.result-modal__main {
  margin: 0 0 10px;
  font-size: clamp(1rem, 2.8vw, 1.12rem);
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
}
.result-modal__sub {
  margin: 0 0 18px;
  font-size: clamp(0.95rem, 2.6vw, 1.05rem);
  font-weight: 700;
  line-height: 1.45;
  min-height: 1.5em;
}
.result-modal__box--win .result-modal__sub {
  color: #5eead4;
  text-shadow: 0 0 20px rgba(94, 234, 212, 0.45);
}
.result-modal__box--lose .result-modal__sub {
  color: var(--muted);
  font-weight: 600;
}
.result-modal__box .btn {
  margin-top: 4px;
}

html[data-copier-theme="light"] .result-modal::backdrop {
  background: rgba(15, 23, 42, 0.45);
}

.segmented {
  display: inline-flex;
  border-radius: 10px;
  border: 1px solid var(--border);
  overflow: hidden;
}
.segmented .seg {
  min-height: 44px;
  min-width: 88px;
  padding: 0 14px;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
}
.segmented .seg.active {
  background: rgba(124, 92, 255, 0.35);
  font-weight: 600;
}

.field { margin-bottom: 10px; }
.field label { display: block; margin-bottom: 4px; font-size: 0.9em; color: var(--muted); }
.field-input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font: inherit;
}

.btn {
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
}
.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  border-color: transparent;
}
.btn.secondary { background: var(--panel); color: var(--text); }
.btn.full { width: 100%; }
.mt8 { margin-top: 8px; }

.btn--icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-ico {
  font-size: 1.05em;
  line-height: 1;
  flex-shrink: 0;
  opacity: 0.92;
}
.btn.primary .btn-ico { opacity: 1; }

.segmented .seg.seg--icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.seg-ico {
  font-size: 1.05em;
  line-height: 1;
  opacity: 0.9;
}

.link-btn--icon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.link-btn-ico {
  font-size: 0.95em;
  line-height: 1;
  flex-shrink: 0;
}

.wheel-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  width: 100%;
}

/* Wheel column + last-10 row below Spin button (horizontal strip, scroll on small screens) */
.wheel-row--stacked {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0;
  width: 100%;
  max-width: min(calc(100vw - 1.5rem), 30rem);
}

.wheel-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  flex: 0 1 auto;
  min-width: 0;
  width: 100%;
}

.wheel-wrap {
  position: relative;
  width: min(92vmin, calc(100vw - 2rem), 22rem);
  aspect-ratio: 1;
  max-width: 100%;
}

/* Last 10 — horizontal row under main Spin; scroll when narrow */
.spin-last-board--below-wheel {
  width: 100%;
  max-width: min(36rem, calc(100vw - 1.25rem));
  margin-top: 2px;
  align-self: stretch;
  overflow: visible;
}

/* Last 10 — one horizontal row of pills; scroll sideways when needed */
.spin-last-board__list,
.spin-last-board__list.spin-last-board__list--horizontal {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: stretch;
  justify-content: flex-start;
  gap: 6px;
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  flex: 0 0 auto;
  padding: 2px 0 6px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) var(--panel);
}

.spin-last-board__list::-webkit-scrollbar {
  height: 6px;
  width: 0;
}

.spin-last-board__list::-webkit-scrollbar-track {
  background: var(--panel);
  border-radius: 8px;
}

.spin-last-board__list::-webkit-scrollbar-thumb {
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 8px;
  border: 1px solid var(--border);
}

.spin-last-board__list::-webkit-scrollbar-thumb:hover {
  filter: brightness(1.12);
}

.spin-last-board__list .spin-last-board__slot {
  flex: 0 0 auto;
  min-width: 4.25rem;
  max-width: 6.5rem;
}

/* Last 10 — theme panel; each slot is solid segment color (same as wheel wedge fill). */
.spin-last-board {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: center;
  padding: 10px 10px 12px;
  box-sizing: border-box;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(165deg, var(--panel), var(--panel2), var(--bg));
  box-shadow:
    0 8px 26px rgba(0, 0, 0, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
@supports (color: color-mix(in srgb, red, blue)) {
  .spin-last-board {
    background: linear-gradient(
      165deg,
      color-mix(in srgb, var(--accent) 32%, var(--bg)),
      color-mix(in srgb, var(--accent2) 24%, var(--bg)) 52%,
      var(--bg)
    );
  }
}
html[data-copier-theme="light"] .spin-last-board {
  box-shadow:
    0 8px 22px rgba(15, 23, 42, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.75);
}
@supports (backdrop-filter: blur(10px)) {
  .spin-last-board {
    backdrop-filter: blur(12px);
  }
}

.spin-last-board__caption {
  flex-shrink: 0;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.42);
  line-height: 1.3;
  padding: 0 0 2px;
  opacity: 0.95;
}
html[data-copier-theme="light"] .spin-last-board__caption {
  text-shadow: none;
  opacity: 1;
}
.spin-last-board__slot {
  flex-shrink: 0;
  border-radius: 6px;
  padding: 4px 5px;
  min-height: 1.9rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  line-height: 1.12;
  border: 1px solid var(--border);
  background: transparent;
  box-shadow: none;
}
.spin-last-board__slot-label,
.spin-last-board__slot-meta {
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
}
.spin-last-board__slot-label {
  font-size: 0.58rem;
  font-weight: 700;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 1px;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.spin-last-board__slot-meta {
  font-size: 0.52rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0;
  border-radius: 0;
  background: transparent;
}

.wheel-pointer {
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 14px solid transparent;
  border-right: 14px solid transparent;
  border-top: 22px solid var(--accent);
  z-index: 2;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.35));
}

.wheel-spin-layer {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  transform: rotate(0deg);
  transform-origin: 50% 50%;
  transition: transform 3.5s cubic-bezier(0.15, 0.85, 0.2, 1);
}

/* Center hub — fixed over the wheel (does not rotate) */
.wheel-hub-spin {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 4;
  transform: translate(-50%, -50%);
  width: clamp(3.25rem, 22%, 5.5rem);
  height: clamp(3.25rem, 22%, 5.5rem);
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  font-size: clamp(0.68rem, 2.8vmin, 0.95rem);
  letter-spacing: 0.02em;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
  background: linear-gradient(145deg, #f472b6 0%, #a78bfa 35%, #38bdf8 70%, #22d3ee 100%);
  box-shadow:
    0 0 0 3px rgba(255, 255, 255, 0.35),
    0 4px 14px rgba(0, 0, 0, 0.35),
    inset 0 2px 12px rgba(255, 255, 255, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease, opacity 0.2s ease;
  touch-action: manipulation;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1.1;
}

.wheel-hub-spin:hover:not(:disabled) {
  filter: brightness(1.08);
  transform: translate(-50%, -50%) scale(1.04);
  box-shadow:
    0 0 0 3px rgba(255, 255, 255, 0.5),
    0 6px 20px rgba(124, 92, 255, 0.45),
    inset 0 2px 12px rgba(255, 255, 255, 0.4);
}

.wheel-hub-spin:active:not(:disabled) {
  transform: translate(-50%, -50%) scale(0.97);
}

.wheel-hub-spin:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  filter: grayscale(0.25) brightness(0.92);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2), 0 2px 8px rgba(0, 0, 0, 0.25);
}

.wheel-svg {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 3px solid var(--border);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  transform-origin: 50% 50%;
  background: transparent;
}

.topbar-signin {
  min-height: 40px;
}

.spin-subtabs {
  position: relative;
  z-index: 4;
  margin: 0 0 12px;
}
.spin-subtabs__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 72rem;
  margin: 0 auto;
  padding: 8px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--panel);
}
.spin-subtab {
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel2);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.tab-ico {
  font-size: 1.05em;
  line-height: 1;
  opacity: 0.95;
}
.spin-subtab.active {
  border-color: transparent;
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.45), rgba(38, 209, 255, 0.28));
  color: #fff;
}

.trader-tx-panel .table { width: 100%; font-size: clamp(0.78rem, 2.2vw, 0.9rem); }

dialog.auth-modal {
  position: fixed;
  inset: 0;
  margin: auto;
  padding: 0;
  border: none;
  background: transparent;
  max-width: min(400px, calc(100vw - 24px));
  width: 100%;
  height: fit-content;
  max-height: min(520px, 92dvh);
  z-index: 100000;
  overflow: visible;
}
.auth-modal::backdrop {
  background: rgba(4, 8, 20, 0.82);
  backdrop-filter: blur(8px);
}
.auth-modal__box {
  padding: 18px 20px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #121a2e;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
  position: relative;
  z-index: 1;
}
html[data-copier-theme="light"] .auth-modal__box {
  background: #f8fafc;
  border-color: rgba(15, 23, 42, 0.18);
  box-shadow: 0 24px 56px rgba(15, 23, 42, 0.2);
}
.auth-modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.auth-modal__title {
  margin: 0;
  flex: 1;
}
.auth-modal__close {
  min-height: 36px;
  min-width: 40px;
  padding: 0 10px;
  font-size: 1.25rem;
  line-height: 1;
}

.wheel-login-line {
  margin: 0;
  text-align: center;
  max-width: 22rem;
}

.spin-btn { max-width: 20rem; }

.err {
  color: var(--danger);
  font-weight: 600;
  text-align: center;
  margin: 0;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 77, 109, 0.35);
  background: rgba(255, 77, 109, 0.08);
}

.copier-theme-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.copier-theme-switch__ico {
  font-size: 1.1rem;
  line-height: 1;
  opacity: 0.95;
}

@media (min-width: 768px) {
  .page-layout .main { max-width: 34rem; }
  .wheel-wrap { width: min(80vmin, 26rem); }
}

@media (min-width: 1024px) {
  .page-layout .main { max-width: 36rem; }
}
