/* ==========================================================================
   Display - the big screen
   Sizing is viewport-relative throughout so the same markup fills a laptop,
   a 4K panel or a projector without a single breakpoint tweak.
   ========================================================================== */

body {
  overflow: hidden;
  cursor: default;
}

/* Oswald is a variable face that defaults light; the scoreboard wants it heavy.
   Pin the big display-face elements to bold in one place (the clock overrides
   this with its own slightly-lighter 600 below). */
.team__name,
.scoreline,
.scoreline .num,
.event-hud__name,
.event-timer__value,
.takeover__name,
.takeover__tag,
.takeover__duration,
.goal-flash__word,
.goal-flash__team,
.goal-flash__mult,
.fulltime__title,
.fulltime__score,
.fulltime__winner,
.sticky-chip {
  font-weight: 700;
}

.stage {
  position: relative;
  z-index: 1;
  height: 100vh;
  height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: clamp(14px, 2.2vh, 30px) clamp(18px, 3vw, 54px);
}

/* ---------------------------------------------------------------- top bar */

/* The deck's navy header band, pulled full-bleed to the stage edges with a
   crimson hairline along the bottom (.rb-band supplies the colours). */
.stage__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: calc(-1 * clamp(14px, 2.2vh, 30px)) calc(-1 * clamp(18px, 3vw, 54px)) clamp(10px, 1.7vh, 24px);
  padding: clamp(8px, 1.4vh, 16px) clamp(18px, 3vw, 54px);
}

.stage__top-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stage__top .tools {
  display: flex;
  gap: 8px;
}

/* Crimson index tick before the wordmark - the deck's "Red Bull" red block. */
.rb-tick {
  width: 0.42em;
  height: 1.15em;
  flex: none;
  border-radius: 1px;
  background: var(--rb-red);
}

.stage__top .rb-lockup__title {
  font-size: clamp(0.95rem, 1.9vw, 1.55rem);
}

.stage__top .rb-lockup .rb-kicker {
  font-size: clamp(0.5rem, 0.86vw, 0.74rem);
  padding-left: 0.75em;
  margin-left: 0.15em;
  border-left: 1px solid rgba(255, 255, 255, 0.2);
}

.tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.5em 1em;
  border-radius: var(--r-pill);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cream);
  background: rgba(4, 10, 31, 0.66);
  border: 1px solid rgba(199, 202, 214, 0.2);
  backdrop-filter: blur(8px);
  transition: background 0.2s, border-color 0.2s, transform 0.15s var(--ease-out);
}

.tool-btn:hover {
  background: rgba(232, 17, 45, 0.85);
  border-color: transparent;
  transform: translateY(-1px);
}

.tool-btn[data-on='true'] {
  background: var(--rb-red);
  border-color: transparent;
}

/* Chrome fades out once the match is live so the board is all you see. */
.stage.is-immersed .stage__top {
  opacity: 0;
  transition: opacity 0.9s ease 1.4s;
}

.stage.is-immersed:hover .stage__top {
  opacity: 1;
  transition-delay: 0s;
}

/* ------------------------------------------------------------------ board */

/* All rows auto + align-content:center keeps the stack optically centred.
   A 1fr row here would strand the score row in a pocket of dead space. */
.stage__body {
  display: grid;
  grid-template-rows: repeat(3, auto);
  align-content: center;
  justify-items: center;
  gap: clamp(12px, 3vh, 42px);
  min-height: 0;
}

/* Brand mark, crowning the board. Sized for the stacked lockup (roughly 3:2);
   a wide single-line logo can take a smaller height without losing presence. */
.brand {
  height: clamp(58px, 11vh, 134px);
  display: grid;
  place-items: center;
  filter: drop-shadow(0 6px 22px rgba(0, 0, 0, 0.5));
}

.brand img,
.brand svg {
  height: 100%;
  width: auto;
  display: block;
}

/* --------------------------------------------------------------- the clock */

.clock-block {
  display: grid;
  justify-items: center;
  gap: 2px;
  position: relative;
}

.clock-label {
  font-size: clamp(0.6rem, 1.05vw, 0.92rem);
  font-weight: 800;
  letter-spacing: 0.42em;
  text-indent: 0.42em;
  text-transform: uppercase;
  color: var(--rb-silver-dim);
}

.clock-block[data-state='running'] .clock-label {
  color: var(--rb-red-glow);
}

.clock {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(4.4rem, 14.5vw, 15rem);
  line-height: 0.9;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
  color: var(--cream);
  text-shadow:
    0 0 62px rgba(120, 170, 255, 0.28),
    0 10px 34px rgba(0, 0, 0, 0.6);
  transition: color 0.3s;
}

/* Final ten seconds: the clock takes over the room. */
.clock-block.is-urgent .clock {
  color: var(--rb-red-glow);
  animation: clock-throb 1s ease-in-out infinite;
}

@keyframes clock-throb {
  0%,
  100% {
    transform: scale(1);
    text-shadow: 0 0 60px rgba(232, 17, 45, 0.4), 0 10px 34px rgba(0, 0, 0, 0.6);
  }
  50% {
    transform: scale(1.035);
    text-shadow: 0 0 110px rgba(232, 17, 45, 0.75), 0 10px 34px rgba(0, 0, 0, 0.6);
  }
}

.clock-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 26px;
}

.chip {
  padding: 0.34em 0.85em;
  border-radius: var(--r-pill);
  font-size: clamp(0.6rem, 0.95vw, 0.82rem);
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.chip--added {
  background: var(--rb-yellow);
  color: var(--ink);
}

.chip--status {
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(199, 202, 214, 0.24);
  color: var(--rb-silver);
}

.chip--golden {
  background: linear-gradient(100deg, var(--rb-yellow), #fff0b4);
  color: var(--ink);
  animation: golden-shine 2.4s ease-in-out infinite;
}

@keyframes golden-shine {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(255, 201, 6, 0.5);
  }
  50% {
    box-shadow: 0 0 26px 4px rgba(255, 201, 6, 0.55);
  }
}

/* Full-bleed match progress along the bottom edge - broadcast style. */
.progress {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 6px;
  z-index: 3;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}

.progress__fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--rb-red-deep), var(--rb-red-glow));
  box-shadow: 0 0 18px rgba(225, 18, 61, 0.7);
  transition: width 0.4s linear;
}

/* ------------------------------------------------------------- score row */

.score-row {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: clamp(12px, 3vw, 56px);
}

.team {
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.6vw, 24px);
  min-width: 0;
}

.team--a {
  justify-content: flex-end;
  text-align: right;
}

/* Reversed so the crest sits inboard next to the score, name to the outside.
   In row-reverse the main-axis start is the right edge, so flex-end packs left. */
.team--b {
  flex-direction: row-reverse;
  justify-content: flex-end;
  text-align: left;
}

.crest {
  width: clamp(52px, 7.4vw, 128px);
  height: auto;
  flex: none;
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.55));
}

.team__name {
  font-family: var(--font-display);
  font-size: clamp(1rem, 2.5vw, 3rem);
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--cream);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team__rule {
  height: 5px;
  width: clamp(40px, 8vw, 150px);
  margin-top: 0.5em;
  border-radius: var(--r-pill);
  background: var(--team-color, var(--rb-red));
  box-shadow: 0 0 18px var(--team-color, var(--rb-red));
}

.team--a .team__rule {
  margin-left: auto;
}

.scoreline {
  display: flex;
  align-items: center;
  gap: clamp(8px, 1.6vw, 26px);
  font-family: var(--font-display);
  font-size: clamp(3.6rem, 11.5vw, 12rem);
  line-height: 0.84;
  font-variant-numeric: tabular-nums;
}

.scoreline .num {
  color: var(--cream);
  min-width: 1.1ch;
  text-align: center;
  text-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  transition: transform 0.28s var(--ease-slam), color 0.28s;
}

.scoreline .num.just-scored {
  animation: score-pop 0.7s var(--ease-slam);
  color: var(--rb-red-glow);
}

@keyframes score-pop {
  0% {
    transform: scale(1);
  }
  35% {
    transform: scale(1.36);
  }
  100% {
    transform: scale(1);
  }
}

.scoreline .dash {
  color: var(--rb-silver-dim);
  font-size: 0.5em;
  transform: translateY(-0.12em);
}

/* --------------------------------------------------------- active event HUD */

.stage__bottom {
  display: grid;
  place-items: center;
  min-height: clamp(76px, 13vh, 132px);
}

/* Active-event bug, styled as the deck's INFOLAYER / lower-third: a squared
   navy panel with a crimson (or event-tone) accent bar down the leading edge. */
.event-hud {
  --tone: var(--rb-red);
  display: none;
  align-items: center;
  gap: clamp(12px, 1.8vw, 26px);
  padding: clamp(8px, 1.2vh, 14px) clamp(20px, 2.4vw, 34px) clamp(8px, 1.2vh, 14px) clamp(14px, 1.8vw, 24px);
  border-radius: 5px;
  background: linear-gradient(100deg, rgba(10, 20, 40, 0.96), rgba(16, 34, 63, 0.9));
  border: 1px solid rgba(199, 202, 214, 0.14);
  border-left: 6px solid var(--tone);
  box-shadow: 0 0 46px -10px var(--tone), 0 18px 44px rgba(0, 0, 0, 0.5);
  max-width: min(94vw, 1180px);
}

.event-hud__kicker {
  font-size: clamp(0.5rem, 0.86vw, 0.76rem);
  color: var(--tone);
  margin-bottom: 0.3em;
}

.event-hud.is-visible {
  display: flex;
  animation: hud-in 0.5s var(--ease-slam) both;
}

@keyframes hud-in {
  from {
    transform: translateY(36px) scale(0.9);
    opacity: 0;
  }
}

.event-hud__badge {
  width: clamp(56px, 7vw, 92px);
  flex: none;
}

.event-hud__badge svg {
  width: 100%;
  height: auto;
  display: block;
}

.event-hud__text {
  min-width: 0;
}

.event-hud__name {
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 2.2vw, 2.3rem);
  line-height: 1;
  color: var(--cream);
  white-space: nowrap;
}

.event-hud__tag {
  font-size: clamp(0.66rem, 1.05vw, 0.95rem);
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--rb-silver);
  margin-top: 0.35em;
}

/* Countdown ring */
.event-timer {
  position: relative;
  width: clamp(58px, 7vw, 96px);
  height: clamp(58px, 7vw, 96px);
  flex: none;
  display: grid;
  place-items: center;
}

.event-timer svg {
  position: absolute;
  inset: 0;
  transform: rotate(-90deg);
}

.event-timer .track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.13);
  stroke-width: 7;
}

.event-timer .bar {
  fill: none;
  stroke: var(--tone);
  stroke-width: 7;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.25s linear, stroke 0.3s;
  filter: drop-shadow(0 0 6px var(--tone));
}

.event-timer__value {
  font-family: var(--font-display);
  font-size: clamp(1rem, 1.9vw, 1.9rem);
  font-variant-numeric: tabular-nums;
  color: var(--cream);
  z-index: 1;
}

.event-hud.is-expiring {
  animation: hud-alarm 0.6s ease-in-out infinite;
}

@keyframes hud-alarm {
  0%,
  100% {
    box-shadow: 0 0 46px -6px var(--tone), 0 18px 44px rgba(0, 0, 0, 0.5);
  }
  50% {
    box-shadow: 0 0 76px 4px var(--tone), 0 18px 44px rgba(0, 0, 0, 0.5);
  }
}

/* Persistent "armed" chips for until-end events like Golden Goal */
.sticky-rail {
  position: absolute;
  bottom: clamp(10px, 2vh, 22px);
  right: clamp(18px, 3vw, 54px);
  display: flex;
  gap: 10px;
  z-index: 2;
}

.sticky-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 6px;
  border-radius: var(--r-pill);
  background: rgba(4, 10, 31, 0.8);
  border: 1px solid var(--rb-yellow);
  font-family: var(--font-display);
  font-size: clamp(0.65rem, 1vw, 0.95rem);
  color: var(--rb-yellow);
  letter-spacing: 0.04em;
}

.sticky-chip svg {
  width: clamp(26px, 2.6vw, 38px);
  height: auto;
}

/* ==========================================================================
   Event takeover - the "pew pew" moment
   ========================================================================== */

.takeover {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
}

.takeover.is-active {
  opacity: 1;
  visibility: visible;
}

/* Near-opaque: the takeover has to own the screen, not float over a busy board. */
.takeover__scrim {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 46%, rgba(5, 10, 28, 0.955) 0%, rgba(1, 2, 8, 0.99) 68%);
  opacity: 0;
}

.takeover.is-active .takeover__scrim {
  animation: scrim-cycle var(--takeover-ms, 3400ms) ease-out both;
}

@keyframes scrim-cycle {
  0% {
    opacity: 0;
  }
  6% {
    opacity: 1;
  }
  88% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

.takeover__lines {
  position: absolute;
  width: 150vmax;
  height: 150vmax;
  color: var(--tone, var(--rb-red));
  opacity: 0;
}

.takeover__lines svg {
  width: 100%;
  height: 100%;
  display: block;
}

.takeover.is-active .takeover__lines {
  animation: lines-cycle var(--takeover-ms, 3400ms) ease-out both;
}

@keyframes lines-cycle {
  0% {
    opacity: 0;
    transform: scale(0.3) rotate(-24deg);
  }
  10% {
    opacity: 0.85;
    transform: scale(1.02) rotate(0deg);
  }
  26% {
    opacity: 0.34;
    transform: scale(1) rotate(3deg);
  }
  88% {
    opacity: 0.24;
    transform: scale(1.06) rotate(12deg);
  }
  100% {
    opacity: 0;
    transform: scale(1.2) rotate(18deg);
  }
}

/* Expanding impact ring at the moment of the slam */
.takeover__ring {
  position: absolute;
  width: 34vmin;
  height: 34vmin;
  border-radius: 50%;
  border: 10px solid var(--tone, var(--rb-red));
  opacity: 0;
}

.takeover.is-active .takeover__ring {
  animation: ring-blast 900ms 240ms ease-out both;
}

@keyframes ring-blast {
  0% {
    transform: scale(0.2);
    opacity: 0.95;
    border-width: 22px;
  }
  100% {
    transform: scale(4.2);
    opacity: 0;
    border-width: 1px;
  }
}

.takeover__stack {
  position: relative;
  display: grid;
  justify-items: center;
  gap: clamp(8px, 1.6vh, 22px);
}

.takeover.is-active .takeover__stack {
  animation: stack-shake 620ms 200ms ease-out both;
}

@keyframes stack-shake {
  0%,
  100% {
    transform: translate(0, 0);
  }
  12% {
    transform: translate(-13px, 7px);
  }
  26% {
    transform: translate(11px, -8px);
  }
  42% {
    transform: translate(-8px, -5px);
  }
  60% {
    transform: translate(6px, 4px);
  }
  80% {
    transform: translate(-3px, 2px);
  }
}

.takeover__badge {
  width: clamp(260px, 44vmin, 580px);
  filter: drop-shadow(0 26px 54px rgba(0, 0, 0, 0.72));
}

.takeover__badge svg {
  width: 100%;
  height: auto;
  display: block;
}

.takeover.is-active .takeover__badge {
  animation: badge-slam var(--takeover-ms, 3400ms) both;
}

@keyframes badge-slam {
  0% {
    transform: scale(3.4) rotate(-24deg);
    opacity: 0;
    filter: blur(18px) drop-shadow(0 26px 54px rgba(0, 0, 0, 0.72));
  }
  7% {
    transform: scale(0.84) rotate(5deg);
    opacity: 1;
    filter: blur(0) drop-shadow(0 26px 54px rgba(0, 0, 0, 0.72));
  }
  11% {
    transform: scale(1.09) rotate(-3deg);
  }
  15% {
    transform: scale(0.97) rotate(1.5deg);
  }
  19% {
    transform: scale(1) rotate(0deg);
  }
  84% {
    transform: scale(1) rotate(0deg) translateY(0);
    opacity: 1;
  }
  100% {
    transform: scale(0.42) rotate(-6deg) translateY(38vh);
    opacity: 0;
  }
}

.takeover__banner {
  display: grid;
  justify-items: center;
  gap: 6px;
  opacity: 0;
}

.takeover.is-active .takeover__banner {
  animation: banner-cycle var(--takeover-ms, 3400ms) both;
}

@keyframes banner-cycle {
  0%,
  8% {
    opacity: 0;
    transform: translateY(34px);
  }
  16% {
    opacity: 1;
    transform: translateY(0);
  }
  84% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(20px);
  }
}

.takeover__kicker {
  font-size: clamp(0.66rem, 1.15vw, 1rem);
  font-weight: 800;
  letter-spacing: 0.5em;
  text-indent: 0.5em;
  text-transform: uppercase;
  color: var(--tone, var(--rb-red));
}

.takeover__tag {
  font-family: var(--font-display);
  font-size: clamp(0.95rem, 2.1vw, 2rem);
  color: var(--cream);
  text-align: center;
  max-width: 34ch;
  line-height: 1.12;
  text-wrap: balance;
}

.takeover__duration {
  margin-top: 4px;
  padding: 0.36em 1.1em;
  border-radius: var(--r-pill);
  background: var(--tone, var(--rb-red));
  color: #fff;
  font-family: var(--font-display);
  font-size: clamp(0.85rem, 1.7vw, 1.6rem);
  letter-spacing: 0.05em;
}

/* ==========================================================================
   Goal flash
   ========================================================================== */

.goal-flash {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
}

.goal-flash.is-active {
  opacity: 1;
  visibility: visible;
  animation: goal-cycle 2200ms ease-out both;
}

@keyframes goal-cycle {
  0% {
    opacity: 0;
  }
  5% {
    opacity: 1;
  }
  82% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

/* Knock the board back so the celebration reads cleanly on top of it. */
.goal-flash__scrim {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(4, 8, 24, 0.86) 0%, rgba(1, 2, 8, 0.96) 70%);
}

.goal-flash__wash {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, var(--team-color, var(--rb-red)) 0%, transparent 62%);
  opacity: 0.42;
  mix-blend-mode: screen;
}

.goal-flash__stack {
  position: relative;
  display: grid;
  justify-items: center;
  gap: clamp(6px, 1.4vh, 18px);
  text-align: center;
}

.goal-flash.is-active .goal-flash__wash {
  animation: wash-pulse 2200ms ease-out both;
}

@keyframes wash-pulse {
  0% {
    transform: scale(0.4);
    opacity: 0.9;
  }
  40% {
    transform: scale(1.1);
    opacity: 0.4;
  }
  100% {
    transform: scale(1.4);
    opacity: 0;
  }
}

.goal-flash__word {
  position: relative;
  font-family: var(--font-display);
  font-size: clamp(4rem, 17vw, 17rem);
  line-height: 0.85;
  color: var(--cream);
  letter-spacing: -0.02em;
  -webkit-text-stroke: clamp(3px, 0.6vw, 8px) var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 18px 50px rgba(0, 0, 0, 0.65);
}

.goal-flash.is-active .goal-flash__word {
  animation: goal-word 2200ms var(--ease-slam) both;
}

@keyframes goal-word {
  0% {
    transform: scale(2.6) rotate(-9deg);
    opacity: 0;
  }
  12% {
    transform: scale(1) rotate(-3deg);
    opacity: 1;
  }
  18% {
    transform: scale(1.08) rotate(-2deg);
  }
  24% {
    transform: scale(1) rotate(-3deg);
  }
  82% {
    transform: scale(1) rotate(-3deg);
    opacity: 1;
  }
  100% {
    transform: scale(1.35);
    opacity: 0;
  }
}

.goal-flash__team {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 3vw, 3rem);
  color: var(--team-color, var(--rb-red));
}

.goal-flash__mult {
  padding: 0.3em 1em;
  border-radius: var(--r-pill);
  background: var(--rb-yellow);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(0.9rem, 2vw, 1.8rem);
}

/* ==========================================================================
   Full time
   ========================================================================== */

.fulltime {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 50% 40%, rgba(10, 31, 92, 0.95), rgba(2, 4, 12, 0.985));
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.6s ease, visibility 0.6s;
}

.fulltime.is-active {
  opacity: 1;
  visibility: visible;
}

.fulltime__inner {
  display: grid;
  justify-items: center;
  gap: clamp(10px, 2vh, 26px);
  text-align: center;
  transform: translateY(30px);
  opacity: 0;
}

.fulltime.is-active .fulltime__inner {
  animation: ft-in 0.9s 0.15s var(--ease-out) both;
}

@keyframes ft-in {
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.fulltime__kicker {
  font-size: clamp(0.7rem, 1.2vw, 1.05rem);
  font-weight: 800;
  letter-spacing: 0.56em;
  text-indent: 0.56em;
  text-transform: uppercase;
  color: var(--rb-red-glow);
}

.fulltime__title {
  font-family: var(--font-display);
  font-size: clamp(3rem, 11vw, 11rem);
  line-height: 0.86;
  color: var(--cream);
}

.fulltime__score {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 8vw, 8rem);
  line-height: 1;
  color: var(--cream);
  font-variant-numeric: tabular-nums;
}

.fulltime__winner {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 3.2vw, 3.2rem);
  color: var(--cream);
}

.fulltime__rule {
  width: clamp(120px, 22vw, 360px);
  height: 5px;
  border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--rb-red-deep), var(--rb-red-glow));
}

/* Sound gate, matching the reference board's affordance */
.sound-gate {
  position: fixed;
  z-index: 95;
  top: clamp(14px, 2.2vh, 30px);
  right: clamp(18px, 3vw, 54px);
}

/* ==========================================================================
   Additions: image badges, flag crests, takeover name, RTL, phone
   ========================================================================== */

/* The crest is the national flag, so unlike the bull it cannot be tinted or
   mirrored - the inscription has to read the right way round and stay white on
   green. The team's colour is carried by the ring instead, drawn as a spread
   box-shadow so it costs no layout and the flag keeps an exact 3:2. */
.crest .flag-mark {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  border-radius: 3px;
  overflow: hidden;
  box-shadow: 0 0 0 3px var(--team, #e6002d);
}

.crest .flag-mark img {
  display: block;
  width: 100%;
  height: 100%;
}

/* Event name shown as its own title on the takeover (no longer baked into art). */
.takeover__name {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 5.5vw, 5rem);
  line-height: 1;
  color: var(--cream);
  letter-spacing: -0.01em;
  text-align: center;
  text-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
}

/* --------------------------------------------------------------- language */

.lang-tag { font-weight: 800; letter-spacing: 0.04em; }

/* Arabic: the display font has no Arabic glyphs, so hand the headline type to a
   face that does, and let the clock/score keep the heavy Latin face. */
:root.is-rtl {
  --font-display: 'Tahoma', 'Segoe UI', 'Arial', sans-serif;
}
:root.is-rtl .clock,
:root.is-rtl .scoreline {
  font-family: 'Oswald', 'Arial Narrow', sans-serif; /* digits stay condensed Latin */
}

/* Mirror the two team blocks under RTL so team A still sits on the left visually
   but its text hugs the centre correctly. Flex + logical order handles most of
   it; these keep the crest/name pairing tidy. */
:root.is-rtl .team--a { flex-direction: row; }
:root.is-rtl .team--b { flex-direction: row-reverse; }

/* --------------------------------------------------------------- phone */

@media (max-width: 720px), (max-aspect-ratio: 3/4) {
  .stage { padding: 10px 12px; }
  .stage__top { gap: 8px; margin: -10px -12px 10px; padding: 7px 12px; }
  .stage__top-right { gap: 6px; }
  .stage__top .rb-lockup .rb-kicker { display: none; }
  .tool-btn { padding: 0.4em 0.7em; font-size: 0.62rem; }

  /* Stack: brand, clock, then the score row big and centred. */
  .stage__body { gap: clamp(8px, 2vh, 18px); }
  .score-row { gap: clamp(6px, 2vw, 20px); }
  .team__name { font-size: clamp(0.8rem, 3.4vw, 1.4rem); }
  .crest { width: clamp(42px, 12vw, 70px); }
  .scoreline { font-size: clamp(3rem, 18vw, 6rem); }
  .clock { font-size: clamp(3.6rem, 22vw, 8rem); }

  .event-hud { gap: 10px; padding: 8px 12px; }
  .event-hud__name { font-size: clamp(0.9rem, 4vw, 1.4rem); }
  .event-hud__tag { display: none; }

  .takeover__badge { width: clamp(180px, 52vw, 300px); }
  .takeover__name { font-size: clamp(1.5rem, 8vw, 3rem); }
}
