:root {
  --gold: #F4B400;
  --gold-light: #FFD54F;
  --green: #00C853;
  --blue: #0A3D91;
  --dark: #0a1628;
  --dark-2: #0e1f38;
  --card: #141f33;
  --card-2: #1a2840;
  --elevated: #1e2d47;
  --text: #f0f4fc;
  --muted: #8b9cb8;
  --line: rgba(244, 180, 0, 0.16);
  --line-strong: rgba(244, 180, 0, 0.32);
  --home: #00C853;
  --draw: #F4B400;
  --away: #4da3ff;
  --brand: var(--gold);
  --danger: #ff6b6b;
  --radius: 16px;
  --font-display: "Anton", Impact, sans-serif;
  --font-body: "Outfit", system-ui, sans-serif;
  --nav-h: calc(4.25rem + env(safe-area-inset-bottom, 0px));
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
}
body {
  font-family: var(--font-body);
  color: var(--text);
  background:
    radial-gradient(ellipse 100% 60% at 50% -5%, rgba(10, 61, 145, 0.35) 0%, transparent 55%),
    radial-gradient(ellipse 50% 35% at 100% 90%, rgba(244, 180, 0, 0.06) 0%, transparent 50%),
    linear-gradient(165deg, #0a1628 0%, #0e1f38 40%, #111827 100%);
  background-attachment: fixed;
}

#fx {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.35;
}

.shell {
  position: relative;
  z-index: 1;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-width: 480px;
  margin: 0 auto;
}

.side-rail { display: none; }

.app {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: var(--gold) rgba(255,255,255,0.06);
  padding: 14px 16px 18px;
}
.app::-webkit-scrollbar { width: 7px; }
.app::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.04);
  border-radius: 999px;
  margin: 6px 0;
}
.app::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--gold-light), var(--gold));
  border-radius: 999px;
}

.top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.eyebrow {
  margin: 0;
  letter-spacing: 0.22em;
  font-size: 0.66rem;
  color: var(--muted);
  font-weight: 700;
}

.brand {
  margin: 2px 0 0;
  font-family: var(--font-display);
  font-size: clamp(2.3rem, 9vw, 3.2rem);
  line-height: 0.9;
  letter-spacing: 0.02em;
  text-transform: lowercase;
  color: var(--text);
}
.brand span { color: var(--gold); }

.brand-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px 12px;
}
.brand-row .brand {
  margin: 0;
  flex: 0 0 auto;
}

.home-tz-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}
.home-tz-bar[hidden] { display: none !important; }
.home-tz-label {
  flex: 1;
  min-width: 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.35;
  text-align: left;
}
.home-tz-settings {
  appearance: none;
  flex-shrink: 0;
  border: 0;
  background: transparent;
  color: var(--gold);
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  padding: 4px 2px;
}

.header-wallet {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  max-width: 46vw;
  margin: 0;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font: 600 0.78rem var(--font-body);
  cursor: pointer;
}
.header-wallet.connected {
  color: var(--text);
  border-color: rgba(244, 180, 0, 0.35);
}
.header-wallet-ico {
  font-size: 1rem;
  line-height: 1;
  color: var(--gold);
}
.header-wallet-addr {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.side-brand .header-wallet {
  width: 100%;
  max-width: none;
  margin-top: 12px;
  justify-content: flex-start;
}

.dashboard-panel {
  display: grid;
  gap: 12px;
}
.dash-hero {
  text-align: center;
  padding: 22px 16px;
}
.dash-hero .balance {
  margin: 6px 0 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 10vw, 2.8rem);
  line-height: 1;
  color: var(--gold);
}
.dash-hero .balance small {
  font-family: var(--font-body);
  font-size: 0.45em;
  color: var(--muted);
  font-weight: 600;
}
.dash-connect-lead {
  margin: 8px 0 14px;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 600;
}
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.dash-stat {
  padding: 14px 12px;
}
.dash-stat-val {
  margin: 4px 0 0;
  font-size: 1rem;
  font-weight: 700;
  word-break: break-all;
}
.dash-stat-val small {
  font-size: 0.75em;
  color: var(--muted);
  font-weight: 600;
}
.dash-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.dash-go-match {
  width: 100%;
}

.hero-line {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}
.hero-line b { color: var(--gold); font-weight: 700; }

.view[hidden],
.match-list[hidden],
.standing-wrap[hidden] { display: none !important; }
.view-head { margin: 4px 0 14px; }
.view-head h2 {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 1.8rem;
  letter-spacing: 0.02em;
  color: var(--text);
}
.view-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  padding: 16px;
}

.settings-panel { display: grid; gap: 14px; }
.settings-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.settings-row .label,
.wallet-summary .label,
.section-label {
  margin: 0 0 4px;
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}
.settings-row .value {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  word-break: break-all;
}
.mono {
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8rem !important;
}
.mono.soft { color: var(--muted); margin: 8px 0 0; word-break: break-all; }

.lang-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.lang-switch .btn.active {
  background: linear-gradient(120deg, var(--gold-light), var(--gold));
  color: #1a1200;
  border-color: transparent;
}
.wallet-status-actions {
  margin-top: 8px;
}
.wallet-status-actions .btn {
  width: 100%;
  padding: 8px 10px;
  font-size: 0.78rem;
}
.wallet-connect-panel {
  display: grid;
  gap: 12px;
}
.wallet-connect-lead {
  margin: 0;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.4;
}
.wallet-connect {
  display: grid;
  gap: 10px;
}
.wallet-connect .btn.primary,
.wallet-connect .btn.ghost {
  width: 100%;
}
.wallet-connect .btn.ghost[disabled] {
  opacity: 0.72;
  cursor: not-allowed;
}
.wallet-alt-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 10px;
  color: var(--muted);
  font-size: 0.82rem;
}
.wallet-alt-links .linkish {
  border: 0;
  background: transparent;
  color: var(--gold-light);
  font: 600 0.82rem var(--font-body);
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.wallet-alt-links .sep {
  opacity: 0.5;
}
.wallet-next-step {
  margin: 0;
  text-align: center;
  font-size: 0.78rem !important;
}
.optional-box {
  border-top: 1px dashed var(--line);
  padding-top: 12px;
}
.rules-box {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.rules-box h3, .optional-box h3 {
  margin: 0 0 8px;
  font-size: 0.95rem;
  color: var(--gold-light);
}
.rules-box ul {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.55;
}

.wallet-summary .wallet-disconnect {
  margin-top: 14px;
  width: 100%;
}
.wallet-summary .wallet-back-tg,
.wallet-summary .wallet-open-tg {
  margin-top: 14px;
  width: 100%;
}
.wallet-bal-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 8px 0 4px;
}
.wallet-bal-row .label {
  margin: 0;
  font-size: 0.72rem;
}
.wallet-bal-val {
  margin: 2px 0 0;
  font-weight: 650;
  font-size: 0.9rem;
}
.wallet-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}
.wallet-actions .btn {
  width: 100%;
}
.wallet-sheet {
  margin-top: 12px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
  display: grid;
  gap: 8px;
}
.wallet-sheet[hidden] {
  display: none !important;
}
.wallet-sheet h3 {
  margin: 0;
  font-size: 0.95rem;
}
.wallet-recent-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
  gap: 8px;
}
.wallet-recent-head h3 {
  margin: 0;
  font-size: 0.9rem;
}
.wallet-recent-head .linkish {
  border: 0;
  background: transparent;
  color: var(--gold-light);
  font: 600 0.82rem var(--font-body);
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.wallet-recent .empty-panel.soft {
  padding: 16px 8px;
  opacity: 0.8;
}
.handoff-banner {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  z-index: 40;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(10, 18, 36, 0.96);
  box-shadow: var(--shadow);
  display: grid;
  gap: 10px;
}
.handoff-banner p {
  margin: 0;
  color: var(--text);
  font-size: 0.88rem;
  line-height: 1.4;
  font-weight: 600;
}
.handoff-banner .btn {
  width: 100%;
}
.wc-return-tip {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: end center;
  padding: 16px 16px calc(88px + env(safe-area-inset-bottom, 0px));
  background: transparent;
  pointer-events: none;
}
.wc-return-tip.elevated {
  z-index: 100000;
  background: rgba(4, 10, 20, 0.55);
  pointer-events: auto;
}
.wc-return-tip[hidden] { display: none !important; }
.wc-return-tip .card {
  width: min(100%, 420px);
  padding: 18px 16px 16px;
  border-radius: 18px;
  border: 1px solid var(--line-strong);
  background: rgba(10, 18, 36, 0.98);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  display: grid;
  gap: 10px;
  pointer-events: auto;
}
.wc-return-tip h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: 0.02em;
  color: var(--text);
}
.wc-return-tip p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
  font-weight: 500;
}
.wc-return-tip .btn {
  width: 100%;
  margin-top: 4px;
}
.wc-return-tip .tip-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}
.wc-return-tip .tip-actions .btn {
  margin-top: 0;
  flex: 1;
  width: auto;
}
.wc-return-tip .tip-actions [hidden] {
  display: none !important;
}
.wallet-summary .balance small {
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 600;
}

.empty-panel {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 28px 16px;
  text-align: center;
  color: var(--muted);
  background: rgba(20, 31, 51, 0.65);
  display: grid;
  gap: 12px;
  justify-items: center;
}

.btn, .cta {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--elevated);
  color: var(--text);
  border-radius: 999px;
  padding: 10px 14px;
  font: 600 0.86rem var(--font-body);
  cursor: pointer;
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
}
.btn:hover, .cta:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
}
.btn.primary, .cta.primary {
  background: linear-gradient(120deg, var(--gold-light), var(--gold));
  color: #1a1200;
  border-color: transparent;
  font-weight: 700;
}
.btn.ghost {
  background: transparent;
}

.league-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 0 0 10px;
  overflow: visible;
}
.league-tabs button {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  border-radius: 10px;
  padding: 9px 6px;
  font: 700 0.72rem/1.1 var(--font-body);
  letter-spacing: 0.02em;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.league-tabs button.active {
  color: #1a1200;
  background: var(--gold);
  border-color: transparent;
}

.home-mode {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0 0 12px;
}
.home-mode button {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  border-radius: 12px;
  padding: 10px 12px;
  font: 700 0.82rem var(--font-body);
  cursor: pointer;
}
.home-mode button.active {
  color: #1a1200;
  background: var(--gold);
  border-color: transparent;
}

.standing-wrap { margin-bottom: 8px; }
.standing-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: var(--card);
  box-shadow: var(--shadow);
}
.standing-head,
.standing-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1.6fr) repeat(5, 28px) 36px;
  gap: 4px;
  align-items: center;
  padding: 8px 10px;
  font-size: 0.72rem;
}
.standing-head {
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,0.02);
}
.standing-row {
  border-bottom: 1px solid rgba(255,255,255,0.04);
  color: var(--text);
}
.standing-row:last-child { border-bottom: 0; }
.standing-row .pos {
  font-weight: 800;
  color: var(--muted);
  border-left: 3px solid var(--qual, transparent);
  padding-left: 4px;
}
.standing-row .club {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-weight: 600;
}
.standing-row .club img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  flex: 0 0 auto;
}
.standing-row .club span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: default;
}
.standing-row .club[title]:hover span {
  color: var(--gold);
}
.standing-row .pts {
  font-weight: 800;
  color: var(--gold);
  text-align: right;
}
.standing-head span:nth-child(n+3),
.standing-row > span:nth-child(n+3) {
  text-align: center;
}
.standing-head span:last-child,
.standing-row .pts { text-align: right; }

.match-list { display: grid; gap: 14px; }
.match-toolbar {
  margin-bottom: 12px;
}
.match-search {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,0.04);
  color: var(--text);
  padding: 12px 14px;
  font: 500 0.92rem var(--font-body);
}
.match-search::placeholder {
  color: var(--muted);
}
.match-search:focus {
  outline: none;
  border-color: var(--line-strong);
}
.loading, .empty {
  padding: 28px 12px;
  text-align: center;
  color: var(--muted);
}

.match-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  background: linear-gradient(180deg, var(--card-2), var(--card));
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: rise .45s ease both;
}
.match-card::before {
  content: "";
  position: absolute;
  inset: auto -18% -42% auto;
  width: 170px;
  height: 170px;
  background: radial-gradient(circle, rgba(244, 180, 0, 0.14), transparent 70%);
  pointer-events: none;
}
.match-card:hover {
  border-color: var(--line-strong);
}
.match-head {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: inherit;
  cursor: pointer;
}
.match-meta-right {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.match-toggle {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.04);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.match-chevron {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-left: 0;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.18s ease;
}
.match-card.is-expanded .match-chevron {
  transform: rotate(-135deg);
  margin-top: 0;
}
.match-card.is-expanded .match-toggle {
  border-color: var(--line-strong);
  background: rgba(255,255,255,0.07);
}
.match-body[hidden] {
  display: none !important;
}
.match-card.is-collapsed .teams {
  margin-bottom: 0;
}
.match-card.is-collapsed .team-row .team-name {
  font-size: clamp(0.92rem, 3.6vw, 1.08rem);
}
.match-card.is-collapsed .team-row .team-logo {
  width: 26px;
  height: 26px;
}
.match-card.is-collapsed .team {
  font-size: clamp(0.92rem, 3.6vw, 1.1rem);
}
.match-card.is-collapsed .team-logo {
  width: 26px;
  height: 26px;
}
.match-card.is-expanded .match-body {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.match-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}
.league-chip {
  color: var(--gold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.teams {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}
.team-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.team-side {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}
.team-row .team-name {
  min-width: 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  font-family: var(--font-display);
  font-size: clamp(1rem, 3.8vw, 1.28rem);
  letter-spacing: 0.01em;
  line-height: 1.1;
  font-weight: 700;
}
.team-row.home .team-name { color: var(--home); }
.team-row.away .team-name { color: var(--away); }
.team-score {
  flex-shrink: 0;
  min-width: 1.4em;
  text-align: right;
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 4vw, 1.35rem);
  font-weight: 700;
  letter-spacing: 0.02em;
}
.team-row.home .team-score { color: var(--home); }
.team-row.away .team-score { color: var(--away); }
.team-score.is-empty {
  color: var(--muted);
  opacity: 0.45;
  font-size: 1rem;
}
.team {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 4.2vw, 1.4rem);
  letter-spacing: 0.01em;
  line-height: 1.05;
  color: var(--text);
}
.team.away {
  flex-direction: row-reverse;
  text-align: right;
}
.team-name {
  min-width: 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.team-logo {
  width: 34px;
  height: 34px;
  object-fit: contain;
  flex: 0 0 auto;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.35));
}
.team-row .team-logo {
  width: 30px;
  height: 30px;
}
.team-logo.placeholder {
  display: inline-block;
  border-radius: 50%;
  background: var(--elevated);
  border: 1px solid var(--line);
}
.vs {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}
.vs.score {
  color: var(--gold-light);
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: 0.04em;
}
.status-chip {
  margin-left: 6px;
  color: #7eb6ff;
  font-weight: 700;
}

.blood { display: grid; gap: 10px; }
.blood-row {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  gap: 10px;
  align-items: center;
}
.blood-row .tag {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.blood-row .tag.home { color: var(--home); }
.blood-row .tag.draw { color: var(--draw); }
.blood-row .tag.away { color: var(--away); }
.blood-track {
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.05);
}
.blood-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  transition: width 900ms cubic-bezier(.2,.8,.2,1);
  position: relative;
}
.blood-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.28), transparent);
  transform: translateX(-100%);
  animation: sheen 2.4s ease-in-out infinite;
}
@keyframes sheen {
  0%, 40% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
.blood-fill.home { background: linear-gradient(90deg, #009624, var(--home)); }
.blood-fill.draw { background: linear-gradient(90deg, #c49000, var(--draw)); }
.blood-fill.away { background: linear-gradient(90deg, #0A3D91, var(--away)); }
.blood-stat {
  min-width: 72px;
  text-align: right;
  font-size: 0.78rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  line-height: 1.15;
}
.blood-stat small {
  display: block;
  color: var(--muted);
  font-weight: 500;
  font-size: 0.72rem;
}

.match-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.match-actions button {
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
  color: var(--text);
  border-radius: 14px;
  padding: 12px 8px;
  font: 700 0.82rem var(--font-body);
  cursor: pointer;
}
.match-actions button[data-outcome="HOME"] {
  border-color: rgba(0, 200, 83, 0.42);
  color: var(--home);
  background: rgba(0, 200, 83, 0.1);
}
.match-actions button[data-outcome="DRAW"] {
  border-color: rgba(244, 180, 0, 0.42);
  color: var(--draw);
  background: rgba(244, 180, 0, 0.1);
}
.match-actions button[data-outcome="AWAY"] {
  border-color: rgba(77, 163, 255, 0.42);
  color: var(--away);
  background: rgba(77, 163, 255, 0.1);
}
.match-actions button[data-outcome="HOME"]:hover { filter: brightness(1.08); }
.match-actions button[data-outcome="DRAW"]:hover { filter: brightness(1.08); }
.match-actions button[data-outcome="AWAY"]:hover { filter: brightness(1.08); }
.match-actions.muted {
  grid-template-columns: 1fr;
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
}

/* Bottom nav sits OUTSIDE scroll area (flex sibling) */
.bottom-nav {
  position: relative;
  flex: 0 0 auto;
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  min-height: var(--nav-h);
  padding: 8px 6px var(--safe-bottom);
  background: rgba(8, 16, 30, 0.98);
  border-top: 1px solid var(--line-strong);
  box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(12px);
}
.bottom-nav-link {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 6px 4px 8px;
  font: 600 0.68rem var(--font-body);
  cursor: pointer;
}
.bottom-nav-link .ico { font-size: 1.15rem; line-height: 1; }
.bottom-nav-link.active {
  color: var(--gold);
}

.bet-dialog {
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  padding: 0;
  width: min(92vw, 420px);
  background: var(--card);
  color: var(--text);
  box-shadow: 0 30px 80px rgba(0,0,0,0.55);
}
.bet-dialog::backdrop { background: rgba(4, 10, 20, 0.72); backdrop-filter: blur(4px); }
.bet-sheet { padding: 16px; }
.bet-sheet header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.bet-sheet h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--text);
}
.bet-sheet .x {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.6rem;
  cursor: pointer;
}
.bet-sub { color: var(--muted); margin: 8px 0 14px; }
.outcome-pills { display: flex; gap: 8px; margin-bottom: 12px; }
.outcome-pills button {
  flex: 1;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--elevated);
  color: var(--text);
  padding: 10px;
  font-weight: 700;
  cursor: pointer;
}
.outcome-pills button.active.HOME { border-color: var(--home); color: var(--home); }
.outcome-pills button.active.DRAW { border-color: var(--draw); color: var(--draw); }
.outcome-pills button.active.AWAY { border-color: var(--away); color: var(--away); }
.amt { display: grid; gap: 6px; margin-bottom: 10px; font-size: 0.85rem; color: var(--muted); }
.amt-stepper {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--dark, rgba(255,255,255,0.04));
}
.amt-stepper .amt-btn {
  border: 0;
  background: rgba(255,255,255,0.06);
  color: var(--text);
  font: 700 1.25rem/1 var(--font-body);
  cursor: pointer;
  padding: 0;
  user-select: none;
}
.amt-stepper .amt-btn:active {
  background: rgba(255,255,255,0.12);
}
.amt-stepper input {
  width: 100%;
  border: 0;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--text);
  padding: 12px 8px;
  text-align: center;
  font: 600 1rem var(--font-body);
  -moz-appearance: textfield;
  appearance: textfield;
}
.amt-stepper input::-webkit-outer-spin-button,
.amt-stepper input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.hint { color: var(--muted); font-size: 0.78rem; margin: 0 0 12px; }
.bet-sheet .cta { width: 100%; border-radius: 14px; padding: 14px; }

/* Time zone picker (Windows-like offset list) */
.tz-dialog {
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  padding: 0;
  width: min(92vw, 420px);
  background: var(--card);
  color: var(--text);
  box-shadow: 0 30px 80px rgba(0,0,0,0.55);
}
.tz-dialog::backdrop { background: rgba(4, 10, 20, 0.72); backdrop-filter: blur(4px); }
.tz-sheet { padding: 16px; }
.tz-sheet header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.tz-sheet h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.45rem;
  color: var(--text);
}
.tz-sheet .x {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.6rem;
  cursor: pointer;
}
.tz-list {
  max-height: min(62vh, 460px);
  overflow: auto;
  padding: 2px 0;
}
.tz-item {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 10px 12px;
  cursor: pointer;
  border-radius: 12px;
  font: 700 0.86rem/1.25 var(--font-body);
}
.tz-item:hover {
  background: rgba(255,255,255,0.06);
}
.tz-item.active {
  background: linear-gradient(120deg, var(--gold-light), var(--gold));
  color: #1a1200;
}

@media (max-width: 420px) {
  .settings-row { grid-template-columns: 1fr; }
  .blood-row { grid-template-columns: 44px 1fr auto; }
}

@media (min-width: 960px) {
  html, body { overflow: auto; height: auto; }
  .shell {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    max-width: 1280px;
    margin: 0 auto;
    min-height: 100dvh;
    height: auto;
    overflow: visible;
  }

  .side-rail {
    display: flex;
    flex-direction: column;
    gap: 28px;
    position: sticky;
    top: 0;
    height: 100dvh;
    padding: 28px 20px;
    border-right: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(10, 22, 40, 0.98), rgba(14, 31, 56, 0.95));
  }
  .side-tag {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 0.85rem;
    line-height: 1.4;
  }
  .side-nav { display: grid; gap: 8px; }
  .side-nav-link {
    appearance: none;
    border: 1px solid transparent;
    background: transparent;
    color: var(--muted);
    border-radius: 14px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    font: 600 0.95rem var(--font-body);
    cursor: pointer;
    text-align: left;
  }
  .side-nav-link .ico { width: 1.2rem; text-align: center; }
  .side-nav-link.active,
  .side-nav-link:hover {
    color: var(--text);
    background: rgba(244, 180, 0, 0.1);
    border-color: var(--line);
  }
  .side-nav-link.active { color: var(--gold); }

  .bottom-nav { display: none; }
  .app-only { display: none; }

  .app {
    max-width: none;
    min-height: 0;
    height: auto;
    overflow: visible;
    padding: 28px 32px 40px;
  }

  .match-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #view-home .hero-line {
    max-width: 42rem;
    font-size: 1rem;
  }
}

/* WalletConnect modal ?? stay below Telegram Mini App header / safe area */
html.euro5-mini {
  --tg-safe-top: 56px;
  --tg-safe-bottom: 12px;
}
wcm-modal,
w3m-modal {
  z-index: 100001 !important;
  --wui-z-index: 100001;
}
html.euro5-mini wcm-modal,
html.euro5-mini w3m-modal {
  padding-top: calc(var(--tg-safe-top, 56px) + 8px) !important;
  padding-bottom: calc(var(--tg-safe-bottom, 12px) + 12px) !important;
  padding-left: 10px !important;
  padding-right: 10px !important;
  box-sizing: border-box !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  align-items: flex-start !important;
}

/* Custom WalletConnect QR ?? fits Telegram Mini App safe area */
.euro5-wc-qr {
  position: fixed;
  inset: 0;
  z-index: 100002;
  display: grid;
  place-items: start center;
  padding: calc(var(--tg-safe-top, 56px) + 12px) 14px calc(var(--tg-safe-bottom, 12px) + 18px);
  background: rgba(4, 10, 20, 0.72);
  box-sizing: border-box;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.euro5-wc-qr[hidden] { display: none !important; }
.euro5-wc-qr .sheet {
  width: min(100%, 400px);
  margin: 0 auto;
  padding: 14px 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--line-strong);
  background: rgba(10, 18, 36, 0.98);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  display: grid;
  gap: 10px;
}
.euro5-wc-qr header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.euro5-wc-qr h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--text);
}
.euro5-wc-qr .x {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}
.euro5-wc-qr .sub {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}
.euro5-wc-qr .qr-frame {
  display: grid;
  place-items: center;
  padding: 12px;
  border-radius: 14px;
  background: #fff;
}
.euro5-wc-qr canvas,
.euro5-wc-qr img {
  display: block;
  width: min(260px, 62vw);
  height: auto;
  max-width: 100%;
}
.euro5-wc-qr .tip-actions {
  display: flex;
  gap: 8px;
}
.euro5-wc-qr .tip-actions .btn {
  flex: 1;
}

.wallet-block {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 8px;
}
.wallet-block h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
}
.deposit-addr {
  word-break: break-all;
  font-size: 0.82rem;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
}
.dep-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.86rem;
}
.dep-row span:first-child {
  color: var(--muted, #9aa3b2);
}
.dep-qr {
  display: flex;
  justify-content: center;
  padding: 8px 0;
}
.dep-qr img {
  width: 160px;
  height: 160px;
  border-radius: 12px;
  background: #fff;
  padding: 8px;
}
.dep-tx-box {
  display: grid;
  gap: 8px;
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.dep-tx-input {
  width: 100%;
  box-sizing: border-box;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8rem;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.04);
  color: inherit;
}
.wallet-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.wallet-row-actions .btn,
.wallet-row-actions a.btn {
  flex: 1;
  text-align: center;
  text-decoration: none;
}
.withdraw-form {
  display: grid;
  gap: 8px;
}
.withdraw-form .amt-stepper {
  background: rgba(255,255,255,0.04);
}
.withdraw-form .btn {
  width: 100%;
}
.history-panel {
  display: grid;
  gap: 12px;
  padding-bottom: 28px;
}
.history-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 2px;
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
}
.history-tabs button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: 600 0.82rem var(--font-body);
  padding: 8px 6px;
  border-radius: 10px;
  cursor: pointer;
}
.history-tabs button.active {
  background: rgba(255,255,255,0.08);
  color: var(--text);
}
.hx-feed {
  display: grid;
  gap: 16px;
}
.hx-day-title {
  margin: 0 0 8px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.hx-stack {
  display: grid;
  gap: 8px;
}
.hx-card {
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
}
.hx-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.hx-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  color: var(--muted);
}
.hx-badge.dep { color: #7dcea0; background: rgba(125,206,160,0.12); }
.hx-badge.wd { color: #f0c674; background: rgba(240,198,116,0.12); }
.hx-badge.bet { color: #7eb6ff; background: rgba(126,182,255,0.12); }
.hx-badge.pay { color: #7dcea0; background: rgba(125,206,160,0.12); }
.hx-badge.ref { color: #c3b7ff; background: rgba(195,183,255,0.12); }
.hx-badge.lose { color: #f5a6a6; background: rgba(245,166,166,0.12); }
.hx-pill {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  color: var(--muted);
}
.hx-pill.confirmed,
.hx-pill.credited,
.hx-pill.settled,
.hx-pill.sent,
.hx-pill.approved { color: #7dcea0; }
.hx-pill.pending { color: #f0c674; }
.hx-pill.refunded,
.hx-pill.void,
.hx-pill.cancelled,
.hx-pill.rejected { color: #f5a6a6; }
.hx-title {
  font-size: 0.92rem;
  font-weight: 650;
  line-height: 1.25;
  margin-bottom: 4px;
}
.hx-bottom {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.78rem;
}
.hx-line {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hx-time {
  flex-shrink: 0;
  opacity: 0.85;
}
