:root {
    --primary-color: #ff9f43;
    /* Tiger Orange */
    --secondary-color: #00d2d3;
    /* Goat Cyan */
    --bg-color: #1a0b2e;
    --board-bg: #2d3436;
    --text-color: #ffffff;
    --line-color: rgba(255, 255, 255, 0.2);
    --node-size: 40px;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    background: radial-gradient(circle at center, #2d1b4e 0%, #1a0b2e 100%);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
}

/* Navigation */
.main-nav {
    width: 100%;
    max-width: 1200px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    z-index: 100;
}

.nav-logo {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    text-decoration: none;
}

.nav-links a {
    color: #e2e8f0;
    text-decoration: none;
    margin-left: 20px;
    font-weight: 600;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--primary-color);
}

/* Back Button */
.back-btn {
    text-decoration: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: color 0.2s;
}

.back-btn:hover {
    color: white;
}

/* Game Container */
.game-container {
    width: 100%;
    max-width: 1000px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-grow: 1;
}

header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
    width: 100%;
}

h1 {
    font-family: 'Fredoka', sans-serif;
    font-size: 2.5rem;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: #a0a0a0;
    font-size: 1.1rem;
}

.game-area {
    display: flex;
    gap: 40px;
    align-items: flex-start;
    justify-content: center;
    width: 100%;
    flex-wrap: wrap;
}

/* Sidebar */
.sidebar {
    flex: 1;
    min-width: 250px;
    max-width: 300px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.status-card,
.stats-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
}

.turn-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 1.2rem;
    font-weight: 700;
    padding: 10px;
    border-radius: 10px;
    margin-top: 10px;
    transition: all 0.3s ease;
}

.turn-indicator.goat-turn {
    background: rgba(0, 210, 211, 0.2);
    color: var(--secondary-color);
    border: 1px solid var(--secondary-color);
}

.turn-indicator.tiger-turn {
    background: rgba(255, 159, 67, 0.2);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.phase-text {
    margin-top: 10px;
    font-size: 0.9rem;
    opacity: 0.7;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.stat-value {
    font-weight: 700;
}

.reset-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 12px;
    border-radius: 10px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    transition: all 0.3s ease;
}

.reset-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Board */
.board-wrapper {
    position: relative;
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.board {
    width: 400px;
    height: 400px;
    position: relative;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: repeat(5, 1fr);
}

.board-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.node {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.node::before {
    content: '';
    width: 12px;
    height: 12px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transition: all 0.2s ease;
}

.node:hover::before {
    background: rgba(255, 255, 255, 0.6);
    transform: scale(1.2);
}

.node.highlight::before {
    background: rgba(0, 255, 136, 0.5);
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
    transform: scale(1.5);
}

.piece {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    position: absolute;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 2;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.5);
}

.piece.tiger {
    background: var(--primary-color);
    border: 2px solid #e58e26;
}

.piece.goat {
    background: var(--secondary-color);
    border: 2px solid #00b8b9;
    font-size: 1rem;
}

.piece.selected {
    box-shadow: 0 0 15px white;
    transform: scale(1.2);
    z-index: 3;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.3s ease;
}

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

.modal-content {
    background: var(--bg-color);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    max-width: 90%;
    width: 400px;
}

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

.modal-content p {
    margin-bottom: 20px;
    color: #ccc;
}

.modal-content button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    margin-bottom: 15px;
}

.home-link {
    display: block;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-size: 0.9rem;
}

/* Mobile adjustments */
@media (max-width: 600px) {
    .main-nav {
        padding: 10px 15px;
    }

    .nav-links {
        margin-top: 0;
    }

    .back-nav {
        top: 100px;
        width: 30px;
        height: 30px;
        font-size: 1.2rem;
    }

    .game-container {
        padding-top: 20px;
    }

    .game-area {
        flex-direction: column-reverse;
        gap: 20px;
        align-items: center;
    }

    .sidebar {
        width: 100%;
        max-width: 100%;
    }

    .board {
        width: 300px;
        height: 300px;
    }

    .node::before {
        width: 10px;
        height: 10px;
    }

    .piece {
        width: 26px;
        height: 26px;
        font-size: 1rem;
    }
}