/* FIFA World Cup 2026 - Predict & Win Challenge */
/* Premium Light Theme with Glassmorphism & Micro-interactions */
/* Brand Colors: #3D8BCC (Blue), #B5CA47 (Green), #F6CE45 (Yellow), #D13730 (Red) */

:root {
    --blue: #3D8BCC;
    --blue-light: #EBF4FB;
    --blue-dark: #2C6FA3;
    --blue-glow: rgba(61, 139, 204, 0.25);
    --green: #B5CA47;
    --green-light: #F4F8E4;
    --green-dark: #8DA832;
    --yellow: #F6CE45;
    --yellow-light: #FEF9E7;
    --yellow-glow: rgba(246, 206, 69, 0.3);
    --red: #D13730;
    --red-light: #FDEAEA;
    --bg: #FFFFFF;
    --bg-secondary: #F5F7FA;
    --bg-card: #FFFFFF;
    --bg-glass: rgba(255, 255, 255, 0.85);
    --text: #1A1F36;
    --text-secondary: #525F7F;
    --text-light: #8898AA;
    --border: #E6EBF1;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
    --shadow: 0 6px 20px rgba(0, 0, 0, 0.06), 0 2px 6px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04);
    --shadow-glow: 0 8px 30px rgba(61, 139, 204, 0.15);
    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 6px;
    --transition: cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: var(--bg-secondary);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 16px;
}

/* Color accent bar at top */
body::before {
    content: '';
    display: block;
    height: 8px;
    background: linear-gradient(90deg, var(--blue), var(--green), var(--yellow), var(--red));
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 999;
}

/* Screens */
.screen {
    display: none;
}

.screen.active {
    display: block;
}

/* ============ REGISTRATION SCREEN ============ */
#register-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    min-height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 500;
    overflow-y: auto;
    background-image: 
        radial-gradient(ellipse at top right, rgba(61, 139, 204, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at bottom left, rgba(246, 206, 69, 0.05) 0%, transparent 50%);
}

#register-screen.active {
    display: flex;
}

#register-screen.hidden {
    display: none !important;
}

.logo-section {
    text-align: center;
    margin-bottom: 28px;
}

.brand-logo {
    width: 180px;
    height: auto;
    margin-bottom: 20px;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.08));
    animation: float 3s ease-in-out infinite;
}

.register-fifa-img {
    width: 70%;
    height: auto;
    mix-blend-mode: multiply;
    margin-bottom: 8px;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.trophy-icon {
    font-size: 52px;
    margin-bottom: 8px;
    animation: pulse-trophy 2s ease-in-out infinite;
}

@keyframes pulse-trophy {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.logo-section h1 {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text);
    margin-top: 8px;
    letter-spacing: -0.5px;
}

.logo-section h1 span {
    background: linear-gradient(135deg, var(--blue), var(--blue-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-section h2 {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-top: 2px;
}

.subtitle {
    margin-top: 10px;
    font-size: 0.85rem;
    color: var(--red);
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* Register Card - Glassmorphism */
.register-card {
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.6);
    position: relative;
    overflow: hidden;
}

.register-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--blue), var(--green), var(--yellow));
    border-radius: var(--radius) var(--radius) 0 0;
}

.register-card h3 {
    text-align: center;
    margin-bottom: 18px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.input-group input {
    padding: 15px 18px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s var(--transition);
}

.input-group input:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 4px var(--blue-glow);
    background: var(--bg);
}

.input-group input::placeholder {
    color: var(--text-light);
}

.btn-primary {
    padding: 15px 24px;
    border-radius: var(--radius-sm);
    border: none;
    background: linear-gradient(135deg, var(--blue), var(--blue-dark));
    color: #FFFFFF;
    font-size: 0.95rem;
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    transition: all 0.3s var(--transition);
    letter-spacing: 0.3px;
    position: relative;
    overflow: hidden;
}

.btn-primary::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-primary:hover::after {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.error-msg {
    color: var(--red);
    font-size: 0.8rem;
    text-align: center;
    margin-top: 8px;
    min-height: 20px;
}

.rules-brief {
    margin-top: 22px;
    text-align: center;
}

.rules-brief h4 {
    color: var(--text);
    margin-bottom: 10px;
    font-size: 0.85rem;
    font-weight: 600;
}

.rules-brief ul {
    list-style: none;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.rules-brief li {
    margin-bottom: 5px;
}

/* ============ GAME SCREEN ============ */
#game-screen {
    background: var(--bg-secondary);
    padding-top: 4px;
}

/* Game Header - Sticky Glassmorphism */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    margin: -16px -16px 20px -16px;
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 8px;
    z-index: 100;
    box-shadow: var(--shadow-sm);
    border-radius: 20px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-logo {
    width: 120px;
    height: auto;
}

.header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 3px;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    transition: all 0.2s var(--transition);
}

.header-right:hover {
    background: var(--bg-secondary);
}

.header-right:active {
    transform: scale(0.97);
}

.header-right-top {
    display: flex;
    align-items: center;
    gap: 8px;
}

.player-name-badge {
    font-size: 0.92rem;
    color: var(--text);
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 700;
}

.points-badge {
    background: linear-gradient(135deg, var(--yellow), #E5B800);
    color: var(--text);
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    box-shadow: 0 2px 8px var(--yellow-glow);
}

.btn-switch {
    color: var(--blue);
    font-size: 0.7rem;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    white-space: nowrap;
}

.header-right:hover .btn-switch {
    text-decoration: underline;
    color: var(--blue-dark);
}

.header-title {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--blue);
}

/* Section Titles */
.section-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 14px;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* FIFA Banner */
.fifa-banner {
    margin-bottom: 24px;
    text-align: center;
}

.fifa-banner-img {
    width: 50%;
    height: auto;
    mix-blend-mode: multiply;
}

/* ============ MATCH CARDS - PREMIUM ============ */
.match-section {
    margin-bottom: 28px;
}

.match-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 14px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: all 0.3s var(--transition);
    position: relative;
    overflow: hidden;
}

.match-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--blue), var(--green));
    opacity: 0;
    transition: opacity 0.3s;
}

.match-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.match-card:hover::before {
    opacity: 1;
}

.match-stage-badge {
    display: inline-block;
    background: var(--blue-light);
    color: var(--blue-dark);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 14px;
    letter-spacing: 0.8px;
}

/* Kickoff Time - Prominent */
.match-time {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 18px;
    padding: 10px 14px;
    background: linear-gradient(135deg, var(--bg-secondary), rgba(61, 139, 204, 0.04));
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
}

.match-time .time-icon {
    font-size: 1.1rem;
}

.match-time .time-label {
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.match-time .time-value {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--blue-dark);
}

.match-teams {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 18px;
}

.team {
    text-align: center;
    flex: 1;
}

.team-flag {
    display: block;
    margin-bottom: 8px;
    line-height: 1;
}

.team-flag .flag-img {
    width: 52px;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
    transition: transform 0.3s var(--transition);
}

.match-card:hover .team-flag .flag-img {
    transform: scale(1.05);
}

.team-flag .flag-placeholder {
    font-size: 2.5rem;
    opacity: 0.4;
}

.flag-img {
    width: 24px;
    height: auto;
    vertical-align: middle;
    border-radius: 3px;
}

.flag-placeholder {
    font-size: 1.2rem;
    vertical-align: middle;
    opacity: 0.5;
}

.team-name {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text);
    word-break: break-word;
}

.vs-badge {
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--text-light);
    padding: 8px 10px;
    background: var(--bg-secondary);
    border-radius: 50%;
    border: 1px solid var(--border);
    letter-spacing: 1px;
}

/* ============ PREDICTION BUTTONS - PREMIUM ============ */
.prediction-buttons {
    display: flex;
    gap: 10px;
}

.btn-predict {
    flex: 1;
    padding: 14px 10px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-size: 0.78rem;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    transition: all 0.3s var(--transition);
    position: relative;
    overflow: hidden;
}

.btn-predict::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(61, 139, 204, 0.1);
    transition: all 0.5s var(--transition);
    transform: translate(-50%, -50%);
}

.btn-predict:hover:not(:disabled)::before {
    width: 300px;
    height: 300px;
}

.btn-predict:hover:not(:disabled) {
    border-color: var(--blue);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(61, 139, 204, 0.15);
}

.btn-predict:active:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(61, 139, 204, 0.1);
}

.btn-predict:disabled {
    cursor: not-allowed;
}

.btn-predict .flag-img {
    width: 18px;
    margin-right: 4px;
}

/* Selected state - animated */
.btn-predict.selected {
    border-color: var(--green);
    background: linear-gradient(135deg, var(--green-light), rgba(181, 202, 71, 0.15));
    color: var(--green-dark);
    box-shadow: 0 4px 16px rgba(181, 202, 71, 0.2);
    animation: select-bounce 0.4s var(--transition);
}

@keyframes select-bounce {
    0% { transform: scale(1); }
    30% { transform: scale(0.95); }
    60% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

.btn-predict.locked {
    border-color: var(--border);
    background: var(--bg-secondary);
    color: var(--text-light);
    opacity: 0.6;
}

.prediction-status {
    text-align: center;
    margin-top: 12px;
    font-size: 0.75rem;
    color: var(--green-dark);
    font-weight: 600;
    padding: 6px 12px;
    background: var(--green-light);
    border-radius: 20px;
    display: inline-block;
    width: 100%;
    animation: fade-in 0.3s ease;
}

@keyframes fade-in {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.prediction-status.locked {
    color: var(--red);
    background: var(--red-light);
}

/* No match card */
.no-match-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 40px 24px;
    text-align: center;
    border: 2px dashed var(--border);
}

.no-match-card p {
    color: var(--text-secondary);
    font-size: 0.88rem;
    margin-bottom: 4px;
}

/* ============ LEADERBOARD - PREMIUM ============ */
.leaderboard-section {
    margin-bottom: 28px;
}

.leaderboard-container {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.leaderboard-row {
    display: flex;
    align-items: center;
    padding: 13px 18px;
    border-bottom: 1px solid var(--border);
    transition: all 0.2s var(--transition);
}

.leaderboard-row:last-child {
    border-bottom: none;
}

.leaderboard-row:hover {
    background: var(--bg-secondary);
}

.leaderboard-row.current-player {
    background: linear-gradient(135deg, var(--yellow-light), rgba(246, 206, 69, 0.08));
    border-left: 3px solid var(--yellow);
}

.lb-rank {
    width: 36px;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-light);
}

.lb-rank.gold { color: #D4A600; font-size: 1rem; }
.lb-rank.silver { color: #7D8590; font-size: 0.95rem; }
.lb-rank.bronze { color: #A0522D; font-size: 0.9rem; }

.lb-name {
    flex: 1;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lb-stats {
    text-align: right;
}

.lb-points {
    font-weight: 700;
    font-size: 0.82rem;
    color: var(--blue);
}

.lb-record {
    font-size: 0.62rem;
    color: var(--text-light);
}

.loading {
    text-align: center;
    padding: 24px;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* ============ POINTS INFO ============ */
.points-info {
    margin-bottom: 32px;
}

.points-grid {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 18px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.point-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.point-item:last-child {
    border-bottom: none;
}

.point-item .stage {
    font-size: 0.82rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.point-item .pts {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--blue);
    background: var(--blue-light);
    padding: 3px 10px;
    border-radius: 12px;
}

/* ============ CONFIRMATION MODAL ============ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 32px;
    max-width: 360px;
    width: 100%;
    text-align: center;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    transform: scale(0.85) translateY(20px);
    transition: all 0.3s var(--transition);
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

.modal h3 {
    margin-bottom: 12px;
    font-size: 1.1rem;
    color: var(--text);
}

.modal p {
    color: var(--text-secondary);
    font-size: 0.82rem;
    margin-bottom: 24px;
    line-height: 1.6;
}

.modal-buttons {
    display: flex;
    gap: 10px;
}

.btn-confirm {
    flex: 1;
    padding: 13px;
    border-radius: var(--radius-sm);
    border: none;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    transition: all 0.2s var(--transition);
}

.btn-confirm:active {
    transform: scale(0.95);
}

.btn-yes {
    background: linear-gradient(135deg, var(--blue), var(--blue-dark));
    color: white;
    box-shadow: 0 4px 12px var(--blue-glow);
}

.btn-yes:hover {
    box-shadow: 0 6px 20px var(--blue-glow);
    transform: translateY(-1px);
}

.btn-no {
    background: var(--bg-secondary);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-no:hover {
    background: var(--border);
}

/* ============ TOAST ============ */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-card);
    color: var(--text);
    padding: 14px 28px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    border-left: 4px solid var(--green);
    z-index: 2000;
    transition: transform 0.4s var(--transition);
    max-width: 90%;
    text-align: center;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

.toast.error {
    border-left-color: var(--red);
}

/* ============ RESPONSIVE ============ */
@media (min-width: 768px) {
    .container {
        max-width: 560px;
        padding: 24px;
    }
    
    .logo-section h1 {
        font-size: 1.9rem;
    }
    
    .brand-logo {
        width: 200px;
    }
    
    .team-flag .flag-img {
        width: 60px;
    }

    .game-header {
        margin: -24px -24px 24px -24px;
        padding: 14px 24px;
    }
}

/* Section header row */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.section-header .section-title {
    margin-bottom: 0;
}

.btn-refresh {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 5px 10px;
    border-radius: var(--radius-xs);
    font-size: 0.7rem;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    transition: all 0.2s var(--transition);
}

.btn-refresh:hover {
    border-color: var(--blue);
    color: var(--blue);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 5px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}
