:root {
      /* LIGHT THEME (default) */
      --bg-gradient: radial-gradient(120% 120% at 50% 10%, #f8fafc 30%, #e2e8f0 70%, #dbeafe 100%);
      --bg-glass: rgba(255, 255, 255, 0.45);
      --bg-glass-active: rgba(255, 255, 255, 0.75);
      --bg-glass-dark: rgba(15, 23, 42, 0.04);
      --border-glass: rgba(255, 255, 255, 0.6);
      --border-glass-hover: rgba(16, 185, 129, 0.4);
      
      --accent: #10b981; /* Grass Green */
      --accent-glow: rgba(16, 185, 129, 0.25);
      --accent-light: #d1fae5;
      
      --blue: #3b82f6;
      --blue-light: #dbeafe;
      
      --red: #ef4444;
      --red-light: #fee2e2;
      
      --text-main: #0f172a; /* Deep Navy */
      --text-muted: #64748b; /* Slate Gray */
      --text-light: #94a3b8;
      
      --gold: #f59e0b;
      --silver: #94a3b8;
      --bronze: #d97706;
      
      --shadow-airy: 0 10px 40px -10px rgba(148, 163, 184, 0.12), 0 1px 3px rgba(148, 163, 184, 0.05);
      --shadow-hover: 0 20px 40px -5px rgba(16, 185, 129, 0.08), 0 1px 5px rgba(0, 0, 0, 0.02);
      --shadow-pop: 0 20px 50px -15px rgba(15, 23, 42, 0.15);
      
      --radius-large: 24px;
      --radius-medium: 16px;
      --radius-small: 12px;

      --ambient-1: rgba(59, 130, 246, 0.08);
      --ambient-2: rgba(16, 185, 129, 0.08);
      --phone-border: rgba(255, 255, 255, 0.7);
      --phone-bg: rgba(255, 255, 255, 0.35);
      --phone-notch-bg: rgba(255, 255, 255, 0.9);
      --card-hover-bg: #ffffff;
      --odd-bg: rgba(255, 255, 255, 0.4);
      --sub-tab-bg: rgba(15, 23, 42, 0.03);
      --node-border: rgba(255, 255, 255, 0.3);
      --scrollbar-thumb: rgba(148, 163, 184, 0.3);
    }

    body.dark-theme {
      /* DARK THEME */
      --bg-gradient: radial-gradient(120% 120% at 50% 10%, #090d16 20%, #020617 70%, #0f172a 100%);
      --bg-glass: rgba(15, 23, 42, 0.55);
      --bg-glass-active: rgba(30, 41, 59, 0.8);
      --bg-glass-dark: rgba(255, 255, 255, 0.05);
      --border-glass: rgba(255, 255, 255, 0.08);
      --border-glass-hover: rgba(16, 185, 129, 0.5);
      
      --accent-light: rgba(16, 185, 129, 0.15);
      
      --text-main: #f8fafc; /* Silver-White */
      --text-muted: #94a3b8; /* Cool Gray */
      --text-light: #64748b;
      
      --shadow-airy: 0 10px 40px -10px rgba(0, 0, 0, 0.4), 0 1px 3px rgba(0, 0, 0, 0.2);
      --shadow-hover: 0 20px 40px -5px rgba(16, 185, 129, 0.2), 0 1px 5px rgba(0, 0, 0, 0.1);
      
      --ambient-1: rgba(59, 130, 246, 0.15);
      --ambient-2: rgba(16, 185, 129, 0.15);
      --phone-border: rgba(255, 255, 255, 0.06);
      --phone-bg: rgba(15, 23, 42, 0.5);
      --phone-notch-bg: rgba(9, 13, 22, 0.95);
      --card-hover-bg: rgba(30, 41, 59, 0.7);
      --odd-bg: rgba(15, 23, 42, 0.4);
      --sub-tab-bg: rgba(255, 255, 255, 0.03);
      --node-border: rgba(255, 255, 255, 0.08);
      --scrollbar-thumb: rgba(255, 255, 255, 0.15);
    }

    * { 
      box-sizing: border-box; 
      margin: 0; 
      padding: 0; 
      font-family: 'Plus Jakarta Sans', 'Outfit', system-ui, -apple-system, sans-serif;
    }
    
    body {
      background: var(--bg-gradient);
      color: var(--text-main);
      min-height: 100vh;
      display: flex;
      flex-direction: column;
      align-items: center;
      padding: 2rem 1rem;
      overflow-x: hidden;
      position: relative;
      transition: background 0.5s ease, color 0.3s ease;
    }

    /* Ambient Glowing Orbs in Background */
    .ambient-glow {
      position: absolute;
      width: 600px;
      height: 600px;
      border-radius: 50%;
      background: radial-gradient(circle, var(--ambient-1) 0%, rgba(59, 130, 246, 0) 70%);
      top: -100px;
      left: 50%;
      transform: translateX(-120%);
      z-index: -1;
      pointer-events: none;
      transition: background 0.5s ease;
    }
    .ambient-glow-2 {
      position: absolute;
      width: 500px;
      height: 500px;
      border-radius: 50%;
      background: radial-gradient(circle, var(--ambient-2) 0%, rgba(16, 185, 129, 0) 70%);
      bottom: 100px;
      left: 50%;
      transform: translateX(20%);
      z-index: -1;
      pointer-events: none;
      transition: background 0.5s ease;
    }

    /* Demo Controls */
    .demo-controls {
      display: flex;
      gap: 0.8rem;
      margin-bottom: 2rem;
      background: var(--bg-glass);
      backdrop-filter: blur(10px);
      padding: 0.5rem;
      border-radius: var(--radius-medium);
      border: 1px solid var(--border-glass);
      box-shadow: var(--shadow-airy);
      z-index: 10;
      transition: all 0.3s ease;
    }

    .demo-btn {
      background: transparent;
      border: none;
      padding: 0.6rem 1.2rem;
      font-size: 0.85rem;
      font-weight: 700;
      color: var(--text-muted);
      cursor: pointer;
      border-radius: var(--radius-small);
      transition: all 0.3s ease;
      display: flex;
      align-items: center;
      gap: 0.5rem;
    }

    .demo-btn.active {
      background: var(--bg-glass-active);
      color: var(--text-main);
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
      border: 1px solid var(--border-glass);
    }

    /* Outer Wrapper supporting Desktop/Mobile toggling */
    .app-viewport {
      transition: all 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
      width: 100%;
      display: flex;
      justify-content: center;
    }

    /* Base Container (Acts as the phone frame by default) */
    .phone-container {
      width: 100%;
      display: flex;
      flex-direction: column;
      position: relative;
      overflow: hidden;
      backdrop-filter: blur(30px);
      transition: all 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
    }

    /* Mobile view specific styling */
    .app-viewport.mode-mobile .phone-container {
      max-width: 420px;
      height: 90vh; max-height: 880px; min-height: 600px;
      background: var(--phone-bg);
      border: 12px solid var(--phone-border);
      border-radius: 50px;
      box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.15), inset 0 2px 2px rgba(255,255,255,0.4);
    }

    .app-viewport.mode-mobile .phone-notch {
      width: 140px;
      height: 28px;
      background: var(--phone-notch-bg);
      position: absolute;
      top: 0;
      left: 50%;
      transform: translateX(-50%);
      border-bottom-left-radius: 18px;
      border-bottom-right-radius: 18px;
      z-index: 10;
      box-shadow: inset 0 -1px 2px rgba(0,0,0,0.02);
      transition: background 0.3s ease;
    }

    /* Tablet/PC Layout (768px - Side Nav + Dual Column content) */
    .app-viewport.mode-tablet .phone-container {
      max-width: 768px;
      height: 92vh; max-height: 900px; min-height: 600px;
      background: var(--phone-bg);
      border: 6px solid var(--phone-border);
      border-radius: 36px;
      box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.2);
      display: grid;
      grid-template-columns: 200px 1fr;
      grid-template-rows: auto 1fr;
    }

    .app-viewport.mode-tablet .phone-notch {
      display: none;
    }

    /* Header adjustments in Tablet mode */
    .app-viewport.mode-tablet .app-header {
      grid-column: 2;
      grid-row: 1;
      padding: 1.5rem 2rem;
      border-bottom: 1px solid var(--border-glass);
      background: linear-gradient(to bottom, var(--bg-glass), transparent);
    }

    /* App Header default */
    .app-header {
      padding: 2.5rem 1.5rem 1.2rem 1.5rem;
      background: linear-gradient(to bottom, var(--bg-glass), transparent);
      border-bottom: 1px solid var(--border-glass);
      display: flex;
      justify-content: space-between;
      align-items: center;
      z-index: 2;
    }

    .app-header h1 {
      font-size: 1.4rem;
      font-weight: 800;
      letter-spacing: -0.02em;
      color: var(--text-main);
    }

    .chat-badge {
      background: rgba(16, 185, 129, 0.08);
      border: 1px solid rgba(16, 185, 129, 0.2);
      color: var(--accent);
      padding: 0.4rem 0.9rem;
      border-radius: 30px;
      font-size: 0.75rem;
      font-weight: 700;
      box-shadow: 0 4px 12px rgba(16, 185, 129, 0.05);
      display: flex;
      align-items: center;
      gap: 0.3rem;
    }

    /* Header Theme Switcher Icon */
    .header-actions {
      display: flex;
      align-items: center;
      gap: 0.75rem;
    }

    .theme-toggle-btn {
      background: var(--bg-glass);
      border: 1px solid var(--border-glass);
      color: var(--text-main);
      width: 38px;
      height: 38px;
      border-radius: 50%;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: all 0.25s ease;
      box-shadow: var(--shadow-airy);
    }
    .theme-toggle-btn:hover {
      background: var(--bg-glass-active);
      transform: scale(1.05);
      border-color: var(--accent);
    }
    
    .theme-toggle-btn svg {
      width: 18px;
      height: 18px;
      fill: none;
      stroke: currentColor;
      stroke-width: 2;
    }
    
    .sun-icon { display: block; }
    .moon-icon { display: none; }
    
    body.dark-theme .sun-icon { display: none; }
    body.dark-theme .moon-icon { display: block; }

    /* App Body layout */
    .app-body {
      flex: 1;
      overflow-y: auto;
      padding: 1.2rem;
      padding-bottom: 90px;
      z-index: 2;
    }

    .app-viewport.mode-tablet .app-body {
      grid-column: 2;
      grid-row: 2;
      padding: 2rem;
      overflow-y: auto;
      padding-bottom: 30px;
    }

    .app-body::-webkit-scrollbar { display: none; }

    /* Navigation Bar (Becomes sidebar in Tablet mode) */
    .app-nav {
      position: absolute;
      bottom: 0;
      left: 0;
      right: 0;
      height: 80px;
      background: var(--bg-glass);
      backdrop-filter: blur(25px);
      border-top: 1px solid var(--border-glass);
      display: flex;
      justify-content: space-around;
      align-items: center;
      padding: 0 1rem;
      z-index: 5;
      transition: all 0.3s ease;
    }

    .app-viewport.mode-tablet .app-nav {
      position: static;
      grid-column: 1;
      grid-row: 1 / 3;
      height: 100%;
      width: 200px;
      border-top: none;
      border-right: 1px solid var(--border-glass);
      flex-direction: column;
      justify-content: flex-start;
      align-items: stretch;
      padding: 3rem 1rem;
      gap: 0.5rem;
    }

    .nav-item {
      display: flex;
      flex-direction: column;
      align-items: center;
      color: var(--text-muted);
      cursor: pointer;
      font-size: 0.75rem;
      font-weight: 700;
      transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
      flex: 1;
      padding: 0.6rem 0;
      opacity: 0.65;
      position: relative;
    }

    .app-viewport.mode-tablet .nav-item {
      flex: 0;
      flex-direction: row;
      justify-content: flex-start;
      gap: 0.8rem;
      font-size: 0.9rem;
      padding: 0.9rem 1.2rem;
      border-radius: var(--radius-small);
      opacity: 0.75;
    }

    .nav-item svg {
      width: 20px;
      height: 20px;
      margin-bottom: 4px;
      stroke: var(--text-muted);
      fill: none;
      transition: all 0.3s ease;
    }
    
    .app-viewport.mode-tablet .nav-item svg {
      margin-bottom: 0;
    }

    .nav-item.active {
      color: var(--text-main);
      opacity: 1;
    }

    .nav-item.active svg {
      stroke: var(--accent);
      filter: drop-shadow(0 2px 8px var(--accent-glow));
      transform: translateY(-2px);
    }
    
    .app-viewport.mode-tablet .nav-item.active {
      background: var(--bg-glass-active);
      color: var(--accent);
      border: 1px solid var(--border-glass);
    }

    /* Tab content */
    .tab-content { display: none; }
    .tab-content.active { display: block; animation: smoothSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1); }

    @keyframes smoothSlideIn {
      from { opacity: 0; transform: translateY(16px); }
      to { opacity: 1; transform: translateY(0); }
    }

    /* Airy Cards */
    .section-title {
      font-size: 0.8rem;
      font-weight: 800;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      color: var(--text-muted);
      margin: 1.8rem 0 0.8rem 0;
      display: flex;
      justify-content: space-between;
      align-items: center;
    }

    .glass-card {
      background: var(--bg-glass);
      border: 1px solid var(--border-glass);
      border-radius: var(--radius-large);
      padding: 1.5rem;
      margin-bottom: 1.2rem;
      box-shadow: var(--shadow-airy);
      backdrop-filter: blur(15px);
      transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    }

    .glass-card:hover {
      border-color: var(--border-glass-hover);
      box-shadow: var(--shadow-hover);
      transform: translateY(-2px);
      background: var(--card-hover-bg);
    }

    /* Two-column layout helper for tablet mode */
    .tablet-grid-2 {
      display: grid;
      grid-template-columns: 1fr;
      gap: 1.2rem;
    }
    .app-viewport.mode-tablet .tablet-grid-2 {
      grid-template-columns: 1fr 1fr;
    }

    /* Custom Horizontal Slider UI */
    .horizontal-slider-container {
      position: relative;
      margin: 1.2rem 0;
      padding: 0.2rem 0;
    }

    .horizontal-scroll-viewport {
      display: flex;
      gap: 1rem;
      overflow-x: auto;
      scroll-behavior: smooth;
      padding-bottom: 1rem;
      scrollbar-width: none; /* Firefox */
      -ms-overflow-style: none;  /* IE and Edge */
    }
    .horizontal-scroll-viewport::-webkit-scrollbar {
      display: none; /* Chrome, Safari, Opera */
    }

    .slider-card-match {
      flex: 0 0 280px;
      background: var(--bg-glass);
      border: 1px solid var(--border-glass);
      border-radius: var(--radius-medium);
      padding: 1.2rem;
      box-shadow: var(--shadow-airy);
      scroll-snap-align: center;
      transition: all 0.3s ease;
    }
    
    .app-viewport.mode-tablet .slider-card-match {
      flex: 1 1 45%;
    }
    
    /* Layout change for matches on tablet */
    .app-viewport.mode-tablet .horizontal-scroll-viewport {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 1.2rem;
      overflow-x: visible;
      padding-bottom: 0;
    }
    .app-viewport.mode-tablet .horizontal-slider-dots {
      display: none;
    }

    /* Custom Tiny Glass Scrollbar Overlay for Bracket Viewport */
    .custom-scrollbar-viewport {
      overflow-x: auto;
      scrollbar-width: thin;
      scrollbar-color: rgba(16, 185, 129, 0.3) transparent;
      padding-bottom: 0.8rem;
    }

    /* Webkit-specific styling for the horizontal slider */
    .custom-scrollbar-viewport::-webkit-scrollbar {
      height: 6px;
    }
    .custom-scrollbar-viewport::-webkit-scrollbar-track {
      background: rgba(15, 23, 42, 0.02);
      border-radius: 10px;
    }
    .custom-scrollbar-viewport::-webkit-scrollbar-thumb {
      background: var(--scrollbar-thumb);
      border-radius: 10px;
      border: 1px solid rgba(255, 255, 255, 0.05);
      transition: background 0.3s ease;
    }
    .custom-scrollbar-viewport::-webkit-scrollbar-thumb:hover {
      background: var(--accent);
      box-shadow: 0 0 8px var(--accent-glow);
    }

    /* Match Detail Elements */
    .match-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      font-size: 0.75rem;
      color: var(--text-muted);
      margin-bottom: 0.8rem;
      font-weight: 600;
    }

    .status-badge {
      background: rgba(16, 185, 129, 0.08);
      color: var(--accent);
      padding: 0.25rem 0.4rem;
      border-radius: 20px;
      font-weight: 700;
      font-size: 0.7rem;
      letter-spacing: 0.02em;
      white-space: nowrap;
      transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
      opacity: 1;
      transform: scale(1);
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 95px;
      text-align: center;
      box-sizing: border-box;
    }

    .status-badge.fade-out {
      opacity: 0;
      transform: scale(0.9);
    }

    .status-badge.completed {
      background: rgba(148, 163, 184, 0.1);
      color: var(--text-muted);
    }

    .status-badge.countdown {
      font-variant-numeric: tabular-nums !important;
    }

    .match-versus {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin: 0.6rem 0 1rem 0;
    }

    .team-block {
      display: flex;
      flex-direction: column;
      align-items: center;
      flex: 1;
    }

    .flag-circle {
      width: 46px;
      height: 46px;
      border-radius: 50%;
      border: 2px solid var(--border-glass);
      display: flex;
      align-items: center;
      justify-content: center;
      box-shadow: 0 6px 16px rgba(0,0,0,0.06);
      margin-bottom: 0.4rem;
      overflow: hidden;
    }
    
    .flag-circle img {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }

    .team-name {
      font-size: 0.85rem;
      font-weight: 700;
      color: var(--text-main);
      text-align: center;
    }

    .score-label {
      font-size: 1.8rem;
      font-weight: 900;
      color: var(--text-main);
      padding: 0 0.5rem;
      letter-spacing: -0.02em;
    }

    .vs-text {
      font-size: 0.75rem;
      color: var(--text-light);
      font-weight: 800;
      padding: 0 0.5rem;
    }

    /* Odds Layout */
    .odds-layout {
      display: grid;
      grid-template-columns: 1fr 1fr 1fr;
      gap: 0.5rem;
      margin-bottom: 1rem;
    }

    .odd-box {
      background: var(--odd-bg);
      border: 1px solid var(--border-glass);
      border-radius: var(--radius-small);
      padding: 0.5rem;
      text-align: center;
      font-size: 0.7rem;
      color: var(--text-muted);
      transition: all 0.25s ease;
      cursor: pointer;
    }
    .odd-box:hover {
      background: var(--card-hover-bg);
      border-color: var(--accent);
      color: var(--accent);
    }
    .odd-box strong {
      display: block;
      font-size: 0.85rem;
      color: var(--text-main);
      font-weight: 800;
      margin-top: 2px;
    }

    /* Dynamic Vote Bar */
    .vote-bar-section {
      border-top: 1px solid var(--border-glass);
      padding-top: 0.8rem;
    }
    .vote-percentage-text {
      display: flex;
      justify-content: space-between;
      font-size: 0.75rem;
      color: var(--text-muted);
      margin-bottom: 0.4rem;
      font-weight: 600;
    }
    .vote-bar-track {
      height: 6px;
      background: rgba(15, 23, 42, 0.05);
      border-radius: 10px;
      display: flex;
      overflow: hidden;
    }
    body.dark-theme .vote-bar-track {
      background: rgba(255, 255, 255, 0.05);
    }
    .vote-bar-fill {
      height: 100%;
      transition: width 0.8s ease;
    }
    .vote-fill-home { background: var(--blue); }
    .vote-fill-draw { background: var(--text-light); }
    .vote-fill-away { background: var(--red); }

    /* Leaders / Leaderboard */
    .rank-row {
      display: flex;
      align-items: center;
      background: var(--bg-glass);
      border: 1px solid var(--border-glass);
      border-radius: var(--radius-medium);
      padding: 0.9rem 1.2rem;
      margin-bottom: 0.6rem;
      box-shadow: var(--shadow-airy);
      transition: all 0.25s ease;
    }
    .rank-row:hover {
      border-color: var(--border-glass-hover);
      transform: scale(1.01);
      background: var(--bg-glass-active);
    }
    .rank-num {
      font-size: 1.1rem;
      font-weight: 800;
      width: 28px;
      color: var(--text-muted);
    }
    .rank-num.top-1 { color: var(--gold); }
    .rank-num.top-2 { color: var(--silver); }
    .rank-num.top-3 { color: var(--bronze); }

    .avatar {
      width: 36px;
      height: 36px;
      border-radius: 50%;
      background: var(--bg-glass-dark);
      border: 1px solid var(--border-glass);
      display: flex;
      align-items: center;
      justify-content: center;
      font-weight: 800;
      color: var(--text-main);
      font-size: 0.85rem;
      margin-right: 0.8rem;
      box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
    }
    
    .user-meta {
      flex: 1;
    }
    .user-name {
      font-size: 0.85rem;
      font-weight: 800;
      display: block;
    }
    .user-tg {
      font-size: 0.75rem;
      color: var(--text-muted);
    }
    .points {
      font-size: 0.8rem;
      font-weight: 800;
      color: var(--accent);
      background: rgba(16, 185, 129, 0.08);
      border: 1px solid rgba(16, 185, 129, 0.2);
      padding: 0.35rem 0.7rem;
      border-radius: 10px;
    }

    /* Sub Tabs */
    .sub-tabs-container {
      display: flex;
      background: var(--sub-tab-bg);
      padding: 0.3rem;
      border-radius: var(--radius-small);
      border: 1px solid var(--border-glass);
      margin-bottom: 1.2rem;
    }
    .sub-tab-item {
      flex: 1;
      text-align: center;
      padding: 0.6rem;
      font-size: 0.8rem;
      font-weight: 700;
      color: var(--text-muted);
      cursor: pointer;
      border-radius: 8px;
      transition: all 0.25s ease;
    }
    .sub-tab-item.active {
      background: var(--bg-glass-active);
      color: var(--text-main);
      box-shadow: 0 4px 12px rgba(148, 163, 184, 0.05);
      border: 1px solid var(--border-glass);
    }

    /* Playoff Tree Layout & Aesthetics */
    .bracket-wrapper {
      display: flex;
      gap: 2.5rem;
      width: max-content;
      padding: 1rem 0;
      position: relative;
    }

    .bracket-round {
      width: 220px;
      display: flex;
      flex-direction: column;
      justify-content: space-around;
      gap: 1.5rem;
    }

    .round-title {
      font-size: 0.75rem;
      font-weight: 800;
      text-transform: uppercase;
      color: var(--accent);
      letter-spacing: 0.06em;
      text-align: center;
      padding-bottom: 0.5rem;
      border-bottom: 1px solid var(--node-border);
      margin-bottom: 1rem;
    }

    .bracket-match-node {
      background: var(--bg-glass);
      border: 1px solid var(--border-glass);
      border-radius: var(--radius-medium);
      overflow: hidden;
      box-shadow: var(--shadow-airy);
      transition: all 0.3s ease;
      position: relative;
    }

    .bracket-match-node::before {
      content: '';
      position: absolute;
      left: 0; top: 0; bottom: 0;
      width: 4px;
      background: rgba(148, 163, 184, 0.2);
    }
    
    .bracket-match-node.winner-active::before {
      background: var(--accent);
    }

    .bracket-match-node:hover {
      border-color: var(--accent-glow);
      transform: translateY(-2px);
      box-shadow: var(--shadow-hover);
    }

    .node-team-row {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 0.6rem 0.9rem;
      font-size: 0.8rem;
      color: var(--text-muted);
      border-bottom: 1px solid var(--node-border);
      transition: background 0.2s ease;
    }
    .node-team-row:last-child {
      border-bottom: none;
    }
    
    .node-team-row.winner {
      font-weight: 700;
      color: var(--text-main);
      background: rgba(16, 185, 129, 0.03);
    }

    .node-team-row.winner::after {
      content: '✓';
      color: var(--accent);
      font-size: 0.75rem;
      font-weight: 900;
      margin-left: 6px;
    }

    .node-score {
      font-weight: 800;
      color: var(--text-light);
    }
    .winner .node-score {
      color: var(--accent);
    }
    
    .node-team-info {
      display: flex;
      align-items: center;
      gap: 0.5rem;
    }
    
    .node-flag {
      width: 20px;
      height: 14px;
      object-fit: cover;
      border-radius: 2px;
      border: 1px solid var(--node-border);
      box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    }

    /* Expand Fullscreen View button */
    .expand-btn {
      background: var(--bg-glass);
      border: 1px solid var(--border-glass);
      padding: 0.5rem 1rem;
      border-radius: var(--radius-small);
      font-size: 0.75rem;
      font-weight: 700;
      color: var(--text-main);
      cursor: pointer;
      transition: all 0.25s ease;
      display: flex;
      align-items: center;
      gap: 0.4rem;
    }
    .expand-btn:hover {
      border-color: var(--accent);
      background: var(--bg-glass-active);
      color: var(--accent);
    }

    /* Group Stage Collapsible Cards */
    .group-accordion {
      background: var(--bg-glass);
      border: 1px solid var(--border-glass);
      border-radius: var(--radius-medium);
      padding: 1rem 1.2rem;
      margin-bottom: 0.8rem;
      transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
      overflow: hidden;
    }

    .group-accordion-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      cursor: pointer;
    }

    .group-accordion-header h4 {
      font-size: 0.85rem;
      font-weight: 800;
      color: var(--text-main);
      letter-spacing: 0.02em;
    }

    .chevron-icon {
      width: 18px;
      height: 18px;
      transition: transform 0.3s ease;
      stroke: var(--text-muted);
      stroke-width: 2.5;
      fill: none;
    }

    .group-accordion.collapsed .chevron-icon {
      transform: rotate(-90deg);
    }

    .group-accordion.collapsed .group-table-wrap {
      max-height: 0;
      opacity: 0;
      margin-top: 0;
    }

    .group-table-wrap {
      max-height: 500px;
      opacity: 1;
      margin-top: 1rem;
      transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
      overflow: hidden;
    }

    .group-table {
      width: 100%;
      border-collapse: collapse;
      font-size: 0.8rem;
    }
    
    .group-table th {
      color: var(--text-muted);
      font-weight: 600;
      text-align: left;
      padding-bottom: 0.6rem;
      border-bottom: 1px solid var(--node-border);
    }

    .group-table td {
      padding: 0.6rem 0;
      border-bottom: 1px solid var(--node-border);
      color: var(--text-main);
    }
    
    .group-table tr:last-child td {
      border-bottom: none;
    }
    
    .group-team-cell {
      display: flex;
      align-items: center;
      gap: 0.5rem;
    }

    .val-cell {
      text-align: center;
      width: 36px;
      color: var(--text-muted) !important;
    }

    /* Fullscreen Modal overlay */
    .fullscreen-modal-view {
      display: none;
      position: fixed;
      top: 0; left: 0; right: 0; bottom: 0;
      background: var(--bg-gradient);
      backdrop-filter: blur(20px);
      z-index: 1000;
      padding: 2.5rem 2.5rem;
      flex-direction: column;
      animation: modalSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
      transition: background 0.5s ease;
    }

    .fullscreen-modal-view.active {
      display: flex;
    }

    @keyframes modalSlideUp {
      from { opacity: 0; transform: translateY(30px); }
      to { opacity: 1; transform: translateY(0); }
    }

    .modal-nav {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 2rem;
    }

    .modal-close-btn {
      background: var(--text-main);
      color: var(--phone-notch-bg);
      border: none;
      padding: 0.6rem 1.2rem;
      border-radius: var(--radius-small);
      font-weight: 700;
      font-size: 0.85rem;
      cursor: pointer;
      box-shadow: var(--shadow-airy);
      transition: all 0.25s ease;
    }
    .modal-close-btn:hover {
      transform: scale(1.02);
      opacity: 0.9;
    }

    /* Slider dots pagination */
    .horizontal-slider-dots {
      display: flex;
      justify-content: center;
      gap: 0.4rem;
      margin-top: 1rem;
    }
    .slider-dot {
      width: 8px;
      height: 8px;
      border-radius: 50%;
      background: rgba(148, 163, 184, 0.3);
      cursor: pointer;
      transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .slider-dot.active {
      width: 20px;
      border-radius: 4px;
      background: var(--accent);
    }

    /* Telegram WebApp Integration Styles */
    body.telegram-app {
      padding: 0 !important;
    }
    body.telegram-app .demo-controls {
      display: none !important;
    }
    body.telegram-app .app-viewport {
      padding: 0 !important;
      margin: 0 !important;
      height: 100vh !important;
      width: 100vw !important;
    }
    body.telegram-app .phone-container {
      max-width: 100% !important;
      height: 100vh !important;
      max-height: 100vh !important;
      border: none !important;
      border-radius: 0 !important;
      box-shadow: none !important;
    }
    body.telegram-app .phone-notch {
      display: none !important;
    }

    /* Completed day header styling */
    .completed-day-header {
      font-size: 0.8rem;
      font-weight: 800;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      color: var(--accent);
      margin: 1.8rem 0 0.8rem 0.2rem;
      border-left: 3px solid var(--accent);
      padding-left: 0.6rem;
    }

    /* Details Modal Overlay */
    .details-modal-overlay {
      position: fixed;
      top: 0;
      left: 0;
      width: 100vw;
      height: 100vh;
      background: rgba(9, 13, 22, 0.45);
      backdrop-filter: blur(15px);
      -webkit-backdrop-filter: blur(15px);
      z-index: 10000;
      display: flex;
      align-items: center;
      justify-content: center;
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.3s ease;
    }
    .details-modal-overlay.active {
      opacity: 1;
      pointer-events: auto;
    }

    /* Details Modal Box */
    .details-modal-box {
      width: 90%;
      max-width: 440px;
      background: var(--bg-glass);
      border: 1px solid var(--border-glass);
      box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
      border-radius: 28px;
      padding: 1.5rem;
      color: var(--text-main);
      max-height: 85vh;
      overflow-y: auto;
      transform: scale(0.92);
      transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    }
    .details-modal-overlay.active .details-modal-box {
      transform: scale(1);
    }

    .modal-header {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      border-bottom: 1px solid var(--border-glass);
      padding-bottom: 0.8rem;
      margin-bottom: 1rem;
    }
    .modal-header h4 {
      margin: 0;
      font-size: 1.1rem;
      font-weight: 900;
      color: var(--accent);
      letter-spacing: -0.01em;
    }
    .modal-header span {
      font-size: 0.72rem;
      color: var(--text-muted);
      font-weight: 500;
    }
    .modal-close-x {
      font-size: 1.8rem;
      line-height: 1;
      color: var(--text-light);
      cursor: pointer;
      transition: color 0.2s ease;
    }
    .modal-close-x:hover {
      color: var(--red);
    }

    /* Scoreboard inside Modal */
    .modal-scoreboard {
      display: flex;
      justify-content: space-between;
      align-items: center;
      background: var(--bg-glass-dark);
      padding: 1rem 0.5rem;
      border-radius: var(--radius-medium);
      margin-bottom: 1.2rem;
      border: 1px solid var(--border-glass);
    }
    .modal-team {
      display: flex;
      flex-direction: column;
      align-items: center;
      width: 35%;
    }
    .modal-flag-circle {
      width: 48px;
      height: 48px;
      border-radius: 50%;
      overflow: hidden;
      border: 2px solid var(--border-glass);
      margin-bottom: 0.5rem;
      box-shadow: var(--shadow-airy);
    }
    .modal-flag-circle img {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }
    .modal-team-name {
      font-size: 0.82rem;
      font-weight: 800;
      text-align: center;
      color: var(--text-main);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      width: 100%;
    }
    .modal-score {
      font-size: 2rem;
      font-weight: 900;
      color: var(--text-main);
      width: 30%;
      text-align: center;
      letter-spacing: -0.03em;
    }

    /* Sections inside Modal */
    .modal-section {
      margin-bottom: 1.2rem;
    }
    .modal-section-title {
      font-size: 0.72rem;
      font-weight: 900;
      text-transform: uppercase;
      color: var(--accent);
      letter-spacing: 0.06em;
      margin-bottom: 0.5rem;
    }

    /* Timeline */
    .modal-timeline {
      display: flex;
      flex-direction: column;
      gap: 0.4rem;
      background: var(--bg-glass-dark);
      border-radius: 12px;
      padding: 0.75rem;
      border: 1px solid var(--border-glass);
      font-size: 0.8rem;
    }
    .timeline-item {
      display: flex;
      gap: 0.5rem;
      align-items: center;
      color: var(--text-main);
      font-weight: 500;
    }
    .timeline-item strong {
      font-weight: 700;
    }
    .empty-timeline {
      color: var(--text-muted);
      font-style: italic;
      font-size: 0.78rem;
      text-align: center;
    }

    /* Stadium */
    .modal-stadium {
      background: var(--bg-glass-dark);
      border-radius: 12px;
      padding: 0.6rem 0.8rem;
      font-size: 0.82rem;
      color: var(--text-main);
      border: 1px solid var(--border-glass);
      font-weight: 600;
    }

    /* Odds Row */
    .modal-odds-row {
      display: grid;
      grid-template-columns: 1fr 1fr 1fr;
      gap: 0.5rem;
    }
    .modal-odd-box {
      background: var(--odd-bg);
      border: 1px solid var(--border-glass);
      padding: 0.5rem;
      border-radius: var(--radius-small);
      text-align: center;
      font-size: 0.75rem;
      color: var(--text-muted);
      font-weight: 600;
    }
    .modal-odd-box strong {
      color: var(--text-main);
      font-weight: 800;
    }

    /* Voters predictions details */
    .modal-vote-bar-track {
      height: 8px;
      background: var(--bg-glass-dark);
      border-radius: 10px;
      display: flex;
      overflow: hidden;
      margin-bottom: 0.5rem;
      border: 1px solid var(--border-glass);
    }
    .modal-vote-bar-fill {
      height: 100%;
      transition: width 0.8s ease;
    }
    .modal-vote-bar-fill.fill-home { background: var(--blue); }
    .modal-vote-bar-fill.fill-draw { background: var(--text-light); }
    .modal-vote-bar-fill.fill-away { background: var(--red); }

    .modal-vote-percentages {
      display: flex;
      justify-content: space-between;
      font-size: 0.72rem;
      font-weight: 800;
      margin-bottom: 0.8rem;
      padding: 0 0.2rem;
    }

    .modal-voters-list {
      display: flex;
      flex-direction: column;
      gap: 0.5rem;
      font-size: 0.75rem;
    }
    .modal-voter-group {
      background: var(--bg-glass-dark);
      border: 1px solid var(--border-glass);
      border-radius: 12px;
      padding: 0.6rem 0.8rem;
    }
    .modal-voter-group-title {
      font-weight: 800;
      margin-bottom: 0.25rem;
      display: flex;
      align-items: center;
      gap: 6px;
    }
    .modal-voters-names {
      color: var(--text-main);
      word-break: break-word;
      font-weight: 500;
    }

    /* Pulsing and Live Animation Badge */
    .status-badge.live {
      background: rgba(239, 68, 68, 0.12) !important;
      color: var(--red) !important;
      border: 1px solid rgba(239, 68, 68, 0.3) !important;
      animation: sseLivePulse 1.5s infinite alternate;
      box-shadow: 0 0 8px rgba(239, 68, 68, 0.2);
    }

    @keyframes sseLivePulse {
      from {
        box-shadow: 0 0 4px rgba(239, 68, 68, 0.2);
        opacity: 0.85;
      }
      to {
        box-shadow: 0 0 14px rgba(239, 68, 68, 0.5);
        opacity: 1;
      }
    }

    /* Countdown Badge styling */
    .status-badge.countdown {
      background: var(--bg-glass-dark) !important;
      border: 1px solid var(--border-glass) !important;
      color: var(--text-muted) !important;
      font-size: 0.68rem !important;
      padding: 0.2rem 0.5rem !important;
      font-weight: 700 !important;
    }

    /* Style for past completed match card to look clickable */
    #completed-matches-list .glass-card {
      cursor: pointer;
      transition: transform 0.2s ease, border-color 0.2s ease;
    }
    #completed-matches-list .glass-card:hover {
      transform: translateY(-2px);
      border-color: var(--accent);
    }

    /* Auth Locked Screen Overlay */
    .auth-lock-overlay {
      position: fixed;
      top: 0;
      left: 0;
      width: 100vw;
      height: 100vh;
      background: rgba(15, 23, 42, 0.4);
      backdrop-filter: blur(16px);
      -webkit-backdrop-filter: blur(16px);
      display: none; /* Flex when active */
      align-items: center;
      justify-content: center;
      z-index: 99999;
      padding: 1.5rem;
      animation: authOverlayFadeIn 0.3s ease forwards;
    }

    .auth-lock-overlay .lock-card {
      background: var(--bg-glass);
      border: 1px solid var(--border-glass);
      box-shadow: var(--shadow-pop);
      padding: 2.5rem 2rem;
      border-radius: var(--radius-large);
      max-width: 400px;
      width: 100%;
      text-align: center;
      display: flex;
      flex-direction: column;
      align-items: center;
      transition: all 0.3s ease;
    }

    .auth-lock-overlay .lock-icon-wrap {
      width: 76px;
      height: 76px;
      background: rgba(239, 68, 68, 0.1);
      border: 1px solid rgba(239, 68, 68, 0.2);
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      color: var(--red);
      margin-bottom: 1.5rem;
      box-shadow: 0 0 20px rgba(239, 68, 68, 0.15);
      animation: authLockPulse 2s infinite;
    }

    .auth-lock-overlay h2 {
      font-size: 1.5rem;
      font-weight: 800;
      margin-bottom: 0.75rem;
      color: var(--text-main);
      letter-spacing: -0.02em;
    }

    .auth-lock-overlay p {
      font-size: 0.9rem;
      line-height: 1.5;
      color: var(--text-muted);
      margin-bottom: 2rem;
      max-width: 320px;
    }

    .auth-lock-overlay .btn-close-app {
      background: linear-gradient(135deg, #ef4444, #dc2626);
      color: #ffffff;
      border: none;
      padding: 0.85rem 1.75rem;
      border-radius: var(--radius-medium);
      font-weight: 700;
      font-size: 0.9rem;
      cursor: pointer;
      box-shadow: 0 8px 20px rgba(239, 68, 68, 0.15);
      transition: all 0.2s ease;
      width: 100%;
    }

    .auth-lock-overlay .btn-close-app:hover {
      transform: translateY(-2px);
      box-shadow: 0 12px 24px rgba(239, 68, 68, 0.25);
    }
    .auth-lock-overlay .btn-close-app:active {
      transform: translateY(0);
    }

    @keyframes authOverlayFadeIn {
      from { opacity: 0; }
      to { opacity: 1; }
    }

    @keyframes authLockPulse {
      0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.3); }
      70% { transform: scale(1.04); box-shadow: 0 0 0 12px rgba(239, 68, 68, 0); }
      100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
    }