﻿:root {
  --text: #fff5ff;
  --muted: #dfcaef;
  --muted-2: #cbb2de;
  --rose: #ff51d3;
  --rose-soft: #ff94e8;
  --violet: #8e58ff;
  --violet-soft: #b49aff;
  --panel: rgba(24, 10, 40, 0.48);
  --panel-strong: rgba(28, 10, 45, 0.64);
  --stroke: rgba(255, 162, 236, 0.34);
  --stroke-soft: rgba(223, 159, 255, 0.2);
  --ink: rgba(9, 3, 18, 0.62);
  --ok: #5df4c2;
  --gold: #ffeb8e;
}

* {
  box-sizing: border-box;
}

body {
  position: relative;
  margin: 0;
  color: var(--text);
  font-family: 'Manrope', sans-serif;
  min-height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
  background: #0f061c;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: url('/static/bg_card_orig.png') center/cover no-repeat fixed;
  filter: brightness(0.9) contrast(1.08) saturate(1.06) blur(0.55px);
  transform: scale(1);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 16%, rgba(255, 92, 217, 0.06), transparent 34%),
    radial-gradient(circle at 83% 12%, rgba(130, 92, 255, 0.06), transparent 32%),
    linear-gradient(165deg, rgba(9, 2, 16, 0.22), rgba(13, 4, 23, 0.44) 58%, rgba(8, 2, 14, 0.6));
}

.overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background:
    radial-gradient(circle at 50% 2%, rgba(250, 234, 255, 0.12), transparent 28%),
    radial-gradient(circle at 50% 120%, rgba(6, 2, 12, 0.4), transparent 42%);
}

.shell {
  position: relative;
  z-index: 3;
  width: min(900px, 100%);
  min-height: 100dvh;
  height: auto;
  margin: 0 auto;
  padding: calc(10px + env(safe-area-inset-top)) 12px calc(12px + env(safe-area-inset-bottom));
  display: grid;
  grid-template-rows: auto auto auto;
  gap: 11px;
}

.panel {
  border-radius: 20px;
  border: 1px solid rgba(255, 180, 239, 0.24);
  background: linear-gradient(164deg, rgba(28, 11, 46, 0.22), rgba(14, 5, 28, 0.3));
  box-shadow:
    0 10px 24px rgba(7, 2, 16, 0.24),
    inset 0 1px 0 rgba(255, 224, 250, 0.06),
    inset 0 0 0 1px rgba(255, 114, 224, 0.03);
  backdrop-filter: blur(10px) saturate(1.02);
}

.hero {
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  min-height: 72px;
  padding: 14px 16px;
}

.hero-brand {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 92% -20%, rgba(255, 255, 255, 0.1), transparent 42%),
    linear-gradient(130deg, rgba(255, 92, 217, 0.03), rgba(142, 88, 255, 0.015) 52%, rgba(118, 91, 255, 0.05));
}

.hero h1 {
  position: relative;
  z-index: 1;
  width: 100%;
  margin: 0;
  font-family: 'Orbitron', monospace;
  text-align: center;
  font-size: clamp(26px, 5.4vw, 36px);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: linear-gradient(135deg, #ffe7ff 0%, #ff9fe9 42%, #9aa4ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow:
    0 0 20px rgba(255, 124, 228, 0.48),
    0 0 52px rgba(126, 162, 255, 0.34);
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  z-index: 1;
}

.hero-badge {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 198, 243, 0.22);
  background: linear-gradient(135deg, rgba(255, 81, 211, 0.12), rgba(142, 88, 255, 0.14));
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #ffeafe;
  font-weight: 700;
}

.hero-badge-countries {
  display: inline-flex;
  gap: 8px;
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: none;
  padding: 4px 8px;
}

.flag-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 14px;
}

.hero-flag {
  width: 16px;
  height: 12px;
  border-radius: 3px;
  border: 1px solid rgba(255, 217, 246, 0.38);
  box-shadow: 0 0 0 1px rgba(18, 7, 32, 0.28);
  object-fit: cover;
  display: block;
}

.hero-flag-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  color: #f8e7ff;
  letter-spacing: 0.02em;
}

.hero-actions {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
  display: flex;
  align-items: center;
}

.wheel-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 196, 243, 0.78);
  text-decoration: none;
  color: #fff6ff;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: linear-gradient(135deg, rgba(255, 81, 211, 0.46), rgba(142, 88, 255, 0.58));
  box-shadow:
    0 10px 24px rgba(255, 81, 211, 0.28),
    inset 0 1px 0 rgba(255, 231, 251, 0.24);
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

.wheel-btn:hover {
  filter: brightness(1.07);
}

.wheel-btn:active {
  transform: translateY(1px) scale(0.99);
  box-shadow: 0 6px 14px rgba(255, 81, 211, 0.24);
}

.tabs {
  padding: 8px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  background: linear-gradient(160deg, rgba(26, 9, 42, 0.18), rgba(16, 6, 30, 0.24));
  backdrop-filter: blur(6px);
}

.tab-btn {
  min-height: 42px;
  border: 1px solid rgba(224, 162, 255, 0.22);
  border-radius: 12px;
  color: #f7e8ff;
  background: linear-gradient(160deg, rgba(39, 14, 60, 0.24), rgba(27, 10, 44, 0.3));
  font-weight: 800;
  letter-spacing: 0.055em;
  text-transform: uppercase;
  font-size: 12px;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.tab-btn.active {
  border-color: rgba(255, 188, 240, 0.46);
  background: linear-gradient(120deg, rgba(255, 81, 211, 0.28), rgba(142, 88, 255, 0.36));
  color: #fff4ff;
  transform: translateY(-1px) scale(1.01);
  box-shadow: 0 6px 12px rgba(142, 88, 255, 0.1);
}

.stage {
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto;
  gap: 9px;
  padding: 10px 11px 11px;
}

.stage h2 {
  margin: 0 2px;
  padding: 0;
  font-family: 'Orbitron', monospace;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #ffe2ff;
}

.screen-stack {
  min-height: 0;
  overflow: visible;
  border: 1px solid rgba(229, 167, 255, 0.16);
  border-radius: 16px;
  background:
    linear-gradient(165deg, rgba(28, 11, 47, 0.24), rgba(15, 6, 30, 0.32)),
    radial-gradient(circle at 100% 0%, rgba(255, 255, 255, 0.02), transparent 26%);
  box-shadow: inset 0 1px 0 rgba(255, 215, 248, 0.04);
  backdrop-filter: blur(10px) saturate(1.02);
}

.screen {
  display: none;
  height: auto;
  overflow: visible;
  padding: 12px;
  animation: screen-fade-in 220ms ease;
}

.screen.active {
  display: block;
}

.form-grid {
  display: grid;
  gap: 10px;
}

.form-grid label,
.form-grid legend {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.form-grid input,
.form-grid select {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(219, 153, 255, 0.18);
  background: rgba(18, 7, 32, 0.16);
  color: #ffefff;
  padding: 11px 12px;
  outline: none;
}

.form-grid input:focus,
.form-grid select:focus {
  border-color: rgba(255, 182, 239, 0.88);
  box-shadow: 0 0 0 3px rgba(255, 81, 211, 0.16);
}

.country-group {
  border-radius: 12px;
  border: 1px solid rgba(219, 153, 255, 0.16);
  padding: 9px;
  display: grid;
  gap: 8px;
  background: rgba(25, 10, 41, 0.12);
}

.country-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: none;
  letter-spacing: normal;
  font-size: 13px;
}

.input-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ghost-btn {
  min-height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(226, 170, 255, 0.2);
  background: linear-gradient(140deg, rgba(34, 12, 56, 0.18), rgba(22, 8, 38, 0.22));
  color: #f3ddff;
  padding: 0 11px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, filter 0.16s ease;
}

.ghost-btn:active {
  transform: translateY(1px) scale(0.99);
}

.suggestions {
  display: grid;
  gap: 8px;
}

.suggestions-head {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.suggestions-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.suggestion-chip {
  border: 1px solid rgba(255, 186, 239, 0.2);
  background: linear-gradient(135deg, rgba(255, 81, 211, 0.08), rgba(142, 88, 255, 0.1));
  color: #ffeefe;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.14s ease, filter 0.14s ease;
}

.suggestion-chip:active {
  transform: translateY(1px) scale(0.99);
}

.primary-btn {
  min-height: 42px;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  color: #fff6ff;
  background: linear-gradient(135deg, var(--rose), var(--violet));
  box-shadow:
    0 10px 28px rgba(255, 81, 211, 0.35),
    inset 0 1px 0 rgba(255, 218, 248, 0.22);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.primary-btn:disabled {
  opacity: 0.68;
  cursor: default;
}

.primary-btn:not(:disabled):active {
  transform: translateY(1px) scale(0.995);
  box-shadow: 0 6px 16px rgba(255, 81, 211, 0.3);
}

.primary-btn.is-loading {
  position: relative;
  color: rgba(255, 246, 255, 0.88);
}

.primary-btn.is-loading::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 2px solid rgba(255, 234, 248, 0.35);
  border-top-color: rgba(255, 234, 248, 0.95);
  transform: translateY(-50%);
  animation: spin-loader 0.8s linear infinite;
}

.result-card {
  margin-top: 12px;
  border-radius: 13px;
  border: 1px solid rgba(255, 183, 239, 0.22);
  background: linear-gradient(155deg, rgba(31, 11, 49, 0.22), rgba(21, 9, 39, 0.28));
  padding: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 212, 248, 0.03);
  backdrop-filter: blur(10px) saturate(1.02);
  animation: card-rise 320ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.result-card.hidden {
  display: none;
}

.result-card.error {
  border-color: rgba(255, 154, 194, 0.72);
  background: linear-gradient(155deg, rgba(56, 14, 35, 0.9), rgba(40, 10, 29, 0.92));
}

.result-title {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
}

.result-subtitle {
  margin: 6px 0 0;
  color: var(--muted-2);
  font-size: 12px;
}

.kpi-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.kpi-item {
  border-radius: 10px;
  border: 1px solid rgba(214, 149, 255, 0.24);
  background: rgba(36, 13, 56, 0.52);
  padding: 8px;
}

.kpi-item span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.kpi-item strong {
  display: block;
  margin-top: 4px;
  font-family: 'Orbitron', monospace;
  font-size: 14px;
}

.chips {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chips-ranks {
  align-items: center;
}

.chips-title {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  margin-right: 2px;
}

.chip {
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255, 182, 239, 0.38);
  background: rgba(255, 81, 211, 0.1);
  font-size: 11px;
}

.chip-rank {
  border-color: rgba(145, 255, 220, 0.28);
  background: linear-gradient(120deg, rgba(75, 239, 195, 0.16), rgba(120, 255, 220, 0.08));
  color: #d8fff0;
}

.metric-line {
  margin-top: 8px;
}

.country-board {
  margin-top: 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 176, 238, 0.2);
  background: linear-gradient(155deg, rgba(33, 12, 55, 0.2), rgba(20, 8, 38, 0.26));
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 218, 248, 0.03);
  backdrop-filter: blur(10px);
}

.country-head {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(180px, 220px);
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255, 178, 238, 0.1);
  background: linear-gradient(120deg, rgba(255, 81, 211, 0.04), rgba(142, 88, 255, 0.05));
}

.country-head-tag {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.country-head-ranks,
.country-ranks {
  display: grid;
  gap: 6px;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
}

.country-cell {
  min-height: 26px;
  border-radius: 8px;
  border: 1px solid rgba(255, 175, 237, 0.14);
  background: rgba(44, 17, 67, 0.12);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  padding: 0 4px;
}

.country-cell-head {
  gap: 4px;
}

.country-flag {
  width: 18px;
  height: 13px;
  border-radius: 3px;
  border: 1px solid rgba(255, 217, 246, 0.45);
  box-shadow: 0 0 0 1px rgba(18, 7, 32, 0.5);
  object-fit: cover;
  display: block;
  flex: 0 0 auto;
}

.country-flag-fallback {
  width: auto;
  height: auto;
  border: 0;
  box-shadow: none;
  font-size: 11px;
  line-height: 1;
  color: #f8e7ff;
}

.country-code {
  font-size: 10px;
  letter-spacing: 0.05em;
  color: #f3ddff;
}

.country-body {
  display: grid;
  overflow: visible;
}

.result-empty {
  padding: 16px 12px;
  display: grid;
  gap: 6px;
  text-align: center;
}

.result-empty h4 {
  margin: 0;
  font-size: 13px;
  letter-spacing: 0.02em;
}

.result-empty p {
  margin: 0;
  color: var(--muted-2);
  font-size: 12px;
}

.country-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(180px, 220px);
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-top: 1px solid rgba(255, 183, 239, 0.16);
  animation: row-in 280ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: calc(var(--row-index, 0) * 20ms);
}

.country-row:nth-child(2n) {
  background: rgba(255, 124, 228, 0.02);
}

.country-tag {
  font-size: 12px;
  color: #ffe9ff;
  font-weight: 600;
  overflow-wrap: anywhere;
  line-height: 1.28;
}

.country-cell-rank.is-ranked {
  gap: 4px;
  border-color: rgba(190, 255, 226, 0.62);
  background: linear-gradient(120deg, rgba(75, 239, 195, 0.2), rgba(120, 255, 220, 0.1));
  color: #d3ffe7;
}

.country-cell-rank.is-ranked.is-top {
  border-color: rgba(255, 230, 146, 0.86);
  background: linear-gradient(120deg, rgba(255, 222, 117, 0.3), rgba(255, 145, 230, 0.16));
  color: var(--gold);
  text-shadow: 0 0 10px rgba(255, 231, 150, 0.34);
}

.country-cell-rank.is-miss {
  color: rgba(231, 210, 248, 0.62);
  border-color: rgba(223, 202, 239, 0.12);
  background: rgba(35, 14, 55, 0.14);
  box-shadow: none;
}

.country-flag-inline {
  width: 14px;
  height: 10px;
  border-radius: 2px;
  border: 1px solid rgba(255, 217, 246, 0.42);
  box-shadow: 0 0 0 1px rgba(18, 7, 32, 0.42);
}

.country-flag-inline-fallback {
  font-size: 10px;
  line-height: 1;
}

.country-rank-value {
  font-family: 'Orbitron', monospace;
  font-size: 10px;
  font-weight: 700;
}

.country-rank-miss {
  font-size: 11px;
  line-height: 1;
}

.meter {
  margin-top: 10px;
  border-radius: 999px;
  height: 10px;
  border: 1px solid rgba(255, 183, 239, 0.26);
  background: rgba(18, 8, 30, 0.5);
  overflow: hidden;
}

.meter-fill {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #ff51d3 0%, #ff9de8 44%, #8e58ff 100%);
}

.tags-board {
  margin-top: 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 178, 238, 0.2);
  background: linear-gradient(155deg, rgba(34, 12, 55, 0.2), rgba(22, 8, 38, 0.26));
  padding: 10px;
  backdrop-filter: blur(10px);
}

.tags-board-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.tags-board-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 700;
}

.copy-btn {
  min-height: 34px;
  border: 1px solid rgba(255, 192, 240, 0.52);
  border-radius: 10px;
  cursor: pointer;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 800;
  color: #fff8ff;
  background: linear-gradient(135deg, rgba(255, 90, 215, 0.38), rgba(142, 88, 255, 0.5));
  box-shadow: 0 8px 20px rgba(255, 81, 211, 0.2);
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

.copy-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.copy-btn-soft {
  background: linear-gradient(135deg, rgba(34, 12, 55, 0.38), rgba(22, 8, 38, 0.46));
  border-color: rgba(255, 192, 240, 0.28);
  box-shadow: none;
}

.copy-btn:active {
  transform: translateY(1px) scale(0.99);
}

.copy-btn.is-copied {
  border-color: rgba(145, 255, 220, 0.86);
  background: linear-gradient(135deg, rgba(93, 244, 194, 0.55), rgba(85, 198, 255, 0.6));
  color: #eafff7;
}

.tags-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-token {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 186, 239, 0.36);
  background: rgba(255, 81, 211, 0.08);
  font-size: 12px;
  color: #ffeefe;
  animation: row-in 280ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: calc(var(--tag-index, 0) * 16ms);
}

.tag-token-main {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tag-token-meta {
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #d8c2ed;
}

.tag-token-trend {
  font-size: 10px;
  color: #f5c8ff;
  text-transform: uppercase;
}

.tag-token-score {
  font-family: 'Orbitron', monospace;
  font-size: 10px;
  color: #ffdff7;
}

.delivery-line {
  margin-top: 10px;
  border-top: 1px solid rgba(255, 188, 240, 0.24);
  padding-top: 10px;
  color: var(--muted-2);
  font-size: 12px;
}

.loading-shell {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid rgba(255, 191, 241, 0.32);
  background: linear-gradient(160deg, rgba(38, 13, 60, 0.58), rgba(20, 8, 38, 0.66));
  padding: 12px;
}

.loading-shell::before {
  content: "";
  position: absolute;
  inset: -100% auto -100% -35%;
  width: 38%;
  background: linear-gradient(90deg, rgba(255, 150, 233, 0), rgba(255, 189, 240, 0.28), rgba(145, 104, 255, 0));
  transform: skewX(-18deg);
  animation: shimmer-slide 1.4s linear infinite;
  pointer-events: none;
}

.loading-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.loading-orb {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: radial-gradient(circle, #ffe6ff 0%, #ff78dd 48%, #8e58ff 100%);
  box-shadow: 0 0 16px rgba(255, 120, 221, 0.8);
  animation: orb-pulse 0.95s ease-in-out infinite;
}

.loading-title {
  margin: 0;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.02em;
}

.loading-copy {
  margin: 8px 0 0;
  color: var(--muted-2);
  font-size: 12px;
  min-height: 18px;
  transition: opacity 180ms ease, transform 180ms ease;
}

.loading-bars {
  margin-top: 10px;
  display: grid;
  gap: 7px;
}

.loading-bar {
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 81, 211, 0.44), rgba(142, 88, 255, 0.42));
  transform-origin: left center;
  animation: bar-breathe 1.2s ease-in-out infinite;
}

.loading-bar:nth-child(2) { width: 86%; animation-delay: 0.15s; }
.loading-bar:nth-child(3) { width: 70%; animation-delay: 0.28s; }

.toast-stack {
  position: fixed;
  left: 50%;
  bottom: calc(14px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 30;
  width: min(720px, calc(100% - 22px));
  display: grid;
  gap: 8px;
  pointer-events: none;
}

.toast {
  justify-self: center;
  min-width: min(92vw, 360px);
  max-width: 100%;
  padding: 10px 12px;
  border-radius: 11px;
  border: 1px solid rgba(255, 189, 240, 0.46);
  background: linear-gradient(140deg, rgba(38, 13, 60, 0.72), rgba(20, 8, 38, 0.72));
  color: #fff4ff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 10px 24px rgba(8, 3, 18, 0.32);
  animation: toast-in 240ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.toast.ok {
  border-color: rgba(142, 250, 215, 0.74);
  background: linear-gradient(140deg, rgba(14, 56, 44, 0.9), rgba(17, 34, 50, 0.92));
}

.toast.error {
  border-color: rgba(255, 163, 197, 0.82);
  background: linear-gradient(140deg, rgba(62, 18, 36, 0.9), rgba(37, 11, 28, 0.92));
}

@keyframes screen-fade-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes card-rise {
  from { opacity: 0; transform: translateY(8px) scale(0.995); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes shimmer-slide {
  0% { transform: translateX(-220%) skewX(-18deg); }
  100% { transform: translateX(420%) skewX(-18deg); }
}

@keyframes orb-pulse {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(1.18); opacity: 1; }
}

@keyframes bar-breathe {
  0%, 100% { opacity: 0.55; transform: scaleX(0.94); }
  50% { opacity: 1; transform: scaleX(1); }
}

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

@keyframes spin-loader {
  from { transform: translateY(-50%) rotate(0deg); }
  to { transform: translateY(-50%) rotate(360deg); }
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 760px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .shell {
    padding-top: calc(8px + env(safe-area-inset-top));
  }

  .panel {
    border-radius: 16px;
  }

  .hero {
    min-height: auto;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    padding: 12px;
  }

  .hero-actions {
    position: static;
    transform: none;
    width: 100%;
    justify-content: center;
  }

  .wheel-btn {
    min-height: 34px;
    padding: 0 12px;
    font-size: 10px;
  }

  .hero h1 {
    width: auto;
    font-size: clamp(22px, 8vw, 30px);
  }

  .country-head,
  .country-row {
    grid-template-columns: 1fr;
  }

  .country-head-ranks,
  .country-ranks {
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
  }

  .country-body {
    max-height: none;
  }
}

.screen::-webkit-scrollbar,
.country-body::-webkit-scrollbar {
  width: 8px;
}

.screen::-webkit-scrollbar-track,
.country-body::-webkit-scrollbar-track {
  background: rgba(20, 8, 33, 0.56);
  border-radius: 10px;
}

.screen::-webkit-scrollbar-thumb,
.country-body::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(255, 126, 226, 0.8), rgba(147, 104, 255, 0.84));
  border-radius: 10px;
  border: 1px solid rgba(255, 208, 246, 0.34);
}

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