/* ============================================
   RESET & BASE STYLES
   ============================================ */

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    color: #2c3e50;
    padding: 20px;
}

/* ============================================
   CONTAINER & LAYOUT
   ============================================ */

.container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.header {
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    color: #666;
    padding: 20px 30px;
    border-radius: 10px;
    margin-bottom: 10px;
    backdrop-filter: blur(10px);
}

.header h1 {
    font-size: 1.5em;
    margin-bottom: 5px;
    font-weight: 500;
}

.subtitle {
    font-size: 0.9em;
    opacity: 0.7;
    font-weight: 300;
}

.game-area {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 25px;
    align-items: stretch;
}

.team-column {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

.attacker-column {
    border-top: 4px solid #e74c3c;
}

.defender-column {
    border-top: 4px solid #27ae60;
}

.team-column h2 {
    font-size: 1.5em;
    margin-bottom: 20px;
    color: #2c3e50;
}

.team-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.formula-box {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 20px;
    border-radius: 12px;
    border: 2px solid #dee2e6;
    text-align: center;
}

.formula-box h3 {
    font-size: 1.1em;
    color: #495057;
    margin-bottom: 15px;
    font-weight: 600;
}

.formula-large {
    font-size: 2em;
    font-weight: 700;
    color: #2c3e50;
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
    line-height: 1.2;
}

.attacker-column .formula-box {
    border-left-color: #e74c3c;
}

.defender-column .formula-box {
    border-left-color: #27ae60;
}

/* ============================================
   CENTER COLUMN (Dice & Buttons)
   ============================================ */

.center-column {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-top: 4px solid #f39c12;
}

.dice-display {
    margin-bottom: 30px;
}

.dice-container {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 20px;
}

.dice {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
    position: relative;
    transition: transform 0.3s ease;
}

.dice:hover {
    transform: scale(1.05);
}

.dice.rolling {
    animation: rollAnimation 0.6s ease;
}

@keyframes rollAnimation {
    0% {
        transform: rotateY(0deg) rotateX(0deg);
    }

    25% {
        transform: rotateY(180deg) rotateX(90deg);
    }

    50% {
        transform: rotateY(360deg) rotateX(180deg);
    }

    75% {
        transform: rotateY(180deg) rotateX(270deg);
    }

    100% {
        transform: rotateY(0deg) rotateX(0deg);
    }
}

.dice-value {
    font-size: 2em;
    font-weight: 900;
    margin-bottom: 5px;
}

.dice-label {
    font-size: 0.8em;
    opacity: 0.9;
    margin-bottom: 2px;
}

.dice-range {
    font-size: 0.7em;
    opacity: 0.8;
}

.buttons-container {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 87, 108, 0.4);
}

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

.message {
    text-align: center;
    padding: 10px;
    min-height: 20px;
    font-size: 0.95em;
}

.message.error {
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.1);
    border-radius: 6px;
    padding: 12px;
}

.message.success {
    color: #27ae60;
    background: rgba(39, 174, 96, 0.1);
    border-radius: 6px;
    padding: 12px;
}

/* ============================================
   INPUT & FORMULA STYLES
   ============================================ */

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 15px;
}

.input-group label {
    font-weight: 600;
    color: #34495e;
    font-size: 0.95em;
}

.input-group input {
    padding: 10px 15px;
    border: 2px solid #ecf0f1;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.formula-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 15px;
    margin-bottom: 15px;
}

.formula-box {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.formula-box h3 {
    font-size: 0.9em;
    color: #667eea;
    margin-bottom: 8px;
    font-weight: 600;
}

.formula {
    font-size: 1.3em;
    font-weight: 700;
    color: #2c3e50;
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
}

.solutions {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #ecf0f1;
}

.solution-box {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 10px;
    border-left: 4px solid #27ae60;
}

.solution-box h4 {
    font-size: 0.9em;
    color: #27ae60;
    margin-bottom: 6px;
    font-weight: 600;
}

.solution-box p {
    font-size: 1.2em;
    font-weight: 700;
    color: #1b5e20;
    font-family: 'Courier New', monospace;
}

.team-description {
    color: #95a5a6;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

/* ============================================
   FOOTER
   ============================================ */

.footer {
    text-align: center;
    padding: 20px;
    color: #7f8c8d;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    font-size: 0.95em;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 1024px) {
    .game-area {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .header h1 {
        font-size: 2em;
    }
}

@media (max-width: 768px) {
    .formula-large {
        font-size: 1.5em;
    }

    .formula-box {
        padding: 15px;
    }

    .dice-container {
        flex-wrap: wrap;
        gap: 20px;
    }

    .dice {
        width: 80px;
        height: 80px;
    }

    .buttons-container {
        gap: 10px;
    }

    .btn {
        padding: 10px 20px;
        font-size: 1em;
    }

    .header {
        padding: 30px 20px;
    }

    .header h1 {
        font-size: 1.8em;
    }
}

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

    .header h1 {
        font-size: 1.5em;
    }

    .team-column {
        padding: 20px;
    }

    .formula-large {
        font-size: 1em;
    }

    .formula-box {
        padding: 10px;
    }

    .dice {
        width: 70px;
        height: 70px;
        font-size: 0.9em;
    }

    .dice-value {
        font-size: 1.5em;
    }
}