/* Główne style */
:root {
    --bg-color: #2c5943;
    --primary-color: #4ecdc4;
    --secondary-color: #f5f5dc;
    --accent-color: #ff6b6b;
    --card-bg-color: #3b745c;
    --text-color: #f5f5dc;
    --font-family: 'Arial', sans-serif;
    --die-bg-color: #e5e5e5;
    --die-dot-color: #2c5943;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-family);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
}

.game-container {
    background: var(--card-bg-color);
    padding: 2em;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    text-align: center;
    max-width: 800px;
    width: 90%;
    margin-bottom: 20px;
}

.game-title {
    font-size: 2.5em;
    font-weight: bold;
    letter-spacing: 2px;
    margin-bottom: 0.5em;
    color: var(--primary-color);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.mode-selector {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 1.5em;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
    text-transform: uppercase;
}

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

.btn-secondary {
    background-color: var(--secondary-color);
    color: var(--bg-color);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.buttons-container {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 1em;
}

.game-info {
    font-size: 1.2em;
    margin-bottom: 1em;
    color: var(--primary-color);
}

.game-info .info-text {
    font-weight: bold;
}

/* Stylizacja kostek */
.dice-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 1.5em;
}

.die {
    width: 70px;
    height: 70px;
    background-color: var(--die-bg-color);
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    border: 3px solid transparent;
}

.die:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.3);
}

.die.held {
    border-color: var(--accent-color);
    box-shadow: 0 0 15px rgba(255, 107, 107, 0.7);
}

.die-face {
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    place-items: center;
    padding: 5px;
}

.dot {
    width: 15px;
    height: 15px;
    background-color: var(--die-dot-color);
    border-radius: 50%;
}

.dot-center { grid-area: 2 / 2; }
.dot-top-left { grid-area: 1 / 1; }
.dot-top-right { grid-area: 1 / 3; }
.dot-middle-left { grid-area: 2 / 1; }
.dot-middle-right { grid-area: 2 / 3; }
.dot-bottom-left { grid-area: 3 / 1; }
.dot-bottom-right { grid-area: 3 / 3; }

/* Stylizacja tabeli wyników */
.scorecard-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1em;
    font-size: 1.1em;
    text-align: center;
}

.scorecard-table th, .scorecard-table td {
    padding: 12px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.scorecard-table thead th {
    background-color: rgba(0, 0, 0, 0.2);
    font-weight: bold;
}

.scorecard-table th:first-child, .scorecard-table td:first-child {
    text-align: left;
}

.score-header {
    font-weight: bold;
    color: var(--primary-color);
}

.score-item-row.available {
    cursor: pointer;
    transition: background-color 0.2s;
}

.score-item-row.available:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.score-item-row.selected {
    background-color: var(--primary-color);
    color: var(--bg-color);
    font-weight: bold;
}

.score-item-row.completed {
    background-color: rgba(0, 0, 0, 0.3);
    cursor: not-allowed;
}

.score-total-row {
    font-weight: bold;
    font-size: 1.3em;
    color: var(--secondary-color);
}

.score-sum-row, .score-bonus-row {
    font-weight: bold;
    color: var(--secondary-color);
    background-color: rgba(0, 0, 0, 0.1);
}

.ai-header, .ai-score {
    display: none;
}
.vs-ai-active .ai-header,
.vs-ai-active .ai-score {
    display: table-cell;
}

.tech-info {
    margin-top: 20px;
    font-size: 0.8em;
    text-align: center;
    opacity: 0.6;
}

#ai-thinking {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--card-bg-color);
    color: var(--text-color);
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 1000;
    max-width: 250px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border-left: 4px solid var(--primary-color);
    display: none;
}

/* Style dla modala końca gry */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

.modal-content {
    background: var(--card-bg-color);
    color: var(--text-color);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
    width: 90%;
    max-width: 450px;
    text-align: center;
    transform: scale(1);
    transition: transform 0.3s ease;
}

.modal-overlay.hidden .modal-content {
    transform: scale(0.95);
}

.modal-header {
    margin-bottom: 20px;
}

#modal-title {
    font-size: 2.2em;
    font-weight: bold;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--primary-color);
    margin-bottom: 5px;
}

#modal-message {
    font-size: 1.1em;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 25px;
}

.final-scores {
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

.score-summary h3 {
    font-size: 1em;
    margin-bottom: 5px;
    color: rgba(255, 255, 255, 0.6);
}

.final-score-value {
    font-size: 2.5em;
    font-weight: bold;
    text-shadow: 2px 2px 5px rgba(0,0,0,0.4);
}

.human-summary .final-score-value {
    color: #4caf50;
}

.ai-summary .final-score-value {
    color: #ff9800;
}

.modal-footer .btn {
    width: 100%;
}