/* Cribbage Game Styles */

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

body {
    font-family: 'Arial', sans-serif;
    background-color: #f0f8ff;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

h1, h2, h3 {
    color: #2c5e1a;
    margin-bottom: 15px;
}

h1 {
    text-align: center;
    font-size: 2.5em;
    margin-top: 20px;
    margin-bottom: 30px;
}

h2 {
    text-align: center;
    font-size: 2em;
    margin-bottom: 20px;
}

h3 {
    text-align: center;
    font-size: 1.5em;
    margin-bottom: 10px;
}

/* Auth forms */
.auth-form {
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    max-width: 400px;
    margin: 20px auto;
}

.auth-form h2 {
    text-align: center;
    margin-bottom: 20px;
}

.auth-form input {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

.auth-form button {
    width: 100%;
    padding: 12px;
    background-color: #2c5e1a;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.auth-form button:hover {
    background-color: #1d4212;
}

/* Game actions */
.game-actions {
    text-align: center;
    margin: 30px 0;
}

.game-actions button {
    padding: 10px 20px;
    margin: 5px;
    background-color: #2c5e1a;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
}

.game-actions button:hover {
    background-color: #1d4212;
}

/* Game board */
.board {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin: 30px 0;
    padding: 20px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    flex-wrap: wrap;
}

.player-area {
    flex: 1;
    text-align: center;
    padding: 15px;
    min-width: 250px;
}

.center-area {
    flex: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-around;
    gap: 30px;
    min-width: 300px;
}

.pegging-area {
    background-color: #e8f5e9;
    padding: 15px;
    border-radius: 8px;
    width: 100%;
    max-width: 400px;
    min-height: 150px;
}

.cut-card {
    text-align: center;
    margin-top: 20px;
}

.cut-card div {
    font-size: 3em;
    padding: 10px;
    background-color: #f0f0f0;
    border-radius: 5px;
    display: inline-block;
    min-width: 80px;
    height: 120px;
    line-height: 120px;
}

/* Card styles */
.card {
    display: inline-block;
    width: 60px;
    height: 84px;
    margin: 5px;
    background-color: white;
    border: 1px solid #ccc;
    border-radius: 5px;
    text-align: center;
    line-height: 84px;
    font-size: 1.2em;
    cursor: pointer;
    transition: transform 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0) 100%);
    pointer-events: none;
}

/* Card faces */
.card.spade::before,
.card.club::before {
    color: #000;
}

.card.heart::before,
.card.diamond::before {
    color: #d32f2f;
}

/* Hand display */
.hand {
    margin: 15px 0;
}

.hand h4 {
    margin-bottom: 10px;
}

/* Move log */
#moveLog {
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    margin-top: 30px;
    max-height: 200px;
    overflow-y: auto;
}

#moveLog h3 {
    margin-bottom: 15px;
}

#moveLog div {
    padding: 8px;
    margin: 5px 0;
    background-color: #f9f9f9;
    border-radius: 4px;
    border-left: 4px solid #2c5e1a;
}

/* Cribbage board styling */
.cribbage-board {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
    padding: 20px;
    background-color: #8B4513;
    border-radius: 10px;
    position: relative;
    overflow: hidden;
}

.cribbage-board::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        linear-gradient(rgba(255,255,255,0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.1) 1px, transparent 1px);
    background-size: 20px 20px;
    pointer-events: none;
}

.peg {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin: 5px;
    position: relative;
    z-index: 1;
}

.peg.player1 {
    background-color: #2c5e1a;
    box-shadow: 0 0 5px rgba(0,0,0,0.3);
}

.peg.player2 {
    background-color: #d32f2f;
    box-shadow: 0 0 5px rgba(0,0,0,0.3);
}

.peg-position {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 10px 0;
}

/* Responsive design */
@media (max-width: 768px) {
    .board {
        flex-direction: column;
        gap: 20px;
    }

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

    .card {
        width: 50px;
        height: 70px;
        line-height: 70px;
        font-size: 1em;
    }

    h1 {
        font-size: 2em;
    }

    h2 {
        font-size: 1.5em;
    }

    .player-area {
        min-width: auto;
    }
}

/* Hidden class */
.hidden {
    display: none;
}

/* Score indicators */
.score-board {
    display: flex;
    justify-content: space-around;
    margin: 20px 0;
    padding: 15px;
    background-color: #e8f5e9;
    border-radius: 10px;
}

.score-board div {
    text-align: center;
    font-size: 1.2em;
}

/* Game status */
#gameStatus {
    font-weight: bold;
    color: #2c5e1a;
}

/* Card sprite grid for the card images */
.card-sprite {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="1300" height="400"><rect width="1300" height="400" fill="white"/><text x="50" y="50" font-family="Arial" font-size="30" fill="black">♠</text><text x="150" y="50" font-family="Arial" font-size="30" fill="black">♥</text><text x="250" y="50" font-family="Arial" font-size="30" fill="black">♦</text><text x="350" y="50" font-family="Arial" font-size="30" fill="black">♣</text></svg>');
    background-repeat: no-repeat;
    background-position: 0 0;
    display: inline-block;
    width: 60px;
    height: 84px;
}

/* Animation for card play */
.card-play-animation {
    animation: playCard 0.5s ease-in-out;
}

@keyframes playCard {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}

/* Button styling */
button {
    padding: 10px 20px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #45a049;
}

/* Loading indicator */
.loading {
    text-align: center;
    padding: 20px;
}

/* Game state indicators */
.game-phase {
    font-weight: bold;
    color: #2c5e1a;
    margin-top: 10px;
}