/* style.css */

/* ── ANIMATIONS ────────────────────────────────────────────────── */
.animate-fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── SCROLLBAR ─────────────────────────────────────────────────── */
.overflow-x-auto::-webkit-scrollbar       { height: 8px; }
.overflow-x-auto::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 4px; }
.overflow-x-auto::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
.overflow-x-auto::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ── BRACKET LAYOUT ────────────────────────────────────────────── */
/*
  The bracket uses a pure CSS flex layout:
  Left side:  R32 (8 matches) → R16 (4) → QF (2) → SF (1)
  Center:     Final + Champion trophy
  Right side: SF (1) → QF (2) → R16 (4) → R32 (8)  [mirrored]

  Each column is a flex column with justify-around so matches
  space out naturally at every round depth.
*/

.bracket-wrap {
    display: flex;
    align-items: stretch;
    gap: 0;
    min-width: 1400px;
    width: 100%;
}

.bracket-half {
    display: flex;
    flex: 1;
    gap: 0;
}
/* .right order is handled by JS (columns already in reversed order) — no CSS reversal needed */

.bracket-col {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    min-width: 170px;
    padding: 8px 6px;
    position: relative;
}

/* Connector lines between rounds */
.bracket-col:not(:last-child) .bracket-node::after {
    content: '';
    position: absolute;
    top: 50%;
    right: -6px;
    width: 6px;
    height: 1px;
    background: #cbd5e1;
}

/* ── BRACKET NODE (match card) ─────────────────────────────────── */
.bracket-node {
    position: relative;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    font-size: 12px;
    width: 162px;
    margin: 4px auto;
}

.bracket-node-label {
    background: #f1f5f9;
    color: #64748b;
    font-size: 10px;
    text-align: center;
    padding: 3px 6px;
    border-bottom: 1px solid #e2e8f0;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bracket-team {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 7px;
    cursor: pointer;
    transition: background 0.15s;
    min-height: 30px;
    font-weight: 500;
    color: #1e293b;
    line-height: 1.2;
}

.bracket-team:hover { background: #eff6ff; }

.bracket-team.winner {
    background: #dcfce7;
    font-weight: 700;
    color: #166534;
}

.bracket-team.tbd {
    color: #94a3b8;
    font-style: italic;
    cursor: default;
}

.bracket-team img {
    width: 16px;
    height: 12px;           /* explicit height prevents vertical misalignment */
    border-radius: 2px;
    flex-shrink: 0;
    object-fit: cover;
    display: block;         /* removes inline baseline gap */
}

.bracket-team-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;           /* critical: allows ellipsis inside flex */
    font-size: 11.5px;
}

.bracket-divider {
    height: 1px;
    background: #e2e8f0;
}

/* ── CENTER (Final + Champion) ─────────────────────────────────── */
.bracket-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px 12px;
    min-width: 200px;
    gap: 12px;
}

.champion-box {
    background: linear-gradient(135deg, #D4AF37, #AA8222);
    color: white;
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 8px 24px rgba(212,175,55,0.35);
    border: 3px solid #fff;
    min-width: 160px;
}

.champion-box img {
    width: 48px;
    height: auto;
    border-radius: 4px;
    margin-bottom: 8px;
}

.champion-name {
    font-size: 22px;
    font-weight: 900;
    line-height: 1.1;
}

.champion-label {
    font-size: 11px;
    opacity: 0.85;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 4px;
}

.champion-placeholder {
    width: 160px;
    height: 100px;
    background: #f1f5f9;
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-weight: 700;
    font-size: 14px;
}

.final-label {
    font-size: 13px;
    font-weight: 800;
    color: #D4AF37;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    text-align: center;
}

/* ── EXPORT-ONLY STYLES ────────────────────────────────────────── 
   Used by the off-screen export containers. These use inline CSS
   so they don't depend on Tailwind CDN loading state.
────────────────────────────────────────────────────────────────── */

/* Export group card */
.exp-group-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    break-inside: avoid;
}

.exp-group-header {
    background: #0055A4;
    color: white;
    padding: 10px 16px;
    font-weight: 800;
    font-size: 16px;
}

.exp-group-body { padding: 12px; }

.exp-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 10px; }
.exp-table th { font-size: 10px; text-transform: uppercase; color: #94a3b8; padding: 4px 6px; text-align: center; }
.exp-table th:first-child { text-align: left; }
.exp-table td { padding: 5px 6px; border-bottom: 1px solid #f1f5f9; }
.exp-table td:not(:first-child) { text-align: center; }
.exp-table tr.q1 { background: #f0fdf4; }
.exp-table tr.q3 { background: #fefce8; }

.exp-team-cell { display: flex; align-items: center; gap: 6px; }
.exp-team-cell img { width: 20px; height: auto; border-radius: 2px; }

.exp-match { display: flex; align-items: center; justify-content: space-between; font-size: 12px; background: #f8fafc; padding: 5px 8px; border-radius: 6px; margin-bottom: 4px; }
.exp-match-team { display: flex; align-items: center; gap: 4px; width: 38%; }
.exp-match-team.right { justify-content: flex-end; flex-direction: row-reverse; }
.exp-match-score { font-weight: 800; font-size: 14px; color: #0055A4; min-width: 32px; text-align: center; }




/* ══════════════════════════════════════════════════════════════
   amwcs__ — WORLD CUP SIMULATOR ARTICLE
══════════════════════════════════════════════════════════════ */

.amwcs__wrapper {
    --wcs-navy:    #0055A4;
    --wcs-green:   #008542;
    --wcs-gold:    #D4AF37;
    --wcs-gold-dk: #AA8222;
    --wcs-red:     #C8102E;
    --wcs-black:   #0f172a;
    --wcs-white:   #ffffff;
    --wcs-bg:      #f1f5f9;
    --wcs-surface: #ffffff;
    --wcs-border:  #e2e8f0;
    --wcs-muted:   #64748b;
    --wcs-text:    #1e293b;

    font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
    background: var(--wcs-bg);
    color: var(--wcs-text);
    padding: 72px 20px;
    box-sizing: border-box;
    width: 100%;
    line-height: 1.6;
}

.amwcs__wrapper * { box-sizing: border-box; }
.amwcs__inner { width: 100%; margin: 0 auto; }

/* ── DIVIDERS ───────────────────────────────────────────────── */
.amwcs__divider {
    display: flex; align-items: center; gap: 16px;
    margin: 56px 0 32px;
}
.amwcs__divider-line { flex: 1; height: 1px; background: var(--wcs-border); }
.amwcs__divider-ball {
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--wcs-navy); flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; line-height: 1;
}

/* ── TYPOGRAPHY ─────────────────────────────────────────────── */
.amwcs__h2 {
    font-size: 1.65rem; font-weight: 800; color: var(--wcs-black);
    margin: 0 0 8px; line-height: 1.15; letter-spacing: -0.02em;
}
.amwcs__h2 span { color: var(--wcs-navy); }

.amwcs__lead {
    font-size: 1rem; color: var(--wcs-muted);
    margin: 0 0 24px; line-height: 1.65;
}

.amwcs__body {
    font-size: 0.97rem; line-height: 1.8;
    color: #334155; margin: 0 0 18px;
}
.amwcs__body strong { color: var(--wcs-black); font-weight: 700; }
.amwcs__body a { color: var(--wcs-navy); text-decoration: underline; }

/* ── HERO ───────────────────────────────────────────────────── */
.amwcs__hero {
    background: linear-gradient(135deg, var(--wcs-navy) 0%, #0f172a 50%, #1a1f2e 100%);
    border-radius: 18px; padding: 52px 44px; margin-bottom: 56px;
    position: relative; overflow: hidden;
}
.amwcs__hero::before {
    content: '⚽';
    position: absolute; right: 32px; top: -20px;
    font-size: 11rem; opacity: 0.06;
    line-height: 1; pointer-events: none; user-select: none;
}
.amwcs__hero-tag {
    display: inline-block;
    background: rgba(212,175,55,0.22); color: var(--wcs-gold);
    font-size: 0.72rem; font-weight: 700; letter-spacing: 0.12em;
    text-transform: uppercase; padding: 4px 14px;
    border-radius: 20px; margin-bottom: 16px;
    border: 1px solid rgba(212,175,55,0.3);
}
.amwcs__hero-title {
    font-size: 2.2rem; font-weight: 900; color: #fff;
    line-height: 1.1; margin: 0 0 16px; letter-spacing: -0.02em;
}
.amwcs__hero-title span { color: var(--wcs-gold); }
.amwcs__hero-body {
    font-size: 1rem; color: rgba(255,255,255,0.65);
    line-height: 1.7; margin: 0; max-width: 580px;
}

/* ── STAT CARDS ─────────────────────────────────────────────── */
.amwcs__stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 14px; margin: 26px 0;
}
.amwcs__stat {
    background: var(--wcs-surface); border: 1px solid var(--wcs-border);
    border-radius: 12px; padding: 20px 16px; text-align: center;
    position: relative; overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}
.amwcs__stat:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(0,0,0,0.08); }
.amwcs__stat::after {
    content: ''; position: absolute; bottom: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--wcs-navy), var(--wcs-green));
}
.amwcs__stat-val {
    font-size: 2rem; font-weight: 900; color: var(--wcs-navy);
    line-height: 1; margin-bottom: 6px;
}
.amwcs__stat-lbl {
    font-size: 0.72rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.07em; color: var(--wcs-muted);
}

/* ── HOW-TO STEPS ───────────────────────────────────────────── */
.amwcs__steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px; margin: 24px 0;
}
.amwcs__step {
    background: var(--wcs-surface); border: 1px solid var(--wcs-border);
    border-radius: 12px; padding: 22px;
    transition: box-shadow 0.2s, border-color 0.2s;
}
.amwcs__step:hover {
    box-shadow: 0 6px 20px rgba(0,85,164,0.1);
    border-color: #bfdbfe;
}
.amwcs__step-num {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: 9px;
    background: var(--wcs-navy); color: #fff;
    font-size: 0.85rem; font-weight: 800; margin-bottom: 12px;
    flex-shrink: 0;
}
.amwcs__step-title {
    font-size: 0.95rem; font-weight: 700;
    color: var(--wcs-black); margin: 0 0 6px;
}
.amwcs__step-body {
    font-size: 0.86rem; color: var(--wcs-muted);
    line-height: 1.65; margin: 0;
}

/* ── CALLOUT ────────────────────────────────────────────────── */
.amwcs__callout {
    border-left: 4px solid var(--wcs-gold);
    background: linear-gradient(135deg, #fefce8 0%, #fffef7 100%);
    border-radius: 0 12px 12px 0;
    padding: 20px 24px; margin: 28px 0;
}
.amwcs__callout p {
    font-size: 1.02rem; font-weight: 600; color: var(--wcs-black);
    line-height: 1.55; margin: 0;
}
.amwcs__callout span {
    display: block; font-size: 0.8rem; font-weight: 500;
    color: var(--wcs-muted); margin-top: 6px;
}

/* ── INFO CALLOUT (navy) ────────────────────────────────────── */
.amwcs__info {
    border-left: 4px solid var(--wcs-navy);
    background: #eff6ff; border-radius: 0 12px 12px 0;
    padding: 18px 22px; margin: 24px 0;
    display: flex; gap: 14px; align-items: flex-start;
}
.amwcs__info-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; }
.amwcs__info-text { font-size: 0.9rem; color: #1e40af; line-height: 1.65; margin: 0; }
.amwcs__info-text strong { color: #1e3a8a; }

/* ── TABLE ──────────────────────────────────────────────────── */
.amwcs__table-wrap {
    overflow-x: auto; margin: 24px 0;
    border-radius: 12px; border: 1px solid var(--wcs-border);
}
.amwcs__table { width: 100%; border-collapse: collapse; font-size: 0.89rem; }
.amwcs__table thead tr { background: var(--wcs-black); color: #fff; }
.amwcs__table th {
    padding: 13px 18px; text-align: left;
    font-size: 0.72rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.08em;
}
.amwcs__table td {
    padding: 12px 18px; border-bottom: 1px solid var(--wcs-border);
    color: var(--wcs-text); vertical-align: top; line-height: 1.5;
}
.amwcs__table tbody tr:last-child td { border-bottom: none; }
.amwcs__table tbody tr:nth-child(even) td { background: #f8fafc; }
.amwcs__table tbody tr:hover td { background: #eff6ff; }

.amwcs__badge {
    display: inline-block; padding: 2px 10px;
    border-radius: 20px; font-size: 0.72rem; font-weight: 700;
}
.amwcs__badge-navy   { background: #dbeafe; color: #1d4ed8; }
.amwcs__badge-green  { background: #d1fae5; color: #065f46; }
.amwcs__badge-gold   { background: #fef9c3; color: #854d0e; }
.amwcs__badge-red    { background: #fee2e2; color: #991b1b; }

/* ── GROUP GRID ─────────────────────────────────────────────── */
.amwcs__groups-mini {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px; margin: 24px 0;
}
.amwcs__group-mini {
    background: var(--wcs-surface); border: 1px solid var(--wcs-border);
    border-radius: 10px; overflow: hidden;
}
.amwcs__group-mini-hdr {
    background: var(--wcs-navy); color: white;
    padding: 7px 14px; font-size: 0.78rem; font-weight: 800;
    letter-spacing: 0.04em; text-transform: uppercase;
}
.amwcs__group-mini-body { padding: 10px 14px; }
.amwcs__group-mini-team {
    display: flex; align-items: center; gap: 7px;
    font-size: 0.84rem; color: var(--wcs-text);
    padding: 3px 0; border-bottom: 1px solid #f1f5f9;
}
.amwcs__group-mini-team:last-child { border-bottom: none; }
.amwcs__group-mini-team img {
    width: 20px; height: 14px; object-fit: cover;
    border-radius: 2px; flex-shrink: 0;
}
.amwcs__group-mini-team .host {
    font-size: 0.62rem; background: var(--wcs-gold);
    color: var(--wcs-black); padding: 1px 5px;
    border-radius: 3px; font-weight: 700; margin-left: auto;
}

/* ── FAQ ────────────────────────────────────────────────────── */
.amwcs__faq-list {
    display: flex; flex-direction: column; gap: 10px; margin: 24px 0;
}
.amwcs__faq-item {
    background: var(--wcs-surface); border: 1px solid var(--wcs-border);
    border-radius: 12px; overflow: hidden;
}
.amwcs__faq-q {
    width: 100%; background: none; border: none; text-align: left;
    padding: 18px 22px; font-family: inherit; font-size: 0.97rem;
    font-weight: 600; color: var(--wcs-black); cursor: pointer;
    display: flex; justify-content: space-between; align-items: center;
    gap: 12px; transition: background 0.15s;
}
.amwcs__faq-q:hover { background: #f8fafc; }
.amwcs__faq-icon {
    flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%;
    background: var(--wcs-navy); color: #fff;
    font-size: 0.95rem; font-weight: 800;
    display: flex; align-items: center; justify-content: center;
    transition: transform 0.25s, background 0.2s;
}
.amwcs__faq-item.amwcs__open .amwcs__faq-icon {
    transform: rotate(45deg); background: var(--wcs-red);
}
.amwcs__faq-a {
    max-height: 0; overflow: hidden;
    transition: max-height 0.35s ease; padding: 0 22px;
}
.amwcs__faq-item.amwcs__open .amwcs__faq-a { max-height: 600px; }
.amwcs__faq-a p {
    font-size: 0.91rem; line-height: 1.78; color: #475569; margin: 0 0 18px;
}
.amwcs__faq-a strong { color: var(--wcs-black); }

/* ── DISCLAIMER ─────────────────────────────────────────────── */
.amwcs__disclaimer {
    background: #f1f5f9; border: 1px solid var(--wcs-border);
    border-radius: 12px; padding: 20px 24px; margin-top: 52px;
    display: flex; gap: 14px; align-items: flex-start;
}
.amwcs__disclaimer-text {
    font-size: 0.82rem; color: var(--wcs-muted); line-height: 1.65; margin: 0;
}
.amwcs__disclaimer-text strong { color: var(--wcs-text); }

/* ── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 640px) {
    .amwcs__hero { padding: 32px 24px; }
    .amwcs__hero-title { font-size: 1.65rem; }
    .amwcs__h2 { font-size: 1.35rem; }
    .amwcs__stats { grid-template-columns: repeat(2, 1fr); }
    .amwcs__groups-mini { grid-template-columns: repeat(2, 1fr); }
}