/* =========================================================================
   FRISBIER HALLENTURNIER 2025 — Turnierbaum Styles
   Scoped under .hallenturnier-root so it can be embedded inside any page.
   ========================================================================= */
@import url("https://fonts.googleapis.com/css2?family=Saira:ital,wght@0,600;0,800;0,900;1,800;1,900&family=Manrope:wght@400;500;600;700;800&display=swap");

.hallenturnier-root {
  /* ---------- TOKENS (scoped) ---------- */
  --ht-black:        #0E0E0E;
  --ht-ink:          #1A1A1A;
  --ht-white:        #FFFFFF;
  --ht-yellow:       #FEDC00;
  --ht-yellow-soft:  #FFE85C;
  --ht-neutral-300:  #B8B3A4;
  --ht-neutral-400:  #8A8678;
  --ht-neutral-500:  #5C5A53;
  --ht-font-display: "Saira", "Arial Black", system-ui, sans-serif;
  --ht-font-heading: "Saira", "Helvetica Neue", system-ui, sans-serif;
  --ht-font-body:    "Manrope", "Helvetica Neue", system-ui, sans-serif;
  --ht-font-mono:    ui-monospace, "JetBrains Mono", Menlo, monospace;
  --ht-ease:         cubic-bezier(.2,.8,.2,1);

  /* ---------- Canvas dims ---------- */
  --ht-canvas-w: 1750px;
  --ht-canvas-h: 1380px;

  /* ---------- Root frame ---------- */
  display: block;
  width: 100%;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(254,220,0,0.07), transparent 60%),
    radial-gradient(ellipse at 75% 80%, rgba(254,220,0,0.04), transparent 55%),
    #000;
  color: var(--ht-white);
  font-family: var(--ht-font-body);
  overflow: hidden;
  box-sizing: border-box;
}
.hallenturnier-root *,
.hallenturnier-root *::before,
.hallenturnier-root *::after { box-sizing: border-box; }

/* ---------- Stage / Canvas (fixed-size, JS scales it to parent) ---------- */
.hallenturnier-root .ht-stage {
  width: 100%;
  position: relative;
  display: block;
  overflow: hidden;
}
.hallenturnier-root .ht-canvas {
  position: relative;
  width: var(--ht-canvas-w);
  height: var(--ht-canvas-h);
  transform-origin: top left;
}

/* ---------- Title block (top-right) ---------- */
.hallenturnier-root .ht-hero {
  position: absolute;
  top: 30px;
  right: 30px;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 18px;
  pointer-events: none;
}
.hallenturnier-root .ht-title {
  text-align: right;
}
.hallenturnier-root .ht-eyebrow {
  font-family: var(--ht-font-heading);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.22em;
  color: var(--ht-yellow);
  text-transform: uppercase;
  margin: 0 0 8px;
}
.hallenturnier-root .ht-h1 {
  font-family: var(--ht-font-display);
  font-style: italic;
  font-weight: 900;
  font-size: 64px;
  line-height: .9;
  letter-spacing: -0.005em;
  margin: 0;
  color: var(--ht-white);
  text-transform: uppercase;
  white-space: nowrap;
}
.hallenturnier-root .ht-h1 .ht-year { color: var(--ht-yellow); }
.hallenturnier-root .ht-champion {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  background: var(--ht-yellow);
  color: #000;
  padding: 12px 22px 12px 18px;
  font-family: var(--ht-font-heading);
  text-transform: uppercase;
  box-shadow: 6px 6px 0 0 var(--ht-white);
  pointer-events: auto;
}
.hallenturnier-root .ht-champion svg { width: 24px; height: 24px; flex-shrink: 0; }
.hallenturnier-root .ht-champ-text { display: inline-flex; flex-direction: column; line-height: 1; }
.hallenturnier-root .ht-champ-label { font-size: 10px; letter-spacing: .22em; opacity: .65; font-style: normal; }
.hallenturnier-root .ht-champ-name { font-family: var(--ht-font-display); font-style: italic; font-weight: 900; font-size: 26px; letter-spacing: 0.02em; margin-top: 4px; }

/* Section label: vertical strip on the far left edge */
.hallenturnier-root .ht-section-label {
  position: absolute;
  font-family: var(--ht-font-heading);
  font-weight: 800;
  font-style: italic;
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--ht-yellow);
  text-transform: uppercase;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  text-align: center;
  padding: 8px 3px;
  border-left: 2px solid var(--ht-yellow);
  border-right: 2px solid var(--ht-yellow);
  width: 24px;
  z-index: 2;
  white-space: nowrap;
}
.hallenturnier-root .ht-section-label.ht-wb { top: 30px; height: 690px; left: 14px; }
.hallenturnier-root .ht-section-label.ht-lb { top: 820px; height: 540px; left: 14px; }

/* ---------- Round labels ---------- */
.hallenturnier-root .ht-round-label {
  position: absolute;
  font-family: var(--ht-font-heading);
  font-weight: 800;
  font-style: italic;
  font-size: 12px;
  letter-spacing: 0.22em;
  color: var(--ht-neutral-400);
  text-transform: uppercase;
  z-index: 3;
  white-space: nowrap;
}

/* ---------- Legend ---------- */
.hallenturnier-root .ht-legend {
  position: absolute;
  top: 830px;
  left: 1420px;
  width: 280px;
  z-index: 4;
  font-family: var(--ht-font-body);
  color: var(--ht-neutral-300);
  font-size: 13px;
  line-height: 1.5;
  border-left: 3px solid var(--ht-yellow);
  padding-left: 14px;
}
.hallenturnier-root .ht-legend-title {
  font-family: var(--ht-font-heading);
  font-weight: 800;
  font-style: italic;
  font-size: 13px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ht-yellow);
  margin-bottom: 6px;
}
.hallenturnier-root .ht-legend code {
  background: #0E0E0E;
  padding: 2px 5px;
  color: var(--ht-yellow);
  font-size: 11px;
  font-family: var(--ht-font-mono);
}

/* ---------- SVG line layer ---------- */
.hallenturnier-root .ht-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}
.hallenturnier-root .ht-lines path {
  fill: none;
  stroke: var(--ht-yellow);
  stroke-width: 2;
  stroke-linecap: square;
  stroke-linejoin: miter;
  vector-effect: non-scaling-stroke;
}
.hallenturnier-root .ht-lines path.ht-winner {
  stroke-width: 2.5;
  stroke-dasharray: 10 5;
  stroke-linecap: round;
  animation: ht-flow 1.6s linear infinite;
  filter: drop-shadow(0 0 3px rgba(254,220,0,0.35));
}
.hallenturnier-root .ht-lines path.ht-dim {
  stroke: var(--ht-yellow);
  opacity: 0.20;
  stroke-width: 1.5;
  stroke-dasharray: 3 4;
}
/* Champion: ernesto's road to the title */
.hallenturnier-root .ht-lines path.ht-champ {
  stroke: var(--ht-yellow-soft);
  stroke-width: 5;
  stroke-dasharray: 16 8;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 10px rgba(254,220,0,0.85));
  animation: ht-champ-flow 1.2s linear infinite;
}
@keyframes ht-flow      { to { stroke-dashoffset: -15; } }
@keyframes ht-champ-flow { to { stroke-dashoffset: -24; } }

/* ---------- Match cards ---------- */
.hallenturnier-root .ht-match {
  position: absolute;
  background: #0E0E0E;
  border: 2px solid var(--ht-yellow);
  color: var(--ht-white);
  font-family: var(--ht-font-heading);
  font-weight: 700;
  cursor: pointer;
  z-index: 2;
  box-sizing: border-box;
  box-shadow: 4px 4px 0 0 rgba(254,220,0,0);
  transition:
    transform .22s var(--ht-ease),
    box-shadow .22s var(--ht-ease),
    background-color .22s var(--ht-ease),
    border-color .22s var(--ht-ease);
  display: flex;
  flex-direction: column;
  user-select: none;
}
.hallenturnier-root .ht-match:hover {
  background: var(--ht-yellow);
  transform: translate(-2px, -2px);
  box-shadow: 8px 8px 0 0 var(--ht-white);
  z-index: 7;
}
.hallenturnier-root .ht-match:hover .ht-player,
.hallenturnier-root .ht-match:hover .ht-vs-row { color: #000; }
.hallenturnier-root .ht-match:hover .ht-vs-row::before,
.hallenturnier-root .ht-match:hover .ht-vs-row::after { background: #000; }
.hallenturnier-root .ht-match:hover .ht-play-glyph { color: #000; }
.hallenturnier-root .ht-match:active { transform: translate(0,0); }

.hallenturnier-root .ht-player {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 0 14px;
  font-style: italic;
  letter-spacing: 0.01em;
  color: var(--ht-white);
  font-weight: 700;
  /* No overflow/ellipsis — cards are sized to fit every player alias.
     If a name is longer, the layout intentionally lets it show.        */
  white-space: nowrap;
  overflow: visible;
  min-width: 0;
}
.hallenturnier-root .ht-player.ht-winner {
  color: var(--ht-yellow);
  font-weight: 900;
  /* Same font-size as loser — only color + underline + weight differ */
}
.hallenturnier-root .ht-player.ht-winner .ht-name {
  background-image: linear-gradient(var(--ht-yellow), var(--ht-yellow));
  background-size: 100% 4px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  padding-bottom: 2px;
}
.hallenturnier-root .ht-match:hover .ht-player.ht-winner .ht-name {
  background-image: linear-gradient(#000, #000);
}
.hallenturnier-root .ht-vs-row {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--ht-font-heading);
  font-size: 9px;
  letter-spacing: 0.3em;
  color: var(--ht-yellow);
  padding: 0 12px;
  height: 14px;
  position: relative;
}
.hallenturnier-root .ht-vs-row::before,
.hallenturnier-root .ht-vs-row::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--ht-yellow);
  opacity: .5;
  margin: 0 6px;
}
.hallenturnier-root .ht-play-glyph {
  position: absolute;
  top: -10px;
  right: 10px;
  width: 18px;
  height: 18px;
  background: var(--ht-yellow);
  color: #000;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ht-yellow);
  box-shadow: 0 0 0 2px #000;
}
.hallenturnier-root .ht-play-glyph svg { width: 9px; height: 9px; }

/* Card size variants — ALL player names in a card share the same font-size.
   Cards are sized to fit the longest player alias ("Muschka Mexikaner").
   Winner is differentiated by color + underline + weight only.            */
.hallenturnier-root .ht-match.ht-entry { width: 220px; height: 76px; }
.hallenturnier-root .ht-match.ht-entry .ht-player { font-size: 14px; padding: 0 12px; }
.hallenturnier-root .ht-match.ht-entry .ht-vs-row { font-size: 8px; height: 12px; padding: 0 12px; }

.hallenturnier-root .ht-match.ht-standard { width: 240px; height: 92px; }
.hallenturnier-root .ht-match.ht-standard .ht-player { font-size: 16px; padding: 0 14px; }
.hallenturnier-root .ht-match.ht-standard .ht-vs-row { padding: 0 14px; }

.hallenturnier-root .ht-match.ht-final { width: 260px; height: 104px; }
.hallenturnier-root .ht-match.ht-final .ht-player { font-size: 18px; padding: 0 16px; }
.hallenturnier-root .ht-match.ht-final .ht-vs-row { padding: 0 16px; }

.hallenturnier-root .ht-match.ht-gf {
  background: var(--ht-yellow);
  border-color: var(--ht-yellow);
  width: 280px;
  height: 118px;
  box-shadow: 6px 6px 0 0 var(--ht-white);
}
.hallenturnier-root .ht-match.ht-gf .ht-player { color: #000; font-size: 20px; padding: 0 18px; }
.hallenturnier-root .ht-match.ht-gf .ht-vs-row { padding: 0 18px; }
.hallenturnier-root .ht-match.ht-gf .ht-player.ht-winner { color: #000; }
.hallenturnier-root .ht-match.ht-gf .ht-player.ht-winner .ht-name {
  background-image: linear-gradient(#000, #000);
  background-size: 100% 4px;
}
.hallenturnier-root .ht-match.ht-gf .ht-vs-row { color: #000; }
.hallenturnier-root .ht-match.ht-gf .ht-vs-row::before,
.hallenturnier-root .ht-match.ht-gf .ht-vs-row::after { background: #000; opacity: .6; }
.hallenturnier-root .ht-match.ht-gf .ht-play-glyph {
  background: #000;
  color: var(--ht-yellow);
  border-color: #000;
  box-shadow: 0 0 0 2px var(--ht-yellow);
}
.hallenturnier-root .ht-match.ht-gf:hover {
  background: #000;
  border-color: #000;
  box-shadow: 8px 8px 0 0 var(--ht-yellow);
}
.hallenturnier-root .ht-match.ht-gf:hover .ht-player { color: var(--ht-white); }
.hallenturnier-root .ht-match.ht-gf:hover .ht-player.ht-winner { color: var(--ht-yellow); }
.hallenturnier-root .ht-match.ht-gf:hover .ht-player.ht-winner .ht-name {
  background-image: linear-gradient(var(--ht-yellow), var(--ht-yellow));
}
.hallenturnier-root .ht-match.ht-gf:hover .ht-vs-row { color: var(--ht-yellow); }
.hallenturnier-root .ht-match.ht-gf:hover .ht-vs-row::before,
.hallenturnier-root .ht-match.ht-gf:hover .ht-vs-row::after { background: var(--ht-yellow); }
.hallenturnier-root .ht-match.ht-gf:hover .ht-play-glyph {
  background: var(--ht-yellow);
  color: #000;
  border-color: var(--ht-yellow);
  box-shadow: 0 0 0 2px var(--ht-white);
}

/* Champion path pulsing cards (ernesto's matches) */
.hallenturnier-root .ht-match.ht-champion-card {
  animation: ht-champ-pulse 2.6s ease-in-out infinite;
}
@keyframes ht-champ-pulse {
  0%, 100% {
    box-shadow: 4px 4px 0 0 rgba(254,220,0,0.45);
    border-color: var(--ht-yellow);
  }
  50% {
    box-shadow: 0 0 28px 4px rgba(254,220,0,0.45), 6px 6px 0 0 rgba(254,220,0,0.9);
    border-color: var(--ht-yellow-soft);
  }
}
.hallenturnier-root .ht-match.ht-champion-card:hover { animation: none; }

/* ============================================================
   Modal — outside the root (fixed-positioned, full viewport)
   ============================================================ */
.ht-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.ht-modal-backdrop.ht-open { display: flex; }
.ht-modal {
  background: #0E0E0E;
  border: 3px solid #FEDC00;
  width: min(1100px, 95vw);
  max-height: 92vh;
  overflow: auto;
  box-shadow: 12px 12px 0 0 #FEDC00;
  position: relative;
  color: #fff;
  font-family: "Manrope", system-ui, sans-serif;
  box-sizing: border-box;
}
.ht-modal *,
.ht-modal *::before,
.ht-modal *::after { box-sizing: border-box; }
.ht-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 22px 26px 16px;
  gap: 20px;
  border-bottom: 1px dashed rgba(254,220,0,0.35);
}
.ht-modal-eyebrow {
  font-family: "Saira", system-ui, sans-serif;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.24em;
  color: #FEDC00;
  text-transform: uppercase;
  margin: 0 0 8px;
}
.ht-modal-title {
  font-family: "Saira", "Arial Black", sans-serif;
  font-style: italic;
  font-weight: 900;
  font-size: 36px;
  line-height: 1;
  margin: 0;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: -0.005em;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 14px;
}
.ht-modal-title .ht-accent { color: #FEDC00; }
.ht-modal-title .ht-vs {
  font-size: 16px;
  font-style: normal;
  font-weight: 800;
  color: #8A8678;
  letter-spacing: 0.3em;
}
.ht-modal-meta {
  font-family: "Saira", system-ui, sans-serif;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #B8B3A4;
  margin-top: 10px;
}
.ht-modal-meta .ht-winner-tag {
  background: #FEDC00;
  color: #000;
  padding: 2px 8px;
  margin-left: 8px;
  font-weight: 900;
}
.ht-close-btn {
  background: #000;
  border: 2px solid #FEDC00;
  color: #FEDC00;
  width: 40px;
  height: 40px;
  cursor: pointer;
  box-shadow: 3px 3px 0 0 #FEDC00;
  transition: all .22s cubic-bezier(.2,.8,.2,1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ht-close-btn:hover {
  background: #FEDC00;
  color: #000;
  box-shadow: 3px 3px 0 0 #fff;
}
.ht-close-btn svg { width: 18px; height: 18px; }

.ht-video-area {
  background: #000;
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin: 18px 22px;
  border: 1px solid rgba(254,220,0,0.25);
}
.ht-video-area video { width: 100%; height: 100%; display: block; background: #000; }
.ht-video-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px;
  background: repeating-linear-gradient(45deg, #0A0A0A 0 14px, #0E0E0E 14px 28px);
}
.ht-video-fallback h3 {
  font-family: "Saira", system-ui, sans-serif;
  font-style: italic;
  font-weight: 900;
  font-size: 22px;
  text-transform: uppercase;
  margin: 0 0 8px;
  color: #FEDC00;
  letter-spacing: 0.02em;
}
.ht-video-fallback p {
  color: #B8B3A4;
  margin: 0 0 8px;
  font-weight: 500;
  max-width: 56ch;
}
.ht-video-fallback code {
  background: #000;
  color: #FEDC00;
  border: 1px solid rgba(254,220,0,0.4);
  padding: 4px 10px;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 13px;
  margin: 2px 0 14px;
  display: inline-block;
}
.ht-pickbtn {
  background: #FEDC00;
  color: #000;
  border: 2px solid #FEDC00;
  font-family: "Saira", system-ui, sans-serif;
  font-weight: 900;
  font-style: italic;
  font-size: 14px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 12px 22px;
  cursor: pointer;
  box-shadow: 4px 4px 0 0 #fff;
  transition: all .22s cubic-bezier(.2,.8,.2,1);
}
.ht-pickbtn:hover {
  background: #000;
  color: #FEDC00;
  box-shadow: 4px 4px 0 0 #FEDC00;
}
.ht-modal-footer {
  padding: 4px 26px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 12px;
}
.ht-hint { color: #8A8678; font-weight: 500; }
.ht-hint code {
  color: #FEDC00;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 12px;
}
.ht-pick-link {
  background: transparent;
  border: 1px solid #FEDC00;
  color: #FEDC00;
  font-family: "Saira", system-ui, sans-serif;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  padding: 8px 14px;
  cursor: pointer;
  transition: all .22s cubic-bezier(.2,.8,.2,1);
}
.ht-pick-link:hover { background: #FEDC00; color: #000; }

.ht-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  background: #FEDC00;
  color: #000;
  font-family: "Saira", system-ui, sans-serif;
  font-weight: 800;
  padding: 10px 18px;
  font-size: 13px;
  letter-spacing: 0.04em;
  box-shadow: 4px 4px 0 0 #fff;
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}
.hallenturnier-root .ht-toast.ht-show,
.ht-toast.ht-show { opacity: 1; }

/* ---------- Mobile mode: zoom in + horizontal scroll ---------- */
.hallenturnier-root.ht-mobile {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-color: var(--ht-yellow) #000;
}
.hallenturnier-root.ht-mobile::-webkit-scrollbar { height: 6px; background: #000; }
.hallenturnier-root.ht-mobile::-webkit-scrollbar-thumb { background: var(--ht-yellow); }

/* Compact hero + hide legend on narrow screens */
@media (max-width: 768px) {
  .hallenturnier-root .ht-hero { gap: 8px; top: 16px; right: 16px; }
  .hallenturnier-root .ht-h1   { font-size: 36px; }
  .hallenturnier-root .ht-champion { padding: 8px 14px 8px 12px; gap: 10px; }
  .hallenturnier-root .ht-champion svg { width: 18px; height: 18px; }
  .hallenturnier-root .ht-champ-name { font-size: 18px; }
  .hallenturnier-root .ht-legend { display: none; }
}

/* Swipe hint that fades out after first interaction */
.hallenturnier-root.ht-mobile::after {
  content: "↔ swipe";
  position: sticky;
  display: block;
  left: 50%;
  bottom: 14px;
  width: max-content;
  background: rgba(254,220,0,0.95);
  color: #000;
  font-family: var(--ht-font-heading);
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 6px 12px;
  pointer-events: none;
  transform: translateX(-50%);
  animation: ht-hint 4s ease-in-out forwards;
}
@keyframes ht-hint {
  0%, 70% { opacity: 1; }
  100%    { opacity: 0; }
}

/* ---------- Mobile mode: zoom in + horizontal scroll ---------- */
.hallenturnier-root.ht-mobile {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-color: var(--ht-yellow) #000;
}
.hallenturnier-root.ht-mobile::-webkit-scrollbar { height: 6px; background: #000; }
.hallenturnier-root.ht-mobile::-webkit-scrollbar-thumb { background: var(--ht-yellow); }
/* On mobile the hero would block half the bracket — float it as a small marker */
@media (max-width: 768px) {
  .hallenturnier-root .ht-hero { gap: 8px; top: 16px; right: 16px; }
  .hallenturnier-root .ht-h1   { font-size: 36px; }
  .hallenturnier-root .ht-champion { padding: 8px 14px 8px 12px; gap: 10px; }
  .hallenturnier-root .ht-champion svg { width: 18px; height: 18px; }
  .hallenturnier-root .ht-champ-name { font-size: 18px; }
  .hallenturnier-root .ht-legend { display: none; }
}
