/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    background: linear-gradient(135deg, rgb(68, 104, 167) 0%, rgb(68, 104, 167) 100%);
    min-height: 100vh;
    color: #fff;
    overflow-x: hidden;
}

/* Game Container */
.game-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Header */
.game-header {
    text-align: center;
    margin-bottom: 30px;
}

.game-title {
    font-size: 3rem;
    font-weight: 900;
    text-shadow: 3px 3px 0px #000;
    margin-bottom: 10px;
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.game-subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    font-weight: 400;
}

/* Game Status */
.game-status {
    display: flex;
    justify-content: space-between;
    width: 100%;
    max-width: 600px;
    margin-bottom: 20px;
}

.match-status {
    background: linear-gradient(45deg, #4CAF50, #45a049);
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 700;
    font-size: 1.1rem;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
    border: 2px solid #fff;
}

.phase-indicator {
    background: linear-gradient(45deg, #ff6b35, #f7931e);
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 700;
    font-size: 1.1rem;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
    border: 2px solid #fff;
}

/* Timer */
.timer-container {
    margin-bottom: 30px;
}

.timer {
    font-size: 4rem;
    font-weight: 900;
    text-align: center;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    border: 4px solid #fff;
    border-radius: 20px;
    padding: 20px 40px;
    background-color: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    min-width: 200px;
    transition: color 0.3s ease;
}

.timer.overtime {
    color: #ff1744;
}

/* Elixir Bar */
.elixir-container {
    width: 100%;
    max-width: 600px;
    margin-bottom: 40px;
}

.elixir-bar-background {
    position: relative;
    width: 100%;
    height: 60px;
    background: rgb(33, 50, 90); /* R:33 G:50 B:90 - empty parts */
    border: 4px solid #ffd700;
    border-radius: 8px; /* More rectangular with rounded corners */
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
}

.elixir-bar-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 70%; /* Starts at 7/10 = 70% */
    background: rgb(208, 33, 215); /* R:208 G:33 B:215 - pink for integers */
    border-radius: 4px; /* Slightly rounded corners */
    transition: width 0.1s ease-out;
    box-shadow: inset 0 2px 10px rgba(255, 255, 255, 0.3);
}

.elixir-bar-filler {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: rgb(81, 81, 135); /* R:81 G:81 B:135 - filler color */
    border-radius: 4px;
    transition: width 0.1s ease-out;
    z-index: 2;
}

.elixir-tick {
    position: absolute;
    top: 0;
    width: 2px;
    height: 100%;
    background: black; /* Black tick marks */
    z-index: 5;
}

.elixir-number {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    font-weight: 900;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    z-index: 10;
}

.elixir-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    font-weight: 700;
    font-size: 1.1rem;
}

/* Control Buttons */
.controls-container {
    display: flex;
    gap: 20px;
    margin-bottom: 40px;
}

.start-button, .reset-button {
    padding: 15px 30px;
    font-size: 1.2rem;
    font-weight: 700;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.start-button {
    background: linear-gradient(45deg, #4CAF50, #45a049);
    color: white;
}

.start-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(76, 175, 80, 0.4);
}

.start-button:active {
    transform: translateY(0);
}

.reset-button {
    background: linear-gradient(45deg, #f44336, #d32f2f);
    color: white;
}

.reset-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(244, 67, 54, 0.4);
}

.reset-button:active {
    transform: translateY(0);
}

/* Elixir Buttons */
.elixir-buttons-container {
    width: 100%;
    max-width: 800px;
    margin-bottom: 40px;
}

.elixir-buttons-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.elixir-button {
    padding: 20px;
    font-size: 1.5rem;
    font-weight: 900;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: linear-gradient(45deg, #ff6b35, #f7931e);
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
    border: 2px solid #fff;
}

.elixir-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.5);
    background: linear-gradient(45deg, #ff5722, #ff9800);
}

.elixir-button:active {
    transform: translateY(-1px);
    box-shadow: 0 2px 10px rgba(255, 107, 53, 0.4);
}

.elixir-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Instructions */
.instructions {
    background: rgba(0, 0, 0, 0.4);
    padding: 25px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    max-width: 600px;
    text-align: center;
}

.instructions h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: #ffd700;
    font-weight: 700;
}

.instructions p {
    font-size: 1.1rem;
    margin-bottom: 10px;
    line-height: 1.6;
    opacity: 0.9;
}

/* Responsive Design */
@media (max-width: 768px) {
    .game-container {
        padding: 15px;
    }
    
    .game-title {
        font-size: 2.5rem;
    }
    
    .timer {
        font-size: 3rem;
        padding: 15px 30px;
    }
    
    .elixir-buttons-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    
    .elixir-button {
        padding: 15px;
        font-size: 1.3rem;
    }
    
    .game-status {
        flex-direction: column;
        gap: 10px;
        align-items: center;
    }
    
    .controls-container {
        flex-direction: column;
        align-items: center;
    }
}

@media (max-width: 480px) {
    .elixir-buttons-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .game-title {
        font-size: 2rem;
    }
    
    .timer {
        font-size: 2.5rem;
        padding: 10px 20px;
    }
}

/* Animation for elixir bar changes */
@keyframes elixirPulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(255, 215, 0, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 215, 0, 0); }
}

.elixir-bar-background.pulse {
    animation: elixirPulse 0.6s;
}

/* Phase transition animations */
@keyframes phaseChange {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.phase-indicator.changing {
    animation: phaseChange 0.5s ease-in-out;
}
