:root {
  --radius: 16px;
  --radius-sm: 10px;
  --topbar-h: 48px;
  --topbar-px: 16px;
  --topbar-py: 10px;
  --stage-top: var(--topbar-h);
  --stage-bottom: clamp(24px, 3vw + 2vh, 72px);
  --stage-header-gap: clamp(32px, 4vw + 2.5vh, 120px);
  --stage-btn-gap: clamp(36px, 5vw + 3vh, 130px);
  --sidebar-w: 320px;
  --sidebar-px: 16px;
  --sidebar-control-h: 32px;
  --sidebar-fs: 14px;
  --sidebar-radius: 6px;
  --sidebar-field-gap: 8px;
  --sidebar-label-gap: 6px;
  --ui-fs-md: 14px;
  --ui-fs-lg: 14px;
  --ui-fs-xl: 15px;
  --text-base: 1rem;
  --ui-lh: 1.25;
  --ui-btn-h: 40px;
  --ui-tab-h: 48px;
  --font: 'Noto Sans', 'Noto Sans KR', 'Noto Sans SC', 'Noto Sans JP', system-ui, sans-serif;
}

html[data-theme='light'] {
  color-scheme: light;
  --bg-0: #f6f7fb;
  --bg-1: #eceff6;
  --bg-2: #e2e7f0;
  --bg-glow-a: rgba(201, 162, 74, 0.12);
  --bg-glow-b: rgba(201, 162, 74, 0.07);
  --panel: rgba(255, 255, 255, 0.94);
  --glass: rgba(0, 0, 0, 0.03);
  --line: rgba(0, 0, 0, 0.1);
  --line-gold: rgba(154, 115, 48, 0.38);
  --text: #1a1d26;
  --muted: rgba(26, 29, 38, 0.55);
  --gold: #b8892e;
  --gold-soft: #9a7330;
  --gold-deep: #7a5a22;
  --gold-glow: rgba(184, 137, 46, 0.28);
  --gold-glow-strong: rgba(154, 115, 48, 0.38);
  --shadow-soft: 0 24px 48px rgba(0, 0, 0, 0.1);
  --surface-btn: rgba(255, 255, 255, 0.92);
  --surface-menu: rgba(255, 255, 255, 0.98);
  --hover-bg: rgba(0, 0, 0, 0.04);
  --tab-hover-bg: rgba(0, 0, 0, 0.03);
  --tab-active-bg: rgba(201, 162, 74, 0.1);
  --input-focus-bg: rgba(201, 162, 74, 0.06);
  --focus-ring: rgba(201, 162, 74, 0.22);
  --scrim: rgba(0, 0, 0, 0.35);
  --scrollbar-thumb: rgba(0, 0, 0, 0.14);
  --logo-filter: none;
  --toast-bg: rgba(255, 255, 255, 0.96);
  --chip-bg: rgba(201, 162, 74, 0.1);
  --chip-shadow: rgba(0, 0, 0, 0.08);
  --carousel-card-border: rgba(108, 114, 128, 0.45);
  --carousel-card-highlight: rgba(255, 255, 255, 0.5);
  --carousel-card-rim: rgba(72, 78, 92, 0.22);
  --carousel-card-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  --carousel-card-bg: linear-gradient(
    168deg,
    #e6e9ef 0%,
    #c5cad4 100%
  );
  --carousel-card-selected-bg: linear-gradient(
    168deg,
    #ead89e 0%,
    #c9a24a 100%
  );
  --carousel-card-selected-shadow: 0 2px 10px rgba(154, 115, 48, 0.28);
  --carousel-frame-border: rgba(154, 115, 48, 0.45);
  --carousel-frame-glow-in: rgba(201, 162, 74, 0.05);
  --carousel-frame-glow-out: rgba(201, 162, 74, 0.06);
  --carousel-control-idle: rgba(26, 29, 38, 0.28);
  --title-grad-a: #7a5a22;
  --title-grad-b: #b8892e;
  --title-grad-c: #9a7330;
}

html[data-theme='dark'] {
  color-scheme: dark;
  --bg-0: #06070c;
  --bg-1: #0e1018;
  --bg-2: #0a0c12;
  --bg-glow-a: rgba(201, 162, 74, 0.14);
  --bg-glow-b: rgba(201, 162, 74, 0.07);
  --panel: rgba(14, 16, 24, 0.88);
  --glass: rgba(255, 255, 255, 0.04);
  --line: rgba(255, 255, 255, 0.1);
  --line-gold: rgba(217, 164, 65, 0.35);
  --text: #f4f5f9;
  --muted: rgba(244, 245, 249, 0.5);
  --gold: #c9a24a;
  --gold-soft: #e8d098;
  --gold-deep: #9a7330;
  --gold-glow: rgba(201, 162, 74, 0.35);
  --gold-glow-strong: rgba(232, 208, 152, 0.5);
  --shadow-soft: 0 24px 48px rgba(0, 0, 0, 0.45);
  --surface-btn: rgba(14, 16, 24, 0.75);
  --surface-menu: rgba(14, 16, 24, 0.96);
  --hover-bg: rgba(255, 255, 255, 0.06);
  --tab-hover-bg: rgba(255, 255, 255, 0.04);
  --tab-active-bg: rgba(201, 162, 74, 0.08);
  --input-focus-bg: rgba(0, 0, 0, 0.2);
  --focus-ring: rgba(201, 162, 74, 0.2);
  --scrim: rgba(4, 5, 10, 0.65);
  --scrollbar-thumb: rgba(255, 255, 255, 0.14);
  --logo-filter: invert(1);
  --toast-bg: rgba(14, 16, 24, 0.92);
  --chip-bg: rgba(201, 162, 74, 0.1);
  --chip-shadow: rgba(0, 0, 0, 0.2);
  --carousel-card-border: rgba(148, 156, 172, 0.32);
  --carousel-card-highlight: rgba(220, 226, 236, 0.14);
  --carousel-card-rim: rgba(0, 0, 0, 0.28);
  --carousel-card-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  --carousel-card-bg: linear-gradient(
    168deg,
    #353945 0%,
    #22262f 100%
  );
  --carousel-card-selected-bg: linear-gradient(
    168deg,
    #8f6e32 0%,
    #c9a24a 100%
  );
  --carousel-card-selected-shadow: 0 2px 12px rgba(201, 162, 74, 0.32);
  --carousel-frame-border: rgba(201, 162, 74, 0.55);
  --carousel-frame-glow-in: rgba(201, 162, 74, 0.04);
  --carousel-frame-glow-out: rgba(201, 162, 74, 0.05);
  --carousel-control-idle: rgba(244, 245, 249, 0.28);
  --title-grad-a: #f5e6c4;
  --title-grad-b: #c9a24a;
  --title-grad-c: #e8d098;
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
  overflow: hidden;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font);
  font-size: var(--ui-fs-lg);
  line-height: var(--ui-lh);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  height: 100%;
  height: 100dvh;
  max-height: 100dvh;
  background:
    radial-gradient(ellipse 90% 55% at 50% -15%, var(--bg-glow-a), transparent 55%),
    radial-gradient(ellipse 70% 45% at 50% 110%, var(--bg-glow-b), transparent 50%),
    linear-gradient(165deg, var(--bg-0) 0%, var(--bg-1) 45%, var(--bg-2) 100%);
  color: var(--text);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

button {
  font-family: inherit;
  cursor: pointer;
}

/* ---------- Topbar ---------- */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1120;
  display: flex;
  align-items: center;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--text);
  opacity: 0.55;
  transition: opacity 0.25s ease, color 0.25s ease;
}
.icon-btn:hover {
  opacity: 1;
  color: var(--gold-soft);
}
.icon-btn svg {
  width: 20px;
  height: 20px;
}

.logo-btn {
  display: inline-flex;
  align-items: center;
  min-height: var(--topbar-h);
  padding: var(--topbar-py) var(--topbar-px);
}
.logo-img {
  height: 11px;
  width: auto;
  display: block;
  filter: var(--logo-filter);
  opacity: 0.92;
}

.menu-btn {
  min-height: var(--topbar-h);
  padding: var(--topbar-py) var(--topbar-px);
}

.corner-btn {
  position: fixed;
  bottom: 0;
  right: 0;
  z-index: 1000;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--topbar-h);
  padding: var(--topbar-py) var(--topbar-px);
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  opacity: 0.55;
  transition: opacity 0.25s ease, color 0.25s ease;
}
.corner-btn:hover {
  opacity: 1;
  color: var(--gold-soft);
}
.corner-btn svg {
  width: 20px;
  height: 20px;
}

/* ---------- Topbar actions (theme + language) ---------- */
.topbar-actions {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: var(--topbar-h);
  padding: 0 var(--topbar-px);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--sidebar-control-h);
  height: var(--sidebar-control-h);
  padding: 0;
  border: none;
  border-radius: var(--sidebar-radius);
  background: transparent;
  color: var(--text);
  transition: color 0.2s ease;
}

.theme-toggle:hover {
  color: var(--gold-soft);
}

.theme-toggle:focus {
  outline: none;
}

.theme-toggle__icon {
  width: 20px;
  height: 20px;
}

.theme-toggle__icon--moon {
  display: none;
}

html[data-theme='dark'] .theme-toggle__icon--sun {
  display: none;
}

html[data-theme='dark'] .theme-toggle__icon--moon {
  display: block;
}

/* ---------- Language dropdown (yoonsel Header 패턴) ---------- */
.lang-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: var(--topbar-h);
  padding: 0;
}

.lang-dropdown__btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: var(--sidebar-control-h);
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface-btn);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--sidebar-fs);
  font-weight: 500;
  line-height: normal;
  white-space: nowrap;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.lang-dropdown__btn:hover {
  border-color: var(--line-gold);
  color: var(--gold-soft);
}

.lang-dropdown__btn:focus {
  outline: none;
  border-color: rgba(232, 208, 152, 0.7);
  box-shadow: 0 0 0 2px var(--focus-ring);
}

.lang-dropdown__chev {
  width: 18px;
  height: 18px;
  opacity: 0.65;
  transition: transform 0.2s ease;
}

.lang-dropdown.is-open .lang-dropdown__chev {
  transform: rotate(180deg);
}

.lang-dropdown__menu {
  position: absolute;
  top: calc(100% + 4px);
  left: auto;
  right: 0;
  z-index: 1001;
  min-width: 100%;
  width: max-content;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface-menu);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-soft);
}

.lang-dropdown__menu[hidden] {
  display: none;
}

.lang-dropdown__option {
  display: block;
  width: 100%;
  padding: 8px 12px;
  border: none;
  background: transparent;
  color: var(--text);
  font-family: var(--font);
  font-size: var(--sidebar-fs);
  font-weight: 500;
  line-height: 1.5;
  text-align: left;
  transition: background 0.2s ease, color 0.2s ease;
}

.lang-dropdown__option:hover {
  background: var(--hover-bg);
  color: var(--gold-soft);
}

.lang-dropdown__option.is-active {
  color: var(--gold-soft);
  background: var(--tab-active-bg);
}

/* ---------- Sidebar ---------- */
.scrim {
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: var(--scrim);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.scrim.open {
  opacity: 1;
  visibility: visible;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1110;
  width: var(--sidebar-w);
  max-width: 88vw;
  height: 100dvh;
  box-sizing: border-box;
  padding-top: var(--topbar-h);
  display: flex;
  flex-direction: column;
  background: var(--panel);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-right: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  transform: translateX(-105%);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  font-size: var(--sidebar-fs);
  line-height: 1.5;
  text-align: left;
}
.sidebar.open {
  transform: translateX(0);
}

.sidebar-close {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--topbar-h);
  height: var(--topbar-h);
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text);
  opacity: 0.55;
  cursor: pointer;
  transition: opacity 0.25s ease, color 0.25s ease;
}

.sidebar-close:hover {
  opacity: 1;
  color: var(--gold-soft);
}

.sidebar-close:focus {
  outline: none;
}

.sidebar-close:focus-visible {
  opacity: 1;
  color: var(--gold-soft);
}

.sidebar-close svg {
  width: 20px;
  height: 20px;
}

.sidebar > .field {
  padding-left: var(--sidebar-px);
  padding-right: var(--sidebar-px);
}

.sidebar > .tabs {
  flex-shrink: 0;
  padding: 0;
  margin: 0;
}

.sidebar .tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--line);
}

.sidebar .tabs__btn {
  flex: 1;
  position: relative;
  min-height: 40px;
  padding: 0 12px;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  margin-bottom: -1px;
  background: transparent;
  color: var(--muted);
  font-family: var(--font);
  font-size: var(--sidebar-fs);
  font-weight: 500;
  line-height: normal;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.sidebar .tabs__btn + .tabs__btn {
  box-shadow: inset 1px 0 0 var(--line);
}

.sidebar .tabs__btn:hover:not(.active) {
  color: var(--text);
  background: var(--tab-hover-bg);
}

.sidebar .tabs__btn.active {
  color: var(--gold-soft);
  border-bottom-color: var(--gold);
  background: var(--tab-active-bg);
}

.sidebar__scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 var(--sidebar-px) 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) transparent;
}

.sidebar:has(#prizePanel.active) .sidebar__scroll {
  display: none;
}

.sidebar__scroll::-webkit-scrollbar {
  width: 4px;
}
.sidebar__scroll::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 2px;
}


/* ---------- Fields (sidebar — eflet editor panel 기준) ---------- */
.sidebar .field {
  margin: var(--sidebar-field-gap) 0;
}
.field__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sidebar-label-gap);
}
.sidebar .field__label {
  display: block;
  font-size: var(--sidebar-fs);
  font-weight: 400;
  letter-spacing: normal;
  color: var(--muted);
  margin-bottom: var(--sidebar-label-gap);
  line-height: 1.5;
}
.field__row .field__label {
  margin-bottom: 0;
}

.field__actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.sidebar .field__hint {
  margin: 4px 0 0;
  font-size: var(--sidebar-fs);
  color: var(--muted);
  line-height: 1.45;
}

.sidebar .text-input,
.sidebar .text-area {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--sidebar-radius);
  background: transparent;
  color: var(--text);
  font-size: var(--sidebar-fs);
  line-height: normal;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.sidebar .text-input {
  min-height: var(--sidebar-control-h);
  padding: 0 8px;
}
.sidebar .text-area {
  min-height: 96px;
  padding: 6px 8px;
  resize: vertical;
  line-height: 1.5;
}
.sidebar .text-input:focus,
.sidebar .text-area:focus {
  border-color: var(--line-gold);
  background: var(--input-focus-bg);
  box-shadow: 0 0 0 2px var(--focus-ring);
}

.sidebar .segmented {
  display: flex;
  gap: 6px;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
}
.sidebar .segmented__btn {
  flex: 1;
  min-height: var(--sidebar-control-h);
  height: var(--sidebar-control-h);
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--sidebar-radius);
  background: transparent;
  color: var(--muted);
  font-family: var(--font);
  font-size: var(--sidebar-fs);
  font-weight: 500;
  line-height: 1;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.sidebar .segmented__btn.active {
  background: linear-gradient(145deg, var(--gold-soft), var(--gold));
  border-color: transparent;
  color: #1a1408;
  box-shadow: 0 1px 4px var(--gold-glow);
}

.sidebar .mini-btn {
  min-height: var(--sidebar-control-h);
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--sidebar-radius);
  background: transparent;
  color: var(--text);
  font-family: var(--font);
  font-size: var(--sidebar-fs);
  font-weight: 500;
  line-height: normal;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.sidebar .mini-btn:hover {
  background: var(--hover-bg);
  color: var(--gold-soft);
  border-color: var(--line-gold);
}

.sidebar .count-badge {
  padding: 0;
  background: none;
  border: none;
  color: var(--gold-soft);
  font-size: var(--sidebar-fs);
  font-weight: 600;
  line-height: 1.5;
}

.panel {
  display: none;
}
.panel.active {
  display: block;
}

#prizePanel.panel.active {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.panel__head {
  flex-shrink: 0;
  padding: var(--sidebar-field-gap) var(--sidebar-px) 8px;
}

.panel__scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  margin: 0;
  padding: 0 var(--sidebar-px);
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.panel__scroll::-webkit-scrollbar {
  display: none;
}

.sidebar .panel__scroll > .item-list::after {
  content: '';
  display: block;
  height: calc(var(--sidebar-field-gap) * 2.5);
  flex-shrink: 0;
}

.sidebar .item-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sidebar .prize-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sidebar .prize-row .prize-name {
  flex: 1;
}
.sidebar .prize-row .prize-stock {
  width: 56px;
  flex: 0 0 56px;
  text-align: center;
}
.sidebar .prize-del {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--sidebar-control-h);
  height: var(--sidebar-control-h);
  flex: 0 0 auto;
  border: none;
  border-radius: var(--sidebar-radius);
  background: transparent;
  color: var(--muted);
  transition: background 0.2s ease;
}
.sidebar .prize-del:hover {
  background: var(--hover-bg);
}
.sidebar .prize-del svg {
  width: 16px;
  height: 16px;
}


/* ---------- Stage ---------- */
.stage {
  position: relative;
  z-index: 10;
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  max-height: 100dvh;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--stage-top) 12px var(--stage-bottom);
  overflow: visible;
}

.stage__stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  width: 100%;
}

.stage__stack > .header {
  margin-bottom: var(--stage-header-gap);
}

.stage__stack > .carousel {
  margin-bottom: var(--stage-btn-gap);
}

.stage__actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(10px, 1.6vh, 18px);
  width: min(560px, 92vw);
}

/* ---------- Spin button ---------- */
.spin-btn {
  position: relative;
  flex-shrink: 0;
  min-width: 148px;
  min-height: 48px;
  padding: 0 40px;
  border: none;
  border-radius: 0;
  background: linear-gradient(145deg, var(--gold-soft) 0%, var(--gold) 45%, var(--gold-deep) 100%);
  color: #1a1408;
  font-family: var(--font);
  font-size: var(--ui-fs-xl);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
  transition: transform 0.2s ease, filter 0.2s ease;
}

html[data-theme='light'] .spin-btn {
  color: #fff;
}

.spin-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.04);
}
.spin-btn:active:not(:disabled) {
  transform: translateY(0);
}
.spin-btn:focus {
  outline: 2px solid rgba(201, 162, 74, 0.45);
  outline-offset: 2px;
}
.spin-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

/* ---------- Result inline ---------- */
.result-inline {
  flex-shrink: 0;
  min-height: 0;
  width: 100%;
  margin-top: 0;
  max-height: clamp(0px, 14vh, 132px);
  overflow-x: hidden;
  overflow-y: auto;
}
.result-inline:empty {
  display: none;
}
.result-inline__label {
  margin: 0 0 12px;
  font-size: var(--ui-fs-md);
  color: var(--gold-soft);
  letter-spacing: 0.06em;
  font-weight: 600;
  line-height: var(--ui-lh);
}
.result-inline__chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.winner-chip {
  padding: 10px 18px;
  border: 1px solid var(--line-gold);
  border-radius: 999px;
  background: var(--chip-bg);
  backdrop-filter: blur(8px);
  font-size: clamp(14px, 2.4vw, 17px);
  font-weight: 600;
  color: var(--gold-soft);
  box-shadow: 0 4px 16px var(--chip-shadow);
}

/* ---------- Confetti ---------- */
#confetti {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1150;
  pointer-events: none;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  top: calc(var(--topbar-h) + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(calc(-100% - 12px));
  z-index: 1120;
  padding: 12px 24px;
  border-radius: 999px;
  background: var(--toast-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line-gold);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--ui-fs-md);
  font-weight: 500;
  line-height: var(--ui-lh);
  box-shadow: var(--shadow-soft);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.35s ease,
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0.35s ease;
}
.toast.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 640px) {
  :root {
    --stage-header-gap: 14px;
    --stage-btn-gap: 56px;
    --stage-bottom: clamp(28px, 4vw + 2vh, 48px);
  }

  .spin-btn {
    min-width: 132px;
    min-height: 44px;
    font-size: var(--ui-fs-md);
  }
}

@media (max-height: 720px) and (min-width: 641px) {
  :root {
    --stage-bottom: clamp(40px, 7vh, 64px);
    --stage-header-gap: clamp(48px, 10vh, 88px);
    --stage-btn-gap: clamp(52px, 10vh, 96px);
  }
}

@media (max-height: 560px) and (min-width: 641px) {
  :root {
    --stage-bottom: 32px;
    --stage-header-gap: clamp(32px, 7vh, 56px);
    --stage-btn-gap: clamp(40px, 8vh, 72px);
  }
}

@media (max-height: 480px) and (min-width: 641px) {
  :root {
    --stage-bottom: 24px;
    --stage-header-gap: clamp(20px, 5vh, 40px);
    --stage-btn-gap: clamp(28px, 6vh, 52px);
  }
}

@media (max-height: 480px) {
  .title {
    font-size: clamp(1.1rem, 4.5vh, 1.5rem);
  }

  .subtitle {
    font-size: var(--text-base);
  }
}
