/* The MAX look: MAX UI-style cards and cells, MAX gradient, Christmas balls and the cartoon Santa
   from work/max-platform/design. Replaces style.css in the MAX copy (app/main.py: max_index). */
:root {
  --bg: linear-gradient(180deg, #eef2ff 0%, #f5f7fa 34%);
  --bg-flat: #f5f7fa;
  --card: #fff;
  --ink: rgba(6, 7, 8, .88);
  --muted: rgba(6, 7, 8, .56);
  --faint: rgba(6, 7, 8, .32);
  --line: rgba(6, 7, 8, .07);
  --shadow: 0 8px 20px rgba(40, 50, 120, .08), 0 1px 2px rgba(40, 50, 120, .06);
  --shadow-sm: 0 6px 14px rgba(40, 50, 120, .07);
  --grad: linear-gradient(135deg, #2a7bff 0%, #8a4dff 100%);
  --grad-hero: linear-gradient(135deg, #2a7bff 0%, #8a4dff 100%);
  --grad-shadow: 0 10px 22px rgba(90, 70, 255, .38), inset 0 1px 0 rgba(255, 255, 255, .35);
  --red: linear-gradient(135deg, #ff6b6b, #d6232f);
  --green: linear-gradient(135deg, #57d98a, #1c8a46);
  --soft: #ecebff;
  --soft-ink: #4b3fe0;
  --green-soft: #e3f6ea;
  --green-ink: #1c8a46;
  --red-ink: #e5303c;
  --grey-soft: #eceef3;
  --grey-ink: rgba(6, 7, 8, .6);
  --input: #f5f7fa;
  --accent: #2a6bff;
  --disabled: #e3e6ef;
  --disabled-ink: rgba(6, 7, 8, .4);
  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: linear-gradient(180deg, #1d1f3a 0%, #17181c 40%);
  --bg-flat: #17181c;
  --card: #25262d;
  --ink: rgba(255, 255, 255, .94);
  --muted: rgba(255, 255, 255, .6);
  --faint: rgba(255, 255, 255, .32);
  --line: rgba(255, 255, 255, .08);
  --shadow: 0 10px 22px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .06);
  --shadow-sm: 0 6px 14px rgba(0, 0, 0, .3);
  --grad-hero: linear-gradient(135deg, #2a6be8 0%, #6a3be0 100%);
  --grad-shadow: 0 12px 24px rgba(90, 70, 255, .5), inset 0 1px 0 rgba(255, 255, 255, .35);
  --soft: rgba(169, 156, 255, .16);
  --soft-ink: #a99cff;
  --green-soft: rgba(87, 217, 138, .14);
  --green-ink: #57d98a;
  --red-ink: #ff6b6b;
  --grey-soft: rgba(255, 255, 255, .08);
  --grey-ink: rgba(255, 255, 255, .6);
  --input: rgba(255, 255, 255, .06);
  --accent: #6b9bff;
  --disabled: rgba(255, 255, 255, .08);
  --disabled-ink: rgba(255, 255, 255, .4);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: -apple-system, system-ui, 'Helvetica Neue', Roboto, sans-serif;
  color: var(--ink); background: var(--bg-flat); background-image: var(--bg); background-repeat: no-repeat;
  overflow-x: hidden; font-size: 15px;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }

main {
  max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px;
  padding: 14px 16px calc(150px + env(safe-area-inset-bottom));
}
[hidden] { display: none !important; }

/* ---------- type ---------- */
.mx-sub { font-size: 13px; color: var(--muted); }
.mx-caps { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: rgba(255, 255, 255, .85); }
.mx-section { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; padding-left: 4px; margin-bottom: -6px; }
.mx-accent { color: var(--accent); }
.mx-dim { opacity: .75; }
.mx-hint { padding: 0 4px; }
.mx-block { display: flex; flex-direction: column; gap: 8px; }
.mx-block .mx-section { margin: 0; }

/* ---------- header ---------- */
.mx-top { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.mx-top__text { display: flex; flex-direction: column; flex-grow: 1; min-width: 0; }
.mx-top h1 { margin: 0; font-size: 21px; font-weight: 700; overflow-wrap: anywhere; }
.mx-back {
  width: 44px; height: 44px; flex: none; margin-left: -10px; border: 0; border-radius: 12px; background: none;
  display: flex; align-items: center; justify-content: center; color: var(--accent);
}
.mx-status { flex: none; font-size: 12px; font-weight: 600; color: #fff; border-radius: 999px; padding: 5px 11px; }
.mx-status--green { background: var(--green); box-shadow: 0 4px 10px rgba(28, 138, 70, .3); }
.mx-status--violet { background: var(--grad); box-shadow: 0 4px 10px rgba(90, 70, 255, .3); }
.mx-status--grey { background: #8a8f98; }
.mx-corner-ball { flex: none; }

/* ---------- cards, cells ---------- */
.mx-card { background: var(--card); border-radius: 20px; box-shadow: var(--shadow); }
.mx-pad { padding: 16px; }
.mx-message { overflow-wrap: anywhere; }
.mx-stack { display: flex; flex-direction: column; gap: 12px; }
.mx-stack--10 { gap: 10px; }
.mx-group { overflow: hidden; display: flex; flex-direction: column; }
.mx-group > * + * { position: relative; }
.mx-group > * + *::before { content: ''; position: absolute; top: 0; right: 0; left: 16px; height: 1px; background: var(--line); }
.mx-group--balls > * + *::before { left: 66px; }
.mx-cell {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px; min-height: 52px; width: 100%;
  border: 0; background: none; text-align: left;
}
.mx-cell__text { display: flex; flex-direction: column; gap: 2px; flex-grow: 1; min-width: 0; }
.mx-cell__title { font-size: 16px; flex-grow: 1; overflow-wrap: anywhere; }
.mx-group--balls .mx-cell__title { font-weight: 500; }
.mx-value { font-size: 15px; color: var(--muted); text-align: right; overflow-wrap: anywhere; max-width: 60%; }
.mx-chevron { flex: none; color: var(--faint); }
.mx-link { border: 0; background: none; color: var(--accent); font-size: 15px; font-weight: 600; padding: 0; }

.mx-choice {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; min-height: 80px; width: 100%;
  border: 0; text-align: left;
}
.mx-choice__title { font-size: 17px; font-weight: 600; overflow-wrap: anywhere; }

.mx-tile {
  width: 52px; height: 52px; border-radius: 16px; flex: none; display: flex; align-items: center; justify-content: center;
}
.mx-tile--sm { width: 44px; height: 44px; border-radius: 14px; }
.mx-tile--red { background: linear-gradient(145deg, #ff6b6b, #d6232f); box-shadow: 0 8px 14px rgba(214, 35, 47, .35), inset 0 2px 3px rgba(255, 255, 255, .45), inset 0 -3px 4px rgba(120, 0, 10, .3); }
.mx-tile--green { background: linear-gradient(145deg, #57d98a, #1c8a46); box-shadow: 0 8px 14px rgba(28, 138, 70, .35), inset 0 2px 3px rgba(255, 255, 255, .45), inset 0 -3px 4px rgba(0, 60, 20, .3); }
.mx-tile--blue { background: var(--grad); box-shadow: 0 6px 12px rgba(90, 70, 255, .3), inset 0 1px 0 rgba(255, 255, 255, .35); }

.mx-pill { flex: none; font-size: 12px; font-weight: 600; border-radius: 999px; padding: 4px 10px; align-self: center; }
.mx-pill--green { color: var(--green-ink); background: var(--green-soft); }
.mx-pill--violet { color: var(--soft-ink); background: var(--soft); }
.mx-pill--grey { color: var(--grey-ink); background: var(--grey-soft); }
.mx-pill--glass { color: #fff; background: rgba(255, 255, 255, .2); }
.mx-badge { align-self: flex-start; font-size: 11px; font-weight: 700; color: #fff; border-radius: 999px; padding: 2px 8px; }
.mx-badge--red { background: var(--red); }
.mx-badge--violet { background: var(--grad); }

/* Christmas balls: avatars of games and players */
.mx-ball { display: inline-block; flex: none; width: 26px; height: 26px; border-radius: 999px; }
.mx-ball--sm { width: 26px; height: 26px; }
.mx-ball--md { width: 38px; height: 38px; box-shadow: 0 4px 8px rgba(40, 20, 90, .3); }
.mx-ball--lg { width: 52px; height: 52px; box-shadow: 0 6px 12px rgba(40, 20, 90, .3); }
.mx-ball--red { background: radial-gradient(circle at 35% 30%, #ffb0b0, #ff4d57 45%, #a5121c); }
.mx-ball--violet { background: radial-gradient(circle at 35% 30%, #e6d4ff, #a970ff 45%, #5a24b0); }
.mx-ball--blue { background: radial-gradient(circle at 35% 30%, #c4dcff, #3e8bff 45%, #173f9e); }
.mx-ball--gold { background: radial-gradient(circle at 35% 30%, #fff2b0, #ffc83d 45%, #b8780a); }
.mx-ball--green { background: radial-gradient(circle at 35% 30%, #c8f5d8, #3fcf78 45%, #157a3c); }

/* ---------- buttons ---------- */
.mx-btn {
  border: 0; border-radius: 14px; height: 46px; padding: 0 16px; font-size: 15px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-align: center;
}
.mx-btn--sm { height: 36px; border-radius: 12px; padding: 0 14px; font-size: 14px; align-self: flex-start; }
.mx-btn--lg { height: 54px; border-radius: 18px; font-size: 17px; }
.mx-btn--block { width: 100%; }
.mx-btn--primary { background: var(--grad); color: #fff; box-shadow: 0 6px 12px rgba(90, 70, 255, .3); }
.mx-btn--soft { background: var(--soft); color: var(--soft-ink); }
.mx-btn--muted { background: var(--grey-soft); color: var(--grey-ink); }
.mx-btn--green { background: var(--green); color: #fff; box-shadow: 0 6px 12px rgba(28, 138, 70, .3); height: 38px; }
.mx-btn--danger { background: none; color: var(--red-ink); }
.mx-btn--glass { background: rgba(255, 255, 255, .2); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3); }
.mx-btn--white { background: #fff; color: #4b3fe0; font-weight: 700; box-shadow: 0 6px 14px rgba(30, 20, 120, .25); }
.mx-btn:disabled { background: var(--disabled); color: var(--disabled-ink); box-shadow: none; cursor: default; }
.mx-btn:active:not(:disabled) { transform: scale(.98); }
.mx-row2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 8px; }
.mx-row2--tight { gap: 8px; }

.mx-bottom {
  position: fixed; z-index: 5; left: 0; right: 0; bottom: 0;
  display: flex; flex-direction: column; gap: 8px; text-align: center;
  padding: 36px max(16px, calc((100% - 528px) / 2)) calc(24px + env(safe-area-inset-bottom));
  background: linear-gradient(to bottom, transparent, var(--bg-flat) 32px);
}
.mx-bottom .mx-btn--primary:not(:disabled) { box-shadow: var(--grad-shadow); }

/* ---------- home ---------- */
.mx-home { display: flex; flex-direction: column; gap: 16px; padding-top: 4px; }
.mx-greeting { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mx-greeting > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mx-greeting h1 { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: -.3px; overflow-wrap: anywhere; }
.mx-avatar {
  width: 44px; height: 44px; flex: none; border-radius: 999px; background: linear-gradient(135deg, #2a7bff, #8a4dff);
  box-shadow: 0 6px 14px rgba(90, 80, 255, .35), inset 0 2px 2px rgba(255, 255, 255, .35);
  display: flex; align-items: center; justify-content: center; font-size: 17px; font-weight: 700; color: #fff;
}
.mx-hero {
  position: relative; height: 216px; border-radius: 24px; background: var(--grad-hero); overflow: hidden;
  box-shadow: 0 16px 32px rgba(90, 70, 255, .32), inset 0 1px 0 rgba(255, 255, 255, .35);
  padding: 18px; display: flex; align-items: flex-end;
}
html[data-theme="dark"] .mx-hero { box-shadow: 0 16px 32px rgba(70, 50, 220, .45), inset 0 1px 0 rgba(255, 255, 255, .25); }
/* As in the mock-up the art is 390 px wide and its right edge (Santa) runs 32 px past the card. */
.mx-hero-art { position: absolute; top: 0; right: -32px; }
.mx-hero__text { position: relative; display: flex; flex-direction: column; gap: 6px; max-width: 176px; color: #fff; }
.mx-hero__text b { font-size: 21px; font-weight: 700; line-height: 1.2; text-shadow: 0 2px 8px rgba(30, 20, 120, .35); }
.mx-hero__text span { font-size: 13px; color: rgba(255, 255, 255, .9); }
/* Narrower than the mock-up: the art keeps Santa in view and slides left, so the text gives way to the tree. */
@media (max-width: 389px) { .mx-hero__text { max-width: 124px; } }
.mx-group--balls .mx-cell { min-height: 60px; }
.mx-legal { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; font-size: 12px; padding: 4px 0; }
.mx-legal a { color: var(--muted); }

/* "Включи уведомления" */
.mx-banner { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.mx-banner__text { display: flex; flex-direction: column; gap: 2px; flex-grow: 1; min-width: 0; font-size: 13px; color: var(--muted); }
.mx-banner__text b { font-size: 15px; font-weight: 600; color: var(--ink); }
.mx-banner .mx-btn { align-self: center; }

/* ---------- notes ---------- */
.mx-note { padding: 14px 16px; font-size: 15px; line-height: 1.4; overflow-wrap: anywhere; }
.mx-note .mx-btn { display: flex; width: fit-content; margin-top: 10px; }
.mx-note .mx-sub { display: block; margin-top: 6px; }
.mx-gradient-note {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 20px; background: var(--grad);
  color: #fff; box-shadow: 0 12px 24px rgba(90, 70, 255, .3), inset 0 1px 0 rgba(255, 255, 255, .3);
  font-size: 14px; line-height: 1.35; overflow-wrap: anywhere;
}
.mx-bauble { flex: none; width: 14px; height: 14px; }
.mx-empty { padding: 22px 18px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.mx-empty b { font-size: 17px; }

/* ---------- wishlist items ---------- */
.mx-item { padding: 12px; display: flex; gap: 12px; }
.mx-item--mine { box-shadow: 0 0 0 2px #8a4dff, 0 8px 20px rgba(90, 70, 255, .18); }
.mx-item--taken { opacity: .62; box-shadow: 0 8px 20px rgba(40, 50, 120, .06); }
.mx-thumb {
  position: relative; width: 84px; height: 84px; border-radius: 14px; flex: none; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.mx-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: var(--card); }
.mx-thumb--red { background: linear-gradient(145deg, #ffe0e0, #ffc4c4); color: #d6232f; }
.mx-thumb--green { background: linear-gradient(145deg, #e3f6ea, #c4ecd3); color: #1c8a46; }
.mx-thumb--blue { background: linear-gradient(145deg, #e0ebff, #c4d8ff); color: #2a6bff; }
.mx-thumb--violet { background: linear-gradient(145deg, #ede4ff, #dccbff); color: #6a3be0; }
.mx-thumb--grey { background: #eceef3; color: #8a8f98; }
.mx-item__body { display: flex; flex-direction: column; gap: 6px; flex-grow: 1; min-width: 0; }
.mx-item__title { font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.mx-item__meta { font-size: 14px; }
.mx-item__meta a { color: inherit; text-decoration: none; }
.mx-item__actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.mx-item__actions .mx-pill { align-self: center; }

/* ---------- a game ---------- */
.mx-dates { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.mx-dates > div {
  background: var(--card); border-radius: 16px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px;
  box-shadow: var(--shadow-sm);
}
.mx-dates span { font-size: 12px; color: var(--muted); }
.mx-dates b { font-size: 16px; font-weight: 700; }
.mx-dates .mx-dates__hot { background: var(--red); color: #fff; box-shadow: 0 8px 16px rgba(214, 35, 47, .3), inset 0 1px 0 rgba(255, 255, 255, .35); }
.mx-dates .mx-dates__hot span { color: rgba(255, 255, 255, .85); }

.mx-santa-for {
  position: relative; border-radius: 24px; padding: 16px; display: flex; flex-direction: column; gap: 12px;
  overflow: hidden; background: var(--grad-hero); color: #fff;
  box-shadow: 0 16px 30px rgba(90, 70, 255, .32), inset 0 1px 0 rgba(255, 255, 255, .3);
}
.mx-garland { position: absolute; right: -8px; top: -10px; }
.mx-santa-for__who { display: flex; align-items: center; gap: 12px; position: relative; }
.mx-santa-for__who b { font-size: 24px; font-weight: 700; overflow-wrap: anywhere; }
.mx-santa-for__who > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.mx-santa-for__wish { font-size: 13px; color: rgba(255, 255, 255, .85); overflow-wrap: anywhere; }
.mx-face {
  width: 58px; height: 58px; border-radius: 999px; flex: none; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 35% 30%, #f1bd85, #c27a3e 60%, #8f5426);
  box-shadow: 0 6px 12px rgba(40, 20, 90, .35), inset 0 -3px 5px rgba(80, 40, 10, .35);
}
.mx-glass { display: flex; flex-direction: column; border-radius: 16px; background: rgba(255, 255, 255, .16); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25); }
.mx-glass__row {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; min-height: 48px; width: 100%;
  border: 0; background: none; color: #fff; text-align: left; font-size: 15px; font-weight: 500;
}
.mx-glass__row svg { flex: none; }
.mx-glass__row > span { overflow-wrap: anywhere; }
.mx-glass__line { height: 1px; background: rgba(255, 255, 255, .18); margin-left: 48px; }
.mx-santa-for .mx-btn--glass, .mx-santa-for .mx-btn--white { height: 46px; }

.mx-my-santa { padding: 14px 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.mx-my-santa .mx-cell__title { font-size: 15px; font-weight: 600; }
.mx-my-santa .mx-btn--green { align-self: center; }
.mx-my-santa__write { margin-left: 56px; }
.mx-code { color: var(--ink); letter-spacing: 1px; }

.mx-players { padding: 4px 16px; display: flex; flex-direction: column; }
.mx-player { display: flex; align-items: center; gap: 10px; min-height: 44px; flex-wrap: wrap; padding: 4px 0; }
.mx-player__name { flex-grow: 1; font-size: 15px; min-width: 0; overflow-wrap: anywhere; }
.mx-mark { font-size: 12px; font-weight: 600; color: var(--muted); }
.mx-mark--green { color: var(--green-ink); }
.mx-mark--red { color: var(--red-ink); }
.mx-kick { border: 0; background: var(--grey-soft); color: var(--red-ink); border-radius: 10px; padding: 6px 10px; font-size: 13px; font-weight: 600; }
.mx-footer { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }

/* ---------- joining, steps ---------- */
.mx-invite { margin-top: 4px; }
.mx-invite {
  position: relative; border-radius: 24px; padding: 18px; background: var(--grad-hero); color: #fff; overflow: hidden;
  box-shadow: 0 16px 30px rgba(90, 70, 255, .32), inset 0 1px 0 rgba(255, 255, 255, .3);
  display: flex; flex-direction: column; gap: 8px; min-height: 170px;
}
.mx-invite-art { position: absolute; right: -14px; bottom: -16px; }
.mx-invite h1 { position: relative; margin: 0; font-size: 26px; font-weight: 700; max-width: 220px; line-height: 1.15; overflow-wrap: anywhere; }
.mx-invite .mx-caps { position: relative; }
.mx-invite__sub { position: relative; font-size: 14px; color: rgba(255, 255, 255, .9); max-width: 210px; }
.mx-step { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.mx-step--off { opacity: .55; }
.mx-step__head { display: flex; align-items: center; gap: 12px; }
.mx-step__num {
  width: 44px; height: 44px; border-radius: 14px; flex: none; display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700; color: #fff; background: var(--grad);
  box-shadow: 0 6px 12px rgba(90, 70, 255, .3), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.mx-step--off .mx-step__num { background: #e9ebf1; color: var(--muted); box-shadow: none; }
html[data-theme="dark"] .mx-thumb--grey { background: rgba(255, 255, 255, .08); }
html[data-theme="dark"] .mx-thumb--red { background: rgba(255, 107, 107, .16); color: #ff8a8a; }
html[data-theme="dark"] .mx-thumb--green { background: rgba(87, 217, 138, .14); color: #57d98a; }
html[data-theme="dark"] .mx-thumb--blue { background: rgba(107, 155, 255, .16); color: #8ab0ff; }
html[data-theme="dark"] .mx-thumb--violet { background: rgba(169, 156, 255, .16); color: #a99cff; }
html[data-theme="dark"] .mx-step--off .mx-step__num { background: rgba(255, 255, 255, .08); }
.mx-step__title { font-size: 16px; font-weight: 600; }
.mx-step .mx-btn { height: 44px; }
.mx-group--inset { border-radius: 14px; background: var(--input); }

/* inputs inside cells */
.mx-input { cursor: text; }
.mx-input .mx-cell__title { flex: none; }
.mx-input input, .mx-input select {
  flex-grow: 1; min-width: 0; border: 0; outline: none; background: transparent; text-align: right;
  font-size: 15px; color: var(--muted); padding: 0; appearance: none; -webkit-appearance: none;
}
.mx-input select { direction: rtl; cursor: pointer; }
.mx-input select option { direction: ltr; color: var(--ink); background: var(--card); }
.mx-input input:focus { color: var(--ink); }
.mx-input input::placeholder { color: var(--faint); }
.mx-field { display: flex; flex-direction: column; gap: 4px; padding: 12px 16px; }
.mx-field span { font-size: 13px; color: var(--muted); }
.mx-field input { border: 0; padding: 0; font-size: 17px; background: transparent; outline: none; color: var(--ink); }
.mx-field input::placeholder { color: var(--faint); }

.mx-date { min-height: 52px; padding-top: 0; padding-bottom: 0; }
.mx-date__chip {
  position: relative; flex: none; font-size: 15px; font-weight: 600; color: var(--soft-ink); background: var(--soft);
  border-radius: 10px; padding: 6px 10px;
}
.mx-date__chip--hot { color: #fff; background: var(--red); }
.mx-date__chip input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }

.mx-toggle { display: flex; align-items: center; gap: 12px; padding: 0 16px; min-height: 56px; cursor: pointer; }
.mx-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.mx-switch {
  position: relative; flex: none; width: 52px; height: 32px; border-radius: 999px; background: var(--disabled);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .15); transition: background .2s;
}
.mx-switch::after {
  content: ''; position: absolute; left: 3px; top: 3px; width: 26px; height: 26px; border-radius: 999px; background: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .25); transition: transform .2s;
}
.mx-toggle input:checked + .mx-switch { background: var(--grad); }
.mx-toggle input:checked + .mx-switch::after { transform: translateX(20px); }
.mx-toggle input:focus-visible + .mx-switch { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- loader, toast, reactions ---------- */
.mx-loader { display: grid; place-items: center; padding-top: 30vh; }
.mx-spinner {
  width: 36px; height: 36px; border-radius: 999px; border: 3px solid var(--soft); border-top-color: #6a5cff;
  animation: mx-spin .8s linear infinite;
}
@keyframes mx-spin { to { transform: rotate(360deg); } }

.toast {
  position: fixed; z-index: 40; left: 50%; transform: translateX(-50%);
  bottom: calc(96px + env(safe-area-inset-bottom)); max-width: calc(100% - 32px);
  background: rgba(30, 32, 40, .94); color: #fff; font-size: 14px; font-weight: 500;
  padding: 10px 16px; border-radius: 14px; text-align: center; box-shadow: 0 8px 20px rgba(0, 0, 0, .2);
}
.mx-react {
  position: fixed; z-index: 45; left: 50%; transform: translateX(-50%); bottom: calc(96px + env(safe-area-inset-bottom));
  width: min(440px, calc(100% - 32px)); display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  background: var(--card); color: var(--ink); border-radius: 20px; box-shadow: 0 16px 40px rgba(40, 50, 120, .25); cursor: pointer;
  animation: mx-pop .25s ease-out;
}
.mx-react b { font-size: 16px; }
.mx-react p { margin: 2px 0 0; font-size: 14px; color: var(--muted); }
@keyframes mx-pop { from { transform: translateX(-50%) translateY(16px); opacity: 0; } }

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

/* ---------- bottom sheet (forms shared with Telegram: app.js, santa.js) ---------- */
.sheet-backdrop { position: fixed; inset: 0; z-index: 20; background: rgba(6, 7, 8, .45); animation: mx-fade .15s; }
.sheet {
  position: fixed; z-index: 21; left: 0; right: 0; bottom: 0; max-height: 90vh; overflow-y: auto;
  max-width: 560px; margin: 0 auto; background: var(--bg-flat); border-radius: 24px 24px 0 0;
  padding: 8px 16px calc(22px + env(safe-area-inset-bottom)); animation: mx-up .2s ease-out;
}
.sheet::before { content: ''; display: block; width: 36px; height: 5px; border-radius: 3px; background: var(--faint); margin: 0 auto 14px; }
@keyframes mx-up { from { transform: translateY(100%); } }
@keyframes mx-fade { from { opacity: 0; } }
.sheet h3 { margin: 0 0 14px; text-align: center; font-size: 19px; font-weight: 700; }
.shout { font: inherit; }
.sheet .stack { display: flex; flex-direction: column; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; background: var(--card); border-radius: 16px; padding: 10px 14px; }
.field > span { font-size: 13px; color: var(--muted); }
.field input, .field textarea, .field select {
  border: 0; outline: none; background: transparent; padding: 2px 0; font-size: 16px; color: var(--ink); width: 100%;
}
.field textarea { min-height: 64px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: var(--faint); }
.check { display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: 16px; padding: 12px 14px; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: #6a5cff; margin: 0; flex: none; }
.hint { font-size: 13px; color: var(--muted); }
.preview { display: flex; align-items: center; gap: 12px; }
.preview .thumb {
  flex: none; width: 72px; height: 72px; border-radius: 14px; overflow: hidden; background: var(--card);
  display: grid; place-items: center; font-size: 30px; box-shadow: var(--shadow-sm);
}
.preview .thumb img { width: 100%; height: 100%; object-fit: cover; }
.preview .thumb.loading { animation: mx-pulse 1s ease-in-out infinite; }
@keyframes mx-pulse { 50% { opacity: .5; } }
.share-link { font-size: 14px; word-break: break-all; padding: 12px 14px; border-radius: 14px; background: var(--card); color: var(--muted); }
.player { display: flex; align-items: center; gap: 8px; background: var(--card); border-radius: 14px; padding: 10px 14px; }
.player .name { flex-grow: 1; overflow-wrap: anywhere; }

/* the shared .btn inside sheets */
.btn {
  border: 0; border-radius: 14px; height: 48px; padding: 0 16px; font-size: 16px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--grad); color: #fff; box-shadow: 0 6px 12px rgba(90, 70, 255, .3);
}
.btn.block { width: 100%; }
.btn.sm { height: 36px; border-radius: 12px; font-size: 14px; padding: 0 12px; }
.btn.ghost { background: var(--soft); color: var(--soft-ink); box-shadow: none; }
.btn.brick { background: var(--grad); color: #fff; }
.btn.danger { background: none; color: var(--red-ink); box-shadow: none; }
.btn:disabled { background: var(--disabled); color: var(--disabled-ink); box-shadow: none; }

@media (prefers-reduced-motion: reduce) {
  .mx-spinner, .preview .thumb.loading, .mx-react, .sheet, .sheet-backdrop { animation: none; }
  .mx-switch, .mx-switch::after { transition: none; }
}
