:root {
    --masters-green: #0f6644;
    --masters-green-light: #1a8a5c;
    --masters-yellow: #f2c94c;
    --bg: #f5f5f5;
    --white: #ffffff;
    --text: #333333;
    --text-light: #666666;
    --border: #e0e0e0;
    --cut-red: #d32f2f;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.4;
}

header {
    background: var(--masters-green);
    color: var(--white);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

header h1 {
    font-size: 1.4rem;
    font-weight: 600;
}

.status-bar {
    text-align: center;
    padding: 8px 20px;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
    color: var(--text-light);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 16px;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    font-size: 0.85rem;
}

thead th {
    background: var(--masters-green);
    color: var(--white);
    padding: 10px 8px;
    text-align: left;
    font-weight: 600;
    font-size: 0.8rem;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 1;
}

tbody tr {
    cursor: pointer;
    transition: background 0.15s;
}

tbody tr:hover {
    background: #e8f5e9;
}

tbody tr:nth-child(even) {
    background: #fafafa;
}

tbody tr:nth-child(even):hover {
    background: #e8f5e9;
}

tbody td {
    padding: 8px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

td.rank {
    font-weight: 700;
    text-align: center;
    width: 50px;
}

td.name-cell {
    font-weight: 600;
    min-width: 120px;
}

td.total {
    font-weight: 700;
    text-align: center;
}

td.cut-count {
    text-align: center;
}

.score-positive {
    color: var(--cut-red);
}

.score-negative {
    color: var(--masters-green);
}

.score-even {
    color: var(--text);
}

/* Detail row */
.detail-row td {
    padding: 0;
    background: #f0f7f0;
}

.detail-row table {
    box-shadow: none;
    border-radius: 0;
    margin: 8px 16px;
    width: calc(100% - 32px);
    font-size: 0.8rem;
}

.detail-row thead th {
    background: var(--masters-green-light);
    padding: 6px 8px;
}

.detail-row tbody td {
    padding: 6px 8px;
}

.detail-row .total-row {
    font-weight: 700;
    background: #e8f5e9;
}

.loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
    font-size: 1.1rem;
}

.spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid var(--border);
    border-top-color: var(--masters-green);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.placeholder {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-light);
    font-style: italic;
}

@media (max-width: 768px) {
    header h1 {
        font-size: 1.1rem;
    }

    table {
        font-size: 0.75rem;
    }

    thead th, tbody td {
        padding: 6px 4px;
    }
}
