: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;
}