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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    color: #fff;
}

.container {
    max-width: 600px;
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
}

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

header h1 {
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.round-counter {
    text-align: center;
    font-size: 1.1rem;
    color: #fff;
    margin-bottom: 15px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    display: inline-block;
}

.round-counter strong {
    color: #ffd700;
    font-size: 1.3rem;
}

.progress-indicator {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

.phase-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.phase-dot.active {
    transform: scale(1.3);
    box-shadow: 0 0 15px currentColor;
}

.phase-counter {
    text-align: center;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.victory-points {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.vp-player {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 12px;
    text-align: center;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.vp-player label {
    display: block;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.vp-player input {
    width: 100%;
    font-size: 1.5rem;
    font-weight: bold;
    color: #ffd700;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 8px;
    padding: 8px;
    text-align: center;
    transition: all 0.3s ease;
}

.vp-player input:focus {
    outline: none;
    border-color: #ffd700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.phase-display {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    transition: all 0.4s ease;
}

.phase-display h2 {
    font-size: 2rem;
    margin-bottom: 15px;
    text-align: center;
}

.phase-display p {
    font-size: 1.1rem;
    text-align: center;
    margin-bottom: 25px;
    color: rgba(255, 255, 255, 0.9);
}

.step-progress {
    text-align: center;
    margin: 15px 0 20px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

#stepCounter {
    display: block;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.step-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.step-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.step-dot.active {
    width: 12px;
    height: 12px;
    background: currentColor;
    box-shadow: 0 0 8px currentColor;
}

.step-dot.completed {
    background: rgba(255, 255, 255, 0.5);
}

.phase-steps {
    margin-top: 20px;
}

.phase-steps h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: #fff;
    text-align: center;
    font-weight: 600;
}

.navigation {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

.nav-btn {
    padding: 15px 20px;
    font-size: 1rem;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    transition: all 0.3s ease;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.nav-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.nav-btn:active:not(:disabled) {
    transform: translateY(0);
}

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

.restart-btn {
    background: rgba(255, 193, 7, 0.2);
}

.restart-btn:hover {
    background: rgba(255, 193, 7, 0.3);
}

.rules-section {
    margin-top: 20px;
}

.rules-toggle {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.rules-toggle:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.toggle-icon {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.rules-content {
    max-height: 600px;
    overflow-y: auto;
    margin-top: 12px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    transition: all 0.4s ease;
}

.rules-content.collapsed {
    max-height: 0;
    padding: 0;
    margin-top: 0;
    overflow: hidden;
    border-width: 0;
}

.rules-text {
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.7;
    margin-bottom: 20px;
}

.rules-text p {
    margin-bottom: 12px;
}

.rules-text strong {
    color: #ffd700;
    font-weight: 600;
}

.reminders {
    background: rgba(255, 193, 7, 0.1);
    border-left: 4px solid #ffc107;
    padding: 15px;
    border-radius: 6px;
}

.reminders h4 {
    color: #ffc107;
    font-size: 0.95rem;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.reminders ul {
    list-style: none;
    padding-left: 0;
}

.reminders li {
    padding: 6px 0 6px 20px;
    color: rgba(255, 255, 255, 0.9);
    position: relative;
    font-size: 0.9rem;
}

.reminders li:before {
    content: "▸";
    position: absolute;
    left: 0;
    color: #ffc107;
}

footer {
    text-align: center;
}

.keyboard-shortcuts {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 12px;
    line-height: 1.6;
}

.keyboard-shortcuts strong {
    color: rgba(255, 255, 255, 0.7);
}

.rulebook-link {
    display: inline-block;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.rulebook-link:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

/* Phase-specific colors */
body.phase-0 .phase-display {
    border-color: #4a90e2;
}

body.phase-0 .phase-dot.active,
body.phase-0 .phase-steps li {
    background: rgba(74, 144, 226, 0.2);
    border-color: #4a90e2;
    color: #4a90e2;
}

body.phase-0 .phase-display h2 {
    color: #4a90e2;
}

body.phase-1 .phase-display {
    border-color: #e74c3c;
}

body.phase-1 .phase-dot.active,
body.phase-1 .phase-steps li {
    background: rgba(231, 76, 60, 0.2);
    border-color: #e74c3c;
    color: #e74c3c;
}

body.phase-1 .phase-display h2 {
    color: #e74c3c;
}

body.phase-2 .phase-display {
    border-color: #2ecc71;
}

body.phase-2 .phase-dot.active,
body.phase-2 .phase-steps li {
    background: rgba(46, 204, 113, 0.2);
    border-color: #2ecc71;
    color: #2ecc71;
}

body.phase-2 .phase-display h2 {
    color: #2ecc71;
}

/* Game End Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal.hidden {
    display: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 20px;
    padding: 40px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    border: 2px solid rgba(255, 215, 0, 0.3);
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.4s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-content h2 {
    color: #ffd700;
    font-size: 2rem;
    margin-bottom: 25px;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}

.final-scores {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

.score-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    font-size: 1.1rem;
}

.score-row:not(:last-child) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.player-label {
    color: rgba(255, 255, 255, 0.8);
}

.score-value {
    color: #fff;
    font-weight: bold;
    font-size: 1.2rem;
}

.winner {
    font-size: 1.5rem;
    font-weight: bold;
    color: #ffd700;
    margin: 20px 0;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.modal-btn {
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: 600;
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3);
}

.modal-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 144, 226, 0.5);
}

.modal-btn:active {
    transform: translateY(0);
}

/* Responsive design */
@media (max-width: 600px) {
    .container {
        padding: 20px;
    }

    header h1 {
        font-size: 1.4rem;
    }

    .round-counter {
        font-size: 1rem;
    }

    .round-counter strong {
        font-size: 1.2rem;
    }

    .phase-display h2 {
        font-size: 1.5rem;
    }

    .victory-points {
        gap: 10px;
    }

    .navigation {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
    }

    .restart-btn {
        order: 3;
    }

    .keyboard-shortcuts {
        font-size: 0.7rem;
    }

    .modal-content {
        padding: 30px 20px;
    }

    .modal-content h2 {
        font-size: 1.6rem;
    }
}

@media (max-width: 400px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 15px;
    }

    .phase-display {
        padding: 20px;
    }

    .nav-btn {
        padding: 12px 16px;
        font-size: 0.9rem;
    }
}
