/* GuessMyBaby — Design system (purple/pink/teal/yellow palette) */

:root {
    --bg-page: #F8F7FC;
    --bg-card: #FFFFFF;
    --bg-purple-soft: #F3EEFF;
    --bg-pink-soft: #FFF0F6;
    --bg-teal-soft: #ECFDF5;
    --bg-yellow-soft: #FFF7ED;
    --accent-purple: #8B5CF6;
    --accent-pink: #F472B6;
    --accent-teal: #14B8A6;
    --accent-yellow: #FBBF24;
    --amber-700: #D97706;
    --text-primary: #18181B;
    --text-secondary: #52525B;
    --border: #E4E4E7;
    --border-light: #F4F4F5;
    /* Spacing & radius tokens */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-full: 100px;
}

/* === Skip to content (a11y) === */
.skip-to-content {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
    z-index: 9999;
    padding: 12px 24px;
    background: var(--accent-purple);
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    border-radius: 0 0 8px 0;
    text-decoration: none;
}
.skip-to-content:focus {
    position: fixed;
    left: 0;
    top: 0;
    width: auto;
    height: auto;
    overflow: visible;
}

/* === Base === */
body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-page);
    color: var(--text-primary);
    min-height: 100vh;
}
body.has-sidebar {
    display: flex;
}
h1, h2, h3, h4, .font-display {
    font-family: 'Plus Jakarta Sans', sans-serif;
}

/* === Sidebar === */
.sidebar {
    width: 280px;
    background: #fff;
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 32px;
    border-right: 1px solid var(--border-light);
    flex-shrink: 0;
    height: 100vh;
    position: sticky;
    top: 0;
    overflow-y: auto;
}
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.logo-icon {
    width: 36px; height: 36px; border-radius: 50%;
    flex-shrink: 0;
    object-fit: cover;
}
.logo-text { font-weight: 700; font-size: 18px; }
.nav-section { display: flex; flex-direction: column; gap: 4px; }
.nav-label {
    font-size: 11px; font-weight: 600; color: var(--text-secondary);
    letter-spacing: 1px; text-transform: uppercase; padding-bottom: 8px;
}
.nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 14px; border-radius: 12px;
    font-size: 14px; font-weight: 500; color: var(--text-secondary);
    cursor: pointer; transition: background .15s; text-decoration: none;
}
.nav-item:hover { background: var(--border-light); color: var(--text-secondary); }
.nav-item.active { background: var(--bg-purple-soft); color: var(--accent-purple); font-weight: 600; }
.nav-item svg { width: 20px; height: 20px; flex-shrink: 0; }
.pool-label-row { display: flex; justify-content: space-between; align-items: center; padding-bottom: 8px; }
.pool-add {
    width: 24px; height: 24px; border-radius: 8px;
    background: var(--bg-purple-soft);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; border: none; color: var(--accent-purple);
    text-decoration: none; font-size: 14px;
}
.pool-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 14px; border-radius: 12px;
    font-size: 14px; font-weight: 500; cursor: pointer;
    transition: background .15s; text-decoration: none; color: var(--text-secondary);
}
.pool-item:hover { background: var(--border-light); color: var(--text-secondary); }
.pool-item.active-pool { color: var(--text-primary); }
.pool-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.pool-dot.open { background: var(--accent-teal); }
.pool-dot.draft { background: var(--accent-yellow); }
.pool-dot.closed { background: #D4D4D8; }
.pool-dot.participating { background: var(--accent-pink); }

/* === Mobile header === */
.mobile-header {
    display: none; background: #fff;
    padding: 16px 20px; align-items: center; justify-content: space-between;
    border-bottom: 1px solid var(--border-light);
    position: sticky; top: 0; z-index: 100;
}
.mobile-header .logo { display: flex; }
.menu-btn { background: none; border: none; cursor: pointer; color: var(--text-secondary); }
.sidebar-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,.3); z-index: 200;
}
.sidebar-overlay.open { display: block; }

/* === Main content === */
.main {
    flex: 1; padding: 32px 40px;
    display: flex; flex-direction: column; gap: 28px;
    min-width: 0; overflow-y: auto;
}

/* === Top bar === */
.top-bar { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 16px; }
.top-bar h1 { font-size: 26px; font-weight: 700; }
.top-bar p { font-size: 14px; color: var(--text-secondary); margin-top: 4px; }
.top-left h1 { font-size: 26px; font-weight: 700; }
.top-sub { display: flex; align-items: center; gap: 16px; margin-top: 4px; }
.top-date { font-size: 13px; color: var(--text-secondary); }
.top-actions { display: flex; align-items: center; gap: 12px; }
.top-right { display: flex; align-items: center; gap: 12px; }

/* === Avatar === */
.avatar {
    width: 40px; height: 40px; border-radius: 50%;
    background: var(--accent-purple);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 600; font-size: 14px; flex-shrink: 0;
}

/* === Dropdowns === */
.dropdown-menu {
    font-family: 'Inter', sans-serif; font-size: 13px;
    border: 1px solid var(--border-light); border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0,0,0,.07); padding: 4px;
    min-width: 160px; margin-top: 6px;
}
.dropdown-item {
    font-family: inherit; font-size: inherit;
    color: var(--text-secondary); border-radius: 7px; padding: 7px 12px;
}
.dropdown-item:hover { background: var(--bg-purple-soft); color: var(--text-primary); }
.dropdown-item button { color: inherit; width: 100%; text-align: left; }

/* === Badges === */
.badge {
    display: inline-flex; padding: 4px 12px; border-radius: 100px;
    font-size: 12px; font-weight: 600;
}
.badge-teal, .badge-open { background: var(--bg-teal-soft); color: var(--accent-teal); }
.badge-purple { background: var(--bg-purple-soft); color: var(--accent-purple); }
.badge-pink { background: var(--bg-pink-soft); color: var(--accent-pink); }
.badge-yellow, .badge-draft { background: var(--bg-yellow-soft); color: var(--amber-700); }
.badge-closed { background: var(--border-light); color: var(--text-secondary); }
.badge-locked { background: var(--bg-yellow-soft); color: var(--amber-700); }
.badge-resolved { background: var(--bg-teal-soft); color: var(--accent-teal); }
.badge-cancelled { background: var(--bg-pink-soft); color: var(--accent-pink); }

/* === Buttons === */
.btn-primary, a.btn-primary,
.btn-secondary-custom,
.btn-outline-custom,
.btn-danger-custom,
.btn-warning-custom,
.btn-confirm {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    border-radius: 12px; border: none; cursor: pointer;
    text-decoration: none; font-family: inherit;
    transition: all .15s;
}
.btn-primary, a.btn-primary {
    padding: 10px 20px; background: var(--accent-purple); color: #fff;
    font-weight: 600; font-size: 14px;
}
.btn-primary:hover, a.btn-primary:hover { opacity: .9; background: var(--accent-purple); color: #fff; }
.btn-sm, a.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-lg { padding: 14px 32px; font-size: 16px; }
.btn-full-width { width: 100%; padding: 12px; font-size: 15px; }
.btn-primary svg { width: 16px; height: 16px; }
.btn-secondary-custom {
    padding: 10px 20px; background: var(--bg-purple-soft); color: var(--accent-purple);
    font-weight: 600; font-size: 14px;
}
.btn-secondary-custom:hover { opacity: .9; }
.btn-outline-custom {
    padding: 8px 16px; background: transparent; color: var(--text-secondary);
    font-weight: 500; font-size: 13px; border: 1px solid var(--border);
}
.btn-outline-custom:hover { background: var(--border-light); color: var(--text-primary); }
.btn-danger-custom {
    padding: 8px 16px; background: var(--bg-pink-soft); color: var(--accent-pink);
    font-weight: 500; font-size: 13px;
}
.btn-danger-custom:hover { opacity: .85; }
.btn-warning-custom {
    padding: 8px 16px; background: var(--bg-yellow-soft); color: var(--amber-700);
    font-weight: 600; font-size: 13px;
}
.btn-warning-custom:hover { opacity: .85; }
.btn-confirm {
    width: 100%; padding: 12px; background: var(--accent-purple); color: #fff;
    font-size: 14px; font-weight: 600;
}

/* === Icon buttons (standardized) === */
.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all .15s;
}
.btn-icon:hover { color: var(--accent-purple); background: var(--bg-purple-soft); }
.btn-icon:disabled { opacity: .3; cursor: default; }
.btn-icon.btn-icon-danger:hover { color: var(--accent-pink); background: var(--bg-pink-soft); }
.btn-icon svg { width: 16px; height: 16px; }

/* === Utility/Semantic Classes === */
.info-box { background: var(--bg-page); border-radius: 12px; padding: 16px; }
.card-panel { background: #fff; border-radius: 20px; padding: 32px; }
.section-title { font-size: 17px; font-weight: 700; margin-bottom: 20px; }
.section-subtitle { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.help-text { font-size: 11px; color: var(--text-secondary); display: block; margin-top: 4px; }
.field-error { font-size: 12px; color: var(--accent-pink); margin-top: 4px; }
.btn-confirm:hover { opacity: .9; }
.btn-disabled { opacity: .4; cursor: not-allowed; pointer-events: none; }

/* === Token badge === */
.token-badge {
    display: flex; align-items: center; gap: 6px;
    padding: 8px 16px; border-radius: 12px;
    background: var(--bg-yellow-soft);
    font-size: 13px; font-weight: 600; color: var(--amber-700);
}
.token-badge svg { width: 16px; height: 16px; }

/* === Cards === */
.card, .metric-card, .bet-card, .pool-card, .invite-card, .recent-card, .wager-form, .prize-card {
    border: none;
    border-radius: 20px;
}
.metric-card, .bet-card, .pool-card, .recent-card, .wager-form, .leaderboard, .prize-card {
    background: #fff;
}

/* === Metrics === */
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.metric-card { padding: 24px; display: flex; flex-direction: column; gap: 12px; }
.metric-top { display: flex; justify-content: space-between; align-items: center; }
.metric-top span { font-size: 14px; font-weight: 500; color: var(--text-secondary); }
.metric-icon {
    width: 40px; height: 40px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.metric-val { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 36px; font-weight: 800; }

/* === Dashboard layout === */
.dash-layout { display: flex; gap: 20px; }
.dash-main { flex: 2; display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.dash-side { flex: 1; display: flex; flex-direction: column; gap: 20px; min-width: 240px; max-width: 340px; }
.dash-cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.dash-kpis { display: flex; gap: 16px; flex-wrap: wrap; }
.dash-kpi { display: flex; flex-direction: column; gap: 2px; min-width: 80px; }
.dash-kpi-val { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 20px; font-weight: 700; }
.dash-kpi-label { font-size: 12px; color: var(--text-secondary); }

/* === Mini KPIs (colored cards) === */
.mini-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.mini-kpi { background: var(--bg-page); border-radius: var(--radius-sm); padding: 14px; text-align: center; }
.mini-kpi-value { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 22px; font-weight: 700; }
.mini-kpi-label { font-size: 11px; color: var(--text-secondary); margin-top: 2px; text-transform: uppercase; letter-spacing: 0.03em; }
.mini-kpi-value.teal { color: var(--accent-teal); }
.mini-kpi-value.pink { color: var(--accent-pink); }
.mini-kpi-value.purple { color: var(--accent-purple); }
.mini-kpi-value.yellow { color: var(--amber-700); }

/* === Closed cagnottes grid === */
.closed-cagnottes-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.pool-card-closed { padding: 20px; gap: 14px; opacity: .75; }
.pool-card-closed:hover { opacity: 1; }
.pool-card-purple { background: var(--bg-purple-soft); }
.mini-kpis-compact { grid-template-columns: repeat(3, 1fr); }

/* === Dashboard bottom row (legacy) === */
.bottom-row { display: flex; gap: 20px; flex: 1; min-height: 0; }
.pool-card { padding: 24px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.pool-card-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.pool-card-head > .d-flex { flex-wrap: wrap; align-items: center; }
.pool-card-head h2 { font-size: 20px; font-weight: 700; flex: 1; min-width: 0; }
.pool-info { display: flex; gap: 24px; flex-wrap: wrap; font-size: 13px; color: var(--text-secondary); }
.pool-info-item { display: flex; align-items: center; gap: 6px; }
.pool-info-item svg { width: 16px; height: 16px; }
.pool-desc { font-size: 14px; color: var(--text-secondary); line-height: 1.6; }
.bets-preview { display: flex; flex-direction: column; gap: 8px; }
.bets-preview-label { font-size: 13px; font-weight: 600; color: var(--text-secondary); padding-bottom: 4px; }
.bet-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-radius: 12px; background: var(--bg-page); font-size: 14px; }
.bet-row-left { display: flex; align-items: center; gap: 10px; }
.bet-row-right { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-secondary); }

/* === Right column === */
.right-col { width: 320px; flex-shrink: 0; display: flex; flex-direction: column; gap: 20px; }
.invite-card { background: var(--accent-purple); border-radius: 20px; padding: 24px; display: flex; flex-direction: column; gap: 16px; color: #fff; }
.invite-card h3 { font-size: 18px; font-weight: 700; }
.invite-card p { font-size: 13px; opacity: .8; line-height: 1.5; }
.invite-link { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 10px; background: rgba(255,255,255,.12); font-size: 12px; opacity: .8; overflow: hidden; word-break: break-all; }
.invite-link svg { width: 14px; height: 14px; flex-shrink: 0; }
.invite-copy { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px; border-radius: 10px; background: #fff; color: var(--accent-purple); font-weight: 600; font-size: 13px; cursor: pointer; border: none; width: 100%; }
.recent-card { padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.recent-card h3 { font-size: 16px; font-weight: 700; }
.participant { display: flex; align-items: center; gap: 12px; }
.participant-av { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 11px; font-weight: 600; flex-shrink: 0; }
.participant-info { font-size: 14px; font-weight: 500; }
.participant-info small { display: block; font-size: 12px; color: var(--text-secondary); font-weight: 400; }

/* === Tabs === */
.tabs { display: flex; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tab {
    display: flex; align-items: center; gap: 8px;
    padding: 12px 20px; font-size: 14px; font-weight: 500;
    color: var(--text-secondary); cursor: pointer; white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: color .15s, border-color .15s; text-decoration: none;
}
.tab:hover { color: var(--text-primary); }
.tab.active { color: var(--accent-purple); font-weight: 600; border-bottom-color: var(--accent-purple); }
.tab svg { width: 16px; height: 16px; }

/* Tab content panels */
.tab-content { display: none; }
.tab-content.active { display: block; }

/* === Bets content === */
.bets-content { display: flex; gap: 20px; flex: 1; min-height: 0; }
.bets-col { flex: 1; display: flex; flex-direction: column; gap: 16px; min-width: 0; }

/* === Bet card === */
.bet-card { padding: 24px; display: flex; flex-direction: column; gap: 20px; }
.bet-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.bet-head-left { display: flex; align-items: center; gap: 12px; }
.bet-emoji { font-size: 20px; }
.bet-title { font-size: 18px; font-weight: 700; }
.bet-meta { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.bet-reorder-btns { display: flex; flex-direction: column; gap: 2px; }
.bet-reorder-btn {
    background: none; border: none; cursor: pointer;
    color: var(--text-secondary); padding: 2px;
    border-radius: 4px; transition: all .15s;
    display: flex; align-items: center; justify-content: center;
}
.bet-reorder-btn:hover:not(:disabled) { color: var(--accent-purple); background: var(--bg-purple-soft); }
.bet-reorder-btn:disabled { opacity: .3; cursor: default; }
@keyframes reorder-flash { 0%,100% { background: inherit; } 30% { background: var(--bg-purple-soft); } }
.reorder-flash { animation: reorder-flash .5s ease; }

/* Odds - 2 options */
.odds-row { display: flex; gap: 12px; }
.odd-card {
    flex: 1; border-radius: 14px; padding: 16px;
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    cursor: default; transition: transform .15s;
}
.odd-label { font-size: 14px; font-weight: 600; }
.odd-cote { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 24px; font-weight: 800; }
.odd-tokens { font-size: 11px; }
.odd-pink { background: var(--bg-pink-soft); color: var(--accent-pink); }
.odd-purple { background: var(--bg-purple-soft); color: var(--accent-purple); }
.odd-teal { background: var(--bg-teal-soft); color: var(--accent-teal); }
.odd-yellow { background: var(--bg-yellow-soft); color: var(--amber-700); }

/* Odds - multiple options */
.odds-grid { display: flex; gap: 10px; flex-wrap: wrap; }
.name-odd {
    flex: 1; min-width: 100px; border-radius: 12px; padding: 12px 14px;
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    cursor: default; transition: transform .15s;
}
.name-odd-label { font-size: 13px; font-weight: 600; }
.name-odd-cote { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 18px; font-weight: 700; }

/* Wager info bar */
.wager-info {
    background: var(--bg-page); border-radius: 12px; padding: 12px 16px;
    display: flex; flex-direction: column; gap: 6px;
}
.wager-info-left { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.wager-info-left svg { width: 16px; height: 16px; color: var(--accent-pink); flex-shrink: 0; }
.wager-info-lines { display: flex; flex-direction: column; gap: 4px; padding-left: 24px; }
.wager-info-line { display: flex; justify-content: space-between; align-items: center; font-size: 13px; gap: 12px; }
.wager-gain { font-size: 13px; font-weight: 600; color: var(--accent-teal); white-space: nowrap; }

/* Resolution result */
.resolution-result {
    display: flex; align-items: center; gap: 8px;
    background: var(--bg-teal-soft); border-radius: 12px; padding: 12px 16px;
    font-size: 13px; color: var(--accent-teal); font-weight: 500;
}

/* === Wager panel === */
.wager-panel { width: 320px; flex-shrink: 0; display: flex; flex-direction: column; gap: 20px; }
.wager-form { padding: 24px; display: flex; flex-direction: column; gap: 20px; }
.wager-form h3 { font-size: 18px; font-weight: 700; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 12px; font-weight: 500; color: var(--text-secondary); }
.form-select-custom {
    display: flex; justify-content: space-between; align-items: center;
    background: var(--bg-page); border-radius: 10px; padding: 10px 14px;
    font-size: 14px; font-weight: 500; color: var(--text-primary);
    cursor: pointer; border: none; font-family: inherit;
}
.option-row { display: flex; gap: 8px; }
.option-btn {
    flex: 1; padding: 10px; border-radius: 10px;
    font-size: 14px; font-weight: 500; text-align: center;
    cursor: pointer; transition: all .15s; border: none; font-family: inherit;
}
.option-btn.selected { background: var(--bg-pink-soft); color: var(--accent-pink); font-weight: 600; outline: 2px solid var(--accent-pink); outline-offset: -2px; }
.option-btn.unselected { background: var(--bg-page); color: var(--text-secondary); }
.option-btn:hover { opacity: .85; }
.gain-preview {
    display: flex; justify-content: space-between; align-items: center;
    background: var(--bg-teal-soft); border-radius: 10px; padding: 12px 16px;
}
.gain-preview span { font-size: 13px; color: var(--accent-teal); }
.gain-preview .gain-val { font-weight: 700; }
.gain-preview .gain-label { font-weight: 500; }

/* === Podium === */
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 16px; padding: 20px 40px 0; }
.pod { display: flex; flex-direction: column; align-items: center; gap: 8px; border-radius: 20px 20px 0 0; padding: 20px 16px; }
.pod-1 { width: 160px; background: var(--bg-yellow-soft); padding: 24px 16px; }
.pod-2 { width: 140px; background: var(--bg-purple-soft); }
.pod-3 { width: 140px; background: var(--bg-pink-soft); }
.pod-medal { font-size: 28px; }
.pod-1 .pod-medal { font-size: 36px; }
.pod-avatar { border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 600; font-size: 13px; }
.pod-1 .pod-avatar { width: 52px; height: 52px; background: var(--accent-yellow); font-size: 14px; }
.pod-2 .pod-avatar { width: 44px; height: 44px; background: var(--accent-teal); }
.pod-3 .pod-avatar { width: 44px; height: 44px; background: var(--accent-pink); }
.pod-name { font-size: 13px; font-weight: 600; text-align: center; }
.pod-1 .pod-name { font-size: 14px; }
.pod-tokens { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 700; font-size: 16px; }
.pod-1 .pod-tokens { font-size: 20px; font-weight: 800; color: var(--amber-700); }
.pod-2 .pod-tokens { color: var(--accent-purple); }
.pod-3 .pod-tokens { color: var(--accent-pink); }

/* === Leaderboard === */
.leaderboard { border-radius: 20px; overflow: hidden; flex: 1; display: flex; flex-direction: column; }
.lb-header { display: flex; align-items: center; padding: 14px 20px; background: var(--bg-page); font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.lb-row { display: flex; align-items: center; padding: 12px 20px; border-bottom: 1px solid var(--border-light); }
.lb-row:last-child { border-bottom: none; }
.lb-rank { width: 40px; font-size: 14px; font-weight: 600; color: var(--text-secondary); flex-shrink: 0; }
.lb-name { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; }
.lb-avatar { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 10px; font-weight: 600; flex-shrink: 0; }
.lb-name-text { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-tokens { width: 100px; text-align: right; font-family: 'Plus Jakarta Sans', sans-serif; font-size: 14px; font-weight: 700; flex-shrink: 0; }
.lb-bets { width: 60px; text-align: right; font-size: 13px; color: var(--text-secondary); flex-shrink: 0; }

/* === Ranking content === */
.ranking-content { display: flex; gap: 20px; flex: 1; min-height: 0; }
.ranking-left { flex: 1; display: flex; flex-direction: column; gap: 20px; min-width: 0; }

/* === Prize panel === */
.prize-panel { width: 320px; flex-shrink: 0; }
.prize-card { padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.prize-title-row { display: flex; justify-content: space-between; align-items: center; }
.prize-title-row h3 { font-size: 18px; font-weight: 700; }
.prize-count { background: var(--bg-purple-soft); color: var(--accent-purple); font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 100px; }
.prize-item { display: flex; align-items: center; gap: 14px; border-radius: 14px; padding: 12px 14px; }
.prize-medal { font-size: 22px; flex-shrink: 0; width: 28px; text-align: center; }
.prize-medal-num { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 18px; font-weight: 800; flex-shrink: 0; width: 28px; text-align: center; }
.prize-info { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.prize-rank { font-size: 11px; font-weight: 600; }
.prize-label { font-size: 14px; font-weight: 500; color: var(--text-primary); }

/* === Prizes vertical list === */
.prizes-list { display: flex; flex-direction: column; gap: 4px; }
.prize-list-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px; background: #fff; border-radius: 14px;
    transition: background .15s;
}
.prize-list-item:hover { background: var(--bg-page); }
.prize-display { display: flex; flex-direction: row; align-items: center; gap: 8px; cursor: pointer; flex-wrap: wrap; }
.prize-delete-btn {
    background: none; border: none; cursor: pointer;
    color: var(--text-secondary); padding: 4px;
    border-radius: 8px; transition: all .15s;
    display: flex; align-items: center; justify-content: center;
}
.prize-delete-btn:hover { color: var(--accent-pink); background: var(--bg-pink-soft); outline: 2px solid var(--accent-pink); }

/* === Messages / alerts === */
.alert-custom {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 20px; border-radius: 14px;
    font-size: 14px; font-weight: 500;
}
.alert-custom.alert-success { background: var(--bg-teal-soft); color: var(--accent-teal); }
.alert-custom.alert-error, .alert-custom.alert-danger { background: var(--bg-pink-soft); color: var(--accent-pink); }
.alert-custom.alert-info { background: var(--bg-purple-soft); color: var(--accent-purple); }
.alert-custom.alert-warning { background: var(--bg-yellow-soft); color: var(--amber-700); }
.alert-custom .alert-close {
    margin-left: auto; background: none; border: none;
    cursor: pointer; font-size: 18px; opacity: .6; color: inherit;
}
.alert-custom .alert-close:hover { opacity: 1; }

/* === Modals (Bootstrap override) === */
.modal { display: none; }
.modal.show { display: block; }
.modal-dialog { display: flex; align-items: center; min-height: calc(100% - var(--bs-modal-margin) * 2); }
.modal-content { border-radius: 20px; border: none; overflow: hidden; }
.modal-header {
    background: var(--bg-purple-soft); border-bottom: 1px solid var(--border-light);
    padding: 20px 24px;
}
.modal-header .modal-title { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 700; font-size: 18px; }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border-light); }

/* === Modal form fields === */
.mf { margin-bottom: 16px; }
.mf:last-child { margin-bottom: 0; }
.mf label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 4px; }
.mf-input { width: 100%; border-radius: 10px; border: 1px solid var(--border); padding: 10px 14px; font-size: 14px; font-family: inherit; }
.mf-input:focus { border-color: var(--accent-purple); box-shadow: 0 0 0 3px rgba(139, 92, 246, .15); outline: none; }

/* === Forms (inside modals / pages) === */
.form-control, .form-select {
    border-radius: 10px; border: 1px solid var(--border);
    padding: 10px 14px; font-size: 14px; font-family: inherit;
}
.form-control:focus, .form-select:focus {
    border-color: var(--accent-purple); box-shadow: 0 0 0 3px rgba(139, 92, 246, .15);
}

/* === Unauthenticated navbar === */
.navbar-unauth {
    background: #fff; border-bottom: 1px solid var(--border-light);
    padding: 12px 24px; display: flex; align-items: center; justify-content: space-between;
}
.navbar-unauth .nav-links { display: flex; align-items: center; gap: 12px; }
.navbar-unauth .nav-links a {
    font-size: 14px; font-weight: 500; color: var(--accent-purple);
    text-decoration: none; padding: 8px 16px; border-radius: 100px;
}
.navbar-unauth .nav-links a:hover { background: var(--bg-purple-soft); }
.navbar-unauth .nav-links a.nav-pill {
    background: var(--accent-purple); color: #fff;
}
.navbar-unauth .nav-links a.nav-pill:hover { opacity: .9; background: var(--accent-purple); }

/* === Auth pages (login, register, etc.) === */
.auth-layout { justify-content: center; align-items: center; min-height: calc(100vh - 65px); padding: 32px 24px; gap: 0; }
.auth-layout .auth-container { margin: 0; }
.auth-container {
    max-width: 460px; margin: 60px auto; padding: 0 20px;
}
.auth-card {
    background: #fff; border-radius: 20px; padding: 40px;
    box-shadow: 0 8px 40px rgba(100,80,180,.10), 0 2px 8px rgba(0,0,0,.04);
}
.auth-card h1 { font-size: 22px; font-weight: 700; margin-bottom: 6px; color: var(--text-primary); }
.auth-card > p { font-size: 13px; color: var(--text-secondary); margin-bottom: 20px; }

/* Auth inputs with icons */
.auth-field { margin-bottom: 14px; }
.auth-field label { display: block; font-size: 13px; font-weight: 500; color: var(--text-primary); margin-bottom: 5px; }
.auth-input-wrap { position: relative; display: flex; align-items: center; }
.auth-input-wrap input {
    width: 100%; padding: 9px 40px;
    border: 1.5px solid var(--border); border-radius: 10px;
    font-size: 13px; font-family: inherit; outline: none;
    background: #fff; color: var(--text-primary);
    transition: border-color .15s, box-shadow .15s;
}
.auth-input-wrap input::placeholder { color: #c0bfce; }
.auth-input-wrap input:focus {
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px rgba(139,92,246,.12);
}
.auth-input-icon {
    position: absolute; left: 12px;
    top: 50%; transform: translateY(-50%);
    color: #c0bfce; pointer-events: none;
}
.auth-eye-btn {
    position: absolute; right: 10px;
    top: 50%; transform: translateY(-50%);
    background: none; border: none;
    cursor: pointer; color: #c0bfce; padding: 2px; display: flex; align-items: center;
    transition: color .15s;
}
.auth-eye-btn:hover { color: var(--text-secondary); }
.auth-field-error { font-size: 11px; color: var(--accent-pink); margin-top: 3px; }

/* Password strength meter */
.pwd-strength { margin-top: 6px; }
.pwd-strength-bar {
    height: 4px; border-radius: 2px; background: var(--border);
    overflow: hidden; margin-bottom: 4px;
}
.pwd-strength-fill {
    height: 100%; border-radius: 2px; width: 0;
    transition: width .3s, background .3s;
}
.pwd-strength-text { font-size: 11px; font-weight: 600; }
.pwd-strength-feedback { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }

/* Auth submit button */
.btn-auth-submit {
    width: 100%; padding: 11px 20px;
    background: var(--accent-purple); color: #fff;
    border: none; border-radius: 100px;
    font-size: 14px; font-weight: 600; font-family: inherit;
    cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px;
    margin-top: 6px; transition: opacity .15s;
}
.btn-auth-submit:hover { opacity: .9; }

/* Auth divider "ou" */
.auth-divider {
    display: flex; align-items: center; gap: 12px;
    margin: 20px 0; color: var(--text-secondary); font-size: 13px;
}
.auth-divider::before, .auth-divider::after {
    content: ""; flex: 1; border-top: 1px solid var(--border);
}

/* Google SSO button */
.btn-google-sso {
    width: 100%; padding: 11px 20px;
    background: #fff; color: #3c4043;
    border: 1px solid var(--border); border-radius: 100px;
    font-size: 14px; font-weight: 600; font-family: inherit;
    cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px;
    text-decoration: none; margin-bottom: 16px;
    transition: background .15s, box-shadow .15s;
}
.btn-google-sso:hover { background: #f8f9fa; box-shadow: 0 1px 3px rgba(0,0,0,.1); }

/* === Empty states === */
.empty-state {
    text-align: center; padding: 24px 20px; color: var(--text-secondary);
}
.empty-state p { font-size: 14px; margin-bottom: 16px; }

/* === Parent actions bar === */
.actions-bar {
    display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
    padding: 16px 20px; background: #fff; border-radius: 16px;
}

/* === Inline edit === */
.inline-editable { cursor: pointer; border-bottom: 1px dashed transparent; transition: border-color .15s, background .15s; border-radius: 4px; }
.inline-editable:hover { border-bottom-color: var(--accent-purple); background: var(--bg-purple-soft); }
.inline-editable.editing { border-bottom-color: transparent; background: transparent; }
.inline-edit-input {
    font-family: inherit; font-size: inherit; font-weight: inherit; color: inherit;
    background: var(--bg-page); border: 2px solid var(--accent-purple); border-radius: 8px;
    padding: 4px 8px; width: 100%; box-sizing: border-box; outline: none;
}
.inline-edit-input:focus { box-shadow: 0 0 0 3px rgba(139, 92, 246, .15); }
textarea.inline-edit-input { resize: none; line-height: 1.6; overflow: hidden; }
.inline-placeholder { color: var(--text-secondary); font-style: italic; }
.pencil-icon { vertical-align: middle; }
.inline-editable .pencil-icon,
.prize-display .pencil-icon { opacity: 0; transition: opacity .15s; color: var(--accent-purple); }
.inline-editable:hover .pencil-icon,
.prize-display:hover .pencil-icon { opacity: .6; }

/* === Responsive === */
@media (max-width: 1200px) {
    .right-col, .wager-panel, .prize-panel { width: 280px; }
    .metrics { grid-template-columns: repeat(2, 1fr); }
    .podium { padding: 20px 20px 0; }
}
@media (max-width: 1024px) {
    .sidebar { display: none; }
    .sidebar.open { display: flex; position: fixed; z-index: 300; top: 0; left: 0; height: 100vh; }
    .mobile-header { display: flex; }
    body.has-sidebar { flex-direction: column; }
    .main { padding: 24px 20px; }
    .bottom-row, .bets-content, .ranking-content { flex-direction: column; }
    .right-col, .wager-panel, .prize-panel { width: 100%; }
    .dash-layout { flex-direction: column; }
    .dash-side { max-width: 100%; }
    .dash-cards-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .main { padding: 20px 16px; gap: 20px; }
    .top-bar { flex-direction: column; }
    .odds-row, .odds-grid { flex-direction: column; }
    .name-odd { min-width: unset; }
    .metrics { grid-template-columns: 1fr 1fr; }
    .metric-val { font-size: 28px; }
    .top-bar h1, .top-left h1 { font-size: 22px; }
    .podium { flex-wrap: wrap; gap: 12px; }
    .pod { width: 120px !important; }
    .pod-1 { width: 140px !important; }
    .lb-bets { display: none; }
}
@media (max-width: 480px) {
    .main { padding: 16px; gap: 20px; }
    .metrics { grid-template-columns: 1fr; }
    .mini-kpis { grid-template-columns: repeat(2, 1fr); }
    .pool-info { flex-direction: column; gap: 8px; }
    .bet-card, .wager-form, .prize-card { padding: 16px; }
    .tab { padding: 10px 14px; font-size: 13px; }
    .podium { padding: 16px 12px 0; }
    .pod { padding: 16px 12px; }
    .auth-card { padding: 24px; }
}

/* === Utility classes (reduce inline styles in templates) === */
.d-flex { display: flex; }
.d-none { display: none; }
.d-block { display: block; }
.d-inline { display: inline; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-4 { gap: 4px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }
.gap-24 { gap: 24px; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-xs { font-size: 11px; }
.text-sm { font-size: 12px; }
.text-base { font-size: 13px; }
.text-md { font-size: 14px; }
.text-lg { font-size: 15px; }
.text-xl { font-size: 16px; }
.text-18 { font-size: 18px; }
.text-2xl { font-size: 20px; }
.text-3xl { font-size: 24px; }
.text-secondary { color: var(--text-secondary); }
.text-purple { color: var(--accent-purple); }
.text-teal { color: var(--accent-teal); }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.m-0 { margin: 0; }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: 2px; }
.mb-4 { margin-bottom: 4px; }
.mb-6 { margin-bottom: 6px; }
.mb-8 { margin-bottom: 8px; }
.mb-10 { margin-bottom: 10px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mb-24 { margin-bottom: 24px; }
.mt-2 { margin-top: 2px; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.p-16 { padding: 16px; }
.p-24 { padding: 24px; }
.mx-auto { margin-left: auto; margin-right: auto; }
.ml-auto { margin-left: auto; }
.max-w-500 { max-width: 500px; }
.max-w-600 { max-width: 600px; }
.w-full { width: 100%; }
.w-120 { width: 120px; }
.w-200 { width: 200px; }
.min-w-280 { min-width: 280px; }
.flex-1 { flex: 1; }
.self-start { align-self: flex-start; }
.cursor-pointer { cursor: pointer; }
.link-inherit { color: inherit; text-decoration: none; }
.whitespace-nowrap { white-space: nowrap; }
.lh-relaxed { line-height: 1.6; }
.w-1p { width: 1%; }

/* === Modal dialog sizes === */
.modal-dialog-md { max-width: 520px; }
.modal-dialog-lg { max-width: 650px; }
.modal-dialog-wager { min-width: 520px; max-width: 90vw; width: fit-content; }
.modal-dialog-prize { min-width: 480px; max-width: 90vw; width: fit-content; }

/* Modal layout variants */
.modal-footer-split { justify-content: space-between; }
.modal-header-warning { background: var(--bg-yellow-soft); }
.modal-header-warning .modal-title { color: var(--amber-700); }

/* === Info box variants === */
.info-box-success { border-left: 4px solid #22c55e; padding-left: 16px; }
.info-box-accent { border-left: 4px solid var(--accent-purple); padding-left: 16px; }

/* === Info label / value pattern === */
.info-label { font-size: 12px; color: var(--text-secondary); margin-bottom: 4px; }
.info-value { font-weight: 700; font-size: 16px; }

/* === Status indicator dots === */
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.status-dot-pending { background: #f59e0b; }
.status-dot-active { background: #22c55e; }

/* === Required field marker === */
.required-star { color: var(--accent-pink); }

/* === Profile page === */
.profile-layout { display: flex; gap: 24px; align-items: flex-start; flex-wrap: wrap; }
.profile-col { flex: 1; min-width: 280px; }
.profile-readonly input {
    background: var(--bg-page) !important;
    color: var(--text-secondary) !important;
    cursor: default;
}
.profile-readonly input:focus {
    border-color: var(--border) !important;
    box-shadow: none !important;
}
.btn-change-pwd {
    width: 100%; padding: 11px 20px;
    background: transparent; color: var(--accent-purple);
    border: 1.5px solid var(--accent-purple); border-radius: 100px;
    font-size: 14px; font-weight: 600; font-family: inherit;
    cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px;
    margin-top: 8px; transition: background .15s, color .15s;
}
.btn-change-pwd:hover { background: var(--accent-purple); color: #fff; }
#modal-pwd-error {
    display: none; background: #fff1f2; border: 1px solid #fda4af; color: #be123c;
    border-radius: 10px; padding: 10px 14px; font-size: 13px; margin-bottom: 16px;
}

/* === Settings readonly rows === */
.settings-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 16px; background: var(--bg-page); border-radius: 12px;
}

/* === Bet create/edit modal === */
.bet-type-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.answer-type-cards { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.bet-type-card {
    border: 1.5px solid var(--border); border-radius: 12px; padding: 16px 12px;
    cursor: pointer; text-align: center; display: flex; flex-direction: column; gap: 6px;
    transition: border-color .15s, background .15s;
}
.bet-type-card input[type=radio] { display: none; }
.bet-type-card:has(input:checked) { border-color: var(--accent-purple); background: var(--bg-purple-soft); }
.bet-type-card-title { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.bet-type-card-desc { font-size: 12px; color: var(--text-secondary); line-height: 1.4; }

/* === Disabled overlay === */
.disabled-overlay { pointer-events: none; opacity: 0.6; }

/* === Wager notice === */
.wager-notice {
    background: var(--bg-purple-soft); border: 1px solid var(--border);
    border-radius: 10px; padding: 12px 16px; margin-bottom: 20px;
}

/* === Prizes message box === */
.prizes-message-box {
    margin-bottom: 20px; padding: 12px 16px;
    background: var(--bg-yellow-soft); border-radius: 12px;
}

/* === Danger zone === */
.danger-zone-title { font-size: 16px; font-weight: 600; color: var(--accent-pink); margin-bottom: 12px; }
.section-separator { margin: 24px 0; }

/* === Checkbox label inline === */
.checkbox-label { display: flex; align-items: center; gap: 8px; cursor: pointer; }

/* === Join page === */
.join-info-card { background: var(--bg-page); border-radius: 14px; padding: 16px; margin-bottom: 20px; }

/* Buy tokens / Contribute modal */
.pack-card {
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: border-color .15s;
    cursor: pointer;
}
.pack-card-center { justify-content: center; }
.pack-radio { display: none; }
.pack-radio:checked + .pack-card { border-color: var(--accent-purple); }
.amount-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.amount-grid label { cursor: pointer; }
.contribute-info-box {
    background: var(--bg-purple-soft);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    text-align: center;
    font-size: 14px;
    color: var(--text-secondary);
}
.contribute-info-sep { margin: 0 8px; }
.alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--radius-md);
    padding: 16px;
    color: #dc2626;
}

/* Loading state for buttons */
.btn-loading {
    pointer-events: none;
    opacity: 0.7;
}
.btn-loading::after {
    content: "";
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-left: 8px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    vertical-align: middle;
    animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
