:root {
    --purdue-gold: #CEB888;
    --purdue-black: #000000;
    --dark-gray: #1a1a1a;
    --light-gray: #333333;
    --text-color: #ffffff;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--purdue-black);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 2rem 0; /* Add some padding so the container doesn't touch the top/bottom when scrolling */
}

#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1; /* Behind everything */
    pointer-events: none; /* Don't block clicks */
}

#flash-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--purdue-gold);
    opacity: 0;
    pointer-events: none;
    z-index: 9999;
    transition: opacity 0.5s ease-out;
}

#flash-overlay.flash {
    opacity: 1;
    transition: none; /* instant flash, slow fade out */
}

.container {
    width: 100%;
    max-width: 600px;
    padding: 2rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    backdrop-filter: blur(10px);
    text-align: center;
    position: relative;
    z-index: 10;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

header {
    margin-bottom: 2rem;
}

header .logo {
    margin-bottom: 1rem;
    animation: float 6s ease-in-out infinite;
}

header .logo img {
    height: 80px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.5));
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

h1 {
    font-size: 3rem;
    font-weight: 900;
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #FFF 0%, var(--purdue-gold) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--purdue-gold);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.status-display {
    margin-bottom: 2rem;
}

#shot-counter {
    font-size: 2.5rem;
    font-weight: 700;
}

.highlight {
    color: var(--purdue-gold);
    font-weight: 900;
    font-size: 3.5rem;
}

.timer-container {
    display: flex;
    justify-content: center;
    margin-bottom: 3rem;
}

.shot-glass {
    position: relative;
    width: 120px;
    height: 160px;
    background: rgba(255, 255, 255, 0.05);
    border: 4px solid var(--glass-border);
    border-top: none;
    border-radius: 0 0 15px 15px;
    box-shadow: inset 0 -10px 20px rgba(0,0,0,0.5), 0 10px 20px rgba(0,0,0,0.3);
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Add a rim to the shot glass */
.shot-glass::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    height: 4px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
}

.liquid {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0%; /* Controlled by JS */
    background: linear-gradient(to bottom, #EBC05B, #B48E3D); /* Beer color */
    border-top: 2px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 -5px 15px rgba(235, 192, 91, 0.5);
    transition: height 0.1s linear; /* Smooth visual updates */
}

/* Bubbles effect */
.liquid::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background-image: radial-gradient(rgba(255,255,255,0.4) 1px, transparent 1px);
    background-size: 15px 15px;
    opacity: 0.5;
    animation: bubbles 10s linear infinite;
}

@keyframes bubbles {
    from { background-position: 0 100px; }
    to { background-position: 0 0; }
}

.time-display {
    position: absolute;
    font-size: 3rem;
    font-weight: 900;
    z-index: 2;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
    transition: color 0.3s ease;
}

.time-display.urgent {
    color: #ff4444;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.btn {
    padding: 0.8rem 1.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn:active {
    transform: scale(0.95);
}

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

.btn.primary {
    background-color: var(--purdue-gold);
    color: var(--purdue-black);
    box-shadow: 0 4px 15px rgba(206, 184, 136, 0.3);
}

.btn.primary:hover:not(:disabled) {
    background-color: #d8c59c;
    box-shadow: 0 6px 20px rgba(206, 184, 136, 0.5);
}

.btn.secondary {
    background-color: var(--light-gray);
    color: white;
}

.btn.secondary:hover:not(:disabled) {
    background-color: #444;
}

.btn.outline {
    background-color: transparent;
    color: var(--purdue-gold);
    border: 2px solid var(--purdue-gold);
}

.btn.outline:hover:not(:disabled) {
    background-color: rgba(206, 184, 136, 0.1);
}

.advanced-panel {
    border-top: 1px solid var(--glass-border);
    padding-top: 1rem;
}

.btn-text {
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.btn-text:hover {
    color: var(--text-color);
}

.settings-content {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(0,0,0,0.2);
    border-radius: 12px;
    text-align: left;
    transition: all 0.3s ease;
}

.settings-content.hidden {
    display: none;
}

.setting-group {
    margin-bottom: 1rem;
}

.setting-group:last-child {
    margin-bottom: 0;
}

.setting-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: #ccc;
}

.input-row {
    display: flex;
    gap: 0.5rem;
}

input[type="number"] {
    flex: 1;
    padding: 0.5rem;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    background: var(--dark-gray);
    color: white;
    font-family: inherit;
}

.btn.small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    background-color: var(--light-gray);
    color: white;
}

.btn.small:hover {
    background-color: #444;
}

.toggle-group {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.toggle-group input[type="radio"] {
    accent-color: var(--purdue-gold);
}

input[type="file"] {
    width: 100%;
    padding: 0.5rem;
    background: var(--dark-gray);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: white;
    font-size: 0.8rem;
}

@media (max-width: 480px) {
    .container {
        padding: 1.5rem;
        border-radius: 0;
        min-height: 100vh;
        border: none;
    }
    h1 { font-size: 2.5rem; }
}
