:root {
    --bg-color: #000000;
    --accent-color: #347C2C;
    --accent-glow: rgba(52, 124, 44, 0.3);
    --card-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --gold: #FFD700;
    --font-main: 'Inter', system-ui, -apple-system, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    background-image: radial-gradient(circle at 50% 50%, rgba(52, 124, 44, 0.15) 0%, transparent 80%);
    background-attachment: fixed;
    color: var(--text-primary);
    font-family: var(--font-main);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

.container {
    max-width: 500px;
    margin: 0 auto;
    padding: 90px 20px 120px 20px;
    /* Aumentado padding superior e inferior */
    position: relative;
    z-index: 1;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 10px 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(to right, #fff, var(--accent-color));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.status-badge {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    backdrop-filter: blur(10px);
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 24px;
    backdrop-filter: blur(15px);
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.card h2 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

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

.scorecard-table th {
    text-align: left;
    color: var(--text-secondary);
    font-size: 0.8rem;
    padding-bottom: 10px;
}

.scorecard-table td {
    padding: 12px 0;
    border-bottom: 1px solid var(--glass-border);
}

.player-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    border: 2px solid var(--glass-border);
}

.score-cell {
    text-align: center;
    font-weight: 600;
    font-size: 1.2rem;
}

.score-cell.positive {
    color: var(--accent-color);
}

.score-cell.negative {
    color: #ff4d4d;
}

.bet-summary {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.bet-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bet-name {
    font-weight: 500;
}

.bet-value {
    font-weight: 700;
    color: var(--accent-color);
}

.bet-value.cop {
    color: var(--text-primary);
    opacity: 0.8;
    font-size: 0.9rem;
}

.btn {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 16px;
    border-radius: 16px;
    font-weight: 700;
    width: 100%;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px var(--accent-glow);
}

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

.nav-bottom {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 40px);
    max-width: 460px;
    background: rgba(20, 20, 20, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 30px;
    display: flex;
    justify-content: space-around;
    padding: 15px;
    z-index: 100;
}

.nav-item {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.7rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.nav-item.active {
    color: var(--accent-color);
}

.nav-icon {
    font-size: 1.2rem;
}

/* Full Scorecard Styles */
.hidden {
    display: none !important;
}

.full-scorecard-container {
    width: 100%;
    overflow-x: auto;
    margin-bottom: 20px;
    padding-bottom: 10px;
    -webkit-overflow-scrolling: touch;
}

.full-scorecard-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
    /* Asegura que sea scrollable en móvil */
}

.full-scorecard-table th,
.full-scorecard-table td {
    padding: 10px;
    text-align: center;
    border: 1px solid var(--glass-border);
    font-size: 0.8rem;
}

.full-scorecard-table th {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
}

/* Compact Scorecard (9 per row) */
.compact-scorecard {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.7rem;
    table-layout: fixed;
}

.compact-scorecard th,
.compact-scorecard td {
    border: 1px solid var(--glass-border);
    padding: 6px 2px;
    text-align: center;
    color: white;
}

.compact-scorecard th {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    font-weight: 500;
}

.compact-scorecard .player-name-cell {
    width: 60px;
    text-align: left;
    padding-left: 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
}

/* Course Selection */
.course-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.course-option {
    padding: 15px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    transition: all 0.2s;
}

.course-option:hover {
    border-color: var(--accent-color);
    background: rgba(52, 124, 44, 0.1);
}

.sticky-col {
    position: sticky;
    left: 0;
    background: #121212;
    z-index: 10;
    text-align: left !important;
    min-width: 100px;
}

.hole-header {
    background: var(--accent-color) !important;
    color: white !important;
}

.total-cell {
    font-weight: 700;
    color: var(--accent-color);
    background: rgba(52, 124, 44, 0.1);
}

/* Profile & Auth Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.form-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 14px;
    color: white;
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s ease;
}

.form-input:focus {
    border-color: var(--accent-color);
}

.auth-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
}

.auth-tab {
    flex: 1;
    text-align: center;
    padding: 10px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
}

.auth-tab.active {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
}

.user-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 20px;
}

.stat-item {
    background: rgba(255, 255, 255, 0.03);
    padding: 15px;
    border-radius: 16px;
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--accent-color);
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
}

/* Bet Suggestion Chips */
.bet-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.chip {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chip:hover {
    background: rgba(52, 124, 44, 0.2);
    border-color: var(--accent-color);
}

.chip.active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 1000;
}

.modal-content {
    width: 100%;
    max-width: 400px;
    max-height: 90vh;
    /* Límite estricto de altura */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* Cortar todo lo extra */
    border: 1px solid var(--accent-color);
}

/* Counter Input Styles */
.counter-input {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    overflow: hidden;
}

.counter-input button {
    background: none;
    border: none;
    color: white;
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
    cursor: pointer;
    transition: background 0.2s;
}

.counter-input button:active {
    background: var(--accent-color);
}

.counter-input input {
    flex: 1;
    background: none;
    border: none;
    color: white;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    outline: none;
    appearance: textfield;
    -moz-appearance: textfield;
}

.counter-input input::-webkit-outer-spin-button,
.counter-input input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
}

/* Hide Scrollbar for specific containers */
#score-players-container::-webkit-scrollbar,
.modal-content::-webkit-scrollbar,
.full-scorecard-container::-webkit-scrollbar,
.no-scrollbar::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    -webkit-appearance: none !important;
}

#score-players-container,
.modal-content,
.full-scorecard-container,
.no-scrollbar {
    -ms-overflow-style: none !important;
    /* IE and Edge */
    scrollbar-width: none !important;
    /* Firefox */
    -webkit-overflow-scrolling: touch;
}

/* Global scrollbar hide for Safari/Chrome on Mac */
::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    -webkit-appearance: none;
}

::-webkit-scrollbar-track {
    background: transparent !important;
    border: none !important;
}

::-webkit-scrollbar-thumb {
    background: transparent !important;
    border: none !important;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

/* Custom Checkbox Styles */
.custom-checkbox-label {
    user-select: none;
    transition: all 0.2s ease;
}

.custom-checkbox-label:hover {
    opacity: 0.8;
}

.custom-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid var(--text-secondary);
    border-radius: 4px;
    background-color: rgba(0, 0, 0, 0.2);
    display: inline-block;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.custom-checkbox:checked {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}

.custom-checkbox:checked::after {
    content: '✓';
    position: absolute;
    color: white;
    font-size: 14px;
    font-weight: bold;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.custom-checkbox.danger {
    border-color: #ffbcbc;
}

.custom-checkbox.danger:checked {
    background-color: #ff4d4d;
    border-color: #ff4d4d;
}