/* Custom styles for World Cup 2026 Family Pool */

:root {
    --bg-dark: #090d16;
    --bg-card: rgba(17, 24, 39, 0.7);
    --bg-card-hover: rgba(31, 41, 55, 0.85);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-accent: rgba(139, 92, 246, 0.2);
    
    /* Text colors */
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --text-dark: #111827;
    
    /* Accent colors */
    --accent-primary: #8b5cf6;
    --accent-primary-gradient: linear-gradient(135deg, #a78bfa, #7c3aed);
    --accent-success: #10b981;
    --accent-danger: #ef4444;
    --accent-info: #3b82f6;
    
    /* Leaderboard Podium Colors */
    --color-gold: #fbbf24;
    --color-gold-grad: linear-gradient(135deg, #fbbf24, #f59e0b);
    --color-silver: #cbd5e1;
    --color-silver-grad: linear-gradient(135deg, #e2e8f0, #94a3b8);
    --color-bronze: #fb923c;
    --color-bronze-grad: linear-gradient(135deg, #fdba74, #ea580c);
    
    /* Pots Colors */
    --pot-1-color: #f43f5e;
    --pot-2-color: #fb923c;
    --pot-3-color: #60a5fa;
    --pot-4-color: #a78bfa;
    
    /* Shadows & Effects */
    --shadow-main: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
    --backdrop-blur: blur(12px);
    
    /* Fonts */
    --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    --font-title: 'Outfit', sans-serif;
}

/* Reset and Global Styles */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-block-size: 100dvb;
    overflow-y: auto;
    scrollbar-gutter: stable;
    position: relative;
}

/* Background Ambient Glows */
.ambient-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(150px);
    z-index: -1;
    pointer-events: none;
    opacity: 0.15;
}

.glow-1 {
    width: 40vw;
    height: 40vw;
    background: var(--accent-primary);
    top: 5%;
    left: 10%;
}

.glow-2 {
    width: 35vw;
    height: 35vw;
    background: var(--accent-info);
    bottom: 10%;
    right: 5%;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* App Container Layout */
.app-container {
    max-inline-size: 1280px;
    margin-inline: auto;
    padding-inline: 1.5rem;
    padding-block: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Header */
.app-header {
    display: flex;
    flex-flow: row wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    padding-block-end: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-emoji {
    font-size: 2.75rem;
    animation: float 4s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.header-logo h1 {
    font-family: var(--font-title);
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: -0.05em;
    background: linear-gradient(135deg, #fff 30%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.countdown-container {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    background: rgba(255, 255, 255, 0.03);
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    backdrop-filter: var(--backdrop-blur);
}

.countdown-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-weight: 700;
    letter-spacing: 0.1em;
}

.countdown-timer {
    font-family: var(--font-title);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-gold);
}

/* Navigation Tabs */
.app-nav {
    display: flex;
    flex-flow: row wrap;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.02);
    padding: 0.5rem;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    backdrop-filter: var(--backdrop-blur);
}

.nav-tab {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-tab:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.nav-tab.active {
    color: #fff;
    background: var(--accent-primary-gradient);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.clash-badge {
    background: var(--accent-danger);
    color: white;
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 20px;
    margin-left: 2px;
    font-weight: 700;
}

/* Main Cards & Components */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: var(--shadow-main);
    backdrop-filter: var(--backdrop-blur);
    transition: transform 0.2s, box-shadow 0.2s;
}

.glass-card {
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0) 100%);
}

/* Section Headers */
.section-header {
    margin-block-end: 1.5rem;
}

.section-header h2 {
    font-family: var(--font-title);
    font-size: 1.75rem;
    font-weight: 700;
    margin-block-end: 0.35rem;
}

.section-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.flex-header {
    display: flex;
    flex-flow: row wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
}

/* Tab Content Visibility */
.tab-content {
    display: none;
    animation: fadeIn 0.3s ease-out;
}

.tab-content.active {
    display: block;
}

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

/* --- LEADERBOARD TAB --- */

/* Podium Setup */
.podium-container {
    display: flex;
    flex-flow: row wrap;
    justify-content: center;
    align-items: flex-end;
    gap: 1.5rem;
    margin-block-end: 2.5rem;
    padding-block-start: 1rem;
}

.podium-spot {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    position: relative;
    box-shadow: var(--shadow-main);
    backdrop-filter: var(--backdrop-blur);
    flex: 1 1 280px;
    max-inline-size: 320px;
}

.podium-1st {
    order: 2;
    min-block-size: 320px;
    border-color: rgba(251, 191, 36, 0.3);
    background: linear-gradient(180deg, rgba(251, 191, 36, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%);
    transform: translateY(-10px);
}

.podium-2nd {
    order: 1;
    min-block-size: 280px;
    border-color: rgba(203, 213, 225, 0.2);
}

.podium-3rd {
    order: 3;
    min-block-size: 260px;
    border-color: rgba(251, 146, 60, 0.2);
}

.podium-badge {
    position: absolute;
    top: -20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 800;
    font-family: var(--font-title);
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

.podium-1st .podium-badge { background: var(--color-gold-grad); color: var(--text-dark); }
.podium-2nd .podium-badge { background: var(--color-silver-grad); color: var(--text-dark); }
.podium-3rd .podium-badge { background: var(--color-bronze-grad); color: #fff; }

.podium-avatar {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: var(--accent-primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: white;
    font-weight: 700;
    margin-block-end: 1rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.podium-1st .podium-avatar {
    border: 3px solid var(--color-gold);
    width: 80px;
    height: 80px;
    font-size: 2.2rem;
}

.podium-name {
    font-family: var(--font-title);
    font-size: 1.35rem;
    font-weight: 700;
    margin-block-end: 0.25rem;
}

.podium-score {
    font-size: 2rem;
    font-weight: 800;
    font-family: var(--font-title);
    margin-block-end: 1rem;
    background: linear-gradient(135deg, #fff 50%, #d1d5db 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.podium-1st .podium-score {
    color: var(--color-gold);
    background: var(--color-gold-grad);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.podium-teams {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.podium-team-flag {
    font-size: 1.5rem;
    cursor: help;
    transition: transform 0.2s;
}

.podium-team-flag:hover {
    transform: scale(1.2) translateY(-2px);
}

/* Leaderboard Table */
.table-container {
    overflow-x: auto;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.leaderboard-table th {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 1rem 1.5rem;
    border-block-end: 1px solid var(--border-color);
}

.leaderboard-table td {
    padding: 1.25rem 1.5rem;
    border-block-end: 1px solid var(--border-color);
    font-size: 0.95rem;
}

.leaderboard-table tbody tr {
    transition: background-color 0.2s;
}

.leaderboard-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

.leaderboard-table tbody tr:last-child td {
    border: none;
}

.col-rank {
    width: 80px;
    font-weight: 700;
}

.rank-number {
    display: inline-block;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    text-align: center;
    line-height: 28px;
    font-size: 0.9rem;
}

.rank-1 { background: var(--color-gold-grad); color: var(--text-dark); font-weight: 800; }
.rank-2 { background: var(--color-silver-grad); color: var(--text-dark); font-weight: 800; }
.rank-3 { background: var(--color-bronze-grad); color: #fff; font-weight: 800; }

.player-name-cell {
    font-weight: 600;
    font-family: var(--font-title);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.player-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: var(--accent-primary);
    font-weight: 700;
}

.teams-list-cell {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.team-badge-inline {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    padding: 0.25rem 0.65rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
}

.team-badge-inline.eliminated {
    opacity: 0.4;
    text-decoration: line-through;
}

.team-points-sub {
    font-weight: 700;
    color: var(--color-gold);
    font-size: 0.75rem;
}

.total-score-cell {
    font-size: 1.25rem;
    font-weight: 800;
    font-family: var(--font-title);
}

/* --- FAMILY TEAMS TAB --- */

.analyzer-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .analyzer-layout {
        grid-template-columns: 1fr;
    }
}

.player-btn-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-block-start: 1rem;
}

.player-select-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 600;
    text-align: left;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
}

.player-select-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.15);
}

.player-select-btn.active {
    color: #fff;
    background: rgba(139, 92, 246, 0.1);
    border-color: var(--accent-primary);
}

.player-select-btn-score {
    font-family: var(--font-title);
    font-weight: 700;
    color: var(--color-gold);
}

.player-teams-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

.team-card {
    position: relative;
    border-block-start: 4px solid var(--border-color);
}

.team-card.pot-1 { border-top-color: var(--pot-1-color); }
.team-card.pot-2 { border-top-color: var(--pot-2-color); }
.team-card.pot-3 { border-top-color: var(--pot-3-color); }
.team-card.pot-4 { border-top-color: var(--pot-4-color); }

.team-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-block-end: 1rem;
}

.team-card-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.team-card-flag {
    font-size: 2rem;
}

.team-card-name {
    font-family: var(--font-title);
    font-size: 1.25rem;
    font-weight: 700;
}

.team-card-group {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.team-pot-tag {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.pot-1-tag { background: rgba(244, 63, 94, 0.1); color: var(--pot-1-color); }
.pot-2-tag { background: rgba(251, 146, 96, 0.1); color: var(--pot-2-color); }
.pot-3-tag { background: rgba(96, 165, 250, 0.1); color: var(--pot-3-color); }
.pot-4-tag { background: rgba(167, 139, 250, 0.1); color: var(--pot-4-color); }

.team-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    text-align: center;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.15);
    padding: 0.75rem;
    border-radius: 10px;
    margin-block-end: 1rem;
}

.stat-item-num {
    font-family: var(--font-title);
    font-size: 1.1rem;
    font-weight: 700;
}

.stat-item-lbl {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
}

.progression-milestones {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.milestone-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.02);
}

.milestone-name {
    font-weight: 500;
    color: var(--text-muted);
}

.milestone-status {
    font-size: 0.8rem;
}

.milestone-row.achieved {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.milestone-row.achieved .milestone-name {
    color: var(--text-main);
    font-weight: 600;
}

.milestone-row.achieved .milestone-status {
    color: var(--accent-success);
}

.team-total-card-score {
    margin-block-start: 1rem;
    border-block-start: 1px solid var(--border-color);
    padding-block-start: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.team-score-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.team-score-value {
    font-family: var(--font-title);
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--color-gold);
}

/* --- MATCH FIXTURES TAB --- */

.filters-container {
    display: flex;
    flex-flow: row wrap;
    gap: 1rem;
    align-items: center;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box i {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
}

.search-box input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: white;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    padding: 0.6rem 1rem 0.6rem 2.25rem;
    inline-size: 220px;
    transition: all 0.2s;
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 2px var(--border-accent);
}

.custom-select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: white;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    padding: 0.6rem 2rem 0.6rem 1rem;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 15px;
    cursor: pointer;
    min-inline-size: 150px;
}

.custom-select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.matches-list-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.25rem;
}

.match-card {
    display: flex;
    flex-direction: column;
    padding: 1.25rem;
}

.match-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-block-end: 0.75rem;
    font-weight: 600;
}

.match-stage-tag {
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
}

.match-teams-block {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-block-end: 1rem;
}

.match-team-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.match-team-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.match-team-flag {
    font-size: 1.35rem;
}

.match-team-name {
    font-family: var(--font-title);
    font-weight: 600;
    font-size: 1rem;
}

.match-team-owner {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
}

.match-team-score {
    font-family: var(--font-title);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-muted);
}

.match-team-row.winner .match-team-name {
    color: #fff;
    font-weight: 700;
}

.match-team-row.winner .match-team-score {
    color: var(--accent-success);
    font-weight: 800;
}

.match-status-row {
    margin-block-start: auto;
    border-block-start: 1px solid var(--border-color);
    padding-block-start: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
}

.status-label {
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
}

.status-label.scheduled { color: var(--text-muted); }
.status-label.playing { color: var(--accent-primary); animation: pulse 1.5s infinite; }
.status-label.completed { color: var(--accent-success); }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.penalty-detail {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-style: italic;
}

.clash-indicator {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--accent-danger);
    font-weight: 700;
    font-size: 0.75rem;
}

/* --- FAMILY CLASHES --- */
.clashes-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 1.5rem;
}

.clash-match-card {
    border: 1px dashed rgba(239, 68, 68, 0.3);
    background: linear-gradient(180deg, rgba(239, 68, 68, 0.04) 0%, rgba(17, 24, 39, 0.7) 100%);
}

.clash-header-banner {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-danger);
    text-align: center;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    padding: 4px;
    margin: -1.25rem -1.25rem 1rem -1.25rem;
    text-transform: uppercase;
}

.clash-vs-box {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-block-end: 1rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 1rem;
    border-radius: 12px;
}

.clash-side {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex: 1;
}

.clash-flag { font-size: 2.25rem; }
.clash-team-name { font-family: var(--font-title); font-weight: 700; font-size: 1.1rem; }
.clash-owner-lbl { font-size: 0.65rem; color: var(--text-muted); margin-block-start: 2px; }
.clash-owner-val { font-weight: 700; color: var(--accent-primary); font-size: 0.9rem; }
.clash-score-val { font-family: var(--font-title); font-size: 1.75rem; font-weight: 800; margin-block-start: 4px; }

.clash-vs-divider {
    font-weight: 800;
    color: var(--text-muted);
    font-style: italic;
}

/* --- ADMIN PANEL --- */

.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 1.5rem;
}

.admin-ctrl-card h3 {
    font-family: var(--font-title);
    font-size: 1.25rem;
    margin-block-end: 1rem;
}

.admin-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.form-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
}

.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: white;
    font-family: var(--font-sans);
    padding: 0.6rem 2.5rem 0.6rem 0.75rem;
}

.password-input-wrapper button {
    position: absolute;
    right: 8px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.9rem;
}

.btn {
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.65rem 1.25rem;
    border-radius: 8px;
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--accent-primary-gradient);
    color: white;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.2);
}

.btn-primary:hover {
    box-shadow: 0 6px 16px rgba(139, 92, 246, 0.4);
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
}

.admin-help-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-block-start: 0.25rem;
}

.admin-table-container {
    max-block-size: 500px;
    overflow-y: auto;
    margin-block-start: 1rem;
}

.admin-matches-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-matches-table th, .admin-matches-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-block-end: 1px solid var(--border-color);
    font-size: 0.85rem;
}

.admin-matches-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.dialog-open-btn {
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
}

/* Dialog Styles (Native Overlay) */
.modal-dialog {
    margin: auto;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background: #0f172a;
    color: white;
    box-shadow: 0 20px 50px rgba(0,0,0,0.8);
    width: calc(100% - 2rem);
    max-inline-size: 520px;
    padding: 1.5rem;
    outline: none;
}

.modal-dialog::backdrop {
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    animation: backdropFade 0.2s ease-out;
}

@keyframes backdropFade {
    from { opacity: 0; }
    to { opacity: 1; }
}

.dialog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-block-end: 1px solid var(--border-color);
    padding-block-end: 0.75rem;
    margin-block-end: 1.25rem;
}

.dialog-header h3 {
    font-family: var(--font-title);
    font-size: 1.25rem;
}

.dialog-close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.75rem;
    cursor: pointer;
}

.match-setup-preview {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 1rem;
    margin-block-end: 1.25rem;
}

.dialog-team {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    text-align: center;
}

.dialog-team-flag { font-size: 2rem; }
.dialog-team-name { font-family: var(--font-title); font-weight: 700; font-size: 0.95rem; margin-block-start: 4px; }
.dialog-team-owner { font-size: 0.65rem; color: var(--text-muted); }
.dialog-vs { font-weight: 800; font-style: italic; color: var(--text-muted); padding-inline: 1rem; }

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-block-end: 1.25rem;
}

.form-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-block-end: 1.5rem;
}

.form-checkbox input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.form-checkbox label {
    font-size: 0.85rem;
    cursor: pointer;
    user-select: none;
}

.dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* Utilities */
.mt-3 { margin-block-start: 0.75rem; }
.mt-4 { margin-block-start: 1.5rem; }

/* Footer */
.app-footer {
    text-align: center;
    padding-block: 2rem 1rem;
    border-block-start: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.app-footer a {
    color: var(--accent-primary);
    text-decoration: none;
}

.app-footer a:hover {
    text-decoration: underline;
}

.api-status {
    font-size: 0.75rem;
}

/* Calendar Grouping & Timezone View CSS */
.day-section {
    margin-block-end: 2rem;
    width: 100%;
    transition: margin-block-end 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.day-section.collapsed {
    margin-block-end: 0.75rem;
}

.day-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-block-end: 1rem;
    padding-block-end: 0.5rem;
    border-block-end: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    user-select: none;
}

.day-toggle-icon {
    color: var(--text-muted);
    transition: transform 0.25s ease, color 0.2s ease, background 0.2s ease;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.day-header:hover .day-toggle-icon {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.08);
}

.day-section.collapsed .day-toggle-icon {
    transform: rotate(-90deg);
}

.day-section .agenda-list {
    max-height: 4000px;
    opacity: 1;
    overflow: visible;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
}

.day-section.collapsed .agenda-list {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
}

.day-date {
    font-family: var(--font-title);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
}

.day-badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.day-badge.today {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-success);
    border: 1px solid rgba(16, 185, 129, 0.3);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.1);
}

.day-badge.tomorrow {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-info);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.day-badge.yesterday {
    background: rgba(156, 163, 175, 0.15);
    color: var(--text-muted);
    border: 1px solid rgba(156, 163, 175, 0.3);
}

/* Agenda Schedule Layout */
.agenda-list-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
}

.agenda-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
}

.agenda-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    gap: 0.75rem;
    width: 100%;
    backdrop-filter: var(--backdrop-blur);
    transition: background-color 0.2s, border-color 0.2s;
}

.agenda-item:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-accent);
}

.agenda-item.clash-match {
    border-inline-start: 4px solid var(--accent-danger);
    background: linear-gradient(180deg, rgba(239, 68, 68, 0.04) 0%, rgba(17, 24, 39, 0.7) 100%);
}

.agenda-time-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    font-size: 0.85rem;
    font-weight: 600;
    width: 100%;
}

.agenda-stage {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
}

.agenda-times {
    color: var(--text-muted);
}

.agenda-teams {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    width: 100%;
    margin-block: 0.25rem;
    flex-wrap: wrap;
}

.agenda-team {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.agenda-team.home {
    flex-direction: row;
}

.agenda-team.away {
    flex-direction: row;
}

.agenda-team-flag {
    font-size: 1.5rem;
}

.agenda-team-name {
    font-family: var(--font-title);
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-main);
}

.agenda-team-owner {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.agenda-team.winner .agenda-team-name {
    color: #fff;
    font-weight: 800;
}

.agenda-vs {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
}

.agenda-status-score {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    width: 100%;
    flex-wrap: wrap;
}

.agenda-score {
    font-family: var(--font-title);
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-main);
}

.agenda-score.finished {
    color: var(--accent-success);
}

.agenda-status-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.agenda-status-badge.scheduled {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
}

.agenda-status-badge.playing {
    background: rgba(139, 92, 246, 0.15);
    color: var(--accent-primary);
    animation: pulse 1.5s infinite;
}

.agenda-status-badge.completed {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-success);
}

.clash-badge-agenda {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--accent-danger);
    font-weight: 700;
    font-size: 0.65rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    text-transform: uppercase;
}

.penalty-detail {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
}

.agenda-venue {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.agenda-venue i {
    color: var(--accent-danger);
}

.agenda-local-time {
    font-size: 0.75rem;
    color: var(--accent-info);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-block-start: 0.1rem;
}

/* --- CLASH OWNER PROMINENCE --- */
.clash-owner-block {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.clash-owner-block.home {
    align-items: flex-end;
    text-align: right;
}

.clash-owner-block.away {
    align-items: flex-start;
    text-align: left;
}

.clash-owner-name {
    font-family: var(--font-title);
    font-size: 1.25rem;
    font-weight: 800;
    color: #ffffff; /* Bright white to stand out */
    text-shadow: 0 0 12px rgba(255, 255, 255, 0.15);
    letter-spacing: -0.01em;
    line-height: 1.15;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.clash-team-sub {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-block-start: 4px;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    transition: all 0.3s ease;
}

.clash-owner-block.home .clash-team-sub {
    justify-content: flex-end;
}

.clash-owner-block.away .clash-team-sub {
    justify-content: flex-start;
}

/* Winner styling: highlight the winning family member */
.agenda-team.winner .clash-owner-name {
    color: var(--accent-success);
    font-weight: 900;
    text-shadow: 0 0 15px rgba(16, 185, 129, 0.5);
    transform: scale(1.05);
}

.agenda-team.winner .clash-team-sub {
    color: rgba(16, 185, 129, 0.85);
}

/* --- TOURNAMENT SIMULATION STYLING --- */
@keyframes slideDown {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}

.simulation-banner {
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
    color: #0f172a;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.6rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 700;
    box-shadow: 0 4px 20px rgba(217, 119, 6, 0.35);
    z-index: 10000;
    animation: slideDown 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.simulation-banner i {
    margin-right: 0.35rem;
    font-size: 1.05rem;
}

.btn-reset-sim {
    background: rgba(15, 23, 42, 0.15);
    border: 1px solid rgba(15, 23, 42, 0.3);
    color: #0f172a;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    transition: all 0.2s ease;
    text-transform: uppercase;
}

.btn-reset-sim:hover {
    background: rgba(15, 23, 42, 0.3);
    border-color: rgba(15, 23, 42, 0.5);
    transform: scale(1.03);
}

.simulation-controls-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
}

.simulation-controls {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.simulation-controls label {
    font-family: var(--font-title);
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.sim-select {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
    padding: 3px 28px 3px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg fill='white' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>");
    background-repeat: no-repeat;
    background-position: right 6px center;
    background-size: 14px;
    transition: all 0.2s ease;
}

.sim-select:hover, .sim-select:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 8px rgba(139, 92, 246, 0.35);
    background-color: rgba(15, 23, 42, 0.9);
}

/* Adjust app-header to flow simulation controls nicely */
@media (max-width: 768px) {
    .app-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    .simulation-controls-wrapper {
        width: 100%;
    }
    .simulation-controls {
        width: 100%;
        justify-content: center;
    }
}

/* --- HIDE PAST DAYS TOGGLE STYLING --- */
.hide-past-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 6px 12px;
    border-radius: 12px;
    user-select: none;
    transition: all 0.2s ease;
}

.hide-past-toggle:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
}

.hide-past-toggle input[type="checkbox"] {
    accent-color: var(--accent-primary);
    cursor: pointer;
    width: 14px;
    height: 14px;
}




/* ===== Simulation In-Progress Overlay ===== */
.sim-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.72);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: sim-fade-in 180ms ease-out;
}

.sim-overlay.is-active {
    display: flex;
}

.sim-overlay-card {
    text-align: center;
    color: #f8fafc;
    font-family: 'Outfit', 'Inter', sans-serif;
    padding: 2rem 3rem;
}

.sim-ball {
    font-size: 5rem;
    display: inline-block;
    animation: sim-bounce 0.9s cubic-bezier(0.5, 0, 0.5, 1) infinite,
               sim-spin 1.4s linear infinite;
    filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.35));
}

.sim-overlay-title {
    margin-top: 1.25rem;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.sim-overlay-flavour {
    margin-top: 0.4rem;
    font-size: 1rem;
    opacity: 0.85;
    min-height: 1.4em;  /* prevent layout shift when copy rotates */
}

/* Both keyframes use the individual CSS transform properties (`translate`
   and `rotate`) rather than the `transform` shorthand — they animate
   independent properties, so the two animations compose instead of
   one overwriting the other. */
@keyframes sim-bounce {
    0%, 100% { translate: 0 0; }
    50%      { translate: 0 -32px; }
}

@keyframes sim-spin {
    from { rotate: 0deg; }
    to   { rotate: 360deg; }
}

@keyframes sim-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .sim-ball {
        animation: none;
    }
}


