/* ===========================================================
   Upcoming Matches — "Match Ticket" design
   Scoped entirely under .upcoming-matches-page so nothing here
   leaks into the shared header/footer/ticker on this page, or
   into any other page. Brand colors reuse the theme's existing
   tokens (--plum, --accent-magenta, --accent-blue) from style.css;
   only the ticket-paper tones are new, page-local variables.
   =========================================================== */

.upcoming-matches-page {
  --paper: #f6f1e7;
  --paper-2: #efe7d8;
  --ink: #1c1626;
  --ink-soft: #5b5468;
  --ticket-gold: #ffb703;

  position: relative;
  min-height: calc(100vh - 72px);
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  font-family: var(--font-body);
}

.upcoming-matches-page .floodlights {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 60% 40% at 15% -5%, rgba(169,0,199,.35), transparent 60%),
    radial-gradient(ellipse 60% 40% at 85% -5%, rgba(0,210,255,.22), transparent 60%),
    radial-gradient(ellipse 80% 50% at 50% 110%, rgba(108,0,133,.30), transparent 60%);
}
.upcoming-matches-page .crowd-noise {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .06;
  background-image: radial-gradient(circle, #fff 1px, transparent 1px);
  background-size: 14px 14px;
}

.upcoming-matches-page .brand-row {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 28px 20px 4px;
  font-family: var(--font-heading); font-weight: 700; font-size: .72rem;
  letter-spacing: .3em; text-transform: uppercase; color: var(--accent-blue);
}
.upcoming-matches-page .brand-row .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent-magenta); }

.upcoming-matches-page .headline { position: relative; z-index: 2; text-align: center; padding: 8px 20px 30px; }
.upcoming-matches-page .headline h1 {
  font-family: var(--font-heading); font-weight: 800;
  font-size: clamp(1.5rem, 4vw, 2.3rem);
  letter-spacing: -.02em;
  background: linear-gradient(90deg, #fff, var(--accent-blue) 60%, var(--accent-magenta));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.upcoming-matches-page .headline p { margin-top: 8px; font-size: .85rem; color: rgba(255,255,255,.55); }

.upcoming-matches-page .stage {
  position: relative; z-index: 2;
  flex: 1;
  display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: center;
  gap: 34px 28px;
  padding: 10px 20px 60px;
}

.upcoming-matches-page .no-tickets-msg {
  max-width: 640px;
  text-align: center;
  padding: 40px 30px;
  color: rgba(255,255,255,.65);
  font-size: .9rem;
  line-height: 1.7;
  background: rgba(255,255,255,.03);
  border: 1px dashed rgba(169,0,199,.4);
  border-radius: 14px;
}
.upcoming-matches-page .no-tickets-msg strong { color: #fff; }

.upcoming-matches-page .ticket-wrap {
  filter: drop-shadow(0 24px 46px rgba(0,0,0,.5));
  animation: mbsn-ticket-settle .7s cubic-bezier(.2,.8,.2,1) both;
}
.upcoming-matches-page .ticket-wrap:nth-child(odd) { animation-delay: .05s; }
.upcoming-matches-page .ticket-wrap:nth-child(even) { animation-delay: .15s; }
@keyframes mbsn-ticket-settle {
  from { transform: translateY(24px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.upcoming-matches-page .ticket {
  display: flex;
  background: var(--paper);
  color: var(--ink);
  border-radius: 14px;
  overflow: hidden;
  width: min(88vw, 500px);
  transform: rotate(-1deg);
}
.upcoming-matches-page .ticket-wrap:nth-child(even) .ticket { transform: rotate(1deg); }

.upcoming-matches-page .ticket-stub {
  flex: 0 0 118px;
  background: var(--paper-2);
  padding: 18px 14px;
  display: flex; flex-direction: column; justify-content: space-between;
}
.upcoming-matches-page .stub-top .eyebrow {
  font-family: 'JetBrains Mono', monospace; font-size: .56rem; font-weight: 700;
  letter-spacing: .12em; color: var(--ink-soft); text-transform: uppercase;
}
.upcoming-matches-page .stub-top .comp {
  font-family: var(--font-heading); font-weight: 700; font-size: .85rem;
  margin-top: 6px; line-height: 1.2;
}
.upcoming-matches-page .stub-mid { margin-top: 12px; }
.upcoming-matches-page .stub-mid .row { font-size: .62rem; color: var(--ink-soft); margin-bottom: 5px; }
.upcoming-matches-page .stub-mid .row b { display: block; color: var(--ink); font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: .66rem; }
.upcoming-matches-page .stub-barcode {
  margin-top: 10px;
  height: 22px;
  background: repeating-linear-gradient(90deg, var(--ink) 0 2px, transparent 2px 5px, var(--ink) 5px 6px, transparent 6px 10px);
  opacity: .75;
}

.upcoming-matches-page .tear {
  flex: 0 0 0;
  position: relative;
  border-left: 2px dashed rgba(28,22,38,.28);
}
.upcoming-matches-page .tear::before,
.upcoming-matches-page .tear::after {
  content: '';
  position: absolute; left: 50%; transform: translateX(-50%);
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--bg-page);
}
.upcoming-matches-page .tear::before { top: -10px; }
.upcoming-matches-page .tear::after { bottom: -10px; }

.upcoming-matches-page .ticket-main { flex: 1; padding: 18px 18px 20px; position: relative; min-width: 0; }

.upcoming-matches-page .status-pill {
  position: absolute; top: 14px; right: 16px;
  font-family: var(--font-heading); font-weight: 700; font-size: .56rem;
  letter-spacing: .1em; text-transform: uppercase;
  padding: 4px 9px; border-radius: 20px;
  color: #fff; white-space: nowrap;
}
.upcoming-matches-page .status-pill.next { background: var(--plum); }
.upcoming-matches-page .status-pill.upcoming { background: #3a7d4f; }
.upcoming-matches-page .status-pill.live { background: var(--accent-magenta); animation: mbsn-live-pulse 1.6s ease-in-out infinite; }
@keyframes mbsn-live-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .6; } }

.upcoming-matches-page .teams-row { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 16px; }
.upcoming-matches-page .team { display: flex; flex-direction: column; align-items: center; gap: 5px; width: 98px; min-width: 0; }
.upcoming-matches-page .crest {
  width: 46px; height: 46px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-heading); font-weight: 800; font-size: .95rem; color: #fff;
  box-shadow: 0 4px 10px rgba(0,0,0,.3), inset 0 0 0 2px rgba(255,255,255,.25);
}
.upcoming-matches-page .crest.mbsg { background: linear-gradient(145deg, #8B1E1E 48%, #1A6B2F 48%); }
.upcoming-matches-page .team-name { font-family: var(--font-heading); font-weight: 700; font-size: .68rem; text-align: center; line-height: 1.2; }
.upcoming-matches-page .team-tag { font-family: 'JetBrains Mono', monospace; font-size: .52rem; color: var(--ink-soft); letter-spacing: .08em; text-transform: uppercase; }

.upcoming-matches-page .vs-badge {
  width: 30px; height: 30px; border-radius: 6px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--ticket-gold), #d68f00);
  transform: rotate(45deg);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 3px var(--paper), 0 4px 10px rgba(0,0,0,.2);
}
.upcoming-matches-page .vs-badge span { transform: rotate(-45deg); font-family: var(--font-heading); font-weight: 800; font-size: .58rem; color: #3a2400; }

.upcoming-matches-page .meta-line {
  display: flex; justify-content: center; gap: 12px; flex-wrap: wrap;
  margin: 14px 0 2px; font-size: .66rem; color: var(--ink-soft);
}
.upcoming-matches-page .meta-line b { color: var(--ink); }

.upcoming-matches-page .live-line {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  margin-top: 16px; font-size: .72rem; font-weight: 600; color: var(--accent-magenta);
}
.upcoming-matches-page .live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent-magenta); animation: mbsn-live-pulse 1.2s ease-in-out infinite; }

.upcoming-matches-page .flap-row { display: flex; align-items: flex-start; justify-content: center; gap: 6px; margin-top: 16px; }
.upcoming-matches-page .flap-unit { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.upcoming-matches-page .flap {
  position: relative;
  width: 38px; height: 46px;
  background: var(--ink);
  border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.06);
}
.upcoming-matches-page .flap span { font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: 1.15rem; color: var(--ticket-gold); }
.upcoming-matches-page .flap::after {
  content: ''; position: absolute; left: 3px; right: 3px; top: 50%; height: 2px;
  background: rgba(0,0,0,.55); transform: translateY(-1px); pointer-events: none;
}
.upcoming-matches-page .flap.flipping span { animation: mbsn-digit-pulse .3s ease; }
@keyframes mbsn-digit-pulse {
  0% { transform: scaleY(.4); opacity: .3; }
  60% { transform: scaleY(1.08); opacity: 1; }
  100% { transform: scaleY(1); opacity: 1; }
}
.upcoming-matches-page .flap-label { font-family: var(--font-heading); font-size: .52rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); }
.upcoming-matches-page .flap-sep { align-self: center; font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: 1rem; color: var(--ink-soft); opacity: .5; padding-top: 10px; }

@media (max-width: 480px) {
  .upcoming-matches-page .ticket { width: 92vw; }
  .upcoming-matches-page .team { width: 84px; }
  .upcoming-matches-page .flap { width: 32px; height: 40px; }
  .upcoming-matches-page .flap span { font-size: 1rem; }
}
