:root {
  --gold: #e8c547;
  --gold-bright: #ffd700;
  --gold-dim: rgba(232, 197, 71, 0.12);
  --dark: #06060c;
  --card: rgba(14, 14, 24, 0.88);
  --card-hover: rgba(18, 18, 30, 0.95);
  --glass: rgba(12, 12, 22, 0.72);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-highlight: rgba(255, 255, 255, 0.04);
  --border: rgba(255, 255, 255, 0.06);
  --text: #f4f4fa;
  --text-soft: rgba(244, 244, 250, 0.72);
  --muted: #6b6b8a;
  --green: #4ade80;
  --blue: #60a5fa;
  --red: #f87171;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.35), 0 1px 0 var(--glass-highlight) inset;
  --shadow-glow: 0 0 40px rgba(232, 197, 71, 0.08);
  --font-display: 'Syne', system-ui, sans-serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
  --app-max: 520px;
}

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
  font-size: 15px;
}

body {
  background: var(--dark);
  color: var(--text);
  font-family: var(--font-body);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.bg-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 90% 55% at 50% -15%, rgba(200, 16, 46, 0.18), transparent 55%),
    radial-gradient(ellipse 50% 35% at 100% 10%, rgba(232, 197, 71, 0.1), transparent 50%),
    radial-gradient(ellipse 45% 30% at 0% 85%, rgba(96, 165, 250, 0.07), transparent 45%),
    radial-gradient(ellipse 80% 50% at 50% 100%, rgba(0, 0, 0, 0.4), transparent);
}

.app {
  position: relative;
  z-index: 1;
  max-width: var(--app-max);
  margin: 0 auto;
  min-height: 100vh;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  box-shadow: 0 0 80px rgba(0, 0, 0, 0.5);
}

.glass {
  background: var(--glass);
  backdrop-filter: blur(24px) saturate(1.2);
  -webkit-backdrop-filter: blur(24px) saturate(1.2);
  border-color: var(--glass-border);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* HEADER */
.header {
  text-align: center;
  padding: 32px 20px 24px;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

.header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0.5;
}

.hero-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  padding: 6px 14px;
  margin-bottom: 14px;
  border-radius: 999px;
  border: 1px solid rgba(232, 197, 71, 0.25);
  background: linear-gradient(135deg, rgba(232, 197, 71, 0.12), rgba(232, 197, 71, 0.04));
}

.trophy {
  font-size: 44px;
  display: block;
  margin-bottom: 8px;
  filter: drop-shadow(0 0 24px rgba(255, 215, 0, 0.5));
  animation: trophy-glow 3.5s ease-in-out infinite;
}

@keyframes trophy-glow {
  0%,
  100% {
    filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.45));
    transform: scale(1);
  }
  50% {
    filter: drop-shadow(0 0 36px rgba(255, 215, 0, 0.85));
    transform: scale(1.04);
  }
}

.title {
  font-family: var(--font-display);
  font-size: clamp(32px, 9vw, 54px);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  line-height: 0.95;
  background: linear-gradient(135deg, #fff 0%, var(--gold-bright) 35%, #ff8c42 65%, var(--gold) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  font-size: 11px;
  color: var(--muted);
  margin-top: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 500;
}

.countdown {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 12px;
  font-weight: 700;
  color: var(--gold-bright);
  letter-spacing: 0.04em;
  border: 1px solid rgba(232, 197, 71, 0.2);
  box-shadow: var(--shadow-glow);
}

.cd-dot {
  width: 7px;
  height: 7px;
  background: var(--gold-bright);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--gold-bright);
  animation: blink 1.4s ease-in-out infinite;
}

@keyframes blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.25;
  }
}

/* STATS */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--border);
}

.stat {
  text-align: center;
  padding: 16px 8px;
  position: relative;
}

.stat:not(:last-child)::after {
  content: '';
  position: absolute;
  right: 0;
  top: 20%;
  height: 60%;
  width: 1px;
  background: linear-gradient(180deg, transparent, var(--border), transparent);
}

.stat-n {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  color: var(--gold-bright);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.stat-l {
  font-size: 9px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-top: 5px;
  font-weight: 600;
}

/* FILTERS */
.filter-wrap {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.filters {
  display: flex;
  gap: 8px;
  padding: 12px 14px 10px;
  overflow-x: auto;
  scrollbar-width: none;
  mask-image: linear-gradient(90deg, transparent, #000 12px, #000 calc(100% - 12px), transparent);
}

.filters::-webkit-scrollbar {
  display: none;
}

.fb {
  flex-shrink: 0;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  letter-spacing: 0.04em;
  transition: color 0.2s, border-color 0.2s, background 0.2s, box-shadow 0.2s, transform 0.15s;
}

.fb:hover {
  color: var(--text-soft);
  border-color: rgba(255, 255, 255, 0.12);
}

.fb:active {
  transform: scale(0.96);
}

.fb.on {
  background: linear-gradient(135deg, var(--gold-bright), #e6a800);
  border-color: transparent;
  color: #0a0a0f;
  box-shadow: 0 4px 20px rgba(255, 215, 0, 0.25);
}

.search-wrap {
  padding: 4px 14px 12px;
}

.search-inner {
  position: relative;
  display: block;
}

.search-inner input {
  width: 100%;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px 12px 42px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.search-inner input:focus {
  border-color: rgba(232, 197, 71, 0.35);
  box-shadow: 0 0 0 3px rgba(232, 197, 71, 0.08);
  background: rgba(0, 0, 0, 0.45);
}

.search-inner input::placeholder {
  color: var(--muted);
}

.search-inner::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  opacity: 0.45;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white' stroke-width='2.5'%3E%3Cpath stroke-linecap='round' d='M21 21l-4.35-4.35M11 18a7 7 0 100-14 7 7 0 000 14z'/%3E%3C/svg%3E") center / contain no-repeat;
  color: var(--muted);
  pointer-events: none;
}

/* LOADER */
.loader {
  text-align: center;
  padding: 64px 24px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.loader-bar {
  width: 48px;
  height: 3px;
  margin: 0 auto 16px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--gold-bright), transparent);
  animation: shimmer 1.2s ease-in-out infinite;
}

@keyframes shimmer {
  0% {
    opacity: 0.3;
    transform: scaleX(0.6);
  }
  50% {
    opacity: 1;
    transform: scaleX(1);
  }
  100% {
    opacity: 0.3;
    transform: scaleX(0.6);
  }
}

.match-list {
  padding-bottom: 8px;
}

/* SECTION */
.section-hdr {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 32px 20px 12px;
}

.section-hdr::before,
.section-hdr::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(232, 197, 71, 0.25), transparent);
}

.section-hdr span {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.28em;
  color: var(--gold);
  text-transform: uppercase;
  white-space: nowrap;
}

/* DAY GROUP */
.day-group {
  padding: 0 14px;
  margin-top: 20px;
}

.day-hdr {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.day-txt {
  font-size: 10px;
  font-weight: 800;
  color: var(--gold);
  letter-spacing: 0.16em;
  flex: 1;
}

.day-cnt {
  font-size: 10px;
  font-weight: 800;
  color: #0a0a0f;
  background: linear-gradient(135deg, var(--gold-bright), #e6a800);
  border-radius: 8px;
  padding: 3px 8px;
  min-width: 22px;
  text-align: center;
}

.today-pill {
  font-size: 9px;
  font-weight: 800;
  color: var(--gold-bright);
  background: rgba(255, 215, 0, 0.1);
  border: 1px solid rgba(255, 215, 0, 0.28);
  border-radius: 8px;
  padding: 3px 8px;
  letter-spacing: 0.06em;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.1);
}

/* MATCH CARD */
.card {
  --stage: var(--gold);
  position: relative;
  background: var(--card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 14px 14px 14px 18px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--stage), color-mix(in srgb, var(--stage) 40%, transparent));
  border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.card:hover {
  background: var(--card-hover);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow-card), var(--shadow-glow);
}

.card.saved {
  border-color: rgba(232, 197, 71, 0.28);
}

.card.saved::before {
  width: 4px;
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
}

.card.today-card {
  border-color: rgba(232, 197, 71, 0.2);
  box-shadow: var(--shadow-card), 0 0 30px rgba(255, 215, 0, 0.06);
}

.match-num {
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--muted);
  opacity: 0.7;
}

.card-left {
  flex: 1;
  min-width: 0;
  padding-top: 2px;
}

.team-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 7px;
}

.team-row:last-of-type {
  margin-bottom: 0;
}

.fl {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  font-size: 18px;
  flex-shrink: 0;
  line-height: 1;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.tn {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  letter-spacing: -0.01em;
}

.tnwin {
  font-size: 14px;
  font-weight: 800;
  color: var(--gold-bright);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.venue {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  color: var(--muted);
  margin-top: 10px;
  padding-left: 42px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

.venue-icon {
  flex-shrink: 0;
  opacity: 0.7;
}

.card-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
  flex-shrink: 0;
  min-width: 86px;
  padding-top: 14px;
}

.time-chip {
  text-align: right;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: rgba(232, 197, 71, 0.08);
  border: 1px solid rgba(232, 197, 71, 0.15);
  min-width: 72px;
}

.kick-t {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  color: var(--gold-bright);
  letter-spacing: 0.02em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.kick-l {
  font-size: 8px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin-top: 3px;
  font-weight: 700;
}

.score-box {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
}

.score {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  color: var(--muted);
  line-height: 1;
  min-width: 16px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.score.win {
  color: var(--gold-bright);
}

.score-sep {
  font-size: 12px;
  color: var(--border);
  font-weight: 700;
}

.ft-tag {
  font-size: 8px;
  font-weight: 800;
  color: var(--green);
  background: rgba(74, 222, 128, 0.1);
  border: 1px solid rgba(74, 222, 128, 0.22);
  border-radius: 6px;
  padding: 3px 8px;
  letter-spacing: 0.12em;
  text-align: center;
}

.stage-tag {
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 9px;
  border-radius: 6px;
  border: 1px solid;
  white-space: nowrap;
  text-align: center;
  backdrop-filter: blur(8px);
}

.star {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  font-size: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  color: var(--muted);
  transition: transform 0.15s, color 0.15s, border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.star:hover {
  border-color: rgba(232, 197, 71, 0.3);
  background: rgba(232, 197, 71, 0.08);
}

.star:active {
  transform: scale(1.08);
}

.star.on {
  color: var(--gold-bright);
  border-color: rgba(232, 197, 71, 0.35);
  background: rgba(232, 197, 71, 0.12);
  box-shadow: 0 0 16px rgba(255, 215, 0, 0.15);
}

/* TOAST */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: linear-gradient(135deg, var(--gold-bright), #e6a800);
  color: #0a0a0f;
  font-weight: 800;
  font-size: 13px;
  padding: 12px 24px;
  border-radius: 999px;
  z-index: 100;
  transition: transform 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
  white-space: nowrap;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45), 0 0 30px rgba(255, 215, 0, 0.2);
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

.no-res {
  text-align: center;
  color: var(--muted);
  padding: 64px 24px;
  font-size: 14px;
  font-weight: 500;
}

/* FOOTER */
.footer {
  text-align: center;
  padding: 36px 20px 48px;
  border-top: 1px solid var(--border);
  margin-top: 16px;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.25));
}

.footer-mark {
  font-size: 28px;
  display: block;
  margin-bottom: 12px;
  filter: drop-shadow(0 0 12px rgba(255, 215, 0, 0.3));
}

.footer p {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.8;
  margin: 0;
}

.footer strong {
  color: var(--gold);
  font-weight: 700;
}

.footer-hint {
  margin-top: 4px !important;
  opacity: 0.85;
}

.footer-meta {
  margin-top: 12px !important;
  font-size: 10px !important;
  letter-spacing: 0.08em;
  opacity: 0.6;
}

@media (min-width: 480px) {
  .card {
    padding: 16px 16px 16px 20px;
  }

  .kick-t {
    font-size: 22px;
  }

  .score {
    font-size: 26px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .trophy,
  .cd-dot,
  .loader-bar {
    animation: none;
  }

  .card:hover {
    transform: none;
  }

  .toast {
    transition: none;
  }
}
