:root {
    --bg-color: #f7f3ec;
    --panel-bg: #ffffff;
    --text-primary: #333333;
    --text-secondary: #666666;
    --accent-color: #d35400;
    --board-bg: #e6b794; /* Soft pinkish/orange like cardboard */
    --line-color: #3e2723;
    --node-color: #3e2723;
    --highlight-color: rgba(211, 84, 0, 0.4);
    --hover-color: rgba(0, 0, 0, 0.1);
}

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

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

.app-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    text-align: center;
    margin-bottom: 30px;
}

.header h1 {
    font-size: 2.5rem;
    color: var(--accent-color);
    margin-bottom: 5px;
}

.header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.main-content {
    display: flex;
    flex-direction: row;
    gap: 30px;
    flex: 1;
}

@media (max-width: 800px) {
    .main-content {
        flex-direction: column-reverse;
    }
}

.left-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.rules-card, .controls-card {
    background-color: var(--panel-bg);
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.rules-card h2, .controls-card h2 {
    margin-bottom: 15px;
    font-size: 1.4rem;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
}

.rules-card ul {
    margin-top: 15px;
    padding-left: 20px;
}

.rules-card li {
    margin-bottom: 8px;
}

.icon {
    font-size: 1.2rem;
}

.mode-selection {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 25px;
}

.mode-selection label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    cursor: pointer;
}

.btn {
    width: 100%;
    padding: 12px 20px;
    font-size: 1.1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
}

.primary-btn {
    background-color: var(--accent-color);
    color: white;
}

.primary-btn:hover {
    background-color: #b54600;
    transform: translateY(-2px);
}

.game-board-container {
    flex: 1.5;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.status-bar {
    width: 100%;
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 1.1rem;
    font-weight: bold;
}

.turn-indicator {
    padding: 5px 15px;
    border-radius: 20px;
    background-color: var(--panel-bg);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.turn-indicator.fox {
    color: #d35400;
}

.turn-indicator.goose {
    color: #2980b9;
}

.moves-left {
    padding: 5px 15px;
    background-color: var(--panel-bg);
    border-radius: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.board-wrapper {
    position: relative;
    width: 100%;
    max-width: 500px;
    aspect-ratio: 1 / 1;
    background-color: var(--board-bg);
    border-radius: 10px;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.1), 0 8px 16px rgba(0,0,0,0.15);
    margin: 0 auto;
}

.board-lines {
    position: absolute;
    top: 6%;
    left: 6%;
    width: 88%;
    height: 88%;
    pointer-events: none;
}

.line {
    stroke: var(--line-color);
    stroke-width: 3;
    stroke-linecap: round;
}

.board-nodes {
    position: absolute;
    top: 6%;
    left: 6%;
    width: 88%;
    height: 88%;
}

.node {
    position: absolute;
    width: clamp(14px, 3.5vw, 20px);
    height: clamp(14px, 3.5vw, 20px);
    background-color: var(--node-color);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

.node::after {
    content: '';
    position: absolute;
    width: 250%;
    height: 250%;
    border-radius: 50%;
    background-color: transparent;
    z-index: 1;
}

.node:hover::after {
    background-color: var(--hover-color);
}

.node.valid-move {
    box-shadow: 0 0 0 6px var(--highlight-color);
    z-index: 5;
}

.node.valid-move::after {
    background-color: rgba(211, 84, 0, 0.1);
}

.piece {
    position: absolute;
    width: clamp(32px, 9vw, 48px);
    height: clamp(32px, 9vw, 48px);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 10;
    transition: top 0.3s ease, left 0.3s ease;
    box-shadow: 0 4px 8px rgba(0,0,0,0.4);
    background-size: cover;
    background-position: center;
    border: 3px solid white;
}

.piece-fox {
    background-image: url('../assets/fox_icon.jpg');
    border-color: #d35400;
}

.piece-goose {
    background-image: url('../assets/goose_icon.jpg');
    border-color: #2980b9;
}

.modal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255,255,255,0.8);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    border-radius: 10px;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    max-width: 80%;
}

.modal-content h2 {
    font-size: 2rem;
    margin-bottom: 15px;
    color: var(--accent-color);
}

.modal-content p {
    font-size: 1.2rem;
    margin-bottom: 25px;
}

.node-label {
    position: absolute;
    top: -24px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 13px;
    color: rgba(0, 0, 0, 0.6);
    pointer-events: none;
    font-weight: 500;
}
