:root,
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #080b10;
  --app-bg:
    radial-gradient(ellipse 110% 70% at 50% 110%, rgba(255, 120, 30, 0.1) 0%, transparent 58%),
    radial-gradient(ellipse 55% 35% at 0% 0%, rgba(255, 159, 28, 0.05) 0%, transparent 55%),
    linear-gradient(175deg, #06080d 0%, #0a0e16 50%, #080c12 100%);
  --surface: #12161f;
  --surface-2: #1a2030;
  --border: #2a3344;
  --text: #f0f2f5;
  --text-muted: #8b93a7;
  --accent: #ff9f1c;
  --accent-2: #ff6b35;
  --green: #2ecc71;
  --red: #e74c3c;
  --blue: #3498db;
  --gold: #ffd700;
  --radius: 16px;
  --radius-sm: 10px;
  --glass-bg: rgba(12, 14, 22, 0.65);
  --glass-border: rgba(255, 159, 28, 0.55);
  --glass-border-focus: rgba(255, 200, 80, 0.85);
  --glass-shadow: 0 0 10px rgba(255, 159, 28, 0.35), 0 0 22px rgba(255, 159, 28, 0.12), inset 0 0 14px rgba(255, 159, 28, 0.06);
  --glass-shadow-active: 0 0 14px rgba(255, 159, 28, 0.55), 0 0 28px rgba(255, 159, 28, 0.25), inset 0 0 18px rgba(255, 159, 28, 0.1);
  --glass-active-bg: rgba(255, 159, 28, 0.1);
  --badge-bg: rgba(255, 159, 28, 0.1);
  --badge-border: rgba(255, 159, 28, 0.25);
  --version-bg: rgba(255, 159, 28, 0.12);
  --version-border: rgba(255, 159, 28, 0.2);
  --status-bg: rgba(46, 204, 113, 0.12);
  --card-shadow: 0 8px 28px rgba(0, 0, 0, 0.4);
  --scene-shadow: 0 8px 28px rgba(0, 0, 0, 0.4);
  --theme-toggle-bg: rgba(22, 26, 34, 0.88);
  --theme-toggle-border: rgba(255, 159, 28, 0.4);
  --theme-toggle-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  --theme-slider-track: rgba(18, 22, 30, 0.9);
  --theme-slider-thumb: linear-gradient(180deg, #3d4556 0%, #252b38 100%);
  --theme-slider-thumb-shadow: 0 2px 6px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  --game-sky:
    radial-gradient(ellipse 100% 55% at 50% 105%, rgba(255, 100, 20, 0.2) 0%, transparent 62%),
    radial-gradient(ellipse 65% 40% at 8% 15%, rgba(255, 159, 28, 0.1) 0%, transparent 58%),
    radial-gradient(ellipse 50% 35% at 92% 20%, rgba(40, 100, 70, 0.08) 0%, transparent 52%),
    linear-gradient(180deg, #030508 0%, #0a0f18 38%, #0e1420 72%, #0a0e16 100%);
  --game-aurora:
    radial-gradient(ellipse 60% 40% at 35% 55%, rgba(255, 140, 40, 0.1) 0%, transparent 68%),
    radial-gradient(ellipse 50% 35% at 68% 45%, rgba(255, 180, 60, 0.06) 0%, transparent 65%);
  --game-mesh-line: rgba(255, 159, 28, 0.04);
  --game-mesh-angle: -18deg;
  --game-glow: radial-gradient(circle, rgba(255, 140, 40, 0.18) 0%, rgba(255, 90, 20, 0.06) 45%, transparent 72%);
  --game-feathers:
    radial-gradient(circle at 25% 30%, rgba(255, 120, 30, 0.07) 0%, transparent 45%),
    radial-gradient(circle at 75% 25%, rgba(255, 159, 28, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 50% 85%, rgba(255, 80, 20, 0.06) 0%, transparent 50%);
  --game-mult: rgba(255, 180, 60, 0.28);
  --game-mult-lg: rgba(255, 200, 80, 0.35);
  --game-spark: rgba(255, 159, 28, 0.3);
  --road-bg: linear-gradient(180deg, #3d4452 0%, #2a303c 50%, #1e232c 100%);
  --road-marking: rgba(255, 220, 120, 0.38);
  --traffic-housing-bg: linear-gradient(180deg, #2e2e2e 0%, #161616 100%);
  --traffic-housing-border: #444444;
  --traffic-housing-shadow: 0 3px 10px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  --traffic-off: radial-gradient(circle at 35% 30%, #5a2020 0%, #2a1010 55%, #1a0808 100%);
  --input-shadow: 0 0 8px rgba(255, 159, 28, 0.2), inset 0 0 10px rgba(255, 159, 28, 0.04);
  --input-shadow-focus: 0 0 12px rgba(255, 159, 28, 0.4), inset 0 0 14px rgba(255, 159, 28, 0.08);
  --gate-glass-bg: rgba(22, 26, 34, 0.85);
  --gate-glass-border: rgba(255, 159, 28, 0.2);
  --gate-glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #dce4d6;
  --app-bg:
    radial-gradient(ellipse 100% 60% at 50% -5%, rgba(255, 252, 240, 0.95) 0%, transparent 62%),
    radial-gradient(ellipse 70% 50% at 15% 90%, rgba(170, 195, 155, 0.35) 0%, transparent 55%),
    radial-gradient(ellipse 65% 45% at 90% 85%, rgba(190, 210, 175, 0.3) 0%, transparent 52%),
    linear-gradient(180deg, #eef2e8 0%, #e2e9dc 40%, #d6dfd0 100%);
  --surface: #f8faf5;
  --surface-2: #e8efe4;
  --border: #a4b0a0;
  --text: #1a221c;
  --text-muted: #4a554c;
  --accent: #4a7d54;
  --accent-2: #6a9a72;
  --green: #3d8a55;
  --red: #b84a3f;
  --blue: #4a7f98;
  --gold: #8fa85c;
  --glass-bg: rgba(248, 250, 245, 0.94);
  --glass-border: rgba(74, 122, 84, 0.55);
  --glass-border-focus: rgba(58, 100, 68, 0.85);
  --glass-shadow:
    0 1px 2px rgba(26, 34, 28, 0.08),
    0 4px 12px rgba(26, 34, 28, 0.1),
    0 0 10px rgba(95, 143, 104, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
  --glass-shadow-active:
    0 2px 4px rgba(26, 34, 28, 0.1),
    0 6px 16px rgba(26, 34, 28, 0.12),
    0 0 14px rgba(95, 143, 104, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  --glass-active-bg: rgba(140, 175, 140, 0.18);
  --badge-bg: rgba(140, 175, 140, 0.2);
  --badge-border: rgba(74, 122, 84, 0.4);
  --version-bg: rgba(140, 175, 140, 0.18);
  --version-border: rgba(74, 122, 84, 0.38);
  --status-bg: rgba(61, 138, 85, 0.16);
  --card-shadow:
    0 1px 3px rgba(26, 34, 28, 0.08),
    0 6px 18px rgba(26, 34, 28, 0.12);
  --scene-shadow:
    0 2px 4px rgba(26, 34, 28, 0.08),
    0 8px 22px rgba(26, 34, 28, 0.14);
  --theme-toggle-bg: rgba(248, 250, 245, 0.96);
  --theme-toggle-border: rgba(74, 122, 84, 0.48);
  --theme-toggle-shadow:
    0 2px 4px rgba(26, 34, 28, 0.08),
    0 6px 16px rgba(26, 34, 28, 0.12);
  --theme-slider-track: rgba(232, 238, 228, 0.95);
  --theme-slider-thumb: linear-gradient(180deg, #ffffff 0%, #e4ebe0 100%);
  --theme-slider-thumb-shadow: 0 2px 6px rgba(26, 34, 28, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.95);
  --game-sky:
    radial-gradient(ellipse 95% 50% at 50% -8%, rgba(255, 252, 242, 1) 0%, transparent 68%),
    radial-gradient(ellipse 75% 45% at 12% 75%, rgba(175, 200, 160, 0.35) 0%, transparent 58%),
    radial-gradient(ellipse 70% 40% at 88% 70%, rgba(190, 215, 175, 0.28) 0%, transparent 55%),
    linear-gradient(180deg, #f2f6ee 0%, #e8efe2 30%, #dce6d6 65%, #d0dbd0 100%);
  --game-aurora:
    radial-gradient(ellipse 55% 38% at 30% 50%, rgba(180, 210, 165, 0.22) 0%, transparent 70%),
    radial-gradient(ellipse 50% 32% at 70% 48%, rgba(210, 225, 195, 0.18) 0%, transparent 68%);
  --game-mesh-line: rgba(90, 115, 85, 0.07);
  --game-mesh-angle: 0deg;
  --game-glow: radial-gradient(circle, rgba(220, 235, 205, 0.5) 0%, rgba(180, 205, 165, 0.15) 42%, transparent 72%);
  --game-feathers:
    radial-gradient(circle at 20% 35%, rgba(160, 190, 145, 0.15) 0%, transparent 45%),
    radial-gradient(circle at 80% 30%, rgba(200, 220, 185, 0.12) 0%, transparent 42%),
    radial-gradient(circle at 50% 90%, rgba(140, 175, 125, 0.1) 0%, transparent 48%);
  --game-mult: rgba(58, 90, 52, 0.48);
  --game-mult-lg: rgba(48, 78, 42, 0.55);
  --game-spark: rgba(90, 130, 85, 0.45);
  --road-bg: linear-gradient(180deg, #6a7268 0%, #5a6258 50%, #4e564c 100%);
  --road-marking: rgba(255, 252, 235, 0.75);
  --traffic-housing-bg: linear-gradient(180deg, #f4f7f2 0%, #c8d4c4 100%);
  --traffic-housing-border: #9aaa96;
  --traffic-housing-shadow:
    0 2px 4px rgba(26, 34, 28, 0.1),
    0 5px 12px rgba(26, 34, 28, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  --traffic-off: radial-gradient(circle at 35% 30%, #d0a8a8 0%, #b07878 55%, #985e5e 100%);
  --input-shadow:
    0 1px 2px rgba(26, 34, 28, 0.06),
    0 3px 10px rgba(26, 34, 28, 0.08),
    inset 0 1px 2px rgba(26, 34, 28, 0.04);
  --input-shadow-focus:
    0 2px 4px rgba(26, 34, 28, 0.08),
    0 0 14px rgba(74, 122, 84, 0.28),
    inset 0 1px 2px rgba(26, 34, 28, 0.05);
  --gate-glass-bg: rgba(248, 250, 245, 0.94);
  --gate-glass-border: rgba(74, 122, 84, 0.32);
  --gate-glass-shadow:
    0 2px 4px rgba(26, 34, 28, 0.06),
    0 10px 28px rgba(26, 34, 28, 0.1);
  --text-shadow-soft: 0 1px 0 rgba(255, 255, 255, 0.9);
  --text-shadow-crisp: 0 1px 2px rgba(26, 34, 28, 0.12);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  overflow-x: hidden;
}

html {
  transition: background-color 0.35s ease, color 0.35s ease;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--app-bg);
  background-color: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.35s ease, color 0.35s ease;
}

/* Theme slider */
.theme-slider {
  position: fixed;
  top: max(12px, env(safe-area-inset-top, 12px));
  right: max(12px, env(safe-area-inset-right, 12px));
  z-index: 1000;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.theme-slider:active .theme-slider__thumb {
  width: 26px;
}

.theme-slider__track {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 62px;
  height: 32px;
  padding: 0 7px;
  border-radius: 20px;
  background: var(--theme-slider-track);
  border: 1.5px solid var(--theme-toggle-border);
  box-shadow: var(--theme-toggle-shadow);
  transition: background-color 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}

.theme-slider__icon {
  font-size: 13px;
  line-height: 1;
  z-index: 1;
  opacity: 0.45;
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}

[data-theme="dark"] .theme-slider__icon--moon,
:root:not([data-theme="light"]) .theme-slider__icon--moon {
  opacity: 1;
  transform: scale(1.08);
}

[data-theme="light"] .theme-slider__icon--sun {
  opacity: 1;
  transform: scale(1.08);
}

.theme-slider__thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--theme-slider-thumb);
  box-shadow: var(--theme-slider-thumb-shadow);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), width 0.15s ease;
  pointer-events: none;
}

[data-theme="light"] .theme-slider__thumb {
  transform: translateX(30px);
}

.app,
.gate-screen--full,
.signal-card__inner,
.mode-btn,
.stat,
.history-item,
.lang-btn,
.password-panel__input,
.gate-card {
  transition:
    background-color 0.35s ease,
    border-color 0.35s ease,
    color 0.35s ease,
    box-shadow 0.35s ease;
}

.app {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px 16px 32px;
  min-height: 100vh;
}

/* Header */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.header__brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header__logo {
  font-size: 36px;
  filter: drop-shadow(0 0 12px rgba(255, 159, 28, 0.5));
}

.header__title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.header__subtitle {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.header__status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--green);
  background: var(--status-bg);
  padding: 6px 10px;
  border-radius: 20px;
  letter-spacing: 0.5px;
}

.pulse {
  width: 8px;
  height: 8px;
  background: var(--green);
  border-radius: 50%;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

/* Section label */
.section-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 10px;
}

/* Mode picker */
.mode-picker {
  margin-bottom: 20px;
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.mode-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 10px 4px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.mode-btn.active {
  background: linear-gradient(135deg, rgba(255, 159, 28, 0.2), rgba(255, 107, 53, 0.15));
  border-color: var(--accent);
  color: var(--accent);
}

.mode-btn:active {
  transform: scale(0.96);
}

/* Signal card */
.signal-card {
  position: relative;
  margin-bottom: 16px;
  border-radius: var(--radius);
  overflow: hidden;
}

.signal-card__glow {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  opacity: 0.15;
}

.signal-card__inner {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
}

.signal-card.enter .signal-card__inner {
  border-color: var(--green);
  box-shadow: 0 0 30px rgba(46, 204, 113, 0.15);
}

.signal-card.wait .signal-card__inner {
  border-color: var(--blue);
}

.signal-card.cashout .signal-card__inner {
  border-color: var(--accent);
  box-shadow: 0 0 30px rgba(255, 159, 28, 0.2);
}

.signal-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.signal-status__icon {
  font-size: 20px;
}

.signal-status__text {
  font-size: 14px;
  font-weight: 600;
}

.signal-card.enter .signal-status__text { color: var(--green); }
.signal-card.wait .signal-status__text { color: var(--blue); }
.signal-card.cashout .signal-status__text { color: var(--accent); }

.signal-main {
  text-align: center;
  margin-bottom: 20px;
}

.signal-main__label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.signal-main__value {
  font-size: 52px;
  font-weight: 800;
  letter-spacing: -2px;
  background: linear-gradient(135deg, var(--accent), var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

.signal-details {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.detail {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 10px 8px;
  text-align: center;
}

.detail__label {
  display: block;
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.detail__value {
  font-size: 15px;
  font-weight: 700;
}

.progress-bar {
  height: 4px;
  background: var(--surface-2);
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 2px;
  transition: width 1s linear;
  width: 100%;
}

/* Stats */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 20px;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 8px;
  text-align: center;
}

.stat__value {
  display: block;
  font-size: 20px;
  font-weight: 800;
  color: var(--accent);
}

.stat__label {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* History */
.history {
  margin-bottom: 24px;
}

.history__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.history__badge {
  font-size: 11px;
  font-weight: 700;
  background: var(--surface-2);
  color: var(--text-muted);
  padding: 4px 8px;
  border-radius: 12px;
}

.history__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 200px;
  overflow-y: auto;
}

.history__list::-webkit-scrollbar {
  width: 4px;
}

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

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 13px;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.history-item__left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.history-item__mode {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface-2);
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

.history-item__mult {
  font-weight: 700;
}

.history-item__result {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
}

.history-item__result.win {
  background: rgba(46, 204, 113, 0.15);
  color: var(--green);
}

.history-item__result.loss {
  background: rgba(231, 76, 60, 0.15);
  color: var(--red);
}

/* Footer */
.footer {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn {
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.15s, opacity 0.15s;
}

.btn:active {
  transform: scale(0.98);
  opacity: 0.9;
}

.btn--primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #1a0e00;
}

[data-theme="light"] .btn--primary {
  color: #f5f7f4;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(26, 34, 28, 0.2);
  box-shadow:
    0 2px 4px rgba(26, 34, 28, 0.1),
    0 6px 16px rgba(74, 122, 84, 0.28);
}

/* Light theme — sharper text and shadows */
[data-theme="light"] .splash-header__bot {
  font-weight: 700;
  text-shadow: var(--text-shadow-soft);
}

[data-theme="light"] .splash-header__signals {
  color: #3a4540;
  font-weight: 800;
  text-shadow: var(--text-shadow-soft);
}

[data-theme="light"] .splash-header__version {
  font-weight: 900;
  box-shadow: 0 2px 6px rgba(26, 34, 28, 0.1);
}

[data-theme="light"] .splash-header__badge {
  box-shadow: 0 2px 8px rgba(26, 34, 28, 0.08);
}

[data-theme="light"] .game-bg__mult,
[data-theme="light"] .game-bg__mult--lg {
  text-shadow:
    var(--text-shadow-soft),
    0 1px 4px rgba(48, 78, 42, 0.2);
}

[data-theme="light"] .game-bg__spark {
  text-shadow:
    var(--text-shadow-soft),
    0 0 10px rgba(74, 110, 78, 0.3);
}

[data-theme="light"] .lang-btn__label,
[data-theme="light"] .password-panel__hint {
  font-weight: 700;
  text-shadow: var(--text-shadow-soft);
}

[data-theme="light"] .password-panel__admin {
  font-weight: 600;
  color: var(--text-muted);
}

[data-theme="light"] .header__title {
  font-weight: 900;
  text-shadow: var(--text-shadow-soft);
}

[data-theme="light"] .header__subtitle,
[data-theme="light"] .section-label {
  font-weight: 700;
  color: var(--text-muted);
}

[data-theme="light"] .signal-card__inner,
[data-theme="light"] .stat,
[data-theme="light"] .history-item,
[data-theme="light"] .mode-btn {
  border-width: 1.5px;
  box-shadow: var(--card-shadow);
}

[data-theme="light"] .mode-btn.active {
  box-shadow:
    0 0 0 1px var(--accent),
    0 3px 12px rgba(74, 122, 84, 0.22);
}

[data-theme="light"] .signal-main__value {
  filter: drop-shadow(0 2px 4px rgba(26, 34, 28, 0.12));
}

[data-theme="light"] .detail__value,
[data-theme="light"] .stat__value {
  font-weight: 800;
  text-shadow: var(--text-shadow-soft);
}

[data-theme="light"] .chicken-runner {
  filter: drop-shadow(0 3px 8px rgba(26, 34, 28, 0.25));
}

[data-theme="light"] .road-scene--splash {
  border-width: 1.5px;
}

[data-theme="light"] .traffic-light.is-lit {
  box-shadow:
    0 0 8px rgba(46, 204, 113, 0.7),
    0 2px 6px rgba(26, 34, 28, 0.15),
    inset 0 -1px 2px rgba(0, 0, 0, 0.2);
}

.btn--secondary {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
}

.footer__note {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.5;
}

/* Gate screens */
.hidden {
  display: none !important;
}

.gate {
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  background: var(--app-bg);
  background-color: var(--bg);
}

.gate-screen {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
}

.gate-screen--full {
  max-width: none;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px 32px;
  position: absolute;
  inset: 0;
  width: 100%;
  transition: opacity 0.45s ease, transform 0.45s ease;
  will-change: opacity, transform;
}

.gate-screen--exit {
  opacity: 0;
  transform: translateY(-14px) scale(0.98);
  pointer-events: none;
}

.gate-screen--enter {
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
}

.gate-screen--enter-active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.gate-screen--enter-active .splash-header {
  animation: screenBlockIn 0.5s ease 0.08s both;
}

.gate-screen--enter-active .lang-stage {
  animation: screenBlockIn 0.5s ease 0.2s both;
}

@keyframes screenBlockIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* App brand */
.app-brand {
  text-align: center;
  margin-bottom: 28px;
  position: relative;
  z-index: 2;
}

.app-brand--compact {
  margin-bottom: 0;
}

.app-brand__eyebrow {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.app-brand__icon {
  font-size: 44px;
  display: block;
  margin-bottom: 8px;
  filter: drop-shadow(0 0 16px rgba(255, 159, 28, 0.6));
}

.app-brand__title {
  font-size: 32px;
  font-weight: 900;
  letter-spacing: -1px;
  line-height: 1;
  background: linear-gradient(135deg, #fff 30%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.app-brand--compact .app-brand__title {
  font-size: 26px;
}

.app-brand__subtitle {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-muted);
  margin-top: 6px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.app-brand__version {
  color: var(--accent);
  -webkit-text-fill-color: var(--accent);
}

/* Splash screen */
.splash-screen {
  position: relative;
}

.splash-bg,
.lang-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.splash-bg__sky,
.lang-bg__sky {
  position: absolute;
  inset: 0;
  background: var(--game-sky);
}

.game-bg__aurora {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: var(--game-aurora);
  animation: auroraShift 8s ease-in-out infinite alternate;
}

.lang-bg .game-bg__aurora,
.lang-bg .game-bg__spark {
  animation: none;
}

.game-bg__mesh {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(
      var(--game-mesh-angle),
      transparent 0px,
      transparent 32px,
      var(--game-mesh-line) 32px,
      var(--game-mesh-line) 33px
    ),
    repeating-linear-gradient(
      90deg,
      transparent 0px,
      transparent 48px,
      var(--game-mesh-line) 48px,
      var(--game-mesh-line) 49px
    );
  mask-image: radial-gradient(ellipse 95% 85% at 50% 48%, black 15%, transparent 78%);
  opacity: 0.85;
  transition: opacity 0.35s ease;
}

.game-bg__decor {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.game-bg__mult {
  position: absolute;
  left: var(--x);
  top: var(--y);
  font-family: 'Lilita One', cursive;
  font-size: 22px;
  color: var(--game-mult);
  text-shadow: 0 0 18px rgba(255, 159, 28, 0.35);
  transform: rotate(-10deg);
}

.game-bg__mult--lg {
  font-size: 28px;
  color: var(--game-mult-lg);
  text-shadow: 0 0 24px rgba(255, 159, 28, 0.45);
}

.game-bg__spark {
  position: absolute;
  left: var(--x);
  top: var(--y);
  font-size: 18px;
  color: var(--game-spark);
  text-shadow: 0 0 14px rgba(56, 189, 248, 0.5);
  animation: sparkPulse 3s ease-in-out infinite;
}

.splash-bg__glow {
  position: absolute;
  width: 340px;
  height: 340px;
  top: auto;
  bottom: 8%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--game-glow);
  animation: glowPulse 3s ease-in-out infinite;
  pointer-events: none;
}

@keyframes auroraShift {
  from { opacity: 0.7; transform: scale(1); }
  to { opacity: 1; transform: scale(1.05); }
}

@keyframes sparkPulse {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.15); }
}

.splash-content,
.lang-content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 400px;
}

.splash-content--split {
  display: flex;
  flex-direction: column;
  gap: 36px;
  padding-top: 12px;
}

.lang-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 24px 20px;
}

/* Splash header — отдельно сверху */
.splash-header {
  text-align: center;
  position: relative;
  z-index: 2;
  padding: 0 8px;
}

.splash-header__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 10px;
  margin-bottom: 18px;
  background: var(--badge-bg);
  border: 1px solid var(--badge-border);
  border-radius: 100px;
}

.splash-header__icon {
  font-size: 20px;
  filter: drop-shadow(0 0 8px rgba(255, 159, 28, 0.5));
}

.splash-header__bot {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.3px;
}

/* Logo title — 3D style like app icon */
.splash-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 0 6px;
  line-height: 1;
  user-select: none;
}

.splash-logo__word {
  position: relative;
  display: block;
  width: 100%;
  text-align: center;
  font-family: 'Lilita One', 'Fredoka One', cursive;
  font-weight: 400;
  letter-spacing: 0.5px;
}

.splash-logo__word--chicken {
  font-size: clamp(40px, 11.5vw, 50px);
  margin-bottom: 6px;
  z-index: 2;
}

.splash-logo__word--robot {
  font-size: clamp(36px, 10.5vw, 44px);
  z-index: 1;
}

.splash-logo__depth {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  color: #3d1a08;
  white-space: nowrap;
  text-align: center;
  transform: translateY(5px);
  z-index: 0;
  pointer-events: none;
  -webkit-text-stroke: 5px #1a0804;
  paint-order: stroke fill;
}

.splash-logo__face,
.splash-logo__robot {
  position: relative;
  z-index: 1;
}

.splash-logo__face {
  display: inline-block;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.splash-logo__robot {
  display: inline-block;
  white-space: nowrap;
}

.splash-logo__face--chicken {
  background-image: linear-gradient(
    180deg,
    #fffce8 0%,
    #ffe566 16%,
    #ffc107 42%,
    #ff9800 68%,
    #e65100 100%
  );
  filter:
    drop-shadow(-1px -1px 0 #2d1204)
    drop-shadow(1px -1px 0 #2d1204)
    drop-shadow(0 3px 0 #8d2608)
    drop-shadow(0 6px 10px rgba(0, 0, 0, 0.4));
}

.splash-logo__face--ro {
  background-image: linear-gradient(
    180deg,
    #ffffff 0%,
    #f0f0f0 22%,
    #cfcfcf 48%,
    #a8a8a8 72%,
    #7a7a7a 100%
  );
  filter:
    drop-shadow(-1px -1px 0 #2d1204)
    drop-shadow(1px -1px 0 #2d1204)
    drop-shadow(0 3px 0 #333333)
    drop-shadow(0 6px 10px rgba(0, 0, 0, 0.4));
}

.splash-logo__face--bot {
  background-image: linear-gradient(
    180deg,
    #e8f7ff 0%,
    #81d4fa 22%,
    #29b6f6 48%,
    #039be5 72%,
    #01579b 100%
  );
  filter:
    drop-shadow(-1px -1px 0 #0a2840)
    drop-shadow(1px -1px 0 #0a2840)
    drop-shadow(0 3px 0 #014a75)
    drop-shadow(0 6px 10px rgba(0, 0, 0, 0.4));
}

.splash-logo--sm .splash-logo__word--chicken {
  font-size: clamp(28px, 8vw, 34px);
  margin-bottom: 4px;
}

.splash-logo--sm .splash-logo__word--robot {
  font-size: clamp(24px, 7vw, 30px);
}

.splash-logo--sm .splash-logo__depth {
  -webkit-text-stroke-width: 3.5px;
  transform: translateY(3px);
}

.splash-header__signals {
  font-family: 'Outfit', 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 6px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 10px;
  margin-bottom: 10px;
}

.splash-header__version {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--accent);
  padding: 4px 12px;
  border-radius: 6px;
  background: var(--version-bg);
  border: 1px solid var(--version-border);
}

/* Road scene — splash loading */
.road-scene--splash {
  position: relative;
  height: 88px;
  margin: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--scene-shadow);
  flex-shrink: 0;
}

.road-scene__road {
  position: absolute;
  inset: 0;
  background: var(--road-bg);
}

.road-markings {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 3px;
  margin-top: -1.5px;
  background: repeating-linear-gradient(
    90deg,
    var(--road-marking) 0px,
    var(--road-marking) 20px,
    transparent 20px,
    transparent 40px
  );
}

.road-markings--move {
  animation: roadScroll 0.7s linear infinite;
}

.chicken-runner {
  position: absolute;
  top: 50%;
  margin-top: -24px;
  left: -52px;
  font-size: 48px;
  line-height: 1;
  z-index: 2;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.55));
  transform: scaleX(-1);
}

.chicken-runner.is-running {
  animation: chickenRunSplash 5.5s ease-in-out forwards;
}

@keyframes chickenRunSplash {
  0% {
    left: -52px;
    transform: scaleX(-1) translateY(0);
  }
  8%, 28%, 48%, 68%, 88% {
    transform: scaleX(-1) translateY(-6px);
  }
  18%, 38%, 58%, 78%, 98% {
    transform: scaleX(-1) translateY(0);
  }
  100% {
    left: calc(100% - 48px);
    transform: scaleX(-1) translateY(0);
  }
}

.traffic-lights {
  position: absolute;
  bottom: 6px;
  left: 0;
  right: 0;
  z-index: 3;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.traffic-lights__housing {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  background: var(--traffic-housing-bg);
  border: 2px solid var(--traffic-housing-border);
  border-radius: 10px;
  box-shadow: var(--traffic-housing-shadow);
}

.traffic-light {
  display: block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--traffic-off);
  border: 1.5px solid #0d0d0d;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6);
  transition: background 0.25s, box-shadow 0.25s, border-color 0.25s;
}

.traffic-light.is-active {
  background: radial-gradient(circle at 35% 30%, #ff6b6b 0%, #c0392b 55%, #922b21 100%);
  border-color: #5c1a1a;
  box-shadow:
    0 0 8px rgba(231, 76, 60, 0.7),
    inset 0 -1px 2px rgba(0, 0, 0, 0.3);
  animation: trafficBlink 0.45s ease-in-out infinite alternate;
}

.traffic-light.is-lit {
  background: radial-gradient(circle at 35% 30%, #7dffb8 0%, #2ecc71 50%, #1e8449 100%);
  border-color: #145a32;
  box-shadow:
    0 0 10px rgba(46, 204, 113, 0.85),
    0 0 18px rgba(46, 204, 113, 0.35),
    inset 0 -1px 2px rgba(0, 0, 0, 0.25);
  animation: none;
}

@keyframes trafficBlink {
  from { opacity: 0.75; }
  to { opacity: 1; }
}

@keyframes roadScroll {
  from { background-position: 0 0; }
  to { background-position: -44px 0; }
}

@keyframes glowPulse {
  0%, 100% { opacity: 0.55; transform: translateX(-50%) scale(1); }
  50% { opacity: 0.9; transform: translateX(-50%) scale(1.08); }
}

/* Language screen */
.lang-bg__feathers {
  position: absolute;
  inset: 0;
  background: var(--game-feathers);
  pointer-events: none;
}

.lang-stage {
  position: relative;
  width: 100%;
  max-width: 340px;
  min-height: 228px;
  display: flex;
  justify-content: center;
}

.splash-header.is-exiting {
  opacity: 0;
  transform: translateY(-14px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.38s ease, transform 0.38s ease;
}

.lang-list {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 188px;
  transition: opacity 0.38s ease, transform 0.38s ease;
}

.lang-list.is-exiting {
  opacity: 0;
  transform: translateY(-14px) scale(0.96);
  pointer-events: none;
}

.password-panel {
  position: absolute;
  top: 0;
  left: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 220px;
  margin-left: -110px;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.38s ease, transform 0.38s ease;
  pointer-events: none;
}

.password-panel.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.password-panel.is-exiting {
  opacity: 0;
  transform: translateY(-14px) scale(0.96);
  pointer-events: none;
}

.password-panel__hint {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--text);
  text-align: center;
  margin: 0;
}

.password-panel__form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.password-panel__input {
  width: 100%;
  padding: 12px 14px;
  background: var(--glass-bg);
  border: 1.5px solid var(--glass-border);
  border-radius: 8px;
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  text-align: center;
  letter-spacing: 1px;
  box-shadow: var(--input-shadow);
}

.password-panel__input:focus {
  outline: none;
  border-color: var(--glass-border-focus);
  box-shadow: var(--input-shadow-focus);
}

.password-panel__error {
  font-size: 12px;
  color: var(--red);
  margin: 0;
  text-align: center;
}

.password-panel__submit,
.password-panel__admin-btn {
  width: 100%;
  text-decoration: none;
}

.password-panel__submit.lang-btn,
.password-panel__admin-btn.lang-btn {
  border-color: transparent;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
}

.password-panel__submit.lang-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #1a0e00;
  font-size: 15px;
}

.password-panel__admin-btn.lang-btn {
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  color: #1a0e00;
  font-size: 14px;
}

[data-theme="light"] .password-panel__submit.lang-btn,
[data-theme="light"] .password-panel__admin-btn.lang-btn {
  color: #f5f7f4;
  text-shadow: 0 1px 2px rgba(26, 34, 28, 0.2);
  box-shadow:
    0 2px 4px rgba(26, 34, 28, 0.1),
    0 6px 16px rgba(74, 122, 84, 0.28);
}

.password-panel__submit.lang-btn:active,
.password-panel__admin-btn.lang-btn:active {
  transform: scale(0.98);
  opacity: 0.92;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.mode-gate,
.instruction-panel {
  position: absolute;
  top: 0;
  left: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: min(100%, 320px);
  opacity: 0;
  transform: translateX(-50%) translateY(16px);
  transition: opacity 0.38s ease, transform 0.38s ease;
  pointer-events: none;
}

.mode-gate.is-visible,
.instruction-panel.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.mode-gate.is-exiting,
.instruction-panel.is-exiting {
  opacity: 0;
  transform: translateX(-50%) translateY(-14px) scale(0.96);
  pointer-events: none;
}

.mode-gate__title {
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  color: var(--text);
  margin: 0;
}

.mode-gate__row {
  display: flex;
  gap: 8px;
  width: 100%;
}

.mode-gate__btn {
  flex: 1;
  min-width: 0;
  padding: 12px 6px;
  border-radius: 8px;
  border: 1.5px solid transparent;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #1a0e00;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s, opacity 0.2s;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.mode-gate__btn:active {
  transform: scale(0.97);
}

.mode-gate__btn--locked {
  background: var(--glass-bg);
  color: var(--text-muted);
  border-color: var(--border);
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

[data-theme="light"] .mode-gate__btn:not(.mode-gate__btn--locked) {
  color: #f5f7f4;
  text-shadow: 0 1px 2px rgba(26, 34, 28, 0.2);
}

.mode-gate__hint {
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-muted);
  text-align: center;
  margin: 0;
}

.mode-gate__admin.lang-btn {
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  color: #1a0e00;
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
}

[data-theme="light"] .mode-gate__admin.lang-btn {
  color: #f5f7f4;
  text-shadow: 0 1px 2px rgba(26, 34, 28, 0.2);
}

.instruction-panel__img {
  width: 150px;
  height: auto;
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  display: block;
}

.instruction-panel__text {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
  text-align: center;
  margin: 0;
}

.instruction-panel__btn.lang-btn {
  width: 100%;
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #1a0e00;
  font-weight: 700;
  font-size: 15px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
}

[data-theme="light"] .instruction-panel__btn.lang-btn {
  color: #f5f7f4;
  text-shadow: 0 1px 2px rgba(26, 34, 28, 0.2);
}

.instruction-panel__btn.lang-btn:active {
  transform: scale(0.98);
  opacity: 0.92;
}

.password-panel__admin {
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-muted);
  text-align: center;
  margin: 4px 0 0;
}

.password-panel__back {
  margin-top: 4px;
  padding: 6px 10px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
}

.password-panel__back:active {
  color: var(--accent);
}

.lang-btn {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-width: 0;
  padding: 9px 18px 9px 14px;
  background: var(--glass-bg);
  border: 1.5px solid var(--glass-border);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s, transform 0.2s;
  white-space: nowrap;
  box-shadow: var(--glass-shadow);
}

.lang-btn:active {
  transform: scale(0.98);
  border-color: var(--glass-border-focus);
  background: var(--glass-active-bg);
  box-shadow: var(--glass-shadow-active);
}

.lang-btn__flag {
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
}

.lang-btn__label {
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
}

.gate-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 24px;
  text-align: center;
}

.gate-card--glass {
  background: var(--gate-glass-bg);
  border-color: var(--gate-glass-border);
  box-shadow: var(--gate-glass-shadow);
}

.gate-logo {
  font-size: 48px;
  display: block;
  margin-bottom: 16px;
}

.gate-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 20px;
  letter-spacing: -0.2px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.gate-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 28px;
}

.password-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 12px;
}

.password-input {
  width: 100%;
  padding: 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 16px;
  font-family: inherit;
  text-align: center;
  letter-spacing: 2px;
}

.password-input:focus {
  outline: none;
  border-color: var(--accent);
}

.password-error {
  font-size: 13px;
  color: var(--red);
  margin: -4px 0 0;
}

.btn--ghost {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  padding: 12px;
  cursor: pointer;
  font-family: inherit;
  width: 100%;
}

.history-step {
  color: var(--text-muted);
  font-size: 11px;
}

.history-item__result.pending {
  color: var(--text-muted);
}

@media (prefers-reduced-motion: reduce) {
  .game-bg__aurora,
  .game-bg__spark,
  .splash-bg__glow,
  .road-markings--move,
  .traffic-light.is-active {
    animation: none !important;
  }
}
