:root {
  color-scheme: light dark;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-synthesis: none;
  --bg: #f6f3fb;
  --surface: var(--tg-theme-bg-color, #ffffff);
  --text: var(--tg-theme-text-color, #181426);
  --muted: var(--tg-theme-hint-color, #777181);
  --button: #6042e8;
  --button-text: #ffffff;
  --link: #6042e8;
  --brand-indigo: #2d1d62;
  --brand-violet: #6042e8;
  --brand-teal: #22bcb6;
  --brand-coral: #ff715b;
  --brand-gold: #f3b53e;
  --line: rgba(46, 29, 98, 0.1);
  --soft-blue: rgba(96, 66, 232, 0.1);
  --soft-teal: rgba(34, 188, 182, 0.12);
  --soft-coral: rgba(255, 113, 91, 0.12);
  --soft-gold: rgba(243, 181, 62, 0.16);
  --soft-red: rgba(210, 54, 54, 0.1);
  --shadow: 0 10px 30px rgba(45, 29, 98, 0.08);
  --shadow-strong: 0 16px 42px rgba(45, 29, 98, 0.14);
  --header-bg: rgba(255, 255, 255, 0.9);
  --nav-bg: rgba(255, 255, 255, 0.94);
  --focus-ring: rgba(96, 66, 232, 0.3);
  --danger: #d23636;
  --keyboard-offset: 0px;
  --radius: 18px;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #100d19;
  --surface: #1b1727;
  --text: #f7f3ff;
  --muted: #aaa4b7;
  --button: #8b76ff;
  --button-text: #ffffff;
  --link: #aa98ff;
  --brand-indigo: #251a47;
  --brand-violet: #8b76ff;
  --brand-teal: #45d4cb;
  --brand-coral: #ff826e;
  --brand-gold: #f6c65d;
  --line: rgba(232, 225, 255, 0.12);
  --soft-blue: rgba(139, 118, 255, 0.16);
  --soft-teal: rgba(69, 212, 203, 0.15);
  --soft-coral: rgba(255, 130, 110, 0.15);
  --soft-gold: rgba(246, 198, 93, 0.17);
  --soft-red: rgba(255, 103, 103, 0.14);
  --shadow: 0 12px 34px rgba(0, 0, 0, 0.24);
  --shadow-strong: 0 18px 48px rgba(0, 0, 0, 0.34);
  --header-bg: rgba(27, 23, 39, 0.9);
  --nav-bg: rgba(27, 23, 39, 0.94);
  --focus-ring: rgba(170, 152, 255, 0.42);
  --danger: #ff7070;
}

* { box-sizing: border-box; }

html {
  min-width: 320px;
  min-height: 100%;
  background:
    radial-gradient(circle at 50% -10%, rgba(96, 66, 232, 0.11), transparent 34%),
    var(--bg);
}

html[data-theme="dark"] {
  background:
    radial-gradient(circle at 50% -10%, rgba(139, 118, 255, 0.17), transparent 36%),
    var(--bg);
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--text);
  background: transparent;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

button,
input,
select,
textarea { font: inherit; }

button,
[role="button"] {
  min-height: 44px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
  transition: transform 140ms ease, filter 140ms ease, box-shadow 140ms ease, background-color 140ms ease;
}

button:disabled { cursor: not-allowed; }

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[role="button"]:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

button:not(:disabled):active,
[role="button"]:active { transform: scale(0.98); }

.icon {
  width: 1.25rem;
  height: 1.25rem;
  display: block;
  flex: 0 0 auto;
  overflow: visible;
  color: currentColor;
  pointer-events: none;
}

.button-icon { width: 1.15rem; height: 1.15rem; }

.button,
.link-button,
.section-heading button,
.inline-form button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.app-shell {
  width: 100%;
  max-width: 680px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 0 12px calc(78px + env(safe-area-inset-bottom));
  background: transparent;
}

.app-shell.no-bottom-nav { padding-bottom: 16px; }
.app-shell.wizard-route { padding-bottom: calc(82px + env(safe-area-inset-bottom)); }

.app-header {
  position: sticky;
  z-index: 20;
  top: 0;
  min-height: calc(56px + env(safe-area-inset-top));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 -12px;
  padding: calc(8px + env(safe-area-inset-top)) 12px 8px;
  border-bottom: 1px solid rgba(46, 29, 98, 0.08);
  background: var(--header-bg);
  backdrop-filter: blur(18px);
  box-shadow: 0 7px 24px rgba(45, 29, 98, 0.05);
}

html[data-theme="dark"] .app-header { box-shadow: 0 7px 24px rgba(0, 0, 0, 0.2); }

html[data-theme="dark"] .status {
  color: #70e49a;
  background: rgba(82, 214, 132, 0.14);
}

html[data-theme="dark"] .status.draft {
  color: #ffd06a;
  background: rgba(246, 198, 93, 0.14);
}

html[data-theme="dark"] .status.finished {
  color: var(--muted);
  background: rgba(232, 225, 255, 0.09);
}

html[data-theme="dark"] .winner { background: rgba(82, 214, 132, 0.13); }
html[data-theme="dark"] .winner span:last-child { color: #70e49a; }

.app-header .back-button + .brand { margin-right: auto; }

.brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark,
.avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: #fff;
  background: var(--brand-violet);
  font-weight: 800;
}

.brand-mark {
  width: 36px;
  height: 36px;
  overflow: hidden;
  padding: 2px;
  border-radius: 11px;
  background: linear-gradient(145deg, var(--brand-coral), var(--brand-gold));
  box-shadow: 0 5px 14px rgba(255, 113, 91, 0.25);
}

.brand-mark img {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 9px;
  object-fit: cover;
}

.brand-copy { min-width: 0; display: grid; gap: 1px; }
.brand-copy strong { font-size: 0.94rem; line-height: 1.15; }
.brand-copy span {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.69rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.back-button,
.icon-button {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  border-radius: 12px;
  color: var(--link);
  background: transparent;
  font-size: 1.25rem;
}

.back-button .icon,
.icon-button .icon { width: 1.35rem; height: 1.35rem; }

.profile-chip {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 0.72rem;
}

.screen {
  padding-top: 12px;
  outline: none;
  animation: enter 220ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes enter {
  from { opacity: 0; }
  to { opacity: 1; }
}

.loading-card,
.empty-state,
.error-state {
  min-height: 160px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  padding: 24px 18px;
  border: 0;
  border-radius: var(--radius);
  color: var(--muted);
  background: var(--surface);
  text-align: center;
}

.compact-empty { min-height: 170px; }
.compact-empty strong { color: var(--text); font-size: 0.95rem; }
.empty-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--button);
  background: var(--soft-blue);
  font-size: 1.2rem;
}

.empty-icon > .icon,
svg.empty-icon {
  width: 44px;
  height: 44px;
  padding: 11px;
}

.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--line);
  border-top-color: var(--button);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.segmented {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 3px;
  padding: 3px;
  border-radius: 12px;
  background: rgba(118, 118, 128, 0.12);
}

.segment {
  min-height: 44px;
  padding: 6px 10px;
  border: 0;
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  font-size: 0.78rem;
  font-weight: 650;
}

.segment.active {
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.segment:not(:disabled):active { background: var(--soft-blue); }

.home-mode { margin: 0 0 12px; }
.home-intro { margin: 0 0 16px; }
.home-intro h1,
.page-title,
.wizard-head h1 {
  margin: 0;
  font-size: 1.58rem;
  line-height: 1.12;
  letter-spacing: -0.035em;
}

.home-intro p,
.page-intro p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.42;
}

.brand-hero {
  position: relative;
  min-height: 196px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--brand-indigo);
  box-shadow: 0 18px 42px rgba(45, 29, 98, 0.2);
  isolation: isolate;
}

.brand-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, transparent 32%, rgba(18, 10, 45, 0.88) 100%);
  pointer-events: none;
}

.home-hero-media {
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  display: block;
  object-fit: cover;
  animation: hero-reveal 520ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes hero-reveal {
  from { opacity: 0; transform: scale(1.025); }
  to { opacity: 1; transform: scale(1); }
}

.brand-hero.participant .home-hero-media { object-position: center 44%; }

.home-hero-copy {
  position: absolute;
  z-index: 2;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 44px 16px 16px;
  color: #fff;
}

.home-hero-copy h1 { color: #fff; text-shadow: 0 2px 16px rgba(0, 0, 0, 0.28); }
.home-hero-copy p { color: rgba(255, 255, 255, 0.78); }

.create-button { margin-bottom: 18px; }
.home-projects { margin-top: 0; }
.project-filter { margin-bottom: 10px; }

.hero { margin: 0 2px 16px; }
.hero h1 { margin: 6px 0; font-size: 1.65rem; }
.hero p { margin: 0; color: var(--muted); font-size: 0.84rem; }
.eyebrow { color: var(--link); font-size: 0.72rem; font-weight: 700; }

.section { margin-top: 22px; }
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 2px 10px;
}

.section-heading > div { min-width: 0; display: flex; align-items: center; gap: 7px; }
.section-heading h2 { margin: 0; font-size: 0.96rem; }
.section-heading button {
  min-height: 44px;
  padding: 6px;
  border: 0;
  color: var(--link);
  background: transparent;
  font-size: 0.78rem;
  font-weight: 650;
}

.count-badge {
  min-width: 22px;
  padding: 3px 7px;
  border-radius: 99px;
  color: var(--muted);
  background: rgba(118, 118, 128, 0.1);
  font-size: 0.66rem;
  text-align: center;
}

.page-intro { margin: 2px 2px 18px; }

.project-list,
.type-list,
.settings-list,
.language-list,
.package-list { display: grid; gap: 9px; }

.project-card,
.type-card,
.settings-card,
.panel,
.balance-card,
.language-option {
  border: 0;
  color: var(--text);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.project-card,
.type-card,
.settings-card,
.balance-card,
.language-option {
  width: 100%;
  min-width: 0;
  text-align: left;
  animation: card-enter 260ms cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

@keyframes card-enter {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.project-card {
  min-height: 105px;
  padding: 14px;
  border-radius: var(--radius);
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.project-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.project-type {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}

.project-type > div { min-width: 0; }

.mini-icon,
.type-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 12px;
  color: var(--brand-violet);
  background: var(--soft-blue);
}

.mini-icon { width: 38px; height: 38px; font-size: 1.05rem; }

.mini-icon > .icon,
.type-icon > .icon { width: 1.2rem; height: 1.2rem; }

svg.mini-icon {
  width: 38px;
  height: 38px;
  display: block;
  padding: 9px;
}

svg.type-icon {
  width: 44px;
  height: 44px;
  display: block;
  padding: 10px;
}
.project-card h3 {
  max-width: 100%;
  overflow: hidden;
  margin: 0 0 4px;
  font-size: 0.9rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.project-card p { margin: 0; color: var(--muted); font-size: 0.7rem; }

.status {
  flex: 0 0 auto;
  padding: 4px 7px;
  border-radius: 99px;
  color: #18894b;
  background: rgba(52, 199, 89, 0.12);
  font-size: 0.62rem;
  font-weight: 700;
}

.status.draft { color: #9b6b00; background: rgba(255, 159, 10, 0.13); }
.status.finished { color: var(--muted); background: rgba(118, 118, 128, 0.12); }

.project-stats {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.7rem;
}

.project-action {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
  color: var(--link);
  font-weight: 650;
}

.inline-icon { width: 0.95rem; height: 0.95rem; }

.type-card {
  min-height: 72px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius);
  box-shadow: 0 9px 26px rgba(45, 29, 98, 0.07);
}

.type-card .type-icon { width: 44px; height: 44px; font-size: 1.2rem; }
.type-card[data-type="giveaway"] .type-icon { background: var(--soft-gold); }
.type-card[data-type="poll"] .type-icon { background: var(--soft-teal); }
.type-card[data-type="prediction"] .type-icon { background: var(--soft-blue); }
.type-card h2 { margin: 0 0 3px; font-size: 0.92rem; }
.type-card p { margin: 0; color: var(--muted); font-size: 0.7rem; line-height: 1.35; }
.type-card.soon,
.project-card.unavailable { cursor: pointer; }
.type-card.soon::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(11, 7, 22, 0.18);
}
.soon-badge,
.choice-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: 5px 8px;
  border: 1px solid rgba(138, 108, 255, 0.28);
  border-radius: 999px;
  color: #c8bbff;
  background: rgba(138, 108, 255, 0.13);
  font-size: 0.62rem;
  font-weight: 750;
  line-height: 1;
}
.chevron {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 1.25rem;
}
.chevron > .icon,
svg.chevron { width: 1.15rem; height: 1.15rem; }
svg.chevron { display: block; }

.account-hero {
  position: relative;
  overflow: hidden;
  padding: 18px;
  border-radius: var(--radius);
  color: var(--text);
  background: linear-gradient(135deg, var(--soft-coral), var(--soft-gold) 58%, var(--surface));
  box-shadow: var(--shadow);
}

.account-mascot {
  width: 86px;
  height: 86px;
  position: absolute;
  top: 50%;
  right: -10px;
  border-radius: 24px;
  opacity: 0.24;
  object-fit: cover;
  transform: translateY(-50%) rotate(-5deg);
  animation: mascot-float 5.5s ease-in-out infinite;
}

@keyframes mascot-float {
  0%, 100% { transform: translateY(-50%) rotate(-5deg); }
  50% { transform: translateY(calc(-50% - 4px)) rotate(-2deg); }
}

.account-user { position: relative; z-index: 1; padding-right: 48px; }

.account-user { display: flex; align-items: center; gap: 12px; }
.account-user .avatar { width: 48px; height: 48px; font-size: 0.9rem; }
.account-user h1 { margin: 0 0 3px; font-size: 1.05rem; }
.account-user p { margin: 0; color: var(--muted); font-size: 0.75rem; }
.account-id { display: none; }

.balance-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
  margin-top: 9px;
}

.balance-card {
  min-height: 112px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 15px;
  border-radius: var(--radius);
}

.balance-card span { color: var(--muted); font-size: 0.72rem; }
.balance-card strong { margin: 6px 0 2px; font-size: 1.35rem; }
.balance-card small { color: var(--link); font-size: 0.68rem; }

.balance-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  margin-bottom: 8px;
  border-radius: 11px;
  color: var(--brand-violet) !important;
  background: var(--soft-blue);
}

.balance-icon > .icon { width: 1.1rem; height: 1.1rem; }

.settings-card {
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 13px;
  border-radius: 14px;
}

.settings-card .mini-icon { width: 38px; height: 38px; }
.settings-card div:nth-child(2) { min-width: 0; flex: 1; }
.settings-card strong { display: block; font-size: 0.84rem; }
.settings-card small { display: block; margin-top: 2px; color: var(--muted); font-size: 0.69rem; }

.language-option {
  min-height: 58px;
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 13px;
  border-radius: 14px;
}
.language-option.selected { box-shadow: inset 0 0 0 2px var(--button); }
.language-code {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: var(--link);
  background: var(--soft-blue);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.check {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: transparent;
  background: rgba(118, 118, 128, 0.1);
  font-size: 0.72rem;
}
.language-option.selected .check { color: #fff; background: var(--button); }

.wizard-head { margin: 2px 2px 14px; }
.wizard-kicker { display: flex; align-items: center; gap: 8px; }
.wizard-mascot {
  width: 30px;
  height: 30px;
  padding: 2px;
  border-radius: 10px;
  box-shadow: none;
  animation: mascot-pop 320ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes mascot-pop {
  from { opacity: 0; transform: translateY(4px) scale(0.92); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.wizard-label { color: var(--link); font-size: 0.72rem; font-weight: 700; }
.wizard-head h1 { margin-top: 5px; }
.progress { display: flex; gap: 5px; margin-top: 12px; }
.progress span { height: 4px; flex: 1; border-radius: 99px; background: rgba(118, 118, 128, 0.15); }
.progress span.done { background: linear-gradient(90deg, var(--brand-teal), var(--brand-violet)); }

.panel {
  padding: 15px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.wizard-panel { padding-bottom: 86px; }
.panel-title { margin: 0 0 5px; font-size: 1rem; }
.panel-subtitle { margin: 0 0 14px; color: var(--muted); font-size: 0.76rem; line-height: 1.4; }

.field {
  display: grid;
  gap: 6px;
  margin: 13px 0;
  color: var(--text);
  font-size: 0.76rem;
  font-weight: 650;
}

.field input,
.field select,
.field textarea,
.option-row input,
.inline-form input {
  width: 100%;
  min-height: 48px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  background: var(--bg);
  font-size: 16px;
  outline: none;
}

.field textarea { min-height: 92px; resize: vertical; }
.field input:focus,
.field select:focus,
.field textarea:focus,
.option-row input:focus,
.inline-form input:focus { border-color: var(--button); box-shadow: 0 0 0 3px var(--soft-blue); }
.field small { color: var(--muted); font-weight: 400; line-height: 1.35; }
.field-section-label {
  margin: 17px 0 8px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.choice-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.choice-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.choice {
  min-width: 0;
  min-height: 72px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  background: var(--bg);
  text-align: left;
}
.choice strong { font-size: 0.78rem; }
.choice small { color: var(--muted); font-size: 0.64rem; line-height: 1.3; overflow-wrap: anywhere; }
.choice.selected { border-color: var(--button); background: var(--soft-blue); box-shadow: inset 0 0 0 1px var(--button); }
.choice.disabled { opacity: 0.56; }
.choice[data-choice-key="button_style"] { border-left-width: 4px; }
.choice[data-choice-key="button_style"][data-choice-value="green"] { border-left-color: #34c759; }
.choice[data-choice-key="button_style"][data-choice-value="blue"] { border-left-color: #4b8cff; }
.choice[data-choice-key="button_style"][data-choice-value="red"] { border-left-color: #ff5b5b; }
.choice[data-choice-key="button_style"][data-choice-value="plain"] { border-left-color: rgba(255, 255, 255, 0.3); }
.choice-badge { margin-top: 2px; color: var(--brand-gold); border-color: rgba(247, 200, 95, 0.25); background: var(--soft-gold); }

.toggle-row {
  min-height: 64px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
}
.toggle-copy { display: grid; gap: 3px; }
.toggle-copy strong { font-size: 0.78rem; }
.toggle-copy small { color: var(--muted); font-size: 0.65rem; line-height: 1.3; }
.toggle-input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-control { width: 42px; height: 24px; position: relative; border-radius: 99px; background: #c7c7cc; transition: 0.16s ease; }
.toggle-control::after {
  content: "";
  width: 20px;
  height: 20px;
  position: absolute;
  top: 2px;
  left: 2px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.16s ease;
}
.toggle-input:checked + .toggle-control { background: #34c759; }
.toggle-input:checked + .toggle-control::after { transform: translateX(18px); }
.toggle-input:focus-visible + .toggle-control { outline: 3px solid var(--soft-blue); }

.option-list { display: grid; gap: 8px; }
.option-row { display: grid; grid-template-columns: 26px minmax(0, 1fr); align-items: center; gap: 7px; }
.option-number { color: var(--muted); font-size: 0.7rem; text-align: center; }
.remove-option { width: 44px; height: 44px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 11px; color: var(--danger); background: var(--soft-red); font-size: 1.2rem; }
.remove-option .icon { width: 1.15rem; height: 1.15rem; }
.link-button { min-height: 44px; padding: 7px 2px; border: 0; color: var(--link); background: transparent; font-size: 0.76rem; font-weight: 650; }

.wizard-actions {
  position: fixed;
  z-index: 10;
  left: 50%;
  bottom: var(--keyboard-offset);
  width: min(100%, 680px);
  display: grid;
  grid-template-columns: minmax(96px, 0.65fr) 1.35fr;
  gap: 8px;
  margin: 0;
  padding: 10px 15px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: var(--nav-bg);
  backdrop-filter: blur(18px);
  transform: translateX(-50%);
  transition: bottom 160ms ease;
}

.button {
  min-height: 48px;
  padding: 11px 15px;
  border: 0;
  border-radius: 12px;
  font-size: 0.86rem;
  font-weight: 700;
}
.button.primary {
  color: var(--button-text);
  background: linear-gradient(135deg, var(--brand-violet), #476eea);
  box-shadow: 0 10px 22px rgba(96, 66, 232, 0.24);
}
.button.secondary { color: var(--link); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.button.full { width: 100%; }
.button.danger { color: #fff; background: #d23636; }
.button:disabled { opacity: 0.5; cursor: not-allowed; }

.review-list { display: grid; margin: 4px 0 12px; border-top: 1px solid var(--line); }
.review-row { display: grid; grid-template-columns: 92px 1fr; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.review-row span { color: var(--muted); font-size: 0.7rem; }
.review-row strong { min-width: 0; font-size: 0.74rem; text-align: right; overflow-wrap: anywhere; }
.unavailable-wizard {
  display: grid;
  justify-items: center;
  gap: 12px;
  margin-top: 18px;
  padding: 28px 18px;
  text-align: center;
}
.unavailable-wizard .type-icon { width: 54px; height: 54px; color: #b6a5ff; background: var(--soft-blue); }
.unavailable-wizard .panel-title,
.unavailable-wizard .panel-subtitle { margin: 0; }

.detail-cover {
  padding: 18px;
  border-radius: var(--radius);
  color: var(--text);
  background: var(--surface);
  border-top: 3px solid var(--brand-gold);
  box-shadow: var(--shadow);
}
.detail-cover .status { display: inline-flex; margin-bottom: 12px; }
.detail-cover h1 { margin: 0 0 6px; font-size: 1.45rem; line-height: 1.12; letter-spacing: -0.035em; overflow-wrap: anywhere; }
.detail-cover p { margin: 0; color: var(--muted); font-size: 0.74rem; }
.detail-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 15px; }
.metric { padding: 10px 5px; border-radius: 11px; background: var(--bg); text-align: center; }
.metric { min-width: 0; }
.metric-icon {
  width: 24px;
  height: 24px;
  display: grid !important;
  place-items: center;
  margin: 0 auto 5px !important;
  color: var(--link) !important;
}
.metric-icon > .icon { width: 1rem; height: 1rem; }
.metric strong { display: block; font-size: 0.82rem; overflow-wrap: anywhere; }
.metric span { display: block; margin-top: 2px; color: var(--muted); font-size: 0.58rem; }

.captcha-box { margin-top: 12px; padding: 12px; border-radius: 13px; background: var(--bg); }
.captcha-question { margin: 0 0 9px; font-size: 1rem; font-weight: 750; }
.inline-form { display: grid; grid-template-columns: 1fr auto; gap: 7px; }
.inline-form button { padding: 0 13px; border: 0; border-radius: 11px; color: var(--button-text); background: var(--button); font-weight: 650; }
.helper { margin: 9px 0 0; color: var(--muted); font-size: 0.68rem; line-height: 1.35; }
.winner-list { display: grid; gap: 7px; margin-top: 10px; }
.winner { display: flex; align-items: center; gap: 8px; padding: 10px 11px; border-radius: 11px; background: rgba(52, 199, 89, 0.1); }
.winner strong { font-size: 0.78rem; }
.winner span:last-child { margin-left: auto; color: #18894b; font-size: 0.65rem; }

.error-state { color: var(--danger); }
.toast-region {
  position: fixed;
  z-index: 40;
  left: 50%;
  bottom: calc(82px + env(safe-area-inset-bottom));
  width: min(calc(100% - 24px), 456px);
  transform: translateX(-50%);
  pointer-events: none;
}
.toast { padding: 12px 14px; border-radius: 12px; color: #fff; background: rgba(30, 30, 30, 0.94); font-size: 0.78rem; text-align: center; }
.toast.error { background: rgba(183, 45, 45, 0.96); }

.bottom-nav {
  position: fixed;
  z-index: 30;
  left: 50%;
  bottom: 0;
  width: min(100%, 680px);
  min-height: calc(64px + env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 5px 10px calc(5px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--nav-bg);
  backdrop-filter: blur(18px);
  box-shadow: 0 -9px 28px rgba(45, 29, 98, 0.07);
  transform: translateX(-50%);
}
.bottom-nav.hidden { display: none; }
.nav-item {
  min-height: 52px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  border: 0;
  border-radius: 12px;
  color: var(--muted);
  background: transparent;
}
.nav-icon {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  font-size: 1.05rem;
  line-height: 1;
}
.nav-icon > .icon,
svg.nav-icon { width: 1.25rem; height: 1.25rem; }
svg.nav-icon { display: block; }
.nav-item span:last-child { font-size: 0.62rem; font-weight: 650; }
.nav-item.active { color: var(--button); background: var(--soft-blue); }

.organize-banner {
  height: 132px;
  overflow: hidden;
  margin: -6px 0 14px;
  border-radius: 20px;
  background: var(--brand-indigo);
  box-shadow: 0 14px 34px rgba(45, 29, 98, 0.16);
}

.organize-art {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center 48%;
}

.mascot-empty {
  width: 58px;
  height: 58px;
  padding: 3px;
  border-radius: 18px;
  background: linear-gradient(145deg, var(--brand-coral), var(--brand-gold));
  animation: mascot-pop 360ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.action-grid { display: grid; gap: 9px; }
.action-card { min-height: 72px; padding: 14px; border: 0; border-radius: var(--radius); color: var(--text); background: var(--surface); text-align: left; }
.action-card.primary-card { color: var(--button-text); background: var(--button); }
.action-icon { display: none; }
.action-footer { display: flex; align-items: center; justify-content: space-between; }
.action-card strong { font-size: 0.9rem; }
.action-card small { color: var(--muted); }
.action-arrow { font-size: 1.2rem; }

.package-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.package { padding: 11px 7px; border-radius: 12px; background: var(--surface); text-align: center; }
.package strong { display: block; font-size: 0.9rem; }
.package span { color: var(--muted); font-size: 0.62rem; }

@media (max-width: 390px) {
  .choice-grid.three { grid-template-columns: 1fr; }
  .choice-grid.three .choice { min-height: 58px; }
  .project-card h3 { max-width: 100%; }
  .review-row { grid-template-columns: 78px 1fr; }
}

@media (max-width: 350px) {
  .app-shell { padding-right: 10px; padding-left: 10px; }
  .app-header { margin-right: -10px; margin-left: -10px; padding-right: 10px; padding-left: 10px; }
  .brand-copy strong { font-size: 0.88rem; }
  .home-intro h1,
  .page-title,
  .wizard-head h1 { font-size: 1.45rem; }
  .inline-form { grid-template-columns: 1fr; }
  .inline-form button { min-height: 46px; }
  .wizard-actions { grid-template-columns: minmax(88px, 0.6fr) 1.4fr; padding-right: 10px; padding-left: 10px; }
}

@media (min-width: 560px) {
  .app-shell { padding-right: 18px; padding-left: 18px; }
  .app-header { margin-right: -18px; margin-left: -18px; padding-right: 18px; padding-left: 18px; }
  .project-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .type-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .type-card { min-height: 164px; grid-template-columns: 1fr auto; align-content: space-between; }
  .type-card .type-icon { grid-column: 1 / -1; }
}

@media (hover: hover) {
  .project-card:hover,
  .type-card:hover,
  .settings-card:hover,
  .balance-card:hover,
  .language-option:hover { filter: brightness(0.985); }
  .project-card:hover,
  .type-card:hover,
  .settings-card:hover,
  .balance-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-strong); }
  .button.primary:hover { filter: brightness(1.04); box-shadow: 0 12px 26px rgba(96, 66, 232, 0.3); }
  .nav-item:hover,
  .segment:hover,
  .back-button:hover,
  .icon-button:hover { background: var(--soft-blue); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }
}

/* Reaction Vault --------------------------------------------------------- */

:root,
html[data-theme="light"],
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0716;
  --surface: rgba(24, 16, 46, 0.88);
  --text: #faf7ff;
  --muted: #aaa1bd;
  --button: #8a6cff;
  --button-text: #ffffff;
  --link: #b39fff;
  --brand-indigo: #171033;
  --brand-violet: #8a6cff;
  --brand-teal: #3ad9cf;
  --brand-coral: #ff7866;
  --brand-gold: #f7c85f;
  --line: rgba(224, 214, 255, 0.13);
  --soft-blue: rgba(138, 108, 255, 0.17);
  --soft-teal: rgba(58, 217, 207, 0.15);
  --soft-coral: rgba(255, 120, 102, 0.16);
  --soft-gold: rgba(247, 200, 95, 0.16);
  --soft-red: rgba(255, 104, 104, 0.15);
  --shadow: 0 14px 36px rgba(3, 1, 12, 0.25);
  --shadow-strong: 0 22px 52px rgba(3, 1, 12, 0.34);
  --header-bg: rgba(11, 7, 22, 0.78);
  --nav-bg: rgba(21, 14, 41, 0.9);
  --focus-ring: rgba(58, 217, 207, 0.48);
  --danger: #ff7676;
  --vault-edge: rgba(247, 200, 95, 0.24);
  --vault-glass: rgba(31, 21, 57, 0.78);
  --vault-glass-strong: rgba(25, 17, 49, 0.94);
}

html[data-theme="dark"] {
  --bg: #080510;
  --surface: rgba(20, 13, 38, 0.92);
  --header-bg: rgba(8, 5, 16, 0.82);
  --nav-bg: rgba(17, 11, 33, 0.93);
  --vault-glass: rgba(25, 17, 47, 0.84);
  --vault-glass-strong: rgba(20, 13, 39, 0.96);
}

html,
html[data-theme="light"],
html[data-theme="dark"] {
  background: var(--bg);
}

body {
  position: relative;
  isolation: isolate;
  background: var(--bg);
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
}

body::before {
  background:
    radial-gradient(circle at 8% 4%, rgba(58, 217, 207, 0.14), transparent 29rem),
    radial-gradient(circle at 94% 13%, rgba(255, 120, 102, 0.14), transparent 27rem),
    radial-gradient(circle at 48% 100%, rgba(138, 108, 255, 0.18), transparent 34rem),
    linear-gradient(180deg, #100a22 0%, var(--bg) 52%, #080510 100%);
}

body::after {
  z-index: -1;
  opacity: 0.2;
  background-image:
    linear-gradient(rgba(222, 212, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(222, 212, 255, 0.08) 1px, transparent 1px);
  background-size: 34px 34px;
  -webkit-mask-image: radial-gradient(circle at 50% 28%, #000 0%, transparent 76%);
  mask-image: radial-gradient(circle at 50% 28%, #000 0%, transparent 76%);
}

button {
  transition: transform 150ms ease, opacity 150ms ease, color 150ms ease, border-color 150ms ease;
}

.app-shell {
  position: relative;
  z-index: 1;
  max-width: 680px;
  padding-right: 12px;
  padding-bottom: calc(104px + env(safe-area-inset-bottom));
  padding-left: 12px;
}

.app-shell.no-bottom-nav { padding-bottom: 22px; }
.app-shell.wizard-route { padding-bottom: calc(104px + env(safe-area-inset-bottom)); }

.app-header {
  min-height: calc(62px + env(safe-area-inset-top));
  border-color: var(--line);
  background: var(--header-bg);
  box-shadow: none;
}

.brand-mark {
  width: 40px;
  height: 40px;
  padding: 2px;
  border: 1px solid rgba(247, 200, 95, 0.45);
  border-radius: 14px;
  background: linear-gradient(145deg, var(--brand-coral), var(--brand-gold));
  box-shadow: 0 7px 20px rgba(255, 120, 102, 0.19);
}

.brand-mark img { border-radius: 11px; }
.brand-copy strong { color: var(--text); letter-spacing: -0.015em; }
.brand-copy span { color: var(--muted); }
.avatar { background: linear-gradient(145deg, #7959ec, #3d2c79); }

.screen {
  padding-top: 14px;
  animation: vault-screen-in 240ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes vault-screen-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.loading-card,
.empty-state,
.error-state,
.panel,
.project-card,
.settings-card,
.balance-card,
.language-option {
  border: 1px solid var(--line);
  background: var(--vault-glass);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.loading-card,
.empty-state,
.error-state { min-height: 176px; }

.scene-stage,
.brand-hero,
.organize-stage,
.language-stage,
.wizard-stage {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid var(--vault-edge);
  border-radius: 28px;
  background: #171033;
  box-shadow: var(--shadow-strong);
}

.scene-media,
.home-hero-media,
.detail-media,
.organize-stage .organize-art {
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  display: block;
  object-fit: cover;
  opacity: 1;
  transform: scale(1.01);
  transition: opacity 320ms ease, transform 520ms cubic-bezier(0.22, 1, 0.36, 1);
}

.scene-media.scene-video:not(.is-ready) { opacity: 0; }
.scene-media.is-ready,
.scene-fallback.is-ready { opacity: 1; transform: scale(1); }

.scene-overlay,
.detail-overlay {
  position: absolute;
  z-index: 1;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(8, 4, 20, 0.08) 18%, rgba(8, 4, 20, 0.48) 62%, rgba(8, 4, 20, 0.96) 100%),
    linear-gradient(90deg, rgba(8, 4, 20, 0.54), transparent 72%);
  pointer-events: none;
}

.scene-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--brand-gold);
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.segmented {
  border: 1px solid var(--line);
  background: rgba(8, 5, 18, 0.58);
  backdrop-filter: blur(14px);
}

.segment { color: var(--muted); }
.segment.active {
  color: var(--text);
  background: rgba(138, 108, 255, 0.24);
  box-shadow: inset 0 0 0 1px rgba(179, 159, 255, 0.22);
}

.home-mode { margin-bottom: 12px; }
.brand-hero .home-mode {
  position: absolute;
  z-index: 4;
  top: 14px;
  right: 14px;
  left: 14px;
  margin: 0;
}

.brand-hero {
  min-height: clamp(320px, 55dvh, 430px);
  margin-bottom: 18px;
  border-radius: 30px;
}

.brand-hero::before {
  content: "";
  position: absolute;
  z-index: 2;
  inset: 0;
  border-radius: inherit;
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.16),
    inset 0 -1px rgba(247, 200, 95, 0.2);
  pointer-events: none;
}

.brand-hero::after {
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(9, 5, 22, 0.08) 24%, rgba(9, 5, 22, 0.44) 59%, rgba(9, 5, 22, 0.96) 100%),
    linear-gradient(90deg, rgba(9, 5, 22, 0.42), transparent 74%);
}

.brand-hero .home-hero-media { z-index: 0; object-position: center center; }
.brand-hero.participant .home-hero-media { object-position: center 48%; }

.home-hero-copy {
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 78px 20px 22px;
  pointer-events: auto;
}

.brand-hero:has(.hero-actions) .home-hero-copy { bottom: auto; padding-bottom: 92px; }
.brand-hero:not(:has(.hero-actions)) .home-hero-copy { bottom: auto; }
.home-hero-copy h1 { font-size: clamp(1.72rem, 7.2vw, 2.35rem); letter-spacing: -0.045em; }
.home-hero-copy p { max-width: 28rem; color: rgba(250, 247, 255, 0.74); }

.hero-actions {
  position: absolute;
  z-index: 4;
  right: 18px;
  bottom: 18px;
  left: 18px;
  display: flex;
  gap: 9px;
}

.hero-actions .button { flex: 1; }
.hero-actions .create-button { width: 100%; position: static; margin: 0; }

.home-create-action {
  margin: -2px 2px 16px;
}

.home-create-action .create-button {
  width: 100%;
  position: static;
  margin: 0;
}

.create-button {
  width: calc(100% - 36px);
  position: relative;
  z-index: 4;
  margin: -43px 18px 22px;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.button.primary {
  min-height: 52px;
  color: #fff;
  background: linear-gradient(135deg, #7659ef, #735ee8 58%, #3c9fc4);
  box-shadow: 0 12px 28px rgba(78, 53, 181, 0.3);
}

.button.secondary {
  color: var(--text);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.055);
  box-shadow: none;
}

.command-sheet,
.home-projects {
  position: relative;
  z-index: 3;
  margin-top: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--vault-glass-strong);
  box-shadow: var(--shadow-strong);
  backdrop-filter: blur(18px);
}

.brand-hero.participant + .home-projects { margin-top: -42px; }
.command-sheet .project-list,
.home-projects .project-list { gap: 10px; }

.section-heading { margin-right: 1px; margin-left: 1px; }
.section-heading h2,
.page-title,
.hero h1,
.wizard-head h1 { color: var(--text); }
.count-badge { color: var(--brand-gold); background: var(--soft-gold); }

.project-card {
  position: relative;
  overflow: hidden;
  min-height: 112px;
  border-color: rgba(222, 212, 255, 0.12);
  border-radius: 18px;
  background:
    linear-gradient(110deg, rgba(138, 108, 255, 0.09), transparent 48%),
    rgba(255, 255, 255, 0.045);
  box-shadow: none;
  transition: transform 150ms ease, border-color 150ms ease;
}

.project-card::before {
  content: "";
  width: 3px;
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 0;
  border-radius: 0 99px 99px 0;
  background: linear-gradient(180deg, var(--brand-gold), var(--brand-teal));
}

.project-card .mini-icon {
  color: var(--brand-gold);
  border: 1px solid rgba(247, 200, 95, 0.18);
  background: var(--soft-gold);
}

.project-card h3 { color: var(--text); }
.project-stats { border-color: var(--line); }
.project-action { color: var(--brand-teal); }

.status {
  color: #81edbd;
  border: 1px solid rgba(74, 226, 165, 0.2);
  background: rgba(60, 211, 151, 0.12);
}

.status.draft {
  color: var(--brand-gold);
  border-color: rgba(247, 200, 95, 0.2);
  background: var(--soft-gold);
}

.status.finished {
  color: var(--muted);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.045);
}

.organize-stage,
.organize-banner {
  height: clamp(205px, 34dvh, 270px);
  margin: -2px 0 16px;
  overflow: hidden;
  border: 1px solid var(--vault-edge);
  border-radius: 28px;
  background: #111e2d;
  box-shadow: var(--shadow-strong);
}

.organize-stage .scene-media,
.organize-art { object-position: center 48%; }

.organize-stage > .scene-overlay,
.language-stage > .scene-overlay {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 6px;
  padding: 18px;
}

.organize-stage > .scene-overlay .page-title,
.language-stage > .scene-overlay .page-title { color: #fff; }

.type-list { gap: 11px; }
.type-card {
  position: relative;
  overflow: hidden;
  min-height: 102px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--vault-glass);
  box-shadow: var(--shadow);
  transition: transform 150ms ease, border-color 150ms ease;
}

.type-card::after {
  content: "";
  width: 96px;
  height: 96px;
  position: absolute;
  z-index: -1;
  top: -42px;
  right: -30px;
  border-radius: 50%;
  background: var(--soft-blue);
}

.type-card[data-type="giveaway"] {
  border-color: rgba(247, 200, 95, 0.24);
  background: linear-gradient(120deg, rgba(247, 200, 95, 0.13), rgba(31, 21, 57, 0.82) 56%);
}

.type-card[data-type="poll"] {
  border-color: rgba(58, 217, 207, 0.23);
  background: linear-gradient(120deg, rgba(58, 217, 207, 0.12), rgba(31, 21, 57, 0.82) 56%);
}

.type-card[data-type="prediction"] {
  border-color: rgba(138, 108, 255, 0.25);
  background: linear-gradient(120deg, rgba(138, 108, 255, 0.15), rgba(31, 21, 57, 0.82) 56%);
}

.type-card[data-type="giveaway"] .type-icon { color: var(--brand-gold); background: var(--soft-gold); }
.type-card[data-type="poll"] .type-icon { color: var(--brand-teal); background: var(--soft-teal); }
.type-card[data-type="prediction"] .type-icon { color: #b6a5ff; background: var(--soft-blue); }
.type-card h2 { color: var(--text); font-size: 0.98rem; }
.type-index { color: rgba(247, 200, 95, 0.65); font: 700 0.65rem/1 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: 0.12em; }

.account-hero,
.language-stage {
  min-height: 205px;
  border: 1px solid var(--vault-edge);
  border-radius: 28px;
  background: #171033;
  box-shadow: var(--shadow-strong);
}

.account-hero:has(.scene-media),
.language-stage { padding: 0; }

.account-hero .scene-media,
.language-stage .scene-media { object-position: center 44%; }

.account-hero:has(.scene-media)::after,
.language-stage::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  background: linear-gradient(180deg, rgba(9, 5, 22, 0.06) 28%, rgba(9, 5, 22, 0.92) 100%);
  pointer-events: none;
}

.account-hero:has(.scene-media) .account-user {
  position: absolute;
  z-index: 2;
  inset: 0;
  align-items: flex-end;
  padding: 18px;
  pointer-events: none;
}

.account-user h1 { color: var(--text); }
.balance-card {
  min-height: 120px;
  border-color: var(--line);
  background: linear-gradient(145deg, rgba(138, 108, 255, 0.11), rgba(255, 255, 255, 0.04));
}
.balance-card .balance-icon {
  width: 24px;
  height: 24px;
  margin-bottom: 9px;
  color: var(--brand-teal);
}

.language-stage {
  margin-bottom: 14px;
}

.language-stage > .scene-overlay { z-index: 2; }

.language-option {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.045);
  box-shadow: none;
}

.language-option.selected {
  border-color: rgba(58, 217, 207, 0.48);
  background: var(--soft-teal);
  box-shadow: inset 0 0 0 1px rgba(58, 217, 207, 0.2);
}

.wizard-stage {
  min-height: 190px;
  margin-bottom: 14px;
}

.wizard-stage .scene-media { object-position: center 44%; }
.wizard-stage .wizard-head {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  margin: 0;
  padding: 18px;
}

.wizard-stage .wizard-label,
.wizard-stage .wizard-head h1 { color: #fff; }

.wizard-stage .progress { margin-top: 11px; }
.progress span { background: rgba(255, 255, 255, 0.15); }
.progress span.done { background: var(--brand-teal); }

.wizard-panel,
.panel {
  border-color: var(--line);
  background: var(--vault-glass-strong);
}

/* A filtered ancestor becomes the containing block for fixed children in
   Chromium/WebView. Keep the wizard action dock attached to the viewport. */
.wizard-panel { backdrop-filter: none; }

.field input,
.field select,
.field textarea,
.option-row input,
.inline-form input,
.choice,
.toggle-row,
.captcha-box,
.metric {
  color: var(--text);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.045);
}

.field input::placeholder,
.field textarea::placeholder,
.option-row input::placeholder,
.inline-form input::placeholder { color: #827990; opacity: 1; }

.choice.selected {
  border-color: rgba(58, 217, 207, 0.48);
  background: var(--soft-teal);
  box-shadow: inset 0 0 0 1px rgba(58, 217, 207, 0.18);
}

.toggle-control { background: rgba(255, 255, 255, 0.18); }
.toggle-input:checked + .toggle-control { background: var(--brand-teal); }

.wizard-actions {
  bottom: calc(var(--keyboard-offset) + 10px);
  width: min(calc(100% - 24px), 640px);
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--nav-bg);
  box-shadow: var(--shadow-strong);
  backdrop-filter: blur(18px);
}

.detail-cover {
  position: relative;
  overflow: hidden;
  min-height: 228px;
  border: 1px solid var(--vault-edge);
  border-top-width: 1px;
  border-radius: 28px;
  background: linear-gradient(145deg, #241443, #101c2d);
  box-shadow: var(--shadow-strong);
}

.detail-cover:has(.detail-media) { min-height: 280px; padding: 18px; }
.detail-cover .detail-media { z-index: 0; }
.detail-cover .detail-overlay {
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 18px;
}
.detail-cover > :not(.detail-media, .detail-overlay) { position: relative; z-index: 2; }
.detail-cover:has(.detail-media) h1,
.detail-cover:has(.detail-media) p { color: #fff; }
.detail-cover .detail-metrics { margin-top: 18px; }
.detail-cover .metric { background: rgba(10, 6, 22, 0.56); backdrop-filter: blur(10px); }
.metric-icon { width: 17px; height: 17px; margin: 0 auto 5px; color: var(--brand-gold); }

.bottom-nav {
  bottom: calc(10px + env(safe-area-inset-bottom));
  width: min(calc(100% - 24px), 640px);
  min-height: 70px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--nav-bg);
  box-shadow: var(--shadow-strong);
  backdrop-filter: blur(18px);
}

.nav-item {
  min-width: 0;
  min-height: 54px;
  border-radius: 16px;
  color: var(--muted);
}

.nav-item.active {
  color: var(--brand-teal);
  background: rgba(58, 217, 207, 0.1);
}

.bottom-nav .nav-item:nth-child(2) {
  width: 64px;
  height: 64px;
  min-height: 64px;
  justify-self: center;
  margin-top: -17px;
  border: 1px solid rgba(247, 200, 95, 0.42);
  border-radius: 22px;
  color: #1d1235;
  background: linear-gradient(145deg, var(--brand-coral), var(--brand-gold));
  box-shadow: 0 13px 28px rgba(255, 120, 102, 0.28);
  transform: translateY(-2px);
}

.bottom-nav .nav-item:nth-child(2).active { color: #1d1235; }
.bottom-nav .nav-item:nth-child(2):active { transform: translateY(-2px) scale(0.96); }
.bottom-nav .nav-item:nth-child(2) span:last-child { color: #2b1a39; font-weight: 750; }

.toast-region { bottom: calc(98px + env(safe-area-inset-bottom)); }
.toast { border: 1px solid var(--line); background: rgba(23, 15, 44, 0.96); box-shadow: var(--shadow); }

body::after { animation: vault-grid-drift 18s ease-in-out infinite alternate; }

@keyframes vault-grid-drift {
  from { transform: translate3d(-5px, -4px, 0); opacity: 0.16; }
  to { transform: translate3d(7px, 8px, 0); opacity: 0.24; }
}

.project-list > :nth-child(-n + 5),
.type-list > :nth-child(-n + 5) {
  animation: vault-card-in 300ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.project-list > :nth-child(2),
.type-list > :nth-child(2) { animation-delay: 35ms; }
.project-list > :nth-child(3),
.type-list > :nth-child(3) { animation-delay: 70ms; }
.project-list > :nth-child(4),
.type-list > :nth-child(4) { animation-delay: 105ms; }
.project-list > :nth-child(5),
.type-list > :nth-child(5) { animation-delay: 140ms; }

@keyframes vault-card-in {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 390px) {
  .brand-hero { min-height: clamp(300px, 52dvh, 370px); }
  .home-hero-copy { padding-right: 17px; padding-left: 17px; }
  .home-hero-copy h1 { font-size: 1.72rem; }
  .command-sheet,
  .home-projects { padding: 11px; border-radius: 21px; }
  .project-card { padding: 13px; }
  .type-card { min-height: 96px; padding: 13px; }
  .account-hero,
  .language-stage { min-height: 188px; }
  .detail-cover:has(.detail-media) { min-height: 252px; }
}

@media (max-width: 350px) {
  .bottom-nav,
  .wizard-actions { width: calc(100% - 16px); }
  .bottom-nav { padding-right: 6px; padding-left: 6px; }
  .bottom-nav .nav-item:nth-child(2) { width: 60px; height: 60px; min-height: 60px; }
  .nav-item span:last-child { font-size: 0.59rem; }
  .brand-hero { border-radius: 25px; }
  .hero-actions { right: 14px; left: 14px; }
  .wizard-actions { grid-template-columns: minmax(86px, 0.58fr) 1.42fr; }
}

@media (min-width: 560px) {
  .brand-hero { min-height: 420px; }
  .organize-stage,
  .organize-banner { height: 280px; }
  .type-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .type-card { min-height: 180px; grid-template-columns: 1fr auto; align-content: space-between; }
  .command-sheet,
  .home-projects { padding: 18px; }
}

@media (hover: hover) {
  .project-card:hover,
  .type-card:hover,
  .settings-card:hover,
  .balance-card:hover,
  .language-option:hover {
    filter: none;
    border-color: rgba(58, 217, 207, 0.32);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
  }

  .button.primary:hover { filter: none; box-shadow: 0 12px 28px rgba(78, 53, 181, 0.3); transform: translateY(-1px); }
  .bottom-nav .nav-item:nth-child(2):hover { background: linear-gradient(145deg, var(--brand-coral), var(--brand-gold)); transform: translateY(-4px); }
}

@media (prefers-reduced-motion: reduce) {
  .screen,
  .project-card,
  .type-card,
  .settings-card,
  .balance-card,
  .language-option,
  .wizard-mascot,
  .mascot-empty,
  .account-mascot,
  .home-hero-media,
  .scene-media,
  .detail-media {
    animation: none !important;
    transition: none !important;
  }
}

/* Reaction Vault: pearl / lilac light theme ----------------------------- */

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f0f9;
  --surface: #ffffff;
  --text: #241c33;
  --muted: #746d80;
  --button: #6042e8;
  --button-text: #ffffff;
  --link: #6042e8;
  --brand-indigo: #2d1d62;
  --brand-violet: #6042e8;
  --brand-teal: #1aa8a2;
  --brand-coral: #f67460;
  --brand-gold: #efb33f;
  --line: rgba(57, 39, 99, 0.12);
  --soft-blue: rgba(96, 66, 232, 0.1);
  --soft-teal: rgba(26, 168, 162, 0.11);
  --soft-coral: rgba(246, 116, 96, 0.11);
  --soft-gold: rgba(239, 179, 63, 0.14);
  --soft-red: rgba(210, 54, 54, 0.09);
  --shadow: 0 12px 32px rgba(47, 30, 86, 0.08);
  --shadow-strong: 0 18px 46px rgba(47, 30, 86, 0.13);
  --header-bg: rgba(249, 247, 253, 0.9);
  --nav-bg: rgba(255, 253, 255, 0.94);
  --focus-ring: rgba(96, 66, 232, 0.3);
  --danger: #c94141;
  --vault-edge: rgba(239, 179, 63, 0.28);
  --vault-glass: rgba(255, 253, 255, 0.8);
  --vault-glass-strong: rgba(253, 250, 255, 0.95);
}

html[data-theme="light"],
html[data-theme="light"] body { background: var(--bg); }

html[data-theme="light"] body::before {
  background:
    radial-gradient(circle at 8% 3%, rgba(26, 168, 162, 0.1), transparent 28rem),
    radial-gradient(circle at 94% 10%, rgba(246, 116, 96, 0.1), transparent 25rem),
    radial-gradient(circle at 48% 100%, rgba(96, 66, 232, 0.11), transparent 34rem),
    linear-gradient(180deg, #faf7fd 0%, #f4f0f9 54%, #eee8f6 100%);
}

html[data-theme="light"] body::after {
  opacity: 0.3;
  background-image:
    linear-gradient(rgba(74, 53, 122, 0.065) 1px, transparent 1px),
    linear-gradient(90deg, rgba(74, 53, 122, 0.065) 1px, transparent 1px);
}

.header-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 0 0 auto;
  gap: 4px;
}

.theme-button {
  width: 44px;
  height: 44px;
  min-height: 44px;
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--link);
  background: rgba(255, 255, 255, 0.055);
  box-shadow: none;
}

.theme-button .icon,
.theme-button .theme-icon { width: 20px; height: 20px; }

html[data-theme="light"] .theme-button {
  color: var(--brand-indigo);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 7px 20px rgba(47, 30, 86, 0.07);
}

html[data-theme="dark"] .theme-button {
  color: var(--brand-gold);
  background: rgba(255, 255, 255, 0.055);
}

html[data-theme="light"] .theme-button .sun-icon,
html[data-theme="light"] .theme-button [data-theme-icon="sun"],
html[data-theme="dark"] .theme-button .moon-icon,
html[data-theme="dark"] .theme-button [data-theme-icon="moon"] { display: none; }

html[data-theme="light"] .theme-button:empty::before,
html[data-theme="dark"] .theme-button:empty::before {
  content: "";
  width: 18px;
  height: 18px;
  display: block;
  border-radius: 50%;
}

html[data-theme="light"] .theme-button:empty::before {
  background: transparent;
  box-shadow: inset -6px -3px 0 0 currentColor;
  transform: translate(1px, -1px);
}

html[data-theme="dark"] .theme-button:empty::before {
  width: 10px;
  height: 10px;
  background: currentColor;
  box-shadow:
    0 -8px 0 -4px currentColor,
    0 8px 0 -4px currentColor,
    8px 0 0 -4px currentColor,
    -8px 0 0 -4px currentColor,
    6px 6px 0 -4px currentColor,
    -6px -6px 0 -4px currentColor,
    6px -6px 0 -4px currentColor,
    -6px 6px 0 -4px currentColor;
}

html[data-theme="light"] .app-header {
  border-color: var(--line);
  background: var(--header-bg);
  box-shadow: 0 7px 24px rgba(47, 30, 86, 0.05);
}

html[data-theme="light"] .brand-copy strong { color: var(--text); }
html[data-theme="light"] .brand-copy span { color: var(--muted); }
html[data-theme="light"] .back-button,
html[data-theme="light"] .icon-button { color: var(--link); }

html[data-theme="light"] .bottom-nav,
html[data-theme="light"] .wizard-actions {
  border-color: rgba(57, 39, 99, 0.13);
  background: var(--nav-bg);
  box-shadow: var(--shadow-strong);
}

html[data-theme="light"] .bottom-nav .nav-item { color: var(--muted); }
html[data-theme="light"] .bottom-nav .nav-item.active {
  color: #147f7b;
  background: rgba(26, 168, 162, 0.1);
}

html[data-theme="light"] .bottom-nav .nav-item:nth-child(2),
html[data-theme="light"] .bottom-nav .nav-item:nth-child(2).active {
  color: #2d1d3e;
  border-color: rgba(197, 128, 12, 0.3);
  background: linear-gradient(145deg, var(--brand-coral), var(--brand-gold));
}

html[data-theme="light"] .bottom-nav .nav-item:nth-child(2) span:last-child { color: #36213d; }

html[data-theme="light"] .command-sheet,
html[data-theme="light"] .home-projects,
html[data-theme="light"] .panel,
html[data-theme="light"] .loading-card,
html[data-theme="light"] .empty-state,
html[data-theme="light"] .error-state,
html[data-theme="light"] .settings-card,
html[data-theme="light"] .balance-card,
html[data-theme="light"] .language-option {
  border-color: var(--line);
  color: var(--text);
  background: var(--vault-glass-strong);
  box-shadow: var(--shadow);
}

html[data-theme="light"] .error-state { color: var(--danger); }

html[data-theme="light"] .segmented {
  border-color: rgba(57, 39, 99, 0.09);
  background: rgba(72, 58, 96, 0.08);
}

html[data-theme="light"] .segment { color: var(--muted); }
html[data-theme="light"] .segment.active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 2px 7px rgba(47, 30, 86, 0.08);
}

html[data-theme="light"] .brand-hero .home-mode {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(12, 7, 27, 0.58);
}

html[data-theme="light"] .brand-hero .home-mode .segment { color: rgba(255, 255, 255, 0.68); }
html[data-theme="light"] .brand-hero .home-mode .segment.active {
  color: #fff;
  background: rgba(138, 108, 255, 0.34);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

html[data-theme="light"] .project-card {
  border-color: rgba(57, 39, 99, 0.11);
  color: var(--text);
  background:
    linear-gradient(110deg, rgba(96, 66, 232, 0.065), transparent 48%),
    rgba(255, 255, 255, 0.78);
}

html[data-theme="light"] .project-card h3 { color: var(--text); }
html[data-theme="light"] .project-card p,
html[data-theme="light"] .project-stats { color: var(--muted); }
html[data-theme="light"] .project-stats { border-color: var(--line); }
html[data-theme="light"] .project-action { color: #147f7b; }

html[data-theme="light"] .status {
  color: #147448;
  border-color: rgba(20, 116, 72, 0.15);
  background: rgba(38, 170, 102, 0.1);
}

html[data-theme="light"] .status.draft {
  color: #956000;
  border-color: rgba(149, 96, 0, 0.14);
  background: rgba(239, 179, 63, 0.14);
}

html[data-theme="light"] .status.finished {
  color: var(--muted);
  border-color: var(--line);
  background: rgba(72, 58, 96, 0.07);
}

html[data-theme="light"] .type-card {
  color: var(--text);
  border-color: var(--line);
  box-shadow: var(--shadow);
}

html[data-theme="light"] .type-card[data-type="giveaway"] {
  border-color: rgba(197, 128, 12, 0.18);
  background: linear-gradient(120deg, rgba(239, 179, 63, 0.14), rgba(255, 255, 255, 0.88) 58%);
}

html[data-theme="light"] .type-card[data-type="poll"] {
  border-color: rgba(20, 127, 123, 0.18);
  background: linear-gradient(120deg, rgba(26, 168, 162, 0.12), rgba(255, 255, 255, 0.88) 58%);
}

html[data-theme="light"] .type-card[data-type="prediction"] {
  border-color: rgba(96, 66, 232, 0.18);
  background: linear-gradient(120deg, rgba(96, 66, 232, 0.12), rgba(255, 255, 255, 0.88) 58%);
}

html[data-theme="light"] .type-card h2 { color: var(--text); }
html[data-theme="light"] .type-card p { color: var(--muted); }
html[data-theme="light"] .type-index { color: #956000; }
html[data-theme="light"] .type-card.soon::before { background: rgba(96, 66, 232, 0.035); }
html[data-theme="light"] .soon-badge {
  color: #6042b8;
  border-color: rgba(96, 66, 232, 0.2);
  background: rgba(96, 66, 232, 0.08);
}

html[data-theme="light"] .balance-card {
  background: linear-gradient(145deg, rgba(96, 66, 232, 0.075), rgba(255, 255, 255, 0.92));
}

html[data-theme="light"] .balance-card .balance-icon { color: #147f7b; }

html[data-theme="light"] .language-option {
  color: var(--text);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: none;
}

html[data-theme="light"] .language-option.selected {
  border-color: rgba(20, 127, 123, 0.28);
  background: rgba(26, 168, 162, 0.1);
  box-shadow: inset 0 0 0 1px rgba(20, 127, 123, 0.1);
}

html[data-theme="light"] .field input,
html[data-theme="light"] .field select,
html[data-theme="light"] .field textarea,
html[data-theme="light"] .option-row input,
html[data-theme="light"] .inline-form input,
html[data-theme="light"] .choice,
html[data-theme="light"] .toggle-row,
html[data-theme="light"] .captcha-box {
  color: var(--text);
  border-color: rgba(57, 39, 99, 0.13);
  background: rgba(250, 247, 253, 0.9);
}

html[data-theme="light"] .field input::placeholder,
html[data-theme="light"] .field textarea::placeholder,
html[data-theme="light"] .option-row input::placeholder,
html[data-theme="light"] .inline-form input::placeholder { color: #8c8496; }

html[data-theme="light"] .choice.selected {
  border-color: rgba(20, 127, 123, 0.32);
  color: var(--text);
  background: rgba(26, 168, 162, 0.1);
  box-shadow: inset 0 0 0 1px rgba(20, 127, 123, 0.1);
}
html[data-theme="light"] .choice[data-choice-key="button_style"][data-choice-value="plain"] { border-left-color: rgba(72, 58, 96, 0.28); }

html[data-theme="light"] .toggle-control { background: rgba(72, 58, 96, 0.2); }
html[data-theme="light"] .toggle-input:checked + .toggle-control { background: #1aa8a2; }

html[data-theme="light"] .button.secondary {
  color: var(--link);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.82);
}

html[data-theme="light"] .account-hero:has(.scene-media) .account-user h1,
html[data-theme="light"] .account-hero:has(.scene-media) .account-user p,
html[data-theme="light"] .detail-cover:has(.detail-media) h1,
html[data-theme="light"] .detail-cover:has(.detail-media) p { color: #fff; }

html[data-theme="light"] .detail-cover .metric {
  color: #fff;
  background: rgba(10, 6, 22, 0.58);
}

html[data-theme="light"] .detail-cover .metric span { color: rgba(255, 255, 255, 0.68); }
html[data-theme="light"] .detail-cover .metric strong { color: #fff; }

html[data-theme="light"] .winner { background: rgba(38, 170, 102, 0.1); }
html[data-theme="light"] .winner span:last-child { color: #147448; }

html[data-theme="light"] .review-list,
html[data-theme="light"] .review-row { border-color: var(--line); }

@media (max-width: 350px) {
  .header-actions { gap: 1px; }
  .theme-button { width: 44px; height: 44px; }
}
