/* =====================================================================
   FIFA World Cup 2026 — "Dream Bracket"
   Theme: white-based, ethereal / inside-a-dream
   Centrepiece: scroll-scrubbed cinematic video hero
   NOTE: legacy CSS variable names are kept so app.js inline styles
   (var(--color-primary) etc.) keep resolving.
   ===================================================================== */

:root {
  /* ---- Dream palette ---- */
  --white: #ffffff;
  --paper: #f6f7fc;        /* page base */
  --mist:  #eceefb;        /* soft mist */
  --ink:   #34384f;        /* primary text – soft slate, never pure black */
  --ink-soft: #767ca0;     /* muted text */
  --lav:   #b6a6f2;        /* lavender */
  --sky:   #8fc6ff;        /* dream sky blue */
  --blush: #ffc3df;        /* blush pink */
  --mint:  #a9efd9;        /* mint */
  --gold:  #e7c879;        /* champion gold */
  --iris:  #8c7bf0;        /* periwinkle accent */

  /* ---- Legacy aliases (used by app.js + reused rules) ---- */
  --color-bg-light: var(--paper);
  --color-bg-card: rgba(255, 255, 255, 0.62);
  --color-bg-card-hover: rgba(255, 255, 255, 0.92);
  --color-border: rgba(140, 123, 240, 0.16);
  --color-border-hover: rgba(140, 123, 240, 0.45);
  --color-primary: #7b6ce8;          /* iris */
  --color-secondary: #59b6e8;        /* soft sky */
  --color-accent: #d9a441;           /* gold */
  --color-text-main: var(--ink);
  --color-text-muted: var(--ink-soft);
  --color-confirmed: rgba(89, 182, 232, 0.08);
  --color-confirmed-border: #7fc8e8;
  --color-losing: rgba(52, 56, 79, 0.08);

  --font-display: 'Outfit', 'Inter', sans-serif;
  --font-body: 'Inter', sans-serif;
  --transition-smooth: all 0.35s cubic-bezier(0.22, 0.8, 0.3, 1);
  --card-shadow: 0 18px 50px -20px rgba(124, 123, 200, 0.35), 0 2px 10px rgba(140, 123, 240, 0.06);
  --neon-glow-primary: 0 0 18px rgba(123, 108, 232, 0.25);
  --neon-glow-secondary: 0 0 18px rgba(89, 182, 232, 0.25);
  --glass-blur: blur(16px) saturate(1.15);
  --gold-grad: linear-gradient(135deg, #8a6a1e 0%, #b9933c 30%, #a8842f 52%, #cdab57 74%, #8f6f24 100%);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  color: var(--ink);
  font-family: var(--font-body);
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
  background: var(--paper);
}

/* Dreamy living aurora behind everything (soft pastels drifting) */
body::before {
  content: "";
  position: fixed;
  inset: -20%;
  z-index: -3;
  background:
    radial-gradient(40% 50% at 18% 22%, rgba(182, 166, 242, 0.40) 0%, transparent 60%),
    radial-gradient(45% 55% at 82% 18%, rgba(143, 198, 255, 0.38) 0%, transparent 60%),
    radial-gradient(50% 50% at 75% 80%, rgba(255, 195, 223, 0.34) 0%, transparent 62%),
    radial-gradient(45% 55% at 20% 85%, rgba(169, 239, 217, 0.30) 0%, transparent 62%),
    var(--paper);
  filter: blur(20px);
  animation: aurora-drift 26s ease-in-out infinite alternate;
}
@keyframes aurora-drift {
  0%   { transform: translate3d(0,0,0) scale(1); }
  50%  { transform: translate3d(2%, -1.5%, 0) scale(1.06); }
  100% { transform: translate3d(-2%, 1.5%, 0) scale(1.03); }
}

/* Fine luminous veil so whites read as "dreamy haze" */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background: radial-gradient(120% 80% at 50% 0%, rgba(255,255,255,0) 40%, rgba(255,255,255,0.55) 100%);
}

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(140,123,240,0.25); border-radius: 10px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(140,123,240,0.5); background-clip: content-box; }

/* =====================================================================
   Dream loading veil
   ===================================================================== */
.dream-veil {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  background: radial-gradient(circle at 50% 45%, #ffffff 0%, #f1f2fb 55%, #e7e9f8 100%);
  transition: opacity 1.1s ease, visibility 1.1s ease;
}
.dream-veil.hidden { opacity: 0; visibility: hidden; }
.veil-orb {
  width: 90px; height: 90px; border-radius: 50%;
  background: conic-gradient(from 0deg, var(--lav), var(--sky), var(--blush), var(--mint), var(--lav));
  filter: blur(6px);
  animation: orb-spin 3.5s linear infinite, orb-pulse 2.4s ease-in-out infinite;
  box-shadow: 0 0 60px rgba(182,166,242,0.6);
}
@keyframes orb-spin { to { transform: rotate(360deg); } }
@keyframes orb-pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.12); } }
.veil-text {
  font-family: var(--font-display);
  font-weight: 300;
  letter-spacing: 4px;
  text-transform: uppercase;
  font-size: 0.85rem;
  color: var(--ink-soft);
}
.veil-dots::after { content: ""; animation: veil-dots 1.6s steps(4, end) infinite; }
@keyframes veil-dots { 0%{content:"";} 25%{content:".";} 50%{content:"..";} 75%{content:"...";} }

/* =====================================================================
   Floating dream particles + cursor aura
   ===================================================================== */
.dream-particles {
  position: fixed; inset: 0; z-index: 1; pointer-events: none; overflow: hidden;
}
.dream-particles span {
  position: absolute;
  bottom: -10vh;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff, rgba(182,166,242,0.5));
  box-shadow: 0 0 12px rgba(255,255,255,0.8);
  opacity: 0;
  animation: float-up linear infinite;
}
@keyframes float-up {
  0%   { transform: translateY(0) translateX(0) scale(1); opacity: 0; }
  10%  { opacity: 0.9; }
  90%  { opacity: 0.5; }
  100% { transform: translateY(-115vh) translateX(var(--drift, 0px)) scale(1.1); opacity: 0; }
}
.cursor-aura {
  position: fixed; top: 0; left: 0; z-index: 2; pointer-events: none;
  width: 420px; height: 420px; margin: -210px 0 0 -210px; border-radius: 50%;
  background: radial-gradient(circle, rgba(143,198,255,0.18) 0%, rgba(182,166,242,0.10) 35%, transparent 70%);
  mix-blend-mode: screen;
  transition: opacity 0.4s ease;
  opacity: 0;
}

/* =====================================================================
   Header
   ===================================================================== */
header {
  position: fixed; top: 0; left: 0; width: 100%;
  z-index: 200;
  transition: background 0.5s ease, backdrop-filter 0.5s ease, border-color 0.5s ease, box-shadow 0.5s ease;
  background: transparent;
  border-bottom: 1px solid transparent;
}
header.scrolled {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--color-border);
  box-shadow: 0 8px 30px -22px rgba(124,123,200,0.5);
}
.header-container {
  max-width: 1600px; margin: 0 auto; padding: 0.9rem 2rem;
  display: flex; justify-content: space-between; align-items: center;
}
.logo { display: flex; align-items: center; gap: 0.75rem; }
.logo h1 {
  font-family: var(--font-display);
  font-size: 1.4rem; font-weight: 800; letter-spacing: 2px;
  color: var(--color-accent);
}
/* Over the dark-ish video the title needs a soft white halo */
header:not(.scrolled) .logo h1 { filter: drop-shadow(0 1px 6px rgba(255,255,255,0.7)); }
.logo-badge {
  background: var(--gold-grad);
  color: #5a4209; font-family: var(--font-display); font-weight: 800;
  padding: 0.2rem 0.55rem; border-radius: 6px; font-size: 0.8rem;
  box-shadow: 0 0 14px rgba(212,175,55,0.35);
}
.header-tools { display: flex; align-items: center; gap: 0.8rem; }

/* Audio toggle */
.audio-toggle {
  position: relative;
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: rgba(255,255,255,0.55);
  border: 1px solid var(--color-border);
  color: var(--ink-soft);
  border-radius: 50px; padding: 0.45rem 0.7rem; cursor: pointer;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: var(--transition-smooth);
}
.audio-toggle:hover { color: var(--iris); border-color: var(--color-border-hover); transform: translateY(-1px); }
.audio-toggle.playing { color: var(--iris); border-color: var(--color-border-hover); box-shadow: var(--neon-glow-primary); }
.audio-wave { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.audio-wave i { width: 2.5px; height: 4px; border-radius: 2px; background: currentColor; opacity: 0.55; }
.audio-toggle.playing .audio-wave i { animation: wave 0.9s ease-in-out infinite; }
.audio-toggle.playing .audio-wave i:nth-child(2){ animation-delay: 0.15s; }
.audio-toggle.playing .audio-wave i:nth-child(3){ animation-delay: 0.3s; }
.audio-toggle.playing .audio-wave i:nth-child(4){ animation-delay: 0.45s; }
@keyframes wave { 0%,100%{ height:4px; } 50%{ height:12px; } }

.i18n-selector {
  display: flex; align-items: center; gap: 0.5rem;
  background: rgba(255,255,255,0.55);
  border: 1px solid var(--color-border);
  border-radius: 50px; padding: 0.4rem 0.75rem;
  transition: var(--transition-smooth);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.i18n-selector:hover { border-color: var(--color-border-hover); box-shadow: var(--neon-glow-primary); }
.globe-icon { color: var(--ink-soft); font-size: 0.9rem; }
.lang-select {
  background: transparent; border: none; color: var(--ink);
  font-family: var(--font-display); font-weight: 600; font-size: 0.85rem;
  cursor: pointer; outline: none; padding-right: 0.25rem; max-width: 130px;
}
.lang-select option { background: #fff; color: var(--ink); }

/* =====================================================================
   Cinematic scroll-scrubbed video hero
   ===================================================================== */
.cinema-section {
  position: relative;
  height: 420vh;            /* tall scroll track -> JS maps to video time */
  z-index: 1;
}
.cinema-stage {
  position: sticky; top: 0;
  height: 100vh; width: 100%;
  overflow: hidden;
  background: #0b1020;       /* dark base while video paints */
}
.cinema-video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  /* very slow living drift so frame 0 isn't static before scroll */
  transform: scale(1.06);
  will-change: transform;
}

/* Dreamy white wash so real footage melts into the white theme */
.cinema-wash {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(120% 80% at 50% 12%, rgba(255,255,255,0.0) 30%, rgba(255,255,255,0.10) 60%, rgba(244,246,251,0.35) 100%),
    linear-gradient(180deg, rgba(255,255,255,0.22) 0%, rgba(255,255,255,0.05) 30%, rgba(255,255,255,0.10) 70%, rgba(246,247,252,0.96) 100%),
    radial-gradient(60% 50% at 20% 30%, rgba(182,166,242,0.20) 0%, transparent 55%),
    radial-gradient(60% 50% at 82% 70%, rgba(143,198,255,0.20) 0%, transparent 55%);
  mix-blend-mode: screen;
}
/* second wash layer (normal blend) to lift overall brightness toward white */
.cinema-stage::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0) 35%, rgba(246,247,252,0.9) 100%);
}
.cinema-grain {
  position: absolute; inset: 0; pointer-events: none; opacity: 0.06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Narrative captions */
.cinema-copy {
  position: absolute; inset: 0; z-index: 3;
  display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 0 1.5rem; pointer-events: none;
}
.cine-cap {
  position: absolute;
  opacity: 0;
  transform: translateY(26px);
  filter: blur(6px);
  transition: opacity 0.5s ease, transform 0.5s ease, filter 0.5s ease;
  will-change: opacity, transform, filter;
}
.cine-eyebrow {
  font-family: var(--font-display); font-weight: 600;
  letter-spacing: 8px; font-size: 0.85rem;
  color: #fff; margin-bottom: 1rem;
  text-shadow: 0 2px 20px rgba(124,123,200,0.7);
}
.cine-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.2rem, 6vw, 5rem);
  line-height: 1.05;
  color: #ffffff;
  letter-spacing: 0.5px;
  text-shadow: 0 6px 40px rgba(80, 90, 160, 0.55), 0 1px 2px rgba(0,0,0,0.2);
}
.cine-sub {
  margin-top: 0.9rem;
  font-family: var(--font-display); font-weight: 300;
  letter-spacing: 3px; text-transform: uppercase;
  font-size: clamp(0.8rem, 1.4vw, 1rem);
  color: rgba(255,255,255,0.92);
  text-shadow: 0 2px 18px rgba(80,90,160,0.6);
}

/* Cinematic progress bar */
.cinema-progress {
  position: absolute; left: 0; bottom: 0; width: 100%; height: 3px;
  background: rgba(255,255,255,0.18); z-index: 4;
}
.cinema-progress span {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--lav), var(--sky), var(--blush));
  box-shadow: 0 0 14px rgba(182,166,242,0.9);
  transition: width 0.1s linear;
}

/* Scroll hint */
.scroll-indicator {
  position: absolute; left: 50%; bottom: 2.4rem; transform: translateX(-50%);
  z-index: 4;
  display: flex; flex-direction: column; align-items: center; gap: 0.6rem;
  color: #fff; font-family: var(--font-display); font-size: 0.78rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 2px;
  text-shadow: 0 2px 14px rgba(80,90,160,0.7);
  animation: bounce-scroll 2.6s infinite;
  transition: opacity 0.5s ease;
}
.scroll-indicator.gone { opacity: 0; pointer-events: none; }
.scroll-arrow { font-size: 1.15rem; }
@keyframes bounce-scroll {
  0%,20%,50%,80%,100% { transform: translateX(-50%) translateY(0); }
  40% { transform: translateX(-50%) translateY(-12px); }
  60% { transform: translateX(-50%) translateY(-6px); }
}

/* =====================================================================
   Content wrapper (rises out of the dream)
   ===================================================================== */
.content-wrapper {
  position: relative; z-index: 5;
  width: 100%;
  display: flex; flex-direction: column;
  /* gently lift the white content over the fading video */
  margin-top: -8vh;
  border-radius: 40px 40px 0 0;
  background: linear-gradient(180deg, rgba(246,247,252,0.85) 0%, var(--paper) 12%);
  box-shadow: 0 -40px 80px -30px rgba(124,123,200,0.25);
}

/* Reveal-on-scroll */
.reveal { opacity: 0; transform: translateY(40px); transition: opacity 0.9s cubic-bezier(0.22,0.8,0.3,1), transform 0.9s cubic-bezier(0.22,0.8,0.3,1); }
.reveal.in { opacity: 1; transform: translateY(0); }

/* Bridge hero */
.bridge-hero {
  max-width: 820px; margin: 0 auto; text-align: center;
  padding: 6rem 1.5rem 2.5rem;
}
.date-badge {
  display: inline-block;
  background: rgba(255,255,255,0.6);
  border: 1px solid var(--color-border);
  padding: 0.35rem 1.1rem; border-radius: 50px;
  font-size: 0.78rem; font-weight: 700; letter-spacing: 1px;
  color: var(--iris); margin-bottom: 1.25rem;
  backdrop-filter: blur(6px);
}
.bridge-title {
  font-family: var(--font-display);
  font-weight: 800; font-size: clamp(2.4rem, 5vw, 3.8rem);
  letter-spacing: -1px; line-height: 1.05;
  color: var(--color-accent);
  filter: drop-shadow(0 2px 10px rgba(184,134,11,0.25));
  margin-bottom: 1rem;
}
.hero-desc {
  font-size: 1.05rem; color: var(--ink-soft); line-height: 1.7; font-weight: 300;
}

/* =====================================================================
   Control panel
   ===================================================================== */
.control-center { max-width: 860px; width: 92%; margin: 0 auto 2.5rem; }
.control-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 22px;
  padding: 1.4rem 2rem;
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 1.5rem;
  box-shadow: var(--card-shadow);
  backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
}
.mode-info h3 { font-family: var(--font-display); font-size: 1.2rem; margin-bottom: 0.25rem; color: var(--ink); }
.mode-info p { font-size: 0.85rem; color: var(--ink-soft); max-width: 460px; line-height: 1.5; }
.control-actions { display: flex; gap: 1rem; }
.btn {
  font-family: var(--font-display); font-weight: 600; font-size: 0.9rem;
  padding: 0.7rem 1.3rem; border-radius: 50px; cursor: pointer;
  transition: var(--transition-smooth);
  display: inline-flex; align-items: center; gap: 0.5rem; border: none;
}
.btn-primary { background: linear-gradient(135deg, var(--iris), var(--sky)); color: #fff; box-shadow: 0 10px 24px -10px rgba(123,108,232,0.7); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -10px rgba(123,108,232,0.9), var(--neon-glow-primary); }
.btn-secondary { background: rgba(255,255,255,0.6); color: var(--ink); border: 1px solid var(--color-border); }
.btn-secondary:hover { background: rgba(255,255,255,0.9); transform: translateY(-2px); }



/* Probability change flash */
.prob-flash { animation: prob-flash-anim 0.7s ease-out; }
@keyframes prob-flash-anim {
  0%   { color: var(--iris); background: rgba(140,123,240,0.35); transform: scale(1.18); }
  100% { color: var(--iris); background: rgba(140,123,240,0.14); transform: scale(1); }
}

/* Live finalisation toasts */
.live-toasts {
  position: fixed; left: 1.2rem; bottom: 1.2rem; z-index: 1500;
  display: flex; flex-direction: column-reverse; gap: 0.6rem; pointer-events: none;
  max-width: min(86vw, 360px);
}
.live-toast {
  display: flex; align-items: center; gap: 0.6rem;
  background: rgba(255,255,255,0.82); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--color-border-hover); border-left: 4px solid #e74c3c;
  border-radius: 14px; padding: 0.7rem 1rem;
  box-shadow: 0 18px 40px -18px rgba(124,123,200,0.6);
  font-family: var(--font-display); font-size: 0.82rem; color: var(--ink);
  opacity: 0; transform: translateX(-20px) scale(0.96);
  transition: opacity 0.45s ease, transform 0.45s cubic-bezier(0.22,0.8,0.3,1);
}
.live-toast.show { opacity: 1; transform: translateX(0) scale(1); }
.live-toast .lt-dot { width: 9px; height: 9px; border-radius: 50%; background: #e74c3c; flex: 0 0 auto; animation: live-pulse 1.6s ease-out infinite; }
.live-toast b { color: var(--iris); font-weight: 800; }

/* =====================================================================
   View selector (mobile)
   ===================================================================== */
.view-selector { display: none; justify-content: center; gap: 0.5rem; margin-bottom: 1.5rem; padding: 0 1rem; flex-wrap: wrap; }
.view-btn {
  background: rgba(255,255,255,0.6); border: 1px solid var(--color-border); color: var(--ink-soft);
  padding: 0.5rem 1rem; border-radius: 50px; font-family: var(--font-display);
  font-weight: 600; font-size: 0.85rem; cursor: pointer; transition: var(--transition-smooth);
}
.view-btn.active { background: linear-gradient(135deg, var(--iris), var(--sky)); color: #fff; border-color: transparent; }

/* =====================================================================
   Bracket
   ===================================================================== */
.bracket-container {
  display: flex; justify-content: space-between; width: 100%;
  max-width: 1750px; margin: 0 auto; padding: 0 1.5rem 5rem;
  gap: 1rem; overflow-x: auto; scrollbar-width: thin; position: relative;
  zoom: 0.67; /* 初期表示サイズを67%に縮小 */
}
.bracket-container::after {
  content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 4px;
  background: linear-gradient(90deg, transparent 15%, var(--iris) 50%, transparent 85%);
  box-shadow: 0 0 15px var(--iris); opacity: 0; pointer-events: none; z-index: 99;
}
.bracket-container.laser-scanning::after { animation: laser-scan-anim 2.5s cubic-bezier(0.4,0,0.2,1) infinite; opacity: 0.9; }
@keyframes laser-scan-anim { 0%{top:0%;opacity:0;} 10%{opacity:1;} 90%{opacity:1;} 100%{top:100%;opacity:0;} }

.bracket-column-group { display: flex; gap: 1.5rem; flex: 1; }
.side-left { justify-content: flex-start; }
.side-right { justify-content: flex-end; }
.side-center { flex: 0 0 240px; display: flex; flex-direction: column; align-items: center; justify-content: center; }

.round-column { display: flex; flex-direction: column; width: 125px; min-width: 120px; }
.round-header {
  text-align: center; font-family: var(--font-display);
  font-size: 0.72rem; font-weight: 700; letter-spacing: 1.5px;
  color: var(--iris); padding: 0.5rem;
  background: rgba(255,255,255,0.55);
  border: 1px solid var(--color-border); border-radius: 50px; margin-bottom: 1.5rem;
  backdrop-filter: blur(6px);
}
.matches-list { display: flex; flex-direction: column; justify-content: space-around; flex-grow: 1; gap: 1.5rem; }

.match-box {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 14px; padding: 0.3rem;
  box-shadow: var(--card-shadow);
  display: flex; flex-direction: column; gap: 2px; position: relative;
  transition: var(--transition-smooth);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.match-box:hover {
  background: var(--color-bg-card-hover); border-color: var(--color-border-hover);
  box-shadow: 0 0 26px rgba(143,198,255,0.35), var(--card-shadow); transform: translateY(-3px);
}
.match-id {
  position: absolute; top: -8px; left: 8px;
  font-size: 0.65rem; font-weight: 700;
  background: rgba(255,255,255,0.96); padding: 1px 7px; border-radius: 30px;
  border: 1px solid var(--iris); color: var(--iris);
  box-shadow: 0 2px 8px rgba(123,108,232,0.18);
}
.match-info-meta { font-size: 0.65rem; color: var(--ink-soft); text-align: right; padding: 2px 4px; }

.team-slot {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.38rem 0.5rem; border-radius: 10px; cursor: pointer;
  transition: var(--transition-smooth); user-select: none; border: 1.5px solid transparent;
}
.team-slot:hover { background: rgba(143,198,255,0.12); }
.team-slot.winner-selected {
  border-color: var(--sky); background: rgba(143,198,255,0.16);
  box-shadow: 0 0 14px rgba(143,198,255,0.4);
}
.team-slot.loser-deselected { opacity: 0.3; filter: grayscale(0.8); }
.team-slot.slot-confirmed {
  background: var(--color-confirmed); border-color: var(--color-confirmed-border);
  cursor: default; box-shadow: 0 0 10px rgba(127,200,232,0.2);
}
.team-slot.slot-confirmed:hover { background: rgba(127,200,232,0.16); }

.team-slot-left { display: flex; align-items: center; gap: 0.5rem; max-width: 75%; }
.flag-placeholder {
  width: 20px; height: 14px; background: #d8ddf0; border-radius: 3px;
  display: inline-block; font-size: 0.55rem; font-weight: 700; text-align: center;
  line-height: 14px; color: #8990b8;
}
.team-name { font-family: var(--font-display); font-weight: 600; font-size: 0.72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.team-slot-right { display: flex; align-items: center; gap: 0.4rem; }
.team-probability {
  font-size: 0.62rem; font-weight: 700; color: var(--iris);
  background: rgba(140,123,240,0.14); padding: 1px 5px; border-radius: 30px;
}
.team-lock-icon { font-size: 0.7rem; color: var(--color-accent); }
.team-flag-img { width: 18px; height: 12px; object-fit: cover; border-radius: 2px; border: 1px solid rgba(52,56,79,0.15); display: inline-block; }

/* Right-side mirroring */
.side-right .team-slot { flex-direction: row-reverse; }
.side-right .team-slot-left { flex-direction: row-reverse; gap: 0.5rem; }
.side-right .team-slot-right { flex-direction: row-reverse; gap: 0.4rem; }
.side-right .match-info-meta { text-align: left; }
.side-right .match-id { left: auto; right: 8px; }

/* Finals */
.finals-container { display: flex; flex-direction: column; gap: 2rem; width: 100%; }
.trophy-display {
  position: relative; width: 100%; height: 210px;
  border: 1px solid var(--color-border);
  background: radial-gradient(circle, rgba(255,255,255,0.92) 0%, rgba(240,243,255,0.8) 100%);
  border-radius: 22px; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  box-shadow: var(--card-shadow);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.trophy-bg-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.28; z-index: 1; }
.trophy-icon {
  font-size: 3.6rem; color: var(--gold); z-index: 2;
  filter: drop-shadow(0 0 16px rgba(231,200,121,0.6)); margin-bottom: 0.5rem;
  animation: float-trophy 3s ease-in-out infinite;
}
@keyframes float-trophy { 0%,100%{transform:translateY(0);} 50%{transform:translateY(-8px);} }
.trophy-glow { position: absolute; width: 150px; height: 150px; background: radial-gradient(circle, rgba(231,200,121,0.25) 0%, rgba(255,255,255,0) 70%); z-index: 1; }
.champion-podium { z-index: 2; text-align: center; width: 90%; }
.podium-label { font-family: var(--font-display); font-size: 0.65rem; font-weight: 800; letter-spacing: 2px; color: var(--color-accent); }
.champion-team-display {
  margin-top: 0.35rem; background: rgba(231,200,121,0.12);
  border: 1px solid var(--gold); border-radius: 14px; padding: 0.55rem 1rem;
  font-family: var(--font-display); font-size: 1.15rem; font-weight: 800; letter-spacing: 1px;
  box-shadow: 0 0 18px rgba(231,200,121,0.25); transition: var(--transition-smooth);
}
.champion-team-display.winning-animation { animation: champion-pulse 1s ease-in-out infinite alternate; }
@keyframes champion-pulse { 0%{transform:scale(1);} 100%{transform:scale(1.05); box-shadow:0 0 30px rgba(231,200,121,0.6);} }
.placeholder-text { color: var(--ink-soft); font-weight: 400; }
.final-match-box, .third-place-box { width: 100%; }
.final-header { color: var(--color-accent); border-color: rgba(231,200,121,0.35); background: rgba(231,200,121,0.08); }
.final-box { border-color: rgba(231,200,121,0.45); background: var(--color-bg-card); }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0; width: 100%; height: 100%;
  background: rgba(236,238,251,0.5); backdrop-filter: blur(10px);
  z-index: 1000; display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}
.modal-overlay.active { opacity: 1; pointer-events: auto; }
.modal-card {
  background: rgba(255,255,255,0.92); border: 1px solid var(--color-border-hover);
  border-radius: 22px; width: 90%; max-width: 400px;
  box-shadow: 0 30px 80px -20px rgba(124,123,200,0.5);
  transform: translateY(20px) scale(0.98); transition: transform 0.35s cubic-bezier(0.22,0.8,0.3,1);
  backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px);
}
.modal-overlay.active .modal-card { transform: translateY(0) scale(1); }
.modal-header { padding: 1.1rem 1.5rem; border-bottom: 1px solid var(--color-border); display: flex; justify-content: space-between; align-items: center; }
.modal-header h4 { font-family: var(--font-display); font-size: 1.1rem; font-weight: 700; color: var(--ink); }
.modal-close { background: transparent; border: none; color: var(--ink-soft); font-size: 1.5rem; cursor: pointer; transition: var(--transition-smooth); line-height: 1; }
.modal-close:hover { color: var(--ink); transform: rotate(90deg); }
.candidates-list { padding: 1rem; display: flex; flex-direction: column; gap: 0.5rem; max-height: 60vh; overflow-y: auto; }
.candidate-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.75rem 1rem; border-radius: 14px;
  background: rgba(246,247,252,0.8); border: 1px solid var(--color-border);
  cursor: pointer; transition: var(--transition-smooth);
}
.candidate-item:hover { background: rgba(143,198,255,0.14); border-color: var(--color-border-hover); box-shadow: 0 0 14px rgba(143,198,255,0.25); transform: translateX(2px); }
.candidate-name-group { display: flex; align-items: center; gap: 0.75rem; }
.candidate-name { font-family: var(--font-display); font-weight: 600; font-size: 0.95rem; color: var(--ink); }
.candidate-prob { font-family: var(--font-display); font-weight: 700; font-size: 0.85rem; color: var(--iris); background: rgba(140,123,240,0.12); padding: 2px 8px; border-radius: 30px; }

/* Footer */
footer { margin-top: auto; border-top: 1px solid var(--color-border); padding: 2rem 1.5rem; text-align: center; }
.footer-container p { font-size: 0.8rem; color: var(--ink-soft); font-weight: 300; }

/* Finalised badge */
.finalised-badge {
  margin-top: 0.75rem; background: linear-gradient(135deg, var(--gold), #f0d9a0);
  color: #6b4e16; font-family: var(--font-display); font-size: 0.7rem; font-weight: 800;
  padding: 0.32rem 0.85rem; border-radius: 50px; display: inline-flex; align-items: center; gap: 0.35rem;
  box-shadow: 0 6px 16px rgba(231,200,121,0.45); animation: pulse-gold 2s infinite; letter-spacing: 1px;
}
@keyframes pulse-gold { 0%{transform:scale(1);} 50%{transform:scale(1.05);} 100%{transform:scale(1);} }

/* Bracket locked overlay */
.bracket-container.bracket-locked::before {
  content: ""; position: absolute; inset: 0; width: 100%; height: 100%;
  background: rgba(246,247,252,0.04); backdrop-filter: saturate(0.85);
  z-index: 10; pointer-events: none; border-radius: 22px; border: 2px solid var(--gold);
  animation: lock-glow 3s infinite alternate;
}
@keyframes lock-glow { 0%{box-shadow: inset 0 0 20px rgba(231,200,121,0.08);} 100%{box-shadow: inset 0 0 40px rgba(231,200,121,0.2);} }
.bracket-container.bracket-locked .team-slot { cursor: default; }

/* =====================================================================
   Responsive
   ===================================================================== */
@media (max-width: 1400px) {
  .side-center { flex: 0 0 280px; }
  .bracket-container { padding: 0 1rem 3rem; }
}
@media (max-width: 1200px) {
  .bracket-container { overflow-x: auto; justify-content: flex-start; }
  .side-center { flex: 0 0 240px; }
}
@media (max-width: 900px) {
  .cinema-section { height: 320vh; }
  .bridge-hero { padding-top: 4rem; }
  .control-card { flex-direction: column; align-items: stretch; padding: 1.1rem 1.25rem; }
  .control-actions { justify-content: space-between; }
  .btn { flex: 1; justify-content: center; }
  .lang-select { max-width: 90px; }

  .bracket-container {
    zoom: 1; /* モバイルでは視認性を確保するためズームを1倍（等倍）に戻す */
  }

  .view-selector { display: flex; }
  .bracket-container.view-left .side-right,
  .bracket-container.view-left .side-center { display: none; }
  .bracket-container.view-left .side-left { flex: 1; justify-content: center; }
  .bracket-container.view-right .side-left,
  .bracket-container.view-right .side-center { display: none; }
  .bracket-container.view-right .side-right { flex: 1; justify-content: center; }
  .bracket-container.view-center .side-left,
  .bracket-container.view-center .side-right { display: none; }
  .bracket-container.view-center .side-center { flex: 1; }
}

/* Reduced motion: respect user preference */
@media (prefers-reduced-motion: reduce) {
  body::before, .veil-orb, .trophy-icon, .scroll-indicator, .dream-particles span { animation: none !important; }
  html { scroll-behavior: auto; }
}

/* SNS share and save image buttons */
.btn-share-x {
  background: #000000;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}
.btn-share-x:hover {
  background: #14171a;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5), 0 0 10px rgba(255, 255, 255, 0.2);
}
.btn-share-line {
  background: #06C755;
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(6, 199, 85, 0.3);
}
.btn-share-line:hover {
  background: #05b04b;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(6, 199, 85, 0.5);
}
.btn-share-wa {
  background: #25D366;
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
}
.btn-share-wa:hover {
  background: #20ba5a;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.5);
}
.btn-save-img {
  background: linear-gradient(135deg, var(--color-accent), #d4af37);
  color: #1a1a1a;
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}
.btn-save-img:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(212, 175, 55, 0.5);
}

/* Ensure flex wrap for control center actions on smaller screens */
.control-actions {
  flex-wrap: wrap;
  justify-content: center;
}

/* =====================================================================
   Live Match Station (Under the Bracket)
   ===================================================================== */
.live-station-section {
  max-width: 1200px;
  width: 92%;
  margin: 4rem auto 3rem;
  padding: 0 1rem;
}
.live-station-container {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 24px;
  padding: 2.2rem;
  box-shadow: var(--card-shadow);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}
.live-station-header {
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 1.2rem;
}
.live-station-header h3 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--iris), var(--sky));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.live-station-header p {
  font-size: 0.9rem;
  color: var(--ink-soft);
  margin-top: 0.35rem;
}

/* Grids and layouts */
.live-matches-grid {
  display: flex;
  flex-direction: column;
  gap: 1.8rem;
}
.live-sub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.2rem;
  margin-bottom: 1.5rem;
}
.live-section-subtitle {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--iris);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  margin-bottom: 0.8rem;
}

/* Match Cards */
.live-match-card {
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  padding: 1.2rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
  transition: var(--transition-smooth);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.live-match-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(124, 123, 200, 0.12);
  border-color: var(--color-border-hover);
}
.live-match-card.live {
  border-color: rgba(231, 76, 60, 0.3);
  background: rgba(231, 76, 60, 0.02);
}
.live-match-card.live:hover {
  border-color: rgba(231, 76, 60, 0.6);
  box-shadow: 0 8px 24px rgba(231, 76, 60, 0.15);
}

/* Card details inner */
.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
}
.card-stage {
  font-weight: 700;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.live-card-badge {
  padding: 0.25rem 0.65rem;
  border-radius: 50px;
  font-weight: 800;
  font-size: 0.7rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.live-card-badge.active-live {
  background: rgba(231, 76, 60, 0.12);
  color: #e74c3c;
}
.live-card-badge.finished-live {
  background: rgba(46, 204, 113, 0.1);
  color: #2ecc71;
}
.live-card-badge.upcoming-live {
  background: rgba(52, 152, 219, 0.1);
  color: #3498db;
}

.badge-dot {
  width: 7px;
  height: 7px;
  background-color: currentColor;
  border-radius: 50%;
  display: inline-block;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 1; }
}
.animate-pulse {
  animation: pulse-dot 1.2s infinite;
}

/* Teams score display inside card */
.card-teams-area {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.3rem 0;
  border-bottom: 1px dashed var(--color-border);
  padding-bottom: 0.8rem;
}
.card-team {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex: 1;
  min-width: 0;
}
.card-team.home {
  justify-content: flex-start;
}
.card-team.away {
  justify-content: flex-end;
  flex-direction: row-reverse;
}
.match-card-flag {
  width: 32px;
  height: 22px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid rgba(0,0,0,0.08);
}
.card-team-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-score-display {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--ink);
  padding: 0 1rem;
  letter-spacing: 1px;
  white-space: nowrap;
  flex-shrink: 0;
  text-align: center;
  min-width: 80px;
}
.card-vs-label {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--ink-soft);
  padding: 0 1.2rem;
}

/* Card details grid (referee/date) */
.card-details-grid {
  display: flex;
  justify-content: space-between;
  font-size: 0.76rem;
  color: var(--ink-soft);
  flex-wrap: wrap;
  gap: 0.6rem;
}
.detail-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.detail-item i {
  color: var(--iris);
}

/* Bracket match box active live effect */
.match-box.live-match-active {
  border-color: #e74c3c;
  box-shadow: 0 0 15px rgba(231, 76, 60, 0.35), var(--card-shadow);
  animation: live-match-border-pulse 2s infinite alternate;
}
.match-box.live-match-active::after {
  content: "LIVE";
  position: absolute;
  top: -8px;
  right: 8px;
  font-size: 0.55rem;
  font-weight: 900;
  color: #fff;
  background: #e74c3c;
  padding: 1px 5px;
  border-radius: 30px;
  box-shadow: 0 2px 6px rgba(231, 76, 60, 0.4);
  animation: live-label-blink 1.2s infinite;
}
.side-right .match-box.live-match-active::after {
  right: auto;
  left: 8px;
}

@keyframes live-match-border-pulse {
  0% { border-color: rgba(231, 76, 60, 0.3); box-shadow: 0 0 4px rgba(231, 76, 60, 0.15), var(--card-shadow); }
  100% { border-color: rgba(231, 76, 60, 1); box-shadow: 0 0 18px rgba(231, 76, 60, 0.45), var(--card-shadow); }
}
@keyframes live-label-blink {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

/* Placeholder inside live grid */
.live-matches-placeholder {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--ink-soft);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
}
.live-matches-placeholder i {
  font-size: 2.2rem;
  color: var(--iris);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .live-station-container {
    padding: 1.4rem;
  }
  .live-sub-grid {
    grid-template-columns: 1fr;
  }
  .card-team-name {
    font-size: 0.85rem;
  }
  .card-score-display {
    font-size: 1.2rem;
  }
}
