/* П.3 task.txt: внешние шрифты Google убраны (были здесь CSS-импортом и вторым
   <link> в index.html — два блокирующих запроса на чужой хост, на части сетей
   они не отвечают, и приложение висело на белом экране). Теперь системный
   стек: выглядит нативно и не требует ни одного внешнего запроса. */
*, ::before, ::after {
  --tw-border-spacing-x: 0;
  --tw-border-spacing-y: 0;
  --tw-translate-x: 0;
  --tw-translate-y: 0;
  --tw-rotate: 0;
  --tw-skew-x: 0;
  --tw-skew-y: 0;
  --tw-scale-x: 1;
  --tw-scale-y: 1;
  --tw-pan-x:  ;
  --tw-pan-y:  ;
  --tw-pinch-zoom:  ;
  --tw-scroll-snap-strictness: proximity;
  --tw-gradient-from-position:  ;
  --tw-gradient-via-position:  ;
  --tw-gradient-to-position:  ;
  --tw-ordinal:  ;
  --tw-slashed-zero:  ;
  --tw-numeric-figure:  ;
  --tw-numeric-spacing:  ;
  --tw-numeric-fraction:  ;
  --tw-ring-inset:  ;
  --tw-ring-offset-width: 0px;
  --tw-ring-offset-color: #fff;
  --tw-ring-color: rgb(59 130 246 / 0.5);
  --tw-ring-offset-shadow: 0 0 #0000;
  --tw-ring-shadow: 0 0 #0000;
  --tw-shadow: 0 0 #0000;
  --tw-shadow-colored: 0 0 #0000;
  --tw-blur:  ;
  --tw-brightness:  ;
  --tw-contrast:  ;
  --tw-grayscale:  ;
  --tw-hue-rotate:  ;
  --tw-invert:  ;
  --tw-saturate:  ;
  --tw-sepia:  ;
  --tw-drop-shadow:  ;
  --tw-backdrop-blur:  ;
  --tw-backdrop-brightness:  ;
  --tw-backdrop-contrast:  ;
  --tw-backdrop-grayscale:  ;
  --tw-backdrop-hue-rotate:  ;
  --tw-backdrop-invert:  ;
  --tw-backdrop-opacity:  ;
  --tw-backdrop-saturate:  ;
  --tw-backdrop-sepia:  ;
  --tw-contain-size:  ;
  --tw-contain-layout:  ;
  --tw-contain-paint:  ;
  --tw-contain-style:  ;
}
::backdrop {
  --tw-border-spacing-x: 0;
  --tw-border-spacing-y: 0;
  --tw-translate-x: 0;
  --tw-translate-y: 0;
  --tw-rotate: 0;
  --tw-skew-x: 0;
  --tw-skew-y: 0;
  --tw-scale-x: 1;
  --tw-scale-y: 1;
  --tw-pan-x:  ;
  --tw-pan-y:  ;
  --tw-pinch-zoom:  ;
  --tw-scroll-snap-strictness: proximity;
  --tw-gradient-from-position:  ;
  --tw-gradient-via-position:  ;
  --tw-gradient-to-position:  ;
  --tw-ordinal:  ;
  --tw-slashed-zero:  ;
  --tw-numeric-figure:  ;
  --tw-numeric-spacing:  ;
  --tw-numeric-fraction:  ;
  --tw-ring-inset:  ;
  --tw-ring-offset-width: 0px;
  --tw-ring-offset-color: #fff;
  --tw-ring-color: rgb(59 130 246 / 0.5);
  --tw-ring-offset-shadow: 0 0 #0000;
  --tw-ring-shadow: 0 0 #0000;
  --tw-shadow: 0 0 #0000;
  --tw-shadow-colored: 0 0 #0000;
  --tw-blur:  ;
  --tw-brightness:  ;
  --tw-contrast:  ;
  --tw-grayscale:  ;
  --tw-hue-rotate:  ;
  --tw-invert:  ;
  --tw-saturate:  ;
  --tw-sepia:  ;
  --tw-drop-shadow:  ;
  --tw-backdrop-blur:  ;
  --tw-backdrop-brightness:  ;
  --tw-backdrop-contrast:  ;
  --tw-backdrop-grayscale:  ;
  --tw-backdrop-hue-rotate:  ;
  --tw-backdrop-invert:  ;
  --tw-backdrop-opacity:  ;
  --tw-backdrop-saturate:  ;
  --tw-backdrop-sepia:  ;
  --tw-contain-size:  ;
  --tw-contain-layout:  ;
  --tw-contain-paint:  ;
  --tw-contain-style:  ;
}
/* ! tailwindcss v3.4.19 | MIT License | https://tailwindcss.com *//*
1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4)
2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116)
*/

*,
::before,
::after {
  box-sizing: border-box; /* 1 */
  border-width: 0; /* 2 */
  border-style: solid; /* 2 */
  border-color: #e5e7eb; /* 2 */
}

::before,
::after {
  --tw-content: '';
}

/*
1. Use a consistent sensible line-height in all browsers.
2. Prevent adjustments of font size after orientation changes in iOS.
3. Use a more readable tab size.
4. Use the user's configured `sans` font-family by default.
5. Use the user's configured `sans` font-feature-settings by default.
6. Use the user's configured `sans` font-variation-settings by default.
7. Disable tap highlights on iOS
*/

html,
:host {
  line-height: 1.5; /* 1 */
  -webkit-text-size-adjust: 100%; /* 2 */
  -moz-tab-size: 4; /* 3 */
  -o-tab-size: 4;
     tab-size: 4; /* 3 */
  font-family: Inter, SF Pro Display, system-ui, sans-serif; /* 4 */
  font-feature-settings: normal; /* 5 */
  font-variation-settings: normal; /* 6 */
  -webkit-tap-highlight-color: transparent; /* 7 */
}

/*
1. Remove the margin in all browsers.
2. Inherit line-height from `html` so users can set them as a class directly on the `html` element.
*/

body {
  margin: 0; /* 1 */
  line-height: inherit; /* 2 */
}

/*
1. Add the correct height in Firefox.
2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655)
3. Ensure horizontal rules are visible by default.
*/

hr {
  height: 0; /* 1 */
  color: inherit; /* 2 */
  border-top-width: 1px; /* 3 */
}

/*
Add the correct text decoration in Chrome, Edge, and Safari.
*/

abbr:where([title]) {
  -webkit-text-decoration: underline dotted;
          text-decoration: underline dotted;
}

/*
Remove the default font size and weight for headings.
*/

h1,
h2,
h3,
h4,
h5,
h6 {
  font-size: inherit;
  font-weight: inherit;
}

/*
Reset links to optimize for opt-in styling instead of opt-out.
*/

a {
  color: inherit;
  text-decoration: inherit;
}

/*
Add the correct font weight in Edge and Safari.
*/

b,
strong {
  font-weight: bolder;
}

/*
1. Use the user's configured `mono` font-family by default.
2. Use the user's configured `mono` font-feature-settings by default.
3. Use the user's configured `mono` font-variation-settings by default.
4. Correct the odd `em` font sizing in all browsers.
*/

code,
kbd,
samp,
pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; /* 1 */
  font-feature-settings: normal; /* 2 */
  font-variation-settings: normal; /* 3 */
  font-size: 1em; /* 4 */
}

/*
Add the correct font size in all browsers.
*/

small {
  font-size: 80%;
}

/*
Prevent `sub` and `sup` elements from affecting the line height in all browsers.
*/

sub,
sup {
  font-size: 75%;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}

sub {
  bottom: -0.25em;
}

sup {
  top: -0.5em;
}

/*
1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297)
2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016)
3. Remove gaps between table borders by default.
*/

table {
  text-indent: 0; /* 1 */
  border-color: inherit; /* 2 */
  border-collapse: collapse; /* 3 */
}

/*
1. Change the font styles in all browsers.
2. Remove the margin in Firefox and Safari.
3. Remove default padding in all browsers.
*/

button,
input,
optgroup,
select,
textarea {
  font-family: inherit; /* 1 */
  font-feature-settings: inherit; /* 1 */
  font-variation-settings: inherit; /* 1 */
  font-size: 100%; /* 1 */
  font-weight: inherit; /* 1 */
  line-height: inherit; /* 1 */
  letter-spacing: inherit; /* 1 */
  color: inherit; /* 1 */
  margin: 0; /* 2 */
  padding: 0; /* 3 */
}

/*
Remove the inheritance of text transform in Edge and Firefox.
*/

button,
select {
  text-transform: none;
}

/*
1. Correct the inability to style clickable types in iOS and Safari.
2. Remove default button styles.
*/

button,
input:where([type='button']),
input:where([type='reset']),
input:where([type='submit']) {
  -webkit-appearance: button; /* 1 */
  background-color: transparent; /* 2 */
  background-image: none; /* 2 */
}

/*
Use the modern Firefox focus style for all focusable elements.
*/

:-moz-focusring {
  outline: auto;
}

/*
Remove the additional `:invalid` styles in Firefox. (https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737)
*/

:-moz-ui-invalid {
  box-shadow: none;
}

/*
Add the correct vertical alignment in Chrome and Firefox.
*/

progress {
  vertical-align: baseline;
}

/*
Correct the cursor style of increment and decrement buttons in Safari.
*/

::-webkit-inner-spin-button,
::-webkit-outer-spin-button {
  height: auto;
}

/*
1. Correct the odd appearance in Chrome and Safari.
2. Correct the outline style in Safari.
*/

[type='search'] {
  -webkit-appearance: textfield; /* 1 */
  outline-offset: -2px; /* 2 */
}

/*
Remove the inner padding in Chrome and Safari on macOS.
*/

::-webkit-search-decoration {
  -webkit-appearance: none;
}

/*
1. Correct the inability to style clickable types in iOS and Safari.
2. Change font properties to `inherit` in Safari.
*/

::-webkit-file-upload-button {
  -webkit-appearance: button; /* 1 */
  font: inherit; /* 2 */
}

/*
Add the correct display in Chrome and Safari.
*/

summary {
  display: list-item;
}

/*
Removes the default spacing and border for appropriate elements.
*/

blockquote,
dl,
dd,
h1,
h2,
h3,
h4,
h5,
h6,
hr,
figure,
p,
pre {
  margin: 0;
}

fieldset {
  margin: 0;
  padding: 0;
}

legend {
  padding: 0;
}

ol,
ul,
menu {
  list-style: none;
  margin: 0;
  padding: 0;
}

/*
Reset default styling for dialogs.
*/
dialog {
  padding: 0;
}

/*
Prevent resizing textareas horizontally by default.
*/

textarea {
  resize: vertical;
}

/*
1. Reset the default placeholder opacity in Firefox. (https://github.com/tailwindlabs/tailwindcss/issues/3300)
2. Set the default placeholder color to the user's configured gray 400 color.
*/

input::-moz-placeholder, textarea::-moz-placeholder {
  opacity: 1; /* 1 */
  color: #9ca3af; /* 2 */
}

input::placeholder,
textarea::placeholder {
  opacity: 1; /* 1 */
  color: #9ca3af; /* 2 */
}

/*
Set the default cursor for buttons.
*/

button,
[role="button"] {
  cursor: pointer;
}

/*
Make sure disabled buttons don't get the pointer cursor.
*/
:disabled {
  cursor: default;
}

/*
1. Make replaced elements `display: block` by default. (https://github.com/mozdevs/cssremedy/issues/14)
2. Add `vertical-align: middle` to align replaced elements more sensibly by default. (https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210)
   This can trigger a poorly considered lint error in some tools but is included by design.
*/

img,
svg,
video,
canvas,
audio,
iframe,
embed,
object {
  display: block; /* 1 */
  vertical-align: middle; /* 2 */
}

/*
Constrain images and videos to the parent width and preserve their intrinsic aspect ratio. (https://github.com/mozdevs/cssremedy/issues/14)
*/

img,
video {
  max-width: 100%;
  height: auto;
}

/* Make elements with the HTML hidden attribute stay hidden by default */
[hidden]:where(:not([hidden="until-found"])) {
  display: none;
}
.\!visible {
  visibility: visible !important;
}
.visible {
  visibility: visible;
}
.collapse {
  visibility: collapse;
}
.static {
  position: static;
}
.fixed {
  position: fixed;
}
.absolute {
  position: absolute;
}
.relative {
  position: relative;
}
.sticky {
  position: sticky;
}
.mb-2 {
  margin-bottom: 0.5rem;
}
.mb-3 {
  margin-bottom: 0.75rem;
}
.mb-4 {
  margin-bottom: 1rem;
}
.mb-5 {
  margin-bottom: 1.25rem;
}
.mt-1 {
  margin-top: 0.25rem;
}
.block {
  display: block;
}
.inline-block {
  display: inline-block;
}
.flex {
  display: flex;
}
.inline-flex {
  display: inline-flex;
}
.table {
  display: table;
}
.grid {
  display: grid;
}
.hidden {
  display: none;
}
.h-8 {
  height: 2rem;
}
.w-8 {
  width: 2rem;
}
.min-w-0 {
  min-width: 0px;
}
.flex-1 {
  flex: 1 1 0%;
}
.transform {
  transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.animate-spin {
  animation: spin 1s linear infinite;
}
.resize {
  resize: both;
}
.grid-cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.flex-col {
  flex-direction: column;
}
.items-center {
  align-items: center;
}
.justify-center {
  justify-content: center;
}
.justify-between {
  justify-content: space-between;
}
.gap-0\.5 {
  gap: 0.125rem;
}
.gap-1 {
  gap: 0.25rem;
}
.gap-2 {
  gap: 0.5rem;
}
.gap-2\.5 {
  gap: 0.625rem;
}
.gap-3 {
  gap: 0.75rem;
}
.gap-4 {
  gap: 1rem;
}
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.break-all {
  word-break: break-all;
}
.rounded-2xl {
  border-radius: 1rem;
}
.rounded-full {
  border-radius: 9999px;
}
.rounded-lg {
  border-radius: 0.5rem;
}
.rounded-xl {
  border-radius: 0.75rem;
}
.border {
  border-width: 1px;
}
.p-1 {
  padding: 0.25rem;
}
.p-3 {
  padding: 0.75rem;
}
.p-4 {
  padding: 1rem;
}
.text-\[11px\] {
  font-size: 11px;
}
.text-\[12px\] {
  font-size: 12px;
}
.text-\[13px\] {
  font-size: 13px;
}
.text-\[15px\] {
  font-size: 15px;
}
.text-\[17px\] {
  font-size: 17px;
}
.font-semibold {
  font-weight: 600;
}
.uppercase {
  text-transform: uppercase;
}
.italic {
  font-style: italic;
}
.tabular-nums {
  --tw-numeric-spacing: tabular-nums;
  font-variant-numeric: var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction);
}
.text-white {
  --tw-text-opacity: 1;
  color: rgb(255 255 255 / var(--tw-text-opacity, 1));
}
.line-through {
  text-decoration-line: line-through;
}
.opacity-25 {
  opacity: 0.25;
}
.opacity-75 {
  opacity: 0.75;
}
.outline {
  outline-style: solid;
}
.blur {
  --tw-blur: blur(8px);
  filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
}
.grayscale {
  --tw-grayscale: grayscale(100%);
  filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
}
.filter {
  filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
}
.backdrop-filter {
  backdrop-filter: var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);
}
.transition {
  transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}
.transition-all {
  transition-property: all;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}
.ease-in-out {
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  margin: 0;
  padding: 0;
  scrollbar-width: none;       /* Firefox */
  -ms-overflow-style: none;    /* IE / Edge */
}

html, body {
  height: var(--tg-app-height, 100dvh);
  width: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  overscroll-behavior-y: none;
}

/* #root жёстко ограничен высотой — flex scroll работает корректно и на десктопе */
#root {
  height: var(--tg-app-height, 100dvh);
  width: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: #050505;
  color: #FFFFFF;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior: none;
}

/* ── Design tokens — SCALPEX Glass ────────────────────────────────────────
   Фирменный зелёный — emerald (#10B981 → #059669), как в кнопке подписки.
   Один акцент на весь интерфейс: внимание не разбегается по цветам.      */
:root {
  --bg: #050505;
  --bg-shell: #0A0A0A;
  --surface: #141414;
  --surface-2: #1A1A1A;

  --accent: #10B981;              /* фирменный emerald */
  --accent-strong: #059669;
  --accent-soft: #34D399;         /* светлый emerald — иконки на тёмном */
  --accent-dim: rgba(16, 185, 129, 0.12);
  --accent-border: rgba(16, 185, 129, 0.30);
  --accent-glow: 0 0 12px rgba(16, 185, 129, 0.30);

  --positive: #34D399;
  --negative: #FF3B30;
  --text-dim: #8E8E93;
  --text-faint: #636366;

  /* Затемнение фона в туре подсказок. Интерфейс под подсказкой должен
     оставаться видимым, поэтому «чуть-чуть тускло», а не почти чёрное. */
  --hint-dim: rgba(0, 0, 0, 0.30);

  --font-display: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-body: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Дисплейный шрифт — логотип, заголовки */
.font-display {
  font-family: var(--font-display);
  letter-spacing: 0.02em;
}

/* Акцентные элементы */
.profit-accent {
  color: var(--accent);
  text-shadow: 0 0 8px rgba(16, 185, 129, 0.3);
}

.profit-bg {
  background: linear-gradient(135deg, var(--accent-dim) 0%, rgba(34, 197, 94, 0.05) 100%);
  border: 1px solid var(--accent-border);
}

.profit-button {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  box-shadow: var(--accent-glow);
  transition: all 0.2s ease;
}

.profit-button:hover {
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.5);
  transform: translateY(-1px);
}

/* Hide scrollbars everywhere (keep scroll functional) */
::-webkit-scrollbar {
  display: none;
}

/* Hide native number-input spin buttons */
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type=number] {
  -moz-appearance: textfield;
}

/* Safe area */
.safe-top { padding-top: env(safe-area-inset-top); }
.safe-bottom { padding-bottom: env(safe-area-inset-bottom); }

/* Smooth transitions + mobile touch optimizations */
button {
  transition: transform 0.1s ease, opacity 0.15s ease;
  touch-action: manipulation; /* removes 300ms tap delay, prevents double-tap zoom */
  -webkit-tap-highlight-color: transparent;
  -moz-user-select: none;
       user-select: none;
  -webkit-user-select: none;
}
button:active { transform: scale(0.96); }

/* No text selection on tappable elements */
a, label, [role="switch"] {
  touch-action: manipulation;
  -moz-user-select: none;
       user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

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

/* Skeleton shimmer */
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton-shimmer {
  background: linear-gradient(90deg, #1A1A1A 25%, #272727 50%, #1A1A1A 75%);
  background-size: 200% 100%;
  animation: shimmer 1.6s ease-in-out infinite;
}

/* ── Анимации: модалки (выезжают снизу) и переключение разделов ──────────── */
@keyframes slideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.sheet-card     { animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1); }
.sheet-backdrop { animation: fadeIn 0.25s ease; }
.tab-fade-in    { animation: fadeSlide 0.22s ease; }

/* ── Закрытие модалки: выезжает вниз, как и появлялась снизу ───────────── */
@keyframes slideDown {
  from { transform: translateY(0); }
  to   { transform: translateY(100%); }
}
@keyframes fadeOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}
.sheet-out          { animation: slideDown 0.28s cubic-bezier(0.4, 0, 1, 1) forwards; }
.sheet-backdrop-out { animation: fadeOut 0.25s ease forwards; }

/* ── Онбординг-подсказки: пульс подсветки и появление пузыря ─────────────── */
/* Пульс зелёного кольца вокруг целевого элемента. Вело «0 0 0 9999px» — это
   затемнение всего экрана вокруг цели (spotlight). */
/* Затемнение экрана живёт ТОЛЬКО здесь (var(--hint-dim), ~30%). Раньше поверх
   этого слоя лежало второе затемнение 0.72 из HintsTour.jsx — вместе они давали
   ~92% черноты, и юзер не видел интерфейс, про который говорит подсказка.
   Кольцо указано ПЕРВЫМ: слои box-shadow рисуются в обратном порядке, так что
   первый оказывается сверху и зелёный контур не глушится затемнением.
   Базовый box-shadow продублирован на самом классе: при prefers-reduced-motion
   анимация отключается, и без него подсветка пропадала вместе с затемнением. */
@keyframes hint-pulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(52,211,153,0.65), 0 0 0 9999px var(--hint-dim); }
  50%      { box-shadow: 0 0 0 5px rgba(52,211,153,1),    0 0 0 9999px var(--hint-dim); }
}
.hint-spot {
  box-shadow: 0 0 0 2px rgba(52,211,153,0.65), 0 0 0 9999px var(--hint-dim);
  animation: hint-pulse 1.8s ease-in-out infinite;
}

/* Только opacity: transform НЕ анимируем. Пузырь центрируется инлайновым
   translateX(-50%) (а финальная карточка — translate(-50%,-50%)), а свойство
   из @keyframes перебивает инлайновый стиль: на время анимации центрирование
   пропадало и пузырь на 0.25 с уезжал вправо от экрана. */
@keyframes hint-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.hint-bubble { animation: hint-fade 0.25s ease; }

/* Пульсация кнопки «Добавить бота» (task.txt 2026-08-31, П.3): после того как
   подсказка объяснила про пробного бота, зелёная кнопка пульсирует кольцом,
   чтобы юзер видел, куда нажимать. Базовый box-shadow продублирован — при
   prefers-reduced-motion анимация отключается, но подсветка остаётся (как
   у .hint-spot выше). */
@keyframes add-bot-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(16,185,129,0.55); }
  70%  { box-shadow: 0 0 0 14px rgba(16,185,129,0); }
  100% { box-shadow: 0 0 0 0 rgba(16,185,129,0); }
}
.add-bot-pulse {
  box-shadow: 0 0 0 0 rgba(16,185,129,0);
  animation: add-bot-pulse 1.6s ease-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .sheet-card, .sheet-backdrop, .sheet-out, .sheet-backdrop-out, .tab-fade-in, .hint-spot, .hint-bubble, .add-bot-pulse { animation: none; }
}

/* ── Колесо фортуны ───────────────────────────────────────────────────────── */
/* Окно-приглашение при входе: маленькая карточка по центру поверх приложения,
   как в утверждённом прототипе. */
.fortune-gate {
  position: fixed; inset: 0; z-index: 10001;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.78);
  animation: fadeIn 0.24s ease;
}
.fortune-gate-card {
  position: relative;
  width: 100%; max-width: 300px;
  padding: 22px 20px 18px;
  border-radius: 22px;
  background: linear-gradient(180deg, #1A1A1A 0%, #141414 100%);
  border: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.72), inset 0 2px 0 rgba(255, 255, 255, 0.04);
  text-align: center;
  animation: fortune-pop 0.34s cubic-bezier(0.16, 1, 0.3, 1);
}
.fortune-gate-close {
  position: absolute; top: 10px; right: 10px;
  width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.08); border: none; cursor: pointer;
  color: var(--text-dim);
  -webkit-tap-highlight-color: transparent;
}
.fortune-gate-close:hover { background: rgba(255, 255, 255, 0.14); color: #fff; }
.fortune-gate-icon {
  width: 48px; height: 48px; border-radius: 15px;
  margin: 0 auto 14px;
  display: flex; align-items: center; justify-content: center;
  color: var(--accent-soft);
  background: rgba(16, 185, 129, 0.13);
  border: 1px solid rgba(52, 211, 153, 0.28);
}
.fortune-gate-title {
  font-size: 17px; font-weight: 700; letter-spacing: -0.01em;
  color: #fff; margin-bottom: 8px;
}
.fortune-gate-text {
  font-size: 12.5px; line-height: 1.5; color: var(--text-dim);
  margin-bottom: 16px;
}
.fortune-gate-hint {
  font-size: 10.5px; line-height: 1.45; color: var(--text-faint);
  margin-top: 12px;
}

/* Кнопка приглашения — та же, что в прототипе: 46 px, градиент, тень. */
.fortune-btn {
  width: 100%; height: 46px; padding: 0; border-radius: 14px;
  font-size: 14.5px; font-weight: 700; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.15s ease, transform 0.12s ease, filter 0.2s ease;
}
.fortune-btn:active { transform: scale(0.985); }
.fortune-btn:disabled { opacity: 0.55; cursor: default; }
.fortune-btn-primary {
  background: linear-gradient(135deg, #34D399 0%, #10B981 100%);
  color: #fff;
  box-shadow: 0 8px 22px rgba(16, 185, 129, 0.24);
}

/* Окно колеса: по центру экрана, а не нижним листом. */
.fortune-overlay {
  position: fixed; inset: 0; z-index: 10000;
  display: grid; place-items: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.80);
  animation: fadeIn 0.24s ease;
}
.fortune-window {
  position: relative;
  width: min(330px, 100%);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  text-align: center;
  color: var(--text);
  background: linear-gradient(180deg, #1B1B1B 0%, #131313 100%);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 22px;
  padding: 18px 18px 20px;
  box-shadow: 0 26px 68px rgba(0, 0, 0, 0.76), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  animation: fortune-pop 0.34s cubic-bezier(0.16, 1, 0.3, 1);
  -webkit-overflow-scrolling: touch;
}
.fortune-window-x {
  position: absolute; top: 10px; right: 10px;
  width: 26px; height: 26px; border-radius: 50%; padding: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.08); border: none;
  color: var(--text-dim); cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.fortune-window-x:hover { background: rgba(255, 255, 255, 0.14); color: #fff; }
.fortune-window-x:disabled { opacity: 0.4; cursor: default; }
.fortune-window-title {
  font-size: 17px; font-weight: 700; letter-spacing: -0.01em;
  color: #fff; margin: 0 0 4px;
}
.fortune-window-tier {
  font-size: 10px; font-weight: 600; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--accent-soft);
  margin: 0 0 14px;
}

/* Три колеса: подпись + цена в звёздах, выбранное подсвечено изумрудом. */
.fortune-pick-label {
  font-size: 10px; font-weight: 600; letter-spacing: 0.09em;
  text-transform: uppercase; color: var(--text-faint);
  margin: 0 0 6px;
}
.fortune-picker { display: flex; gap: 5px; margin: 0 0 13px; }
.fortune-pick {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 1px;
  padding: 6px 4px; border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.fortune-pick b {
  font-size: 9.5px; font-weight: 600; color: var(--text-dim);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fortune-pick span {
  font-size: 9px; color: var(--text-faint); font-variant-numeric: tabular-nums;
}
.fortune-pick.is-on {
  background: rgba(16, 185, 129, 0.13);
  border-color: rgba(52, 211, 153, 0.34);
}
.fortune-pick.is-on b { color: var(--accent-soft); }
.fortune-pick.is-on span { color: #8FC7B2; }
.fortune-pick:disabled { cursor: default; opacity: 0.7; }

/* Плашка «ничего не спишет» — тёплый янтарный акцент, как в прототипе. */
.fortune-starnote {
  display: flex; gap: 8px; align-items: flex-start; text-align: left;
  background: rgba(255, 176, 32, 0.06);
  border: 1px solid rgba(255, 176, 32, 0.18);
  border-radius: 11px; padding: 8px 10px; margin: 0 0 14px;
}
.fortune-starnote svg { flex: none; margin-top: 1px; color: #FFB020; }
.fortune-starnote span { font-size: 10px; line-height: 1.45; color: #B9A67C; }
.fortune-starnote b { color: #FFB020; font-weight: 600; }

/* Само колесо: обод, вращающийся canvas, неподвижная ступица и указатель. */
.fortune-wheel-wrap {
  position: relative;
  width: 210px; height: 210px;
  margin: 0 auto 14px;
}
.fortune-wheel-rim {
  position: absolute; inset: -8px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 0 42px rgba(16, 185, 129, 0.10);
}
.fortune-wheel-rotor {
  width: 100%; height: 100%;
  will-change: transform;
}
.fortune-wheel-rotor.is-moving { filter: blur(0.6px); }
.fortune-wheel-canvas {
  width: 100%; height: 100%; display: block;
  border-radius: 50%;
}
.fortune-wheel-hub {
  position: absolute; top: 50%; left: 50%;
  width: 42px; height: 42px; margin: -21px 0 0 -21px;
  border-radius: 50%;
  background: linear-gradient(180deg, #202020, #0B0B0B);
  border: 1px solid rgba(52, 211, 153, 0.28);
  display: flex; align-items: center; justify-content: center;
  font-size: 8.5px; font-weight: 700; letter-spacing: 0.14em;
  color: var(--accent-soft);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.7);
}
.fortune-wheel-pointer {
  position: absolute; top: -13px; left: 50%; margin-left: -7.5px;
  width: 15px; height: 16.6px;
  filter: drop-shadow(0 3px 7px rgba(0, 0, 0, 0.75));
}

.fortune-price {
  font-size: 11px; color: var(--text-faint);
  margin: 0 0 3px; line-height: 1.45;
}
.fortune-price b { color: #A8A8A8; font-weight: 600; }
.fortune-hist-link {
  display: block; margin: 0 auto 12px; padding: 4px 3px;
  border: none; background: none; cursor: pointer;
  font-family: inherit; font-size: 10px; font-weight: 600;
  color: var(--text-dim);
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.22);
  text-underline-offset: 3px;
}
.fortune-hist-link:hover { color: #C9C9C9; }

/* Результат: строка с галочкой, как в прототипе. */
.fortune-result {
  display: flex; align-items: center; gap: 10px; text-align: left;
  background: rgba(16, 185, 129, 0.09);
  border: 1px solid rgba(52, 211, 153, 0.24);
  border-radius: 12px; padding: 11px 12px; margin-bottom: 13px;
  animation: fortune-pop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.fortune-result-ico {
  width: 30px; height: 30px; border-radius: 9px; flex: none;
  background: rgba(16, 185, 129, 0.16); color: var(--accent-soft);
  display: flex; align-items: center; justify-content: center;
}
.fortune-result-label {
  font-size: 10px; letter-spacing: 0.08em; color: var(--text-dim);
}
.fortune-result-value {
  font-size: 14px; font-weight: 700; color: var(--accent-soft); margin-top: 1px;
}
.fortune-result-sub {
  font-size: 10px; line-height: 1.4; color: var(--text-dim); margin-top: 2px;
}

.fortune-main {
  width: 100%; height: 46px; border: none; border-radius: 14px;
  cursor: pointer; font-family: inherit;
  font-size: 14.5px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, #34D399 0%, #10B981 100%);
  display: flex; align-items: center; justify-content: center; gap: 7px;
  box-shadow: 0 8px 22px rgba(16, 185, 129, 0.22);
  transition: transform 0.12s ease, filter 0.2s ease, opacity 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.fortune-main:hover { filter: brightness(1.06); }
.fortune-main:active { transform: scale(0.985); }
.fortune-main:disabled {
  background: rgba(255, 255, 255, 0.07); color: var(--text-faint);
  box-shadow: none; cursor: default; filter: none;
}

.fortune-note {
  margin-top: 9px; font-size: 10.5px; line-height: 1.45; color: #FFB020;
}
.fortune-legend {
  font-size: 10px; line-height: 1.5; color: var(--text-faint);
  margin: 11px 0 0;
}
.fortune-loading, .fortune-error {
  padding: 34px 6px; text-align: center; font-size: 12.5px;
}
.fortune-loading { color: var(--text-dim); }
.fortune-error { color: var(--negative); }

/* История выигрышей — отдельный экран внутри окна колеса. */
.fortune-hist {
  display: flex; flex-direction: column; gap: 7px;
  margin-top: 12px; padding: 14px; text-align: left;
  border-radius: 18px;
  background: linear-gradient(180deg, #1B1B1B 0%, #131313 100%);
  border: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5);
}
.fortune-hist-row {
  display: grid; grid-template-columns: 1fr auto; gap: 3px 10px;
  align-items: center; padding: 8px 10px; border-radius: 10px;
  background: rgba(255, 255, 255, 0.028);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.fortune-hist-prize {
  font-size: 12.5px; font-weight: 600; letter-spacing: -0.01em; color: #C9C9C9;
}
.fortune-hist-prize.is-money { color: #9FD9C4; }
.fortune-hist-date {
  grid-column: 1; font-size: 10px; color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}
.fortune-hist-status {
  grid-column: 2; grid-row: 1 / span 2; white-space: nowrap;
  font-size: 9.5px; font-weight: 600; padding: 2px 7px; border-radius: 6px;
}
.fortune-hist-status.is-ok {
  color: #34D399; background: rgba(16, 185, 129, 0.10);
  border: 1px solid rgba(16, 185, 129, 0.24);
}
.fortune-hist-status.is-wait {
  color: #FFB020; background: rgba(255, 176, 32, 0.08);
  border: 1px solid rgba(255, 176, 32, 0.22);
}
.fortune-hist-empty { padding: 24px 12px; text-align: center; color: var(--text-faint); }
.fortune-hist-empty b {
  display: block; font-size: 12px; color: var(--text-dim); margin-bottom: 4px;
}
.fortune-hist-empty span { display: block; font-size: 11px; line-height: 1.5; }

/* Плавающая кнопка колеса: висит у края, перетаскивается вдоль краёв.
   z-index выше нижней навигации (50), но ниже модалок (10000+) — когда
   открыто колесо или другое окно, кнопка не перекрывает его. */
.fortune-fab {
  position: fixed;
  z-index: 9000;
  width: 54px; height: 54px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(233, 185, 73, 0.42);
  background:
    radial-gradient(circle at 32% 26%, rgba(201, 138, 22, 0.30) 0%, rgba(201, 138, 22, 0) 58%),
    linear-gradient(160deg, #1A2A24 0%, #0C1713 100%);
  color: #E9B949;
  display: flex; align-items: center; justify-content: center;
  box-shadow:
    0 10px 26px rgba(0, 0, 0, 0.55),
    0 0 0 4px rgba(16, 185, 129, 0.07);
  cursor: grab;
  touch-action: none;
  -moz-user-select: none;
       user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: left 0.22s ease, top 0.22s ease, transform 0.15s ease, box-shadow 0.2s ease;
}
.fortune-fab:active { cursor: grabbing; transform: scale(0.96); }
.fortune-fab.is-dragging {
  transition: none;
  transform: scale(1.06);
  box-shadow:
    0 14px 32px rgba(0, 0, 0, 0.65),
    0 0 0 5px rgba(233, 185, 73, 0.12);
}
.fortune-fab:focus-visible {
  outline: 2px solid var(--accent-soft);
  outline-offset: 3px;
}

@keyframes fortune-pop {
  from { opacity: 0; transform: translateY(8px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .fortune-gate, .fortune-gate-card, .fortune-window, .fortune-result { animation: none; }
  .fortune-wheel-rotor { transition: none !important; }
  .fortune-wheel-rotor.is-moving { filter: none; }
  .fortune-fab { transition: none; }
}

.active\:scale-95:active {
  --tw-scale-x: .95;
  --tw-scale-y: .95;
  transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
}
