/* ========================================
       RESET & VARIABLES
       ======================================== */
    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

    :root {
      /* Emil's easings */
      --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
      --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
      --ease-spring: cubic-bezier(0.32, 0.72, 0, 1); /* Apple-like drawer curve */

      /* Colors */
      --text:         #111827;
      --text-dim:     #4b5563;
      
      --accent-gold:  #ca8a04;
      --accent-glow:  rgba(202,138,4,0.15);

      --player:       #007aff;
      --player-bg:    rgba(0,122,255,0.1);
      --banker:       #ff3b30;
      --banker-bg:    rgba(255,59,48,0.1);
      --tie:          #34c759;
      --tie-bg:       rgba(52,199,89,0.1);

      --radius-lg:    24px;  /* Apple loves large radii for main cards */
      --radius:       14px;
      --radius-sm:    10px;
      --font-body:    'Inter', system-ui, sans-serif;
      --font-display: 'Outfit', system-ui, sans-serif;
    }

    body {
      font-family: var(--font-body);
      color: var(--text);
      min-height: 100vh;
      display: flex;
      flex-direction: column;
      align-items: center;
      -webkit-font-smoothing: antialiased;
      -moz-osx-font-smoothing: grayscale;
      position: relative;
      background-color: #fafafa;
      overflow-x: hidden;
    }
    
    /* Dynamic Mesh Aurora Background (Optimized for performance) */
    body::before {
      content: "";
      position: fixed;
      top: 0; left: 0; right: 0; bottom: 0;
      z-index: -1;
      background: linear-gradient(135deg, 
        rgba(0, 122, 255, 0.08) 0%,   /* Player Blue */
        rgba(52, 199, 89, 0.08) 33%,  /* Tie Green */
        rgba(255, 59, 48, 0.06) 66%,  /* Banker Red */
        rgba(202, 138, 4, 0.08) 100%  /* Gold */
      );
    }

    /* ========================================
       PAGE LOAD STAGGER
       ======================================== */
    header, .card, .action-bar, .min-warn {
      opacity: 0;
      transform: translateY(24px);
      animation: fadeInUp 800ms var(--ease-spring) forwards;
    }
    header { animation-delay: 50ms; }
    .card:nth-of-type(1) { animation-delay: 150ms; }
    .card:nth-of-type(2) { animation-delay: 250ms; }
    .action-bar { animation-delay: 350ms; }
    .min-warn { animation-delay: 400ms; }

    @keyframes fadeInUp {
      to { opacity: 1; transform: translateY(0); }
    }

    /* ========================================
       HEADER
       ======================================== */
    header {
      width: 100%;
      padding: 24px 0 12px;
      text-align: center;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 6px;
    }
    header h1 {
      font-family: var(--font-display);
      font-size: 2rem;
      font-weight: 800;
      letter-spacing: -0.04em;
      color: #000;
      line-height: 1.1;
      background: linear-gradient(to right, #111827, #4b5563);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
    }
    header p { 
      color: var(--text-dim); 
      font-size: 0.88rem; 
      max-width: 420px;
      line-height: 1.4;
      font-weight: 500;
    }

    /* ========================================
       MAIN CONTAINER
       ======================================== */
    .container {
      width: 100%;
      max-width: 760px;
      padding: 0 20px 48px;
      display: flex;
      flex-direction: column;
      gap: 20px;
    }

    /* ========================================
       LIQUID GLASS CARD MIXIN
       ======================================== */
    .card {
      background: rgba(255, 255, 255, 0.85);
      border: 1px solid rgba(255, 255, 255, 0.4);
      border-top: 1px solid rgba(255, 255, 255, 0.9); /* Edge catch light */
      border-radius: var(--radius-lg);
      padding: 32px;
      box-shadow: 0 12px 40px rgba(0,0,0,0.04), inset 0 1px 0 rgba(255,255,255,0.6);
    }
    .section-heading {
      font-family: var(--font-display);
      font-size: 1.25rem;
      font-weight: 700;
      color: var(--text);
      margin-bottom: 20px;
      letter-spacing: -0.02em;
    }

    /* ========================================
       INPUT BUTTONS
       ======================================== */
    .input-row {
      display: flex;
      gap: 16px;
      justify-content: center;
    }
    .btn-outcome {
      flex: 1;
      padding: 18px 0;
      border: 1px solid rgba(255, 255, 255, 0.5);
      border-top: 1px solid rgba(255, 255, 255, 0.8);
      border-radius: var(--radius);
      font-family: var(--font-display);
      font-size: 1.1rem;
      font-weight: 700;
      cursor: pointer;
      box-shadow: 0 2px 10px rgba(0,0,0,0.03);
      transition: transform 160ms var(--ease-out), filter 200ms ease, box-shadow 300ms ease, background 300ms ease, opacity 200ms ease;
    }

    .btn-outcome:disabled {
      opacity: 0.5;
      cursor: not-allowed;
    }

    .btn-outcome.btn-player {
      background: rgba(0,122,255,0.12);
      border-color: rgba(0,122,255,0.3);
      color: var(--player);
    }
    .btn-outcome.btn-banker {
      background: rgba(255,59,48,0.12);
      border-color: rgba(255,59,48,0.3);
      color: var(--banker);
    }
    .btn-outcome.btn-tie {
      background: rgba(52,199,89,0.12);
      border-color: rgba(52,199,89,0.3);
      color: var(--tie);
    }
    
    @media (hover: hover) and (pointer: fine) {
      .btn-outcome.btn-player:not(:disabled):hover { 
        background: rgba(0,122,255,0.18); 
        box-shadow: 0 8px 24px rgba(0,122,255,0.15);
      }
      .btn-outcome.btn-banker:not(:disabled):hover { 
        background: rgba(255,59,48,0.18); 
        box-shadow: 0 8px 24px rgba(255,59,48,0.15);
      }
      .btn-outcome.btn-tie:not(:disabled):hover { 
        background: rgba(52,199,89,0.18); 
        box-shadow: 0 8px 24px rgba(52,199,89,0.15);
      }
      
      .btn-undo:hover { background: rgba(255,255,255,0.9); color: var(--text); }
      .btn-clear:hover { background: rgba(255,59,48,0.08); color: var(--banker); }
    }

    .btn-outcome:not(:disabled):active { 
      transform: scale(0.97); 
      filter: blur(1px);
    }

    /* ========================================
       SCOREBOARD
       ======================================== */
    .scoreboard {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      min-height: 52px;
      padding: 10px 14px;
      border-radius: var(--radius);
      background: rgba(255,255,255,0.4);
      border: 1px solid rgba(255,255,255,0.5);
      align-content: flex-start;
      box-shadow: inset 0 2px 10px rgba(0,0,0,0.02);
      position: relative;
    }
    
    .scoreboard-empty {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      width: 100%;
      text-align: center;
      font-weight: 700;
      font-size: 1rem !important;
      letter-spacing: -0.01em;
      background: linear-gradient(135deg, var(--player) 0%, var(--banker) 100%);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      animation: pulseText 2s infinite ease-in-out;
      pointer-events: none;
    }
    
    @keyframes pulseText {
      0%, 100% { opacity: 0.8; transform: translate(-50%, -50%) scale(1); }
      50% { opacity: 1; transform: translate(-50%, -50%) scale(1.02); }
    }
    
    .round-chip {
      width: 36px;
      height: 36px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-family: var(--font-display);
      font-size: 0.88rem;
      font-weight: 700;
      position: relative;
      animation: chipSpring 400ms var(--ease-spring) forwards;
      opacity: 0;
      transform: scale(0.6) translateY(10px);
    }
    @keyframes chipSpring {
      to { transform: scale(1) translateY(0); opacity: 1; }
    }

    .round-chip.P { background: var(--player); color: #fff; box-shadow: 0 4px 12px rgba(0,122,255,0.3); border: 1px solid rgba(255,255,255,0.3); }
    .round-chip.B { background: var(--banker); color: #fff; box-shadow: 0 4px 12px rgba(255,59,48,0.3); border: 1px solid rgba(255,255,255,0.3); }
    .round-chip.T { background: var(--tie); color: #fff; box-shadow: 0 4px 12px rgba(52,199,89,0.3); border: 1px solid rgba(255,255,255,0.3); }
    
    .round-chip .chip-num {
      position: absolute;
      bottom: -4px;
      right: -4px;
      font-size: 0.65rem;
      background: #fff;
      border-radius: 50%;
      width: 20px;
      height: 20px;
      display: flex;
      align-items: center;
      justify-content: center;
      border: 1px solid rgba(0,0,0,0.05);
      color: var(--text-dim);
      font-weight: 700;
      box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    }

    .round-count {
      text-align: right;
      font-size: 0.9rem;
      color: var(--text-dim);
      margin-top: 16px;
      font-weight: 500;
    }

    /* ========================================
       SCOREBOARD TOGGLE & GRID
       ======================================== */
    .scoreboard-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 20px;
    }
    .scoreboard-header .section-heading { margin-bottom: 0; }
    
    .view-toggle {
      display: flex;
      background: rgba(255,255,255,0.6);
      border-radius: 8px;
      padding: 4px;
      border: 1px solid rgba(255,255,255,0.8);
    }
    .view-toggle button {
      background: transparent;
      border: none;
      padding: 6px 12px;
      font-size: 0.85rem;
      font-weight: 600;
      border-radius: 6px;
      cursor: pointer;
      color: var(--text-dim);
      transition: all 200ms ease;
    }
    .view-toggle button.active {
      background: #fff;
      color: var(--text);
      box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    }

    .scoreboard.grid-view {
      display: grid;
      grid-template-rows: repeat(6, 44px);
      grid-auto-columns: 44px;
      grid-auto-flow: column;
      gap: 4px;
      overflow-x: auto;
      padding: 12px;
      min-height: 288px; /* 6 * 44 + 5 * 4 = 284 */
      align-content: start;
      justify-content: start;
      scrollbar-width: thin;
      background: #fff;
    }
    .scoreboard.grid-view .round-chip {
      margin: 0;
      width: 44px;
      height: 44px;
      border-radius: 4px; /* Bead plate style squares */
      transform: none !important;
      animation: none !important;
      opacity: 1;
    }
    .scoreboard.grid-view .round-chip .chip-num {
      display: none; /* Hide numbers in grid view for cleaner look */
    }

    /* Grid placeholder cells */
    .grid-cell-empty {
      width: 44px;
      height: 44px;
      border: 1px solid rgba(0,0,0,0.1);
      border-radius: 4px;
      background: #fafafa;
    }

    /* ========================================
       GAME STATE STATS BOX
       ======================================== */
    .game-state-box {
      background: rgba(255,255,255,0.85);
      border-radius: var(--radius-lg);
      padding: 24px;
      border: 1px solid rgba(255,255,255,0.6);
      box-shadow: 0 4px 20px rgba(0,0,0,0.03);
      margin-top: 16px;
      display: flex;
      flex-direction: column;
      gap: 12px;
    }
    .game-state-header {
      font-family: var(--font-display);
      font-size: 1.1rem;
      font-weight: 700;
      text-align: center;
      margin-bottom: 8px;
    }
    .stat-row {
      display: flex;
      justify-content: space-between;
      font-size: 0.95rem;
      font-weight: 500;
      color: var(--text-dim);
      padding: 8px 0;
      border-bottom: 1px dashed rgba(0,0,0,0.1);
    }
    .stat-row:last-child { border-bottom: none; }
    .stat-row span:last-child {
      font-weight: 700;
      color: var(--text);
    }
    
    .percent-summary {
      display: flex;
      justify-content: space-around;
      margin-bottom: 12px;
    }
    .percent-item {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 8px;
    }
    .percent-box {
      width: 48px;
      height: 48px;
      border-radius: 12px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-family: var(--font-display);
      font-weight: 800;
      font-size: 1.2rem;
      color: #fff;
    }
    .percent-box.P { background: var(--player); box-shadow: 0 4px 12px rgba(0,122,255,0.2); }
    .percent-box.B { background: var(--banker); box-shadow: 0 4px 12px rgba(255,59,48,0.2); }
    .percent-box.T { background: var(--tie); box-shadow: 0 4px 12px rgba(52,199,89,0.2); }
    .percent-val {
      font-family: var(--font-display);
      font-weight: 700;
      font-size: 1.1rem;
    }
    .percent-val.P { color: var(--player); }
    .percent-val.B { color: var(--banker); }
    .percent-val.T { color: var(--tie); }

    /* ========================================
       ACTION BAR
       ======================================== */
    .action-bar {
      display: flex;
      gap: 10px;
      justify-content: center;
      margin-top: -2px;
    }
    .btn-action {
      padding: 8px 18px;
      border: 1px solid transparent;
      border-radius: var(--radius-sm);
      font-family: var(--font-body);
      font-weight: 600;
      font-size: 0.86rem;
      cursor: pointer;
      transition: transform 160ms var(--ease-out), background-color 200ms ease, color 200ms ease;
    }
    .btn-action:active {
      transform: scale(0.96);
    }

    .btn-undo {
      background: rgba(255,255,255,0.8);
      color: var(--text);
      border: 1px solid rgba(255,255,255,0.8);
      box-shadow: 0 2px 8px rgba(0,0,0,0.03);
    }
    .btn-clear {
      background: transparent;
      color: var(--text-dim);
    }

    .min-warn {
      text-align: center;
      font-size: 0.9rem;
      color: var(--accent-gold);
      opacity: 0;
      transform: translateY(-4px);
      transition: opacity 300ms var(--ease-out), transform 300ms var(--ease-out);
      pointer-events: none;
      font-weight: 600;
    }
    .min-warn.show { 
      opacity: 1; 
      transform: translateY(0); 
    }

    /* ========================================
       RESULTS SECTION
       ======================================== */
    #results-area { 
      display: none; 
    }
    #results-area.visible { 
      display: flex; 
      flex-direction: column; 
      gap: 8px; 
      animation: revealResults 500ms var(--ease-out) forwards;
    }
    #sortable-cards {
      display: flex;
      flex-direction: column;
      gap: 8px;
    }

    @keyframes revealResults {
      0% { opacity: 0; transform: translateY(12px); }
      100% { opacity: 1; transform: translateY(0); }
    }

    /* ========================================
       ACCORDION PREDICTION CARDS
       ======================================== */
    .result-card {
      border-radius: var(--radius);
      padding: 0;
      border: 1px solid rgba(255,255,255,0.7);
      background: rgba(255,255,255,0.92);
      position: relative;
      overflow: hidden;
      box-shadow: 0 3px 12px rgba(0,0,0,0.03);
      transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
    }
    .result-card:hover {
      box-shadow: 0 6px 18px rgba(0,0,0,0.06);
    }
    
    .result-exact::before {
      content: '';
      position: absolute;
      top: 0; left: 0; right: 0; height: 3px;
      background: linear-gradient(90deg, #ca8a04, #fde047);
    }
    .result-sim::before {
      content: '';
      position: absolute;
      top: 0; left: 0; right: 0; height: 3px;
      background: linear-gradient(90deg, #007aff, #60a5fa);
    }

    .card-summary-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 14px;
      padding: 11px 18px;
      cursor: pointer;
      user-select: none;
      background: rgba(255, 255, 255, 0.65);
      transition: background 0.15s ease;
    }
    .card-summary-row:hover {
      background: rgba(255, 255, 255, 0.95);
    }

    .summary-left {
      display: flex;
      align-items: center;
      gap: 8px;
      flex: 1.2;
      min-width: 0;
    }
    .summary-title {
      font-family: var(--font-display);
      font-size: 0.95rem;
      font-weight: 700;
      letter-spacing: -0.01em;
      white-space: nowrap;
    }

    .summary-pred-group {
      display: flex;
      align-items: center;
      gap: 9px;
      flex: 1;
      min-width: 0;
    }
    .summary-chip {
      width: 28px;
      height: 28px;
      border-radius: 7px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      font-family: var(--font-display);
      font-weight: 800;
      font-size: 0.85rem;
      color: #fff;
      flex-shrink: 0;
    }
    .summary-chip.P { background: var(--player); box-shadow: 0 2px 8px rgba(0,122,255,0.35); }
    .summary-chip.B { background: var(--banker); box-shadow: 0 2px 8px rgba(255,59,48,0.35); }
    .summary-chip.T { background: var(--tie); box-shadow: 0 2px 8px rgba(52,199,89,0.35); }
    .summary-chip.none { background: #94a3b8; }
    .summary-chip.END { background: #64748b; font-size: 0.65rem; font-weight: 800; }

    .summary-pred-details {
      display: flex;
      flex-direction: column;
      gap: 1px;
      min-width: 0;
    }
    .summary-pred-line {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      font-size: 0.92rem;
      font-weight: 600;
      color: var(--text);
      white-space: nowrap;
    }
    .pred-label {
      color: var(--text-dim);
      font-weight: 500;
      font-size: 0.84rem;
    }

    .pred-outcome-val {
      font-weight: 800;
      font-size: 1rem;
      letter-spacing: -0.01em;
    }
    .pred-outcome-val.P { color: var(--player); }
    .pred-outcome-val.B { color: var(--banker); }
    .pred-outcome-val.T { color: var(--tie); }
    .pred-outcome-val.END { color: #64748b; }

    .summary-sub {
      color: var(--text-dim);
      font-size: 0.76rem;
      font-weight: 500;
      line-height: 1.2;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .summary-conf-group {
      display: flex;
      align-items: center;
      flex-shrink: 0;
    }

    .conf-highlight {
      display: inline-flex;
      align-items: center;
      gap: 3px;
      font-weight: 800;
      font-size: 0.88rem;
      padding: 3px 9px;
      border-radius: 6px;
      letter-spacing: -0.01em;
      white-space: nowrap;
      flex-shrink: 0;
    }
    .conf-highlight.high {
      background: rgba(16, 185, 129, 0.16);
      color: #047857;
      border: 1px solid rgba(16, 185, 129, 0.3);
    }
    .conf-highlight.med {
      background: rgba(245, 158, 11, 0.16);
      color: #b45309;
      border: 1px solid rgba(245, 158, 11, 0.3);
    }
    .conf-highlight.low {
      background: rgba(107, 114, 128, 0.14);
      color: #374151;
      border: 1px solid rgba(107, 114, 128, 0.25);
    }
    .conf-highlight.ultra {
      background: rgba(139, 92, 246, 0.16);
      color: #6d28d9;
      border: 1px solid rgba(139, 92, 246, 0.3);
    }
    .conf-num {
      font-weight: 800;
    }
    .conf-label {
      font-weight: 600;
      font-size: 0.78rem;
      opacity: 0.88;
    }

    .summary-right {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-shrink: 0;
    }

    .expand-btn {
      background: rgba(0, 0, 0, 0.04);
      border: 1px solid rgba(0, 0, 0, 0.06);
      border-radius: 12px;
      padding: 4px 10px;
      font-size: 0.75rem;
      font-weight: 600;
      color: var(--text-dim);
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 4px;
      transition: all 0.15s ease;
    }
    .card-summary-row:hover .expand-btn {
      background: rgba(0, 0, 0, 0.08);
      color: var(--text);
    }

    .card-drawer {
      display: none;
      padding: 16px 20px 20px 20px;
      border-top: 1px solid rgba(0, 0, 0, 0.06);
      background: rgba(255, 255, 255, 0.5);
    }
    .result-card.expanded .card-drawer {
      display: block;
      animation: drawerSlide 0.2s ease-out;
    }

    @keyframes drawerSlide {
      from { opacity: 0; transform: translateY(-4px); }
      to { opacity: 1; transform: translateY(0); }
    }

    .drawer-subtitle {
      font-size: 0.85rem;
      color: var(--text-dim);
      margin-bottom: 12px;
    }

    .card-drawer .prediction-box {
      padding: 14px 16px;
      gap: 14px;
      margin-bottom: 14px;
    }
    .card-drawer .prediction-icon {
      width: 44px;
      height: 44px;
      font-size: 1.15rem;
    }
    .card-drawer .prediction-text h3 {
      font-size: 1.15rem;
    }
    .card-drawer .prediction-text p {
      font-size: 0.85rem;
      margin-top: 4px;
    }

    @media (max-width: 640px) {
      .card-summary-row {
        display: grid;
        grid-template-columns: 1fr auto;
        grid-template-areas:
          "header action"
          "pred   conf";
        row-gap: 8px;
        column-gap: 8px;
        padding: 10px 14px;
        align-items: center;
      }
      .summary-left {
        grid-area: header;
        min-width: 0;
        gap: 6px;
      }
      .summary-title {
        font-size: 0.88rem;
        overflow: hidden;
        text-overflow: ellipsis;
      }
      .summary-right {
        grid-area: action;
        justify-self: end;
      }
      .summary-pred-group {
        grid-area: pred;
        min-width: 0;
        gap: 8px;
      }
      .summary-chip {
        width: 30px;
        height: 30px;
        font-size: 0.9rem;
      }
      .summary-pred-line {
        font-size: 0.94rem;
      }
      .pred-outcome-val {
        font-size: 1.05rem;
      }
      .summary-conf-group {
        grid-area: conf;
        justify-self: end;
        flex-shrink: 0;
      }
      .conf-highlight {
        font-size: 0.92rem;
        padding: 4px 10px;
        border-radius: 8px;
        box-shadow: 0 1px 4px rgba(0,0,0,0.04);
      }
      .conf-num {
        font-size: 0.98rem;
        font-weight: 800;
      }
      .conf-label {
        font-size: 0.72rem;
      }
      .card-drawer {
        padding: 12px 14px 16px 14px;
      }
    }

    .result-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 20px;
    }
    .result-label {
      font-family: var(--font-display);
      font-size: 1.15rem;
      font-weight: 700;
      letter-spacing: -0.01em;
    }
    .result-exact .result-label { color: #ca8a04; }
    .result-sim   .result-label { color: var(--player); }

    .result-badge {
      padding: 4px 10px;
      border-radius: 20px;
      font-size: 0.75rem;
      font-weight: 700;
      background: rgba(255,255,255,0.8);
      color: var(--text-dim);
      border: 1px solid rgba(255,255,255,0.9);
      box-shadow: 0 2px 6px rgba(0,0,0,0.04);
    }

    .prediction-box {
      display: flex;
      align-items: center;
      gap: 16px;
      padding: 16px;
      border-radius: var(--radius);
      background: rgba(255,255,255,0.5);
      border: 1px solid rgba(255,255,255,0.6);
      margin-bottom: 16px;
      box-shadow: inset 0 2px 10px rgba(0,0,0,0.01);
    }
    .prediction-icon {
      width: 56px;
      height: 56px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-family: var(--font-display);
      font-size: 1.4rem;
      font-weight: 800;
      flex-shrink: 0;
    }
    .prediction-icon.P { background: var(--player); color: #fff; box-shadow: 0 6px 20px rgba(0,122,255,0.3); }
    .prediction-icon.B { background: var(--banker); color: #fff; box-shadow: 0 6px 20px rgba(255,59,48,0.3); }
    .prediction-icon.T { background: var(--tie);    color: #fff; box-shadow: 0 6px 20px rgba(52,199,89,0.3); }

    .prediction-text h3 {
      font-family: var(--font-display);
      font-size: 1.5rem;
      font-weight: 800;
      color: var(--text);
      letter-spacing: -0.03em;
    }
    .prediction-text p {
      font-size: 0.95rem;
      color: var(--text-dim);
      margin-top: 6px;
      line-height: 1.5;
      font-weight: 500;
    }

    /* Breakdown bars with clip-path animation */
    .breakdown { display: flex; flex-direction: column; gap: 14px; }
    .breakdown-row {
      display: flex;
      align-items: center;
      gap: 14px;
    }
    .breakdown-label {
      width: 55px;
      font-size: 0.9rem;
      font-weight: 600;
      text-align: right;
    }
    .breakdown-bar-bg {
      flex: 1;
      height: 16px;
      background: rgba(255,255,255,0.5);
      border-radius: 8px;
      overflow: hidden;
      position: relative;
      border: 1px solid rgba(255,255,255,0.8);
    }
    
    .breakdown-bar {
      height: 100%;
      border-radius: 8px;
      width: 100%;
      transform-origin: left;
      /* We animate scaleX instead of width for GPU acceleration */
      transform: scaleX(0);
      transition: transform 800ms var(--ease-out);
    }
    
    .breakdown-bar.P { background: linear-gradient(90deg, #3b82f6, #007aff); }
    .breakdown-bar.B { background: linear-gradient(90deg, #ef4444, #ff3b30); }
    .breakdown-bar.T { background: linear-gradient(90deg, #22c55e, #34c759); }
    
    .breakdown-count {
      width: 65px;
      font-size: 0.9rem;
      color: var(--text-dim);
      font-weight: 600;
    }

    .no-match-msg {
      text-align: center;
      padding: 40px 0;
      color: var(--text-dim);
      font-size: 1.05rem;
      font-weight: 500;
    }

    /* Detail shoe list */
    .shoe-detail-list {
      margin-top: 28px;
      max-height: 240px;
      overflow-y: auto;
      border: 1px solid rgba(255,255,255,0.6);
      border-radius: var(--radius-sm);
      background: rgba(255,255,255,0.4);
      scrollbar-width: thin;
      scrollbar-color: rgba(0,0,0,0.1) transparent;
    }
    .shoe-detail-list table { width: 100%; border-collapse: collapse; text-align: left; }
    .shoe-detail-list th {
      padding: 14px 20px;
      font-size: 0.8rem;
      color: var(--text-dim);
      font-weight: 700;
      border-bottom: 1px solid rgba(0,0,0,0.05);
      background: rgba(255,255,255,0.95);
      position: sticky;
      top: 0;
      z-index: 2;
      text-transform: uppercase;
      letter-spacing: 0.05em;
    }
    .shoe-detail-list td {
      padding: 14px 20px;
      font-size: 0.9rem;
      border-bottom: 1px solid rgba(0,0,0,0.03);
      color: var(--text);
      font-weight: 500;
    }
    .shoe-detail-list tr:last-child td { border-bottom: none; }
    
    /* Staggered list items */
    .shoe-detail-list tr {
      opacity: 0;
      transform: translateY(12px);
      animation: slideUp 400ms var(--ease-out) forwards;
    }
    @keyframes slideUp { to { opacity: 1; transform: translateY(0); } }
    
    .shoe-detail-list tr:nth-child(1) { animation-delay: 0ms; }
    .shoe-detail-list tr:nth-child(2) { animation-delay: 40ms; }
    .shoe-detail-list tr:nth-child(3) { animation-delay: 80ms; }
    .shoe-detail-list tr:nth-child(4) { animation-delay: 120ms; }
    .shoe-detail-list tr:nth-child(5) { animation-delay: 160ms; }
    .shoe-detail-list tr:nth-child(6) { animation-delay: 200ms; }
    .shoe-detail-list tr:nth-child(7) { animation-delay: 240ms; }
    .shoe-detail-list tr:nth-child(8) { animation-delay: 280ms; }
    .shoe-detail-list tr:nth-child(9) { animation-delay: 320ms; }
    .shoe-detail-list tr:nth-child(10) { animation-delay: 360ms; }

    .outcome-tag {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 28px;
      height: 28px;
      border-radius: 6px;
      font-weight: 700;
      font-size: 0.8rem;
      font-family: var(--font-display);
    }
    .outcome-tag.P { background: var(--player-bg); color: #007aff; border: 1px solid rgba(0,122,255,0.2); }
    .outcome-tag.B { background: var(--banker-bg); color: #ff3b30; border: 1px solid rgba(255,59,48,0.2); }
    .outcome-tag.T { background: var(--tie-bg); color: #34c759; border: 1px solid rgba(52,199,89,0.2); }

    /* Loading spinner */
    .spinner {
      display: none;
      text-align: center;
      padding: 40px;
    }
    .spinner.active { display: block; }
    .spinner-ring {
      display: inline-block;
      width: 36px;
      height: 36px;
      border: 3px solid rgba(255,255,255,0.6);
      border-top-color: var(--text);
      border-radius: 50%;
      animation: spin 0.8s var(--ease-linear) infinite;
    }
    @keyframes spin { to { transform: rotate(360deg); } }

    /* ========================================
       RESPONSIVE
       ======================================== */
    @media (max-width: 600px) {
      .input-row { flex-direction: column; }
      .btn-outcome { padding: 18px 0; font-size: 1.15rem; }
      .container { padding: 0 16px 40px; }
      .prediction-box { flex-direction: column; text-align: center; gap: 16px; }
      .breakdown-label, .breakdown-count { font-size: 0.8rem; }
      header { padding: 56px 20px 32px; }
      header h1 { font-size: 2.4rem; }
      .card { padding: 24px; }
    }

/* ========================================
   LOGIN & DATA ENTRY STYLES
   ======================================== */

.login-card {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-top: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.04), inset 0 1px 0 rgba(255,255,255,0.6);
  width: 100%;
  max-width: 420px;
  margin: 80px auto;
  text-align: center;
  animation: fadeInUp 800ms var(--ease-spring) forwards;
}

.login-icon {
  width: 64px;
  height: 64px;
  background: var(--player-bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  color: var(--player);
  border: 1px solid rgba(0,122,255,0.2);
}

.login-icon svg {
  width: 32px;
  height: 32px;
  fill: currentColor;
}

.login-card h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--text);
  letter-spacing: -0.02em;
}

.subtitle {
  color: var(--text-dim);
  font-size: 1rem;
  margin-bottom: 32px;
}

.form-group {
  text-align: left;
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 8px;
  color: var(--text);
}

.form-group input {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(0,0,0,0.1);
  background: #fff;
  font-family: var(--font-body);
  font-size: 1rem;
  transition: border-color 200ms ease, box-shadow 200ms ease;
  outline: none;
}

.form-group input:focus {
  border-color: var(--player);
  box-shadow: 0 0 0 4px var(--player-bg);
}

.login-btn {
  width: 100%;
  padding: 16px;
  background: var(--player);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 12px;
  transition: transform 160ms var(--ease-out), background-color 200ms ease, filter 200ms ease;
  box-shadow: 0 4px 12px rgba(0,122,255,0.2);
}

.login-btn:active {
  transform: scale(0.97);
  filter: blur(1px);
}

.error-msg {
  background: var(--banker-bg);
  color: var(--banker);
  padding: 12px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 20px;
  border: 1px solid rgba(255,59,48,0.2);
}

.back-link {
  display: inline-block;
  margin-top: 24px;
  color: var(--text-dim);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: color 200ms ease;
}

.back-link:hover {
  color: var(--text);
}

/* ========================================
   DATA ENTRY PAGE (SHOES / STATUS / TABLE / MODAL / TOAST)
   ======================================== */

.shoe-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: rgba(255,255,255,0.6);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.8);
  margin-bottom: 20px;
}

.shoe-status-info {
  display: flex;
  flex-direction: column;
}

.shoe-status-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.shoe-status-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

.shoe-status-badge {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
}

.badge-active { background: var(--tie-bg); color: var(--tie); }
.badge-inactive { background: rgba(0,0,0,0.05); color: var(--text-dim); }
.badge-published { background: var(--player-bg); color: var(--player); }
.badge-status { padding: 4px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: 700; display: inline-block; }

.shoe-controls {
  display: flex;
  gap: 12px;
}

.btn-shoe {
  flex: 1;
  padding: 14px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 160ms var(--ease-out), filter 200ms ease, opacity 200ms ease;
}

.btn-start-shoe {
  background: var(--text);
  color: #fff;
}

.btn-start-shoe:not(:disabled):active, .btn-end-shoe:not(:disabled):active {
  transform: scale(0.97);
  filter: blur(1px);
}

.btn-end-shoe {
  background: transparent;
  border: 1px solid rgba(0,0,0,0.1);
  color: var(--text-dim);
}

.btn-shoe:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-publish-all, .btn-export {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid rgba(0,0,0,0.1);
  background: #fff;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms var(--ease-out), box-shadow 200ms ease;
}

.btn-publish-all:active, .btn-export:active {
  transform: scale(0.97);
}

.shoes-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.shoes-table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: var(--radius-sm);
  background: #fff;
}

.shoes-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.shoes-table th {
  padding: 14px 16px;
  background: #fafafa;
  font-size: 0.85rem;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 700;
  letter-spacing: 0.05em;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

.shoes-table td {
  padding: 14px 16px;
  font-size: 0.95rem;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  color: var(--text);
  font-weight: 500;
}

.shoes-table-actions {
  display: flex;
  gap: 8px;
}

.btn-table {
  padding: 6px 12px;
  border: none;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 160ms var(--ease-out);
}

.btn-table:active { transform: scale(0.95); }
.btn-table-view { background: rgba(0,0,0,0.05); color: var(--text); }
.btn-table-publish { background: var(--player-bg); color: var(--player); }
.btn-table-delete { background: var(--banker-bg); color: var(--banker); }

/* TOAST (Emil Style) */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--text);
  color: #fff;
  padding: 14px 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  box-shadow: 0 12px 30px rgba(0,0,0,0.15);
  z-index: 9999;
  
  opacity: 0;
  transform: translateY(100%);
  transition: opacity 400ms var(--ease-out), transform 400ms var(--ease-spring);
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* MODAL OVERLAY & CONTENT (Emil Style) */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms var(--ease-out);
}

.modal-content {
  background: #fafafa;
  width: 100%;
  max-width: 500px;
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.15);
  max-height: 90vh;
  overflow-y: auto;
  
  /* Starting Style for Entry */
  transform: scale(0.95);
  opacity: 0;
  transition: transform 400ms var(--ease-spring), opacity 300ms var(--ease-out);
}

.modal-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.modal-overlay.visible .modal-content {
  transform: scale(1);
  opacity: 1;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.modal-header h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
}

.modal-close {
  background: rgba(0,0,0,0.05);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 160ms var(--ease-out), background 200ms ease;
}

.modal-close:active { transform: scale(0.9); }

.modal-rounds-table {
  width: 100%;
  border-collapse: collapse;
}

.modal-rounds-table th {
  padding: 10px;
  text-align: left;
  font-size: 0.8rem;
  color: var(--text-dim);
  border-bottom: 1px solid rgba(0,0,0,0.1);
}

.modal-rounds-table td {
  padding: 10px;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

.edit-select {
  padding: 6px;
  border-radius: 6px;
  border: 1px solid rgba(0,0,0,0.1);
  background: #fff;
  font-family: var(--font-body);
  font-size: 0.9rem;
}

.btn-back, .btn-logout {
  padding: 8px 16px;
  background: rgba(255,255,255,0.6);
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  font-size: 0.9rem;
  transition: transform 160ms var(--ease-out);
}

.btn-back:active, .btn-logout:active {
  transform: scale(0.97);
}

.header-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

    @media (prefers-reduced-motion: reduce) {
      *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
      }
    }