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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #0f7938 0%, #165a2c 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

h1 {
    background: linear-gradient(135deg, #0f7938 0%, #165a2c 100%);
    color: white;
    padding: 25px;
    text-align: center;
    font-size: 2rem;
    margin: 0;
}

.section {
    padding: 30px;
}

h2 {
    color: #165a2c;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

h3 {
    color: #0f7938;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

/* Player Setup */
.player-inputs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.player-input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.player-input-group label {
    font-weight: 600;
    color: #333;
}

.player-input-row {
    display: flex;
    gap: 5px;
}

.player-input {
    flex: 1;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.player-input:focus {
    outline: none;
    border-color: #0f7938;
    box-shadow: 0 0 0 3px rgba(15, 121, 56, 0.1);
}

.handicap-input {
    width: 60px;
    padding: 12px 8px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 0.95rem;
    text-align: center;
    transition: border-color 0.3s;
}

.handicap-input:focus {
    outline: none;
    border-color: #0f7938;
    box-shadow: 0 0 0 3px rgba(15, 121, 56, 0.1);
}

.handicap-input::placeholder {
    color: #999;
}

/* Buttons */
.start-btn, .primary-btn {
    padding: 14px 28px;
    background: linear-gradient(135deg, #0f7938 0%, #165a2c 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.start-btn:hover, .primary-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(15, 121, 56, .3);
}

.primary-btn:not(:disabled) {
    background: linear-gradient(135deg, #0f7938 0%, #165a2c 100%);
}

.primary-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.secondary-btn, .back-btn {
    padding: 10px 20px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s;
}

.secondary-btn:hover, .back-btn:hover {
    background: #5a6268;
}

.clear-btn {
    padding: 8px 16px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
}

.clear-btn:hover {
    background: #c82333;
}

/* Hole Index Setup */
.hole-index-setup {
    margin: 20px 0;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.hole-index-setup h3 {
    color: #0f7938;
    margin-bottom: 20px;
}

.hole-index-setup.collapsed .index-inputs-container,
.hole-index-setup.collapsed .index-actions {
    display: none;
}

.hole-index-setup h3 {
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.hole-index-setup h3::after {
    content: '▼';
    font-size: 0.8em;
    transition: transform 0.3s;
}

.hole-index-setup.collapsed h3::after {
    transform: rotate(-90deg);
}

.index-inputs-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 20px;
}

.index-grid h4 {
    color: #165a2c;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.index-inputs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.index-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.index-input-group label {
    font-size: 0.9rem;
    color: #666;
    min-width: 45px;
}

.index-input {
    width: 60px;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    text-align: center;
}

.index-input:focus {
    outline: none;
    border-color: #0f7938;
    box-shadow: 0 0 0 2px rgba(15, 121, 56, 0.1);
}

.index-actions {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 15px;
}

.index-hint {
    font-size: 0.85rem;
    color: #666;
    font-style: italic;
}

@media (max-width: 768px) {
    .index-inputs-container {
        grid-template-columns: 1fr;
    }
    
    .index-inputs {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Scorecard Section */
.scorecard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.progress-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.index-edit-hint {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 15px;
    font-style: italic;
}

#progressText {
    font-weight: 600;
    color: #0f7938;
    font-size: 1.1rem;
}

.scorecard-container {
    margin-bottom: 30px;
}

.nine-holes {
    margin-bottom: 30px;
}

.scorecard-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.scorecard-table thead {
    background: linear-gradient(135deg, #0f7938 0%, #165a2c 100%);
    color: white;
}

.scorecard-table th {
    padding: 12px 8px;
    text-align: center;
    font-weight: 600;
    font-size: 0.95rem;
}

.scorecard-table th:first-child {
    text-align: left;
    padding-left: 15px;
    min-width: 120px;
}

.hole-indexes th {
    background: linear-gradient(135deg, #2e7d32 0%, #1b5e20 100%);
    color: white;
    font-size: 1rem;
    font-weight: 700;
    padding: 10px 8px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    border-bottom: 2px solid #1b5e20;
}

.hole-indexes th:first-child {
    background: linear-gradient(135deg, #1b5e20 0%, #0d4f1f 100%);
    font-weight: 600;
}

.hole-indexes th.editable-index {
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
}

.hole-indexes th.editable-index:hover {
    background: linear-gradient(135deg, #4caf50 0%, #388e3c 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.index-edit-input {
    width: 50px;
    padding: 4px 6px;
    border: 2px solid #4caf50;
    border-radius: 4px;
    text-align: center;
    font-size: 0.95rem;
    font-weight: 700;
    background: white;
    color: #1b5e20;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.scorecard-table tbody tr {
    border-bottom: 1px solid #e0e0e0;
}

.scorecard-table tbody tr:hover {
    background: #f8f9fa;
}

.scorecard-table td {
    padding: 8px;
    text-align: center;
}

.scorecard-table td:first-child {
    text-align: left;
    padding-left: 15px;
    font-weight: 600;
    color: #333;
}

/* Score Input Cells */
.score-input {
    width: 50px;
    height: 38px;
    padding: 6px 4px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.2s;
    box-sizing: border-box;
}

.score-input:focus {
    outline: none;
    border-color: #0f7938;
    box-shadow: 0 0 0 3px rgba(15, 121, 56, 0.2);
    transform: scale(1.1);
    background: #f0f8f3;
}

.score-input:hover {
    border-color: #0f7938;
}

/* Legacy class name support */
.score-input-cell {
    width: 50px;
    height: 38px;
    padding: 6px 4px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.2s;
    box-sizing: border-box;
}

.score-input-cell:focus {
    outline: none;
    border-color: #0f7938;
    box-shadow: 0 0 0 3px rgba(15, 121, 56, 0.2);
    transform: scale(1.1);
    background: #f0f8f3;
}

.score-input-cell:hover {
    border-color: #0f7938;
}

/* Score colors */
.score-input-cell.eagle {
    background: #cff4fc;
    color: #055160;
    border-color: #0dcaf0;
    font-weight: 700;
}

.score-input-cell.birdie {
    background: #d4edda;
    color: #155724;
    border-color: #28a745;
}

.score-input-cell.par {
    background: #f8f9fa;
    color: #495057;
}

.score-input-cell.bogey {
    background: #fff3cd;
    color: #856404;
    border-color: #ffc107;
}

.score-input-cell.double-bogey {
    background: #f8d7da;
    color: #721c24;
    border-color: #dc3545;
}

/* Subtotal cells */
.subtotal {
    font-weight: 700;
    color: #0f7938;
    background: #f0f8f3;
}

/* Total Scores */
.total-scores {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

#totalScoresSummary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.player-total {
    display: flex;
    justify-content: space-between;
    padding: 12px;
    background: white;
    border-radius: 8px;
    border-left: 4px solid #0f7938;
}

.player-total .name {
    font-weight: 600;
    color: #333;
}

.player-total .score {
    font-weight: 700;
    color: #0f7938;
    font-size: 1.1rem;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

/* Results Section */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

/* Handicap Info */
.handicap-info {
    background: #f0f8f3;
    border-radius: 8px;
    padding: 15px;
    margin-top: 10px;
}

/* Mobile Card Layout for Up/Down Details */
.updown-mobile-details {
    display: none;
}

.hole-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 10px;
    margin-bottom: 15px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.hole-card.tie-card {
    background: #f8f9fa;
}

.hole-header {
    background: #f0f8f3;
    padding: 12px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e0e0e0;
}

.hole-number {
    font-weight: 700;
    font-size: 1.1rem;
    color: #0f7938;
}

.hole-index-badge {
    background: white;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.85rem;
    color: #666;
    font-weight: 600;
}

.player-scores {
    padding: 10px 0;
}

.player-score-row {
    padding: 8px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e9ecef;
}

.player-score-row:last-child {
    border-bottom: none;
}

.player-score-row.winner-player {
    background: rgba(212, 237, 218, 0.3);
}

.player-name {
    font-weight: 600;
    color: #333;
    min-width: 100px;
}

.scores {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
}

.gross-score {
    color: #666;
}

.gross-score sup {
    color: #0f7938;
    font-size: 0.7rem;
}

.net-score {
    font-weight: 700;
    color: #0f7938;
}

.point-change {
    font-size: 0.85rem;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
}

.point-change.point-gain {
    background: #d4edda;
    color: #155724;
}

.point-change.point-loss {
    background: #f8d7da;
    color: #721c24;
}

.point-change.point-neutral {
    background: #f0f0f0;
    color: #666;
}

.result-badge {
    padding: 10px;
    text-align: center;
    font-weight: 700;
    font-size: 0.95rem;
}

.result-badge.win {
    background: #d4edda;
    color: #0f7938;
}

.result-badge.tie {
    background: #f8f9fa;
    color: #666;
}

.handicap-info p {
    margin-bottom: 8px;
    color: #333;
    line-height: 1.6;
}

.handicap-info p:last-child {
    margin-bottom: 0;
}

.handicap-note {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #d4edda;
    color: #0f7938;
    font-style: italic;
}

/* Tabs */
.result-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    border-bottom: 2px solid #e0e0e0;
}

.tab-btn {
    padding: 12px 24px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: #666;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.tab-btn:hover {
    color: #0f7938;
}

.tab-btn.active {
    color: #0f7938;
    border-bottom-color: #0f7938;
}

.tab-content {
    display: none;
}

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

/* Settings Row */
.settings-row {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.pair-config {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pair-config label {
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
}

.pair-config select {
    min-width: 200px;
}

.settings-row label {
    font-weight: 600;
    color: #333;
}

.settings-row select {
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    background: white;
}

.player-checkboxes {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.player-checkboxes label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
}

.player-checkboxes input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.recalc-btn {
    padding: 8px 20px;
    background: #0f7938;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
    white-space: nowrap;
    min-width: 120px;
}

.recalc-btn:hover {
    background: #165a2c;
}

/* Results Display */
.result-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.result-card h4 {
    color: #0f7938;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.pair-result {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid #e0e0e0;
}

.pair-result:last-child {
    border-bottom: none;
}

.pair-name {
    font-weight: 600;
    color: #333;
}

.pair-score {
    display: flex;
    gap: 20px;
    align-items: center;
}

.wins {
    color: #28a745;
    font-weight: 600;
}

.losses {
    color: #dc3545;
    font-weight: 600;
}

.total-score {
    font-size: 1.1rem;
    font-weight: 700;
    padding: 0 10px;
}

.total-score.positive {
    color: #28a745;
}

.total-score.negative {
    color: #dc3545;
}

.total-score.neutral {
    color: #6c757d;
}

/* Hole by hole results */
.hole-results {
    display: grid;
    gap: 10px;
    margin-top: 15px;
}

.hole-result-row {
    display: grid;
    grid-template-columns: 60px 1fr 1fr 100px;
    align-items: center;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 0.95rem;
}

.hole-result-row.new-pairing {
    background: #e8f5e9;
}

.switch-info {
    padding: 10px;
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    margin-bottom: 10px;
    border-radius: 4px;
    color: #856404;
    font-weight: 500;
}

.rotation-result {
    display: grid;
    grid-template-columns: 120px 1fr auto auto;
    align-items: center;
    gap: 15px;
    padding: 12px;
    background: #f0f8ff;
    border-left: 4px solid #0f7938;
    border-radius: 6px;
    margin-bottom: 10px;
}

.rotation-number {
    font-weight: 700;
    color: #0f7938;
    font-size: 0.95rem;
}

.rotation-teams {
    font-weight: 600;
    color: #333;
}

.rotation-score {
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.95rem;
}

.rotation-score.winner-badge {
    background: #d4edda;
    color: #155724;
}

.rotation-score.tie-badge {
    background: #f8f9fa;
    color: #6c757d;
}

.rotation-players {
    color: #28a745;
    font-weight: 600;
    font-size: 0.9rem;
}

.hole-number {
    font-weight: 700;
    color: #0f7938;
}

.hole-number small {
    font-weight: 400;
    color: #666;
    font-size: 0.8rem;
    margin-left: 4px;
}

.winner-badge {
    text-align: right;
    padding: 4px 8px;
    background: #d4edda;
    color: #155724;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.85rem;
}

.tie-badge {
    background: #f8f9fa;
    color: #6c757d;
}

/* Up/Down Results */
.updown-result {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: white;
    border-radius: 8px;
    margin-bottom: 10px;
    border-left: 4px solid #0f7938;
}

.updown-player-name {
    font-weight: 600;
    color: #333;
    font-size: 1.1rem;
}

.updown-stats {
    display: flex;
    gap: 30px;
    align-items: center;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-label {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 1.2rem;
    font-weight: 700;
}

.stat-value.wins {
    color: #28a745;
}

.stat-value.total.positive {
    color: #28a745;
}

.stat-value.total.negative {
    color: #dc3545;
}

/* Individual Results */
.individual-result {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    background: white;
    border-radius: 8px;
    margin-bottom: 10px;
    border-left: 4px solid #ddd;
    transition: all 0.3s;
}

.individual-result.winner {
    border-left-color: #ffd700;
    background: linear-gradient(to right, rgba(255, 215, 0, 0.1), transparent);
}

.individual-result .rank {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 50%;
    font-weight: 700;
    color: #666;
}

.individual-result.winner .rank {
    background: #ffd700;
    color: #333;
}

.individual-result .player-name {
    flex: 1;
    font-weight: 600;
    color: #333;
}

.individual-result .player-score {
    font-weight: 700;
    color: #0f7938;
    font-size: 1.1rem;
}

.individual-result .winner-icon {
    font-size: 1.2rem;
    margin-left: 10px;
}

/* Winner Display */
.winner-display {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    padding: 25px;
    border-radius: 10px;
    text-align: center;
    margin-top: 20px;
}

.winner-display h3 {
    color: #333;
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.winner-display .winner-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f7938;
}

.winner-display .winner-score {
    font-size: 1.2rem;
    font-weight: 600;
    color: #165a2c;
    margin-top: 8px;
}

/* Up/Down Detailed Results Table */
.updown-details-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden;
}

.updown-details-table thead {
    background: linear-gradient(135deg, #0f7938 0%, #165a2c 100%);
    color: white;
}

.updown-details-table th {
    padding: 12px 10px;
    text-align: center;
    font-weight: 600;
    font-size: 0.95rem;
    border-right: 1px solid rgba(255,255,255,0.1);
}

.updown-details-table th:last-child {
    border-right: none;
    min-width: 120px;
}

.updown-details-table thead tr:first-child th {
    border-bottom: 1px solid rgba(255,255,255,0.2);
}

.updown-details-table .hole-index {
    font-weight: 600;
    color: #666;
    background: #f9f9f9;
    font-size: 0.9rem;
}

.updown-details-table tbody tr {
    border-bottom: 1px solid #e0e0e0;
    transition: background 0.2s;
}

.updown-details-table tbody tr:hover {
    background: #f0f8f3;
}

.updown-details-table tbody tr.tie-row {
    background: #f8f9fa;
}

.updown-details-table td {
    padding: 10px 8px;
    text-align: center;
    vertical-align: middle;
}

.updown-details-table td.hole-num {
    font-weight: 700;
    color: #0f7938;
    background: #f0f8f3;
}

/* Score Cell Styling */
.score-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.score-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #333;
}

.score-value sup {
    font-size: 0.7rem;
    color: #0f7938;
    font-weight: 600;
    vertical-align: super;
}

.score-value.net-score {
    color: #0f7938;
    font-weight: 800;
}

.winner-score .score-value {
    color: #0f7938;
    background: #d4edda;
    padding: 2px 8px;
    border-radius: 4px;
}

.point-change {
    font-size: 0.85rem;
    font-weight: 600;
    padding: 1px 4px;
    border-radius: 3px;
}

.point-gain {
    color: #28a745;
    background: #d4edda;
}

.point-loss {
    color: #dc3545;
    background: #f8d7da;
}

.point-neutral {
    color: #6c757d;
    background: #f8f9fa;
}

.running-total {
    font-size: 0.75rem;
    color: #666;
    font-weight: 500;
}

.total-positive {
    color: #28a745;
    font-weight: 600;
}

.total-negative {
    color: #dc3545;
    font-weight: 600;
}

/* Result Cell */
.result-cell {
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 4px;
}

.result-cell.win {
    background: #d4edda;
    color: #155724;
}

.result-cell.tie {
    background: #f8f9fa;
    color: #6c757d;
}

/* Summary Statistics */
.updown-summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.player-summary-stat {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #0f7938;
}

.stat-player-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: #0f7938;
    margin-bottom: 12px;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.stat-box {
    text-align: center;
    padding: 8px;
    background: white;
    border-radius: 6px;
}

.stat-box .stat-label {
    display: block;
    font-size: 0.75rem;
    color: #666;
    margin-bottom: 4px;
    text-transform: uppercase;
    font-weight: 600;
}

.stat-box .stat-value {
    display: block;
    font-size: 1.2rem;
    font-weight: 700;
    color: #333;
}

.stat-box .stat-value.positive {
    color: #28a745;
}

.stat-box .stat-value.negative {
    color: #dc3545;
}

/* Virtual Keypad */
.virtual-keypad {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 2px solid #0f7938;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.2);
    z-index: 1000;
    padding: 10px;
    max-height: 30vh;
    overflow-y: auto;
}

.keypad-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e0e0e0;
}

.keypad-header span {
    font-weight: 600;
    color: #0f7938;
    font-size: 0.95rem;
}

.close-keypad {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.current-cell-info {
    text-align: center;
    padding: 6px;
    background: #f0f8f3;
    border-radius: 6px;
    margin-bottom: 10px;
}

#currentCellLabel {
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
}

.keypad-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.keypad-btn {
    padding: 10px 8px;
    font-size: 1rem;
    font-weight: 600;
    border: 1.5px solid #0f7938;
    background: white;
    color: #0f7938;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    touch-action: manipulation;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

.keypad-btn:active {
    background: #0f7938;
    color: white;
    transform: scale(0.95);
}

.keypad-btn[data-value="-1"] {
    /* Albatross/Eagle - Purple */
    background: #9C27B0;
    border-color: #8E24AA;
    color: white;
    font-weight: 700;
}

.keypad-btn[data-value="0"] {
    /* Eagle - Cyan */
    background: #00BCD4;
    border-color: #00ACC1;
    color: white;
    font-weight: 700;
}

.keypad-btn[data-value="1"],
.keypad-btn[data-value="2"] {
    /* Birdie - Green */
    background: #4CAF50;
    border-color: #45a049;
    color: white;
    font-weight: 700;
}

.keypad-btn[data-value="3"] {
    /* Par - Light green */
    background: #8BC34A;
    border-color: #7CB342;
    color: white;
    font-weight: 600;
}

.keypad-btn[data-value="4"] {
    /* Bogey - Bright yellow */
    background: #FFB300;
    border-color: #FFA000;
    color: #333;
    font-weight: 600;
}

.keypad-btn[data-value="5"] {
    /* Double Bogey - Deep orange */
    background: #FF6D00;
    border-color: #F57C00;
    color: white;
    font-weight: 600;
}

.keypad-btn.clear-btn {
    background: #dc3545;
    border-color: #dc3545;
    color: white;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 0;
    }
    
    .container {
        border-radius: 0;
        box-shadow: none;
    }
    
    h1 {
        font-size: 1.5rem;
        padding: 20px 15px;
    }
    
    .section {
        padding: 15px;
    }
    
    /* Mobile scorecard improvements */
    .scorecard-container {
        margin-bottom: 80px; /* Space for keypad */
    }
    
    .nine-holes {
        margin-bottom: 20px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .scorecard-table {
        font-size: 0.75rem;
        min-width: 100%;
        border-collapse: separate;
        border-spacing: 0;
    }
    
    .scorecard-table thead th {
        position: sticky;
        top: 0;
        z-index: 10;
        background: linear-gradient(135deg, #0f7938 0%, #165a2c 100%);
    }
    
    .scorecard-table tbody tr td:first-child {
        position: sticky;
        left: 0;
        z-index: 5;
        background: white;
        border-right: 1px solid #e0e0e0;
    }

    .score-input,
    .score-input-cell {
        width: 40px;
        height: 36px;
        font-size: 0.9rem;
        padding: 4px;
        /* Disable native keyboard on mobile */
        -webkit-user-select: none;
        user-select: none;
        touch-action: manipulation;
    }

    /* Prevent native keyboard on mobile */
    .score-input:focus,
    .score-input-cell:focus {
        outline: 2px solid #0f7938;
        outline-offset: -1px;
        box-shadow: 0 0 0 3px rgba(15, 121, 56, 0.2);
        transform: none;
    }
    
    .scorecard-table th {
        padding: 8px 6px;
        font-size: 0.75rem;
        white-space: nowrap;
    }
    
    .scorecard-table td {
        padding: 6px 4px;
        font-size: 0.75rem;
        white-space: nowrap;
    }
    
    .scorecard-table th:first-child,
    .scorecard-table td:first-child {
        padding-left: 10px;
        padding-right: 10px;
        min-width: 90px;
        max-width: 90px;
        font-size: 0.8rem;
        font-weight: 600;
    }
    
    .subtotal {
        font-size: 0.85rem;
        font-weight: 700;
        min-width: 45px;
    }
    
    /* Hide input spinners on mobile */
    input[type="number"]::-webkit-inner-spin-button,
    input[type="number"]::-webkit-outer-spin-button {
        -webkit-appearance: none;
        margin: 0;
    }
    
    input[type="number"] {
        -moz-appearance: textfield;
        /* Prevent mobile keyboard */
        inputmode: none;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .action-buttons button {
        width: 100%;
    }
    
    .settings-row {
        flex-direction: column;
        align-items: stretch;
        flex-wrap: wrap;
    }
    
    .recalc-btn {
        width: 100%;
    }
    
    .player-checkboxes {
        flex-direction: column;
    }

    /* Result tabs - enable horizontal scroll on mobile */
    .result-tabs {
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 2px;
        margin-bottom: 23px;
    }

    .tab-btn {
        flex-shrink: 0;
        white-space: nowrap;
        padding: 10px 16px;
        font-size: 0.95rem;
    }

    /* Up/Down details - show mobile cards, hide table */
    .updown-mobile-details {
        display: block;
    }
    
    .updown-hole-details {
        display: none;
    }
    
    /* Mobile specific adjustments for hole cards */
    .hole-card {
        margin-bottom: 12px;
    }
    
    .player-score-row {
        flex-wrap: wrap;
    }
    
    .scores {
        font-size: 0.85rem;
        gap: 8px;
    }
    
    @media (max-width: 400px) {
        .player-name {
            min-width: 80px;
            font-size: 0.9rem;
        }
        
        .scores {
            flex-direction: column;
            align-items: flex-end;
            gap: 4px;
        }
    }
    
    .stat-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .updown-summary-stats {
        grid-template-columns: 1fr;
    }
}

/* Share Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

.modal[style*="flex"] {
    display: flex !important;
}

.modal-content {
    background: white;
    border-radius: 15px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 2px solid #f0f0f0;
    background: linear-gradient(135deg, #0f7938 0%, #165a2c 100%);
    color: white;
    border-radius: 15px 15px 0 0;
}

.modal-header h3 {
    margin: 0;
    color: white;
    font-size: 1.4rem;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 25px;
}

.qr-container {
    text-align: center;
    margin-bottom: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

#qrcode {
    display: inline-block;
    padding: 15px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.qr-hint {
    margin-top: 15px;
    color: #666;
    font-size: 0.95rem;
}

.share-link-container {
    margin-bottom: 20px;
}

.share-link-container label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.link-input-group {
    display: flex;
    gap: 10px;
}

.share-link-input {
    flex: 1;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 0.9rem;
    background: #f8f9fa;
}

.share-link-input:focus {
    outline: none;
    border-color: #0f7938;
}

.copy-btn {
    padding: 12px 20px;
    background: #0f7938;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
}

.copy-btn:hover {
    background: #165a2c;
    transform: translateY(-2px);
}

.copy-feedback {
    margin-top: 10px;
    padding: 10px;
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    border-radius: 6px;
    text-align: center;
    animation: fadeIn 0.3s ease-out;
}

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

.share-info {
    padding: 15px;
    background: #e8f5e9;
    border-radius: 8px;
    border-left: 4px solid #0f7938;
}

.share-info p {
    margin: 8px 0;
    color: #333;
    font-size: 0.95rem;
}

.share-info p:last-child {
    margin-bottom: 0;
}

/* Share Button Styles */
.share-btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.3);
}

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

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

/* Normal Mode Results */
.normal-results-table {
    width: 100%;
    overflow-x: auto;
    margin-top: 15px;
}

.normal-table {
    width: 100%;
    border-collapse: collapse;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden;
}

.normal-table thead {
    background: linear-gradient(135deg, #0f7938 0%, #165a2c 100%);
    color: white;
}

.normal-table th {
    padding: 12px 15px;
    text-align: center;
    font-weight: 600;
    font-size: 0.95rem;
    border-right: 1px solid rgba(255,255,255,0.1);
}

.normal-table th:last-child {
    border-right: none;
}

.normal-table tbody tr {
    border-bottom: 1px solid #e0e0e0;
    transition: background 0.2s;
}

.normal-table tbody tr:hover {
    background: #f0f8f3;
}

.normal-table tbody tr.winner-row {
    background: linear-gradient(to right, rgba(255, 215, 0, 0.2), transparent);
    font-weight: 700;
}

.normal-table td {
    padding: 10px 15px;
    text-align: center;
    vertical-align: middle;
}

.normal-table .rank-cell {
    font-weight: 700;
    color: #0f7938;
    font-size: 1.1rem;
}

.normal-table .name-cell {
    text-align: left;
    font-weight: 600;
    color: #333;
}

.normal-table .hdc-cell {
    color: #666;
    font-weight: 600;
}

.normal-table .gross-cell {
    font-weight: 600;
    color: #495057;
}

.normal-table .net-cell {
    font-weight: 700;
    color: #0f7938;
    font-size: 1.1rem;
}

.normal-table tr.winner-row .rank-cell {
    background: #ffd700;
    color: #333;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 768px) {
    .normal-table {
        font-size: 0.85rem;
    }
    
    .normal-table th,
    .normal-table td {
        padding: 8px 10px;
    }
    
    .normal-table .rank-cell,
    .normal-table .net-cell {
        font-size: 1rem;
    }
}

/* Fixed Team Styles */
.fixed-team-setup {
    margin-bottom: 20px;
}

.team-selection {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
}

.team-pair {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.team-label {
    font-weight: 600;
    color: #0f7938;
    min-width: 70px;
}

.team-player-select {
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    min-width: 180px;
    transition: border-color 0.3s;
}

.team-player-select:focus {
    outline: none;
    border-color: #0f7938;
    box-shadow: 0 0 0 3px rgba(15, 121, 56, 0.1);
}

.team-separator {
    font-weight: 600;
    color: #666;
    font-size: 1.2rem;
}

.vs-separator {
    font-size: 1.5rem;
    font-weight: 700;
    color: #dc3545;
    padding: 10px 0;
}

.fixed-team-summary {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.fixed-team-summary .team-result {
    text-align: center;
    padding: 15px 25px;
    background: #f9f9f9;
    border-radius: 10px;
    border: 2px solid #e0e0e0;
}

.fixed-team-summary .team-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.fixed-team-summary .team-stats {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.fixed-team-summary .wins {
    color: #666;
    font-size: 0.95rem;
}

.fixed-team-summary .total {
    font-size: 1.2rem;
    font-weight: 700;
}

.fixed-team-summary .vs-divider {
    font-size: 1.5rem;
    font-weight: 700;
    color: #dc3545;
}

/* Fixed Team Table */
.fixed-team-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.fixed-team-table th,
.fixed-team-table td {
    padding: 10px 8px;
    border: 1px solid #e0e0e0;
    text-align: center;
}

.fixed-team-table thead {
    background: #f5f5f5;
}

.fixed-team-table th {
    font-weight: 600;
    color: #333;
}

.fixed-team-table .winner-score {
    background-color: rgba(15, 121, 56, 0.1);
    font-weight: 600;
}

.fixed-team-table .point-gain {
    color: #28a745;
    font-weight: 600;
}

.fixed-team-table .point-loss {
    color: #dc3545;
    font-weight: 600;
}

.fixed-team-table .point-neutral {
    color: #666;
}

.fixed-team-table .result-cell {
    font-weight: 600;
}

.fixed-team-table .result-cell.win {
    color: #0f7938;
}

.fixed-team-table .result-cell.tie {
    color: #666;
}

.fixed-team-table .rotation-separator td {
    background: #0f7938;
    height: 3px;
    padding: 0;
    border: none;
}

.fixed-team-table .detail-cell {
    text-align: left;
    font-size: 0.85rem;
    line-height: 1.4;
}

.fixed-team-table small {
    color: #888;
    font-size: 0.75rem;
}

/* Fixed Team Mobile View */
.fixed-team-mobile-details {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.fixed-team-mobile-details .hole-card {
    background: #f9f9f9;
    border-radius: 10px;
    padding: 15px;
    border: 1px solid #e0e0e0;
}

.fixed-team-mobile-details .team1-win {
    border-left: 4px solid #0f7938;
}

.fixed-team-mobile-details .team2-win {
    border-right: 4px solid #0f7938;
}

.fixed-team-mobile-details .tie-card {
    border-top: 4px solid #ffc107;
}

.fixed-team-mobile-details .team-scores {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 10px 0;
}

.fixed-team-mobile-details .team-section {
    padding: 10px;
    border-radius: 8px;
    background: white;
}

.fixed-team-mobile-details .team-section.winner {
    background: rgba(15, 121, 56, 0.05);
    border: 1px solid rgba(15, 121, 56, 0.2);
}

.fixed-team-mobile-details .team-label {
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.fixed-team-mobile-details .player-score {
    font-size: 0.85rem;
    color: #666;
    margin: 3px 0;
}

.fixed-team-mobile-details .team-total {
    font-weight: 600;
    margin-top: 5px;
    color: #333;
}

/* Responsive Design for Modal */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 10px;
    }
    
    .share-link-input {
        font-size: 0.85rem;
    }
    
    .link-input-group {
        flex-direction: column;
    }
    
    .copy-btn {
        width: 100%;
    }
    
    .header-buttons {
        flex-direction: column;
        width: 100%;
        gap: 8px;
    }
    
    .share-btn, .back-btn {
        width: 100%;
    }

    /* Fixed Team Mobile Responsive */
    .team-selection {
        gap: 15px;
    }

    .team-pair {
        justify-content: center;
        text-align: center;
    }

    .team-label {
        min-width: 60px;
        font-size: 0.9rem;
    }

    .team-player-select {
        min-width: 120px;
        font-size: 0.9rem;
        padding: 8px;
    }

    .team-separator {
        font-size: 1rem;
    }

    .vs-separator {
        font-size: 1.2rem;
        padding: 5px 0;
    }

    .fixed-team-summary {
        gap: 15px;
    }

    .fixed-team-summary .team-result {
        padding: 10px 15px;
    }

    .fixed-team-summary .team-name {
        font-size: 1rem;
    }

    .fixed-team-summary .wins {
        font-size: 0.85rem;
    }

    .fixed-team-summary .total {
        font-size: 1.1rem;
    }
}

/* ==================== Money Calculation Section ==================== */

#moneyCalculationSection .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

#moneyCalculationSection .section-header h2 {
    margin-bottom: 0;
}

#moneyCalculationSection .header-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
}

#moneyCalculationSection .share-btn {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s;
}

#moneyCalculationSection .share-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(23, 162, 184, 0.3);
}

.money-btn {
    width: 100%;
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.money-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.4);
}

.money-config-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #e9ecef;
}

.money-config-card h4 {
    color: #165a2c;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.money-input-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.money-input-row input {
    flex: 1;
    max-width: 200px;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1.1rem;
    transition: border-color 0.3s;
}

.money-input-row input:focus {
    outline: none;
    border-color: #0f7938;
}

.money-unit {
    color: #666;
    font-weight: 500;
    white-space: nowrap;
}

.money-note {
    color: #888;
    font-size: 0.85rem;
    margin-top: 8px;
    font-style: italic;
}

.keo-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #e9ecef;
    flex-wrap: wrap;
    gap: 10px;
}

.keo-row:last-child {
    border-bottom: none;
}

.keo-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    min-width: 140px;
}

.keo-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: #0f7938;
    cursor: pointer;
}

.keo-label span {
    font-weight: 500;
    color: #333;
}

.keo-money-input {
    display: flex;
    align-items: center;
    gap: 8px;
}

.keo-money-input input {
    width: 120px;
    padding: 10px 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    text-align: right;
}

.keo-money-input input:focus {
    outline: none;
    border-color: #0f7938;
}

.keo-money-input .money-unit {
    font-size: 0.85rem;
    min-width: 70px;
}

/* Money Results */
.money-results-container {
    display: grid;
    gap: 15px;
    margin-top: 20px;
}

.money-player-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    border: 2px solid #e9ecef;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.money-player-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
    margin-bottom: 15px;
}

.money-player-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
}

.money-grand-total {
    font-size: 1.3rem;
    font-weight: 700;
}

.money-positive {
    color: #0f7938;
}

.money-negative {
    color: #dc3545;
}

.money-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.money-keo-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 6px;
}

.money-shared-row {
    background: #fff3cd;
    border: 1px solid #ffc107;
}

.money-paid-row {
    background: #d4edda;
    border: 1px solid #28a745;
}

/* Paid amounts input section */
.paid-amount-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.paid-amount-row:last-child {
    border-bottom: none;
}

.paid-player-name {
    font-weight: 500;
    color: #333;
    flex: 1;
}

.paid-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.paid-amount-input {
    width: 100px;
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    text-align: right;
}

.paid-amount-input:focus {
    outline: none;
    border-color: #28a745;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.15);
}

.keo-name {
    font-weight: 500;
    color: #555;
    flex: 1;
}

.keo-points {
    color: #888;
    font-size: 0.9rem;
    margin: 0 15px;
    min-width: 70px;
    text-align: center;
}

.keo-money {
    font-weight: 600;
    min-width: 100px;
    text-align: right;
}

.money-empty-state {
    text-align: center;
    padding: 40px 20px;
    background: #f8f9fa;
    border-radius: 12px;
    color: #666;
}

.money-empty-state p {
    margin: 5px 0;
}

/* Custom Kèo Section */
.custom-keo-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.custom-keo-header h4 {
    margin: 0;
}

.add-keo-btn {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}

.add-keo-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(23, 162, 184, 0.3);
}

.custom-keo-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 8px;
    border: 1px solid #e9ecef;
}

.custom-keo-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.custom-keo-name {
    font-weight: 600;
    color: #333;
}

.custom-keo-players {
    font-size: 0.85rem;
    color: #666;
}

.delete-keo-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background 0.2s;
}

.delete-keo-btn:hover {
    background: #fee;
}

.no-custom-keo {
    color: #888;
    text-align: center;
    padding: 20px;
    font-style: italic;
    margin: 0;
}

/* Modal form styling */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #0f7938;
}

/* Mobile responsiveness */
@media (max-width: 600px) {
    .keo-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .keo-money-input {
        width: 100%;
    }

    .keo-money-input input {
        flex: 1;
        width: auto;
    }

    .money-player-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .money-keo-row {
        flex-wrap: wrap;
        gap: 5px;
    }

    .keo-name {
        width: 100%;
    }

    .keo-points, .keo-money {
        flex: 1;
    }
}