:root {
    --bg-color: #f4f4f9;
    --text-color: #333;
    --peg-color: #8B4513;
    --base-color: #5C4033;
    --primary: #4a90e2;
    --danger: #e74c3c;
    --success: #2ecc71;
}

html, body {
    overflow: hidden;
    touch-action: none;
    overscroll-behavior: none;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: 800px;
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
}

h1 {
    margin-top: 0;
    color: var(--primary);
}

.stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    font-size: 1.2rem;
    font-weight: bold;
}

button {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.2s;
}

button:hover {
    background-color: #357abd;
}

#message-container {
    margin-bottom: 1.5rem;
    padding: 1rem;
    border-radius: 8px;
    display: none; /* hidden by default */
}

#message-container.hidden {
    display: none !important;
}

#message-container.win {
    display: block;
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

#message-container.lose {
    display: block;
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

#message-title {
    margin: 0 0 0.5rem 0;
}

#message-body {
    margin: 0;
    font-family: monospace;
    font-size: 1.1rem;
}

/* Game Board */
.game-board {
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    height: 300px;
    padding-top: 50px;
}

.peg-container {
    position: relative;
    width: 30%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
}

.peg {
    position: absolute;
    bottom: 20px; /* above base */
    width: 15px;
    height: 250px;
    background-color: var(--peg-color);
    border-radius: 10px 10px 0 0;
    z-index: 1;
}

.peg-base {
    width: 100%;
    height: 20px;
    background-color: var(--base-color);
    border-radius: 10px;
    z-index: 1;
}

.disks {
    position: absolute;
    bottom: 20px;
    width: 100%;
    display: flex;
    flex-direction: column-reverse; /* Stack from bottom */
    align-items: center;
    z-index: 2;
}

.disk {
    height: 30px;
    border-radius: 15px;
    margin-bottom: 2px;
    cursor: grab;
    border: 2px solid rgba(0,0,0,0.2);
    box-sizing: border-box;
    transition: transform 0.1s;
}

.disk:active {
    cursor: grabbing;
}

.disk.dragging {
    opacity: 0.5;
}

/* Colors for disks based on size (up to 10 sizes for safety) */
.disk[data-size="1"] { width: 30%; background-color: #ff595e; }
.disk[data-size="2"] { width: 40%; background-color: #ffca3a; }
.disk[data-size="3"] { width: 50%; background-color: #8ac926; }
.disk[data-size="4"] { width: 60%; background-color: #1982c4; }
.disk[data-size="5"] { width: 70%; background-color: #6a4c93; }
.disk[data-size="6"] { width: 80%; background-color: #f15bb5; }
.disk[data-size="7"] { width: 90%; background-color: #00bbf9; }
.disk[data-size="8"] { width: 100%; background-color: #00f5d4; }
