/* --- Dark Theme Variables --- */
:root {
    --color-background: #1f2937;
    /* Dark Blue Gray */
    --color-vial-border: #94a3b8;
    /* Slate 400 (light border for contrast) */
    --color-vial-select: #f87171;
    /* Red 400 for selection */
    --color-header-text: #f9fafb;
    /* White */
    --color-subheader-text: #e6e6e6;
    /* Gray 400 */
    --color-reset-button: #dc2626;
    /* Red 600 */
    --color-modal-gradient-start: #10b981;
    /* Emerald 600 */
    --color-modal-gradient-end: #059669;
    /* Emerald 700 */
    --color-copy-button: #fcd34d;
    /* Amber 300 */
    --color-copy-button-hover: #fbbf24;
    /* Amber 400 */
    --color-card-background: #282a2c;
    /* Darker Card Background */
    --color-message-box-bg: #fcd34d;
    --color-message-box-text: #1f2937;
}


/* --- Game Container & Responsiveness --- */
#game-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    max-width: 900px;
    margin: 1rem auto 0px;
    width: 100%;
    padding: 20px;
    background: var(--color-card-background);
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.header {
    width: 100%;
    text-align: center;
    margin-bottom: 20px;
}

.header h1 {
    font-size: 1.875rem;
    /* 3xl */
    font-weight: 800;
    /* Extra Bold */
    color: var(--color-header-text);
}

.header p {
    color: var(--color-subheader-text);
    margin-top: 0.25rem;
    font-size: 0.9rem;
}

.header p span {
    font-weight: bold;
}

#reset-button {
    margin-top: 0.75rem;
    padding: 0.5rem 1rem;
    background-color: var(--color-reset-button);
    color: white;
    font-weight: 600;
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.06);
    transition: background-color 0.15s, transform 0.15s;
    cursor: pointer;
}

#reset-button:hover {
    background-color: #b91c1c;
    transform: translateY(-1px);
}

/* --- Guide Section Styling --- */
#game-guide {
    width: 100%;
    margin-top: 10px;
    margin-bottom: 20px;
    padding: 15px;
    background-color: var(--primary-bg);
    color: white;
    border-radius: 10px;
}

.guide-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    cursor: pointer;
    padding: 5px 0;
}

#guide-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out, padding 0.3s ease-in-out;
    padding-top: 0;
}

#game-guide.open #guide-content {
    max-height: 300px;
    /* Sufficient height for content */
    padding-top: 10px;
}

#guide-content ul {
    list-style: disc;
    margin-left: 20px;
    padding-left: 0;
    font-size: 0.95rem;
}

/* --- Vial (Bottle) Styling --- */
.vial-container {
    width: 80px;
    /* Base width for mobile */
    height: 250px;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s;
    position: relative;
    margin-bottom: 30px;
}

@media (min-width: 640px) {
    .vial-container {
        width: 90px;
    }
}

.vial {
    width: 100%;
    height: 200px;
    border: 4px solid var(--color-vial-border);
    border-top: none;
    border-radius: 0 0 40px 40px;
    display: flex;
    flex-direction: column-reverse;
    /* Colors stack from bottom up */
    overflow: hidden;
    position: relative;
    background-color: rgba(0, 0, 0, 0.2);
    /* Darker transparency */
}

.vial::before {
    content: '';
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 30px;
    background: #374151;
    /* Dark neck */
    border-radius: 50%;
    border: 4px solid var(--color-vial-border);
    z-index: 10;
}

.vial-container.selected {
    transform: translateY(-10px);
}

.vial-container.selected .vial {
    border-color: var(--color-vial-select);
    box-shadow: 0 0 15px rgba(248, 113, 113, 0.8);
}

.liquid-layer {
    width: 100%;
    height: 50px;
    /* 1/4 of 200px bottle height */
    transition: all 0.5s ease-out;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    /* Separator line */
}

/* --- Win Modal Styling (Kept vibrant against dark background) --- */
#win-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

#modal-content {
    background: linear-gradient(135deg, var(--color-modal-gradient-start), var(--color-modal-gradient-end));
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
    text-align: center;
    color: white;
    max-width: 90%;
    animation: fadeIn 0.5s ease-out;
}

#modal-content h2 {
    font-size: 2.25rem;
    /* 4xl */
    font-weight: 800;
    margin-bottom: 1rem;
}

#modal-content .congrats-text {
    font-size: 1.25rem;
    /* xl */
    margin-bottom: 1.5rem;
}

#modal-content .coupon-label {
    font-size: 1.125rem;
    /* lg */
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

#coupon-code {
    font-size: 1.5rem;
    font-weight: bold;
    letter-spacing: 2px;
    background-color: rgba(255, 255, 255, 0.2);
    padding: 10px 20px;
    border-radius: 8px;
    margin: 20px 0;
    display: inline-block;
    cursor: text;
}

.copy-button {
    background-color: var(--color-copy-button);
    color: #000000;
    /* Use dark text for button contrast */
    padding: 10px 25px;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    margin-bottom: 10px;
    /* Added margin for new button */
}

.copy-button:hover {
    background-color: var(--color-copy-button-hover);
    transform: translateY(-1px);
}

/* --- New Game Button Styling --- */
.new-game-button {
    margin-top: 15px;
    background-color: #4f46e5;
    /* Indigo 600 - Prominent Color */
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    font-size: 1.125rem;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.new-game-button:hover {
    background-color: #4338ca;
    /* Indigo 700 */
    transform: translateY(-2px);
}


.new-coupon-button {
    margin-left: 2px;
    background-color: #4f46e5;
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    padding: 10px 18px;
    border-radius: 6px;
    font-weight: 400;
    transition: background-color 0.2s, transform 0.1s;
}

.new-coupon-button:not(.show) {
    display: none;
}

.new-coupon-button:hover {
    background-color: #4338ca;
    transform: translateY(-2px);
}

/* --- End New Game Button Styling --- */


#copy-message {
    margin-top: 0.75rem;
    font-size: 0.875rem;
    /* sm */
    font-style: italic;
    color: #fef08a;
    /* Yellow 100 */
}

/* --- Message Box (Non-modal alerts) --- */
#message-box {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 20px;
    background-color: var(--color-message-box-bg);
    color: var(--color-message-box-text);
    border-radius: 8px;
    z-index: 101;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transition: opacity 0.5s, transform 0.5s;
}

#message-box.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}