/* Elimination stadium — styled after classic two-sided 1v1 brackets */

.elim-page .results-main {
  max-width: none;
  padding-left: 0;
  padding-right: 0;
}

.elim-page .results-hero,
.elim-page .results-status,
.elim-page .results-event-header,
.elim-page .bracket-controls {
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

/* ── Fullscreen presentation (body.elim-fs-active) ──
   Fullscreen the document and hide site chrome so the bracket
   owns the entire viewport. */

body.elim-fs-active {
  overflow: hidden !important;
  height: 100dvh !important;
  max-height: 100dvh !important;
  flex-direction: column !important;
}

body.elim-fs-active .nav-header,
body.elim-fs-active .results-suite-nav,
body.elim-fs-active .results-hero,
body.elim-fs-active .results-status,
body.elim-fs-active .results-event-header {
  display: none !important;
}

body.elim-fs-active .results-main {
  max-width: none !important;
  width: 100% !important;
  flex: 1 1 auto !important;
  margin: 0 !important;
  padding: 0 !important;
  min-height: 0 !important;
  height: 100% !important;
}

body.elim-fs-active #event-view,
body.elim-fs-active #elim-view.bracket-panel,
body.elim-fs-active .elim-stage-shell {
  display: flex !important;
  flex-direction: column !important;
  margin: 0 !important;
  padding: 0 !important;
  width: 100% !important;
  height: 100dvh !important;
  max-height: 100dvh !important;
  min-height: 0 !important;
  gap: 0 !important;
}

body.elim-fs-active .elim-stage-shell {
  position: relative;
  background: var(--results-bg, #0b1219);
  overflow: hidden;
}

body.elim-fs-active .elim-stage-shell .bracket-controls {
  --fs-chrome-pad: 0.55rem 0.85rem;
  max-width: none !important;
  width: 100% !important;
  margin: 0 !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 8;
  padding: var(--fs-chrome-pad) !important;
  border-radius: 0 !important;
  border: none !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  background: color-mix(in srgb, var(--results-surface) 94%, transparent);
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
  transition:
    transform 0.28s ease,
    opacity 0.28s ease;
}

body.elim-fs-active .elim-stage-shell.fs-chrome-hidden .bracket-controls {
  transform: translateY(calc(-100% - 2px));
  opacity: 0;
  pointer-events: none;
}

body.elim-fs-active .elim-stage-shell .elim-nav {
  display: none !important;
}

body.elim-fs-active .elim-stage-shell .elim-scroll {
  flex: 1 1 auto !important;
  align-self: stretch !important;
  width: 100% !important;
  height: 100% !important;
  max-height: none !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 0 !important;
  /* Clean kiosk look */
  scrollbar-width: none;
}

body.elim-fs-active .elim-stage-shell .elim-scroll::-webkit-scrollbar {
  display: none;
}

body.elim-fs-active .elim-stage-shell .elim-stage {
  margin: 0 !important;
  border-radius: 0 !important;
  border: none !important;
  box-sizing: border-box;
  min-width: 100%;
  min-height: 100%;
  width: max-content;
}

.elim-stage-shell {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 0;
}

.elim-stage-shell .archer-modal {
  /* Keep modal above bracket when shell is fullscreen */
  z-index: 20;
}

.elim-fs-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: auto;
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--results-border);
  border-radius: 0.5rem;
  background: var(--results-surface-2);
  color: var(--results-text);
  font-family: Kanit, sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}

.elim-fs-btn:hover,
.elim-fs-btn:focus-visible {
  border-color: var(--results-accent);
  background: rgba(56, 152, 236, 0.14);
  outline: none;
}

.elim-fs-btn[aria-pressed='true'] {
  border-color: var(--results-accent);
  color: var(--results-accent);
}

.elim-fs-btn__icon {
  font-size: 1rem;
  line-height: 1;
}

.elim-page .results-event-header {
  text-align: center;
  margin-bottom: 0.75rem;
}

.elim-page .results-event-header h2 {
  font-family: Kanit, sans-serif;
  font-weight: 800;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.elim-scroll {
  overflow: auto;
  width: 100%;
  max-height: min(78vh, 56rem);
  padding: 0 0.35rem 1rem;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(56, 152, 236, 0.35) transparent;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.elim-scroll.is-drag-ready,
.elim-scroll.is-dragging {
  scroll-behavior: auto;
  cursor: grabbing;
}

.elim-scroll.is-dragging {
  cursor: grabbing;
}

.elim-scroll button,
.elim-scroll a,
.elim-scroll select,
.elim-scroll input {
  cursor: pointer;
  user-select: auto;
}

.elim-scroll::-webkit-scrollbar {
  height: 6px;
  width: 6px;
}

.elim-scroll::-webkit-scrollbar-thumb {
  background: rgba(56, 152, 236, 0.35);
  border-radius: 999px;
}

.elim-stage {
  --elim-card: #121a24;
  --elim-card-edge: rgba(255, 255, 255, 0.1);
  --elim-chip: hsl(202, 72%, 48%);
  --elim-chip-won: #3dd68c;
  --elim-line: rgba(180, 210, 235, 0.22);
  position: relative;
  border-radius: 0.85rem;
  margin: 0.25rem auto;
  padding: 0.55rem 0.4rem 0.85rem;
  background:
    radial-gradient(
      ellipse 55% 70% at 50% 45%,
      rgba(56, 152, 236, 0.12),
      transparent 70%
    ),
    linear-gradient(180deg, #0d1520 0%, #0a1018 100%);
  border: 1px solid var(--results-border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  min-width: min-content;
}

.elim-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin: 0 0.35rem 0.55rem;
  padding: 0.35rem 0.5rem;
  border-radius: 0.55rem;
  background: rgba(8, 14, 22, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.06);
  position: sticky;
  top: 0;
  z-index: 4;
}

.elim-nav__hint {
  margin: 0;
  font-size: 0.72rem;
  color: var(--results-muted);
}

.elim-nav__pad {
  display: grid;
  grid-template-columns: repeat(3, 2rem);
  grid-template-rows: repeat(3, 2rem);
  gap: 0.25rem;
  grid-template-areas:
    '. up .'
    'left center right'
    '. down .';
}

.elim-nav__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--results-border);
  border-radius: 0.4rem;
  background: var(--results-surface-2);
  color: var(--results-text);
  font-size: 0.85rem;
  cursor: pointer;
  line-height: 1;
}

.elim-nav__btn[data-nav='up'] {
  grid-area: up;
}

.elim-nav__btn[data-nav='left'] {
  grid-area: left;
}

.elim-nav__btn[data-nav='center'] {
  grid-area: center;
}

.elim-nav__btn[data-nav='right'] {
  grid-area: right;
}

.elim-nav__btn[data-nav='down'] {
  grid-area: down;
}

.elim-nav__btn:hover,
.elim-nav__btn:focus-visible {
  border-color: var(--results-accent);
  background: rgba(56, 152, 236, 0.16);
  outline: none;
}

.elim-nav__btn--center {
  color: var(--results-gold);
}

.elim-pyramid {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 0.4rem;
  width: max-content;
  min-width: 100%;
  min-height: 14rem;
}

.elim-pyramid__side {
  display: flex;
  align-items: stretch;
  gap: 0.4rem;
}

.elim-pyramid__side--left {
  justify-content: flex-end;
}

.elim-pyramid__side--right {
  justify-content: flex-start;
}

.elim-pyramid__center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  flex: 0 0 auto;
  padding: 0.25rem 0.45rem;
  min-width: 11rem;
  z-index: 1;
}

.elim-stage__logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: clamp(7.5rem, 12vw, 11rem);
  height: clamp(7.5rem, 12vw, 11rem);
  margin: 0.35rem 0 0.65rem;
  padding: 0.45rem;
  border-radius: 1rem;
  background: rgba(8, 14, 22, 0.72);
  border: 1px solid rgba(56, 152, 236, 0.35);
  box-shadow:
    0 0 0 3px rgba(56, 152, 236, 0.08),
    0 8px 18px rgba(0, 0, 0, 0.35);
}

.elim-stage__logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.4));
}

body.elim-fs-active .elim-stage__logo {
  width: clamp(9rem, 14vw, 14rem);
  height: clamp(9rem, 14vw, 14rem);
  margin: 0.5rem 0 0.85rem;
}

.elim-round {
  display: flex;
  flex-direction: column;
  min-width: 9.4rem;
  max-width: 10.75rem;
  flex: 0 0 auto;
}

.elim-round__label {
  display: flex;
  justify-content: center;
  margin: 0 0 0.35rem;
}

.elim-round__label span {
  display: inline-block;
  padding: 0.18rem 0.45rem;
  border-radius: 999px;
  font-family: Kanit, sans-serif;
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #dce9f5;
  background: rgba(12, 20, 30, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.1);
  white-space: nowrap;
}

.elim-round--final .elim-round__label span {
  color: #1a1406;
  background: var(--results-gold);
  border-color: transparent;
}

.elim-round--bronze .elim-round__label span {
  color: #f3e0c8;
  background: rgba(160, 100, 55, 0.45);
  border-color: rgba(196, 138, 90, 0.45);
}

.elim-round__matches {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  flex: 1;
  gap: 0.35rem;
  min-height: 100%;
}

.elim-node {
  position: relative;
  display: flex;
  align-items: center;
  transition: box-shadow 0.25s ease;
}

.elim-node.is-nav-focus,
.elim-pyramid__center.is-nav-focus {
  box-shadow: 0 0 0 2px rgba(56, 152, 236, 0.55);
  border-radius: 0.55rem;
  z-index: 2;
}

.elim-round--left .elim-node::after,
.elim-round--right .elim-node::before {
  content: '';
  position: absolute;
  top: 50%;
  width: 0.4rem;
  height: 2px;
  background: var(--elim-line);
  transform: translateY(-50%);
}

.elim-round--left .elim-node::after {
  left: 100%;
}

.elim-round--right .elim-node::before {
  right: 100%;
}

.elim-match {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  padding: 0.18rem;
  background: rgba(8, 12, 18, 0.55);
  border: 1px solid var(--elim-card-edge);
  border-radius: 0.45rem;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.22);
}

.elim-round--final .elim-match {
  min-width: 10.5rem;
  border-color: rgba(245, 200, 66, 0.4);
  box-shadow:
    0 0 0 1px rgba(245, 200, 66, 0.12),
    0 8px 18px rgba(0, 0, 0, 0.3);
}

.elim-slot {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.3rem;
  padding: 0.22rem 0.3rem;
  min-height: 2.05rem;
  background: var(--elim-card);
  border-radius: 0.35rem;
}

.elim-slot--won {
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--results-accent) 22%, var(--elim-card)),
    var(--elim-card)
  );
  box-shadow: inset 2px 0 0 var(--results-accent);
}

.elim-slot--won .elim-slot__scorechip {
  background: var(--elim-chip-won);
  color: #04140c;
}

.elim-slot--bye {
  display: flex;
  justify-content: center;
  color: var(--results-muted);
  font-style: italic;
  font-size: 0.78rem;
  background: rgba(255, 255, 255, 0.03);
}

.elim-slot__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.45rem;
  height: 1.45rem;
  border-radius: 50%;
  font-family: Kanit, sans-serif;
  font-size: 0.55rem;
  font-weight: 700;
  color: #d7e6f4;
  background: radial-gradient(circle at 35% 30%, #2a3d52, #15202c);
  border: 1px solid rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
}

.elim-slot__avatar--champ {
  width: 1.9rem;
  height: 1.9rem;
  font-size: 0.62rem;
  border-color: rgba(245, 200, 66, 0.55);
  background: radial-gradient(circle at 35% 30%, #5a4a1e, #2a220c);
  color: var(--results-gold);
}

.elim-slot__meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.15;
}

.elim-slot__first {
  font-family: Kanit, sans-serif;
  font-weight: 700;
  font-size: 0.7rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.elim-slot__last {
  font-size: 0.64rem;
  color: #c5d4e2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.elim-slot__team {
  font-size: 0.62rem;
  color: var(--results-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.elim-slot__scorechip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.55rem;
  height: 1.55rem;
  padding: 0 0.3rem;
  border: none;
  border-radius: 0.35rem;
  font-family: Kanit, sans-serif;
  font-weight: 800;
  font-size: 0.78rem;
  color: #fff;
  background: var(--elim-chip);
  cursor: pointer;
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease,
    filter 0.12s ease;
}

button.elim-slot__scorechip:hover,
button.elim-slot__scorechip:focus-visible {
  transform: scale(1.08);
  filter: brightness(1.12);
  box-shadow: 0 0 0 2px rgba(56, 152, 236, 0.45);
  outline: none;
}

.elim-slot__scorechip--empty {
  opacity: 0.25;
  background: #2a3644;
  cursor: default;
  pointer-events: none;
}

/* Match detail modal */
.match-detail__round {
  margin: 0.2rem 0 0;
  color: var(--results-muted);
  font-size: 0.9rem;
}

.match-detail__fighters {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1rem;
}

.match-fighter {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.75rem;
  border-radius: 0.65rem;
  background: var(--results-surface-2);
  border: 1px solid var(--results-border);
}

.match-fighter--won {
  border-color: rgba(61, 214, 140, 0.45);
  background: color-mix(in srgb, var(--results-leader) 12%, var(--results-surface-2));
}

.match-fighter__seed {
  font-family: Kanit, sans-serif;
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--results-muted);
  min-width: 1.6rem;
}

.match-fighter__meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
  line-height: 1.2;
}

.match-fighter__meta strong {
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.match-fighter__meta span {
  font-size: 0.75rem;
  color: var(--results-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.match-fighter__score {
  font-family: Kanit, sans-serif;
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--results-accent);
}

.match-detail__scoreline {
  font-family: Kanit, sans-serif;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--results-gold);
  white-space: nowrap;
}

.match-detail__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin-bottom: 0.75rem;
  font-size: 0.78rem;
  color: var(--results-muted);
}

.match-ends {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.match-end {
  display: grid;
  grid-template-columns: 3.5rem 1fr auto 1fr auto;
  gap: 0.45rem;
  align-items: center;
  padding: 0.55rem 0.65rem;
  border-radius: 0.55rem;
  background: var(--results-surface-2);
  border: 1px solid var(--results-border);
}

.match-end--home {
  box-shadow: inset 3px 0 0 var(--results-accent);
}

.match-end--away {
  box-shadow: inset -3px 0 0 var(--results-leader);
}

.match-end--tie {
  box-shadow: inset 0 -2px 0 rgba(245, 200, 66, 0.55);
}

.match-end--tb {
  border-color: rgba(245, 200, 66, 0.4);
  background: color-mix(in srgb, var(--results-gold) 8%, var(--results-surface-2));
}

.match-end__label {
  font-family: Kanit, sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--results-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.match-end__side {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

.match-end__side--home {
  justify-content: flex-end;
}

.match-end__side--away {
  justify-content: flex-start;
}

.match-end__arrows {
  display: flex;
  gap: 0.2rem;
  flex-wrap: wrap;
}

.match-end__pts {
  font-family: Kanit, sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  min-width: 1.5rem;
  text-align: center;
}

.match-end__vs {
  font-size: 0.7rem;
  color: var(--results-muted);
  text-transform: uppercase;
}

.match-end__set {
  font-family: Kanit, sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--results-gold);
  min-width: 2.2rem;
  text-align: right;
}

.match-detail__empty {
  margin: 0;
  padding: 1rem;
  text-align: center;
  color: var(--results-muted);
}

.match-detail__totals {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--results-border);
  font-size: 0.85rem;
  color: var(--results-muted);
}

.match-detail__totals strong {
  color: var(--results-text);
  font-family: Kanit, sans-serif;
}

@media (max-width: 640px) {
  .match-detail__fighters {
    grid-template-columns: 1fr;
  }

  .match-detail__scoreline {
    text-align: center;
  }

  .match-end {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  .match-end__side--home,
  .match-end__side--away {
    justify-content: space-between;
  }

  .match-end__vs,
  .match-end__set {
    text-align: center;
  }
}

.elim-winner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
  max-width: 14rem;
}

.elim-winner__label {
  margin: 0;
  font-family: Kanit, sans-serif;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 2px 12px rgba(56, 152, 236, 0.45);
}

.elim-winner__card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  padding: 0.55rem 0.65rem;
  border-radius: 0.7rem;
  background: linear-gradient(
    160deg,
    color-mix(in srgb, var(--results-gold) 18%, #121a24),
    #121a24 55%
  );
  border: 1px solid rgba(245, 200, 66, 0.45);
  box-shadow:
    0 0 0 1px rgba(245, 200, 66, 0.08),
    0 14px 28px rgba(0, 0, 0, 0.4);
}

.elim-winner__card .elim-slot__first {
  font-size: 0.9rem;
}

.elim-winner__card .elim-slot__scorechip {
  background: var(--results-gold);
  color: #1a1406;
}

@media (max-width: 900px) {
  .elim-pyramid {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 1.25rem;
  }

  .elim-pyramid__side {
    flex-direction: column;
    gap: 1rem;
  }

  .elim-round {
    max-width: none;
    width: 100%;
  }

  .elim-round__matches {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
    gap: 0.65rem;
  }

  .elim-round--left .elim-node::after,
  .elim-round--right .elim-node::before {
    display: none;
  }

  .elim-pyramid__center {
    order: -1;
  }
}
