:root {
    --golf-primary: #2E7D32;
    --golf-dark: #1B5E20;
    --bg-color: #F4F9F1;
    --gold: #FFC107;
    --font-heading: 'Comfortaa', cursive;
    --font-body: 'Poppins', sans-serif;
}

body {
    background-color: var(--bg-color);
    font-family: var(--font-body);
    color: #333;
    overscroll-behavior-y: none;
    -webkit-overflow-scrolling: touch;
    -webkit-user-select: none;
    user-select: none;
}

#screenGame {
    padding-bottom: 120px;
}

/* LOBBY */
#screenLobby {
    background: radial-gradient(circle at 50% 30%, #43a047 0%, var(--golf-dark) 60%, #051a05 100%);
    min-height: 100vh;
    color: white !important;
    padding-top: 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.lobby-header {
    text-align: center;
    margin-bottom: 2rem;
}

.lobby-title-icon {
    font-size: 3.5rem;
    display: block;
    margin-bottom: 0.5rem;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.2));
}

.lobby-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 3rem;
    color: white !important;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    letter-spacing: -1px;
    margin: 0;
}

#screenLobby .card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: none;
    border-radius: 20px;
    color: #333;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
}

#screenLobby .btn-outline-glass {
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.1);
    font-weight: 600;
    backdrop-filter: blur(5px);
    font-family: var(--font-heading);
}

#screenLobby .btn-outline-glass:hover {
    background: white;
    color: var(--golf-primary);
}

/* HEADER */
.header-golf {
    background: linear-gradient(135deg, var(--golf-dark), var(--golf-primary));
    color: white;
    padding: 15px 20px 20px 20px;
    border-bottom-left-radius: 30px;
    border-bottom-right-radius: 30px;
    box-shadow: 0 4px 15px rgba(46, 125, 50, 0.3);
    margin-bottom: 15px;
    position: sticky;
    top: 0;
    z-index: 100;
    text-align: center;
    position: relative;
}

.app-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.8rem;
    margin: 5px 0 0 0;
    line-height: 1;
    letter-spacing: -1px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.header-icon {
    font-size: 2rem;
    display: block;
    line-height: 1;
    margin-bottom: 5px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.live-badge {
    font-size: 0.6rem;
    opacity: 0.9;
    font-weight: 700;
    display: inline-block;
    letter-spacing: 1px;
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 10px;
    margin-top: 5px;
}

.header-logo-link {
    display: block;
    margin-top: 8px;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.header-logo-link:hover {
    opacity: 1;
}

.header-logo-img {
    height: 1.2rem;
    width: auto;
    filter: brightness(0) invert(1);
}

/* BOTON SALIR */
.btn-exit {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 50;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 12px;
    padding: 5px 12px;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    text-decoration: none;
    backdrop-filter: blur(4px);
    font-family: var(--font-heading);
    font-weight: 600;
    transition: background 0.2s;
}

.btn-exit:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* UI GENERAL */
.card {
    border: none;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
    margin-bottom: 12px;
    background: white;
}

.btn-golf {
    background: var(--golf-primary);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 14px;
    font-weight: 800;
    width: 100%;
    box-shadow: 0 4px 10px rgba(46, 125, 50, 0.2);
    transition: transform 0.1s;
    font-family: var(--font-heading);
    letter-spacing: 0.5px;
}

.btn-golf:active {
    transform: scale(0.98);
}

.btn-ranking-pill {
    position: absolute;
    bottom: -14px;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    color: var(--golf-dark);
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 5px 20px;
    font-size: 0.75rem;
    font-weight: 800;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    text-decoration: none;
    z-index: 101;
    font-family: var(--font-heading);
}

.form-control,
.form-select {
    border-radius: 10px;
    padding: 10px;
    font-weight: 600;
    background-color: #FAFAFA;
    border: 1px solid #dee2e6;
    font-family: var(--font-body);
}

/* DOTS FIXED */
.input-score-wrapper {
    position: relative;
    height: 65px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.score-input {
    font-size: 1.8rem;
    height: 100%;
    width: 100%;
    text-align: center;
    color: var(--golf-dark);
    font-weight: 800;
    background-color: white;
    z-index: 1;
    position: relative;
    border: 2px solid #eee;
    padding-top: 15px;
}

.dots-overlay {
    position: absolute;
    top: 8px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 4px;
    pointer-events: none;
    z-index: 20;
}

.big-dot {
    display: block;
    width: 8px;
    height: 8px;
    background-color: #212529;
    border-radius: 50%;
}

/* SCORECARD */
.scorecard-wrapper {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 5px;
}

.scorecard-label {
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--golf-primary);
    margin: 8px 0 4px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: center;
    background: #e8f5e9;
    padding: 3px;
    border-radius: 4px;
}

.scorecard-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 2px;
}

.scorecard-table th {
    background-color: var(--golf-primary);
    color: white;
    font-weight: 600;
    font-size: 0.65rem;
    padding: 4px 0;
    text-align: center;
    border-radius: 3px;
}

.scorecard-table td {
    background-color: #fff;
    text-align: center;
    font-weight: 700;
    padding: 0;
    border-radius: 3px;
    font-size: 0.75rem;
    border: 1px solid #f0f0f0;
    vertical-align: middle;
    position: relative;
    height: 42px;
}

.star-bg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -55%);
    color: var(--gold);
    font-size: 2rem;
    line-height: 0;
    z-index: 1;
    text-shadow: 0 0 2px rgba(255, 160, 0, 0.5);
}

.score-badge {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    font-weight: 800;
    font-size: 0.8rem;
    position: relative;
    z-index: 5;
    background: transparent;
}

.dots-mini {
    position: absolute;
    top: 2px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 1px;
    z-index: 5;
}

.dot-small {
    display: block;
    width: 3px;
    height: 3px;
    background-color: #000;
    border-radius: 50%;
}

/* COLORES */
.pga-eagle {
    color: #E65100;
    text-decoration: underline double;
}

.pga-birdie {
    color: #DC3545;
}

.pga-par {
    color: #212529;
}

.pga-bogey {
    color: #0D6EFD;
}

.pga-double {
    color: #000;
    font-style: italic;
}

.money-pill {
    padding: 3px 8px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.8rem;
    display: inline-block;
    min-width: 60px;
}

.money-plus {
    background-color: #E8F5E9;
    color: var(--golf-dark);
    border: 1px solid #C8E6C9;
}

.money-minus {
    background-color: #FFEBEE;
    color: #C62828;
    border: 1px solid #FFCDD2;
}

/* MODALES PERSONALIZADOS (AD HOC) */
.modal-content {
    border-radius: 25px;
    border: none;
    overflow: hidden;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25);
    font-family: var(--font-body);
}

.modal-header {
    background: linear-gradient(135deg, var(--golf-dark), var(--golf-primary));
    color: white;
    border-bottom: none;
    padding: 1.5rem;
    justify-content: center;
}

.modal-title {
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: 0.5px;
    font-size: 1.2rem;
    margin: 0;
}

.btn-close-white {
    position: absolute;
    right: 20px;
    top: 20px;
    filter: invert(1) grayscale(100%) brightness(200%);
    opacity: 0.8;
}

.modal-body {
    padding: 2rem 2rem 1.5rem 2rem;
    text-align: center;
}

.modal-footer {
    border-top: none;
    padding: 0 2rem 2rem 2rem;
    justify-content: center;
    gap: 10px;
}

.btn-modal-cancel {
    background: #f1f3f5;
    color: #495057;
    font-weight: 700;
    border: none;
    padding: 12px 30px;
    border-radius: 50px;
    font-family: var(--font-heading);
    transition: all 0.2s;
}

.btn-modal-cancel:hover {
    background: #e9ecef;
    transform: translateY(-2px);
}

.btn-modal-confirm {
    background: var(--golf-primary);
    color: white;
    font-weight: 700;
    border: none;
    padding: 12px 30px;
    border-radius: 50px;
    box-shadow: 0 4px 12px rgba(46, 125, 50, 0.3);
    font-family: var(--font-heading);
    transition: all 0.2s;
}

.btn-modal-confirm:hover {
    background: var(--golf-dark);
    transform: translateY(-2px);
}

.btn-modal-danger {
    background: #dc3545;
    color: white;
    font-weight: 700;
    border: none;
    padding: 12px 30px;
    border-radius: 50px;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
    font-family: var(--font-heading);
    transition: all 0.2s;
}

.btn-modal-danger:hover {
    background: #b02a37;
    transform: translateY(-2px);
}

/* HISTORIAL */
.active-game-item {
    background: #fff;
    border-left: 6px solid var(--golf-primary);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.active-game-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.finished-game-item {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 10px;
    border: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s;
}

.finished-game-item:hover {
    background: #fff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    border-color: #dee2e6;
    transform: translateY(-1px);
}

.accordion-button {
    font-weight: 700;
    color: var(--golf-dark);
    background: #e8f5e9;
    border: none;
    box-shadow: none !important;
}

.accordion-button:not(.collapsed) {
    background: #c8e6c9;
    color: var(--golf-dark);
}

.nav-pills .nav-link {
    color: #666;
    font-weight: 700;
    border-radius: 20px;
}

.nav-pills .nav-link.active {
    background-color: var(--golf-primary);
    color: white;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.info-box {
    background-color: #f8f9fa;
    border-radius: 10px;
    padding: 8px 10px;
    text-align: center;
    border: 1px solid #edf2f7;
}

.info-label {
    font-size: 0.6rem;
    color: #999;
    font-weight: 700;
    text-transform: uppercase;
}

.info-val {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--golf-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.98);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

/* ==================================================== */
/* PREMIUM DARK GLASSMORPHISM OVERRIDES (GOLF STYLE)    */
/* ==================================================== */

body {
    /* Richer, slightly brighter green background */
    background-color: #0d361c !important;
    background-image: 
        radial-gradient(circle at 50% -20%, #167a46 0%, transparent 70%),
        radial-gradient(circle at -20% 100%, #0a2614 0%, transparent 60%),
        radial-gradient(circle at 120% 100%, #1b5e20 0%, transparent 60%) !important;
    background-attachment: fixed !important;
    color: #ffffff !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
}

h1, h2, h3, h4, h5, h6, .lobby-title, .app-title, .card-title, .modal-title {
    font-family: 'Inter', sans-serif !important;
    font-weight: 800 !important;
    color: #ffffff !important;
    text-shadow: 0 4px 10px rgba(0,0,0,0.4);
}

.logo-footer {
    display: block;
    margin: 0.5rem auto 1.5rem auto !important;
    max-width: 150px;
    height: auto !important;
    filter: brightness(0) invert(1) drop-shadow(0 2px 4px rgba(0,0,0,0.4)) !important;
    transition: transform 0.3s ease;
    opacity: 1 !important; /* Max opacity for reading */
}
.logo-footer:hover { transform: scale(1.05); }

#screenLobby { background: transparent !important; }

#screenLobby .card, .card {
    /* Lighter glass to separate from background */
    background: rgba(255,255,255,0.08) !important;
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255,255,255,0.2) !important;
    color: #ffffff !important;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.1) !important;
}

/* Modals */
.modal-content {
    background-color: #0d361c !important;
    background-image: radial-gradient(circle at 50% 0%, #167a46 0%, transparent 70%) !important;
    border: 1px solid rgba(255,255,255,0.2) !important;
    color: #ffffff !important;
}
.modal-header, .card-header-custom {
    background: rgba(255,255,255,0.1) !important;
    border-bottom: 1px solid rgba(255,255,255,0.1) !important;
}
.modal-body { background: transparent !important; }

/* Buttons */
.btn-golf {
    background: #28a745 !important;
    color: #ffffff !important;
    box-shadow: 0 6px 15px rgba(40,167,69,0.4) !important;
    border-radius: 100px !important;
    font-family: 'Inter', sans-serif !important;
    text-transform: uppercase;
    font-weight: 800 !important;
    font-size: 1.1rem !important; /* Larger text */
    text-shadow: 0 2px 4px rgba(0,0,0,0.2) !important;
}

.btn-outline-glass {
    border-radius: 100px !important;
    border: 2px solid rgba(255,255,255,0.4) !important;
    background: rgba(255,255,255,0.05) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
}

/* Inputs */
.form-control, .form-select, .score-input {
    background-color: rgba(255,255,255,0.1) !important; /* Lighter inputs */
    border: 2px solid rgba(255,255,255,0.2) !important;
    color: #ffffff !important;
    font-size: 1.2rem !important; /* Larger text for accessibility */
    font-weight: 700 !important;
    text-shadow: none;
}
.form-control:focus, .form-select:focus, .score-input:focus {
    background-color: rgba(255,255,255,0.15) !important;
    border-color: #28a745 !important;
    box-shadow: 0 0 0 0.25rem rgba(40, 167, 69, 0.4) !important;
}
.form-control::placeholder, .score-input::placeholder {
    color: rgba(255,255,255,0.6) !important;
}

/* Text Colors */
.text-dark, .text-muted, .text-secondary {
    color: rgba(255,255,255,0.9) !important;
    font-weight: 600 !important;
}
.text-success { color: #f1c40f !important; }

/* Tables and Scorecards */
.table { color: #ffffff !important; font-size: 1rem !important; }
.scorecard-table td {
    background-color: rgba(255,255,255,0.08) !important;
    border-color: rgba(255,255,255,0.1) !important;
    font-size: 1rem !important; /* Bigger numbers */
}
.scorecard-label {
    background: rgba(40, 167, 69, 0.5) !important;
    color: #ffffff !important;
    font-size: 0.85rem !important;
}
.scorecard-table th {
    background-color: #0a2614 !important;
    font-size: 0.85rem !important;
}
.table-light { background-color: rgba(255,255,255,0.1) !important; color: #ffffff !important; }
.table-dark { background-color: #0d361c !important; border-color: rgba(255,255,255,0.1) !important;}
.table-hover>tbody>tr:hover>* { background-color: rgba(255,255,255,0.1) !important; color:#ffffff !important;}
.table-striped>tbody>tr:nth-of-type(odd)>* { background-color: rgba(255,255,255,0.05) !important; color:#ffffff !important;}

/* Misc Elements */
.bg-light, .bg-white { background-color: transparent !important; }
.big-dot, .dot-small { background-color: #ffffff !important; }
.btn-close-white { filter: invert(1) grayscale(100%) brightness(200%) !important; opacity: 1 !important;}

/* Info Boxes (Group/Apuesta) */
.info-box {
    background-color: rgba(255,255,255,0.1) !important;
    border: 1px solid rgba(255,255,255,0.2) !important;
}
.info-label { color: rgba(255,255,255,0.8) !important; font-weight: 700 !important; font-size: 0.75rem !important;}
.info-val { font-size: 1.1rem !important; color: #ffffff !important; font-weight: 800 !important;}

/* FIXES PARA OVERLAP Y FUENTES GARIGOLEADAS */
:root {
    --font-heading: 'Inter', -apple-system, sans-serif !important;
    --font-body: 'Inter', -apple-system, sans-serif !important;
}

.header-golf {
    padding-bottom: 35px !important; /* Espacio extra para que el logo Plexarian y el Ranking no choquen */
}

/* Active Games lists */
.active-game-item {
    background: rgba(255,255,255,0.1) !important;
    border-color: #28a745 !important;
    border-left-width: 8px !important;
}
.finished-game-item {
    background: rgba(0,0,0,0.3) !important;
    border-color: rgba(255,255,255,0.1) !important;
}

/* Ranking Pill */
.btn-ranking-pill {
    background: #0d361c !important; /* Dark solid */
    color: #ffffff !important;
    border: 2px solid #28a745 !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5) !important;
    padding: 8px 25px !important;
    font-size: 0.9rem !important;
}

/* Custom score colors for dark theme (Brighter versions) */
.pga-eagle { color: #ffd700 !important; text-shadow: 0 0 5px rgba(255,215,0,0.5); }
.pga-birdie { color: #ff7675 !important; font-weight: 800 !important;}
.pga-par { color: #ffffff !important; }
.pga-bogey { color: #74b9ff !important; font-weight: 800 !important;}
.pga-double { color: #dfe6e9 !important; font-style: normal !important; opacity: 0.9; }