:root {
    --p1-color: #e74c3c;
    --p2-color: #3498db;
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --text-color: #2c3e50;
    --border-radius: 8px;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 10px;
    display: flex;
    justify-content: center;
}

.container {
    max-width: 1000px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

h1 {
    font-size: 1.5rem;
    margin: 0;
}

.game-controls {
    display: flex;
    gap: 10px;
}

button {
    padding: 10px 15px;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: bold;
    transition: opacity 0.2s;
}

button:active {
    opacity: 0.7;
}

button.secondary {
    background-color: #ecf0f1;
    color: var(--text-color);
}

#board-container {
    background: white;
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow-x: auto;
}

#board-scroll {
    min-width: 800px;
}

#cribbage-board {
    width: 100%;
    height: auto;
    display: block;
}

#players-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 600px) {
    #players-section {
        grid-template-columns: 1fr;
    }
}

.player {
    background: white;
    padding: 15px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    border-top: 5px solid transparent;
}

.player.p1 { border-top-color: var(--p1-color); }
.player.p2 { border-top-color: var(--p2-color); }

.player-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.player-header h2 {
    margin: 0;
    font-size: 1.2rem;
    outline: none;
}

.score {
    font-size: 2rem;
    font-weight: bold;
}

.p1 .score { color: var(--p1-color); }
.p2 .score { color: var(--p2-color); }

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

.score-buttons button {
    padding: 12px 5px;
    font-size: 0.9rem;
    color: white;
}

.p1 .score-buttons button { background-color: var(--p1-color); }
.p2 .score-buttons button { background-color: var(--p2-color); }

#history-section {
    background: white;
    padding: 15px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

#history-log {
    max-height: 150px;
    overflow-y: auto;
    font-size: 0.9rem;
}

.history-item {
    padding: 5px 0;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
}

.empty-msg {
    color: #95a5a6;
    text-align: center;
}

.hole {
    fill: #ecf0f1;
    stroke: #bdc3c7;
    stroke-width: 1;
}

.hole.active-p1 {
    fill: var(--p1-color);
    stroke: #c0392b;
}

.hole.active-p2 {
    fill: var(--p2-color);
    stroke: #2980b9;
}

.hole.prev-p1 {
    fill: #f1948a;
    stroke: #e74c3c;
    opacity: 0.6;
}

.hole.prev-p2 {
    fill: #85c1e9;
    stroke: #3498db;
    opacity: 0.6;
}

.track-label {
    font-size: 10px;
    fill: #95a5a6;
    text-anchor: middle;
}
