:root {
    --bg-dark: #121820;
    --surface: #1e272e;
    --surface-light: #2c3e50;
    --primary: #f39c12;
    --primary-hover: #f1c40f;
    --accent: #e74c3c;
    --text-main: #ecf0f1;
    --text-muted: #bdc3c7;
    --radius: 12px;
    --transition: 0.3s ease;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
    color: var(--text-main);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--primary-hover);
}

/* Layout */
.container {
    width: 95%;
    max-width: 1200px;
    margin: 0 auto;
}

main {
    flex: 1;
    padding: 2rem 0;
}

/* Header */
.main-header {
    background: rgba(30, 39, 46, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.main-nav {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.main-nav a {
    color: var(--text-main);
    font-weight: 500;
}

.main-nav a:hover {
    color: var(--primary);
}

.header-tools {
    display: flex;
    gap: 0.8rem;
    align-items: center;
    margin-left: auto;
    margin-right: 1.2rem;
}

.header-tools button,
.header-tools a.tool-icon-link {
    background: var(--surface-light);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: white;
    font-size: 1.35rem;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    line-height: 1;
    transition: transform var(--transition), border-color var(--transition), background-color var(--transition);
}

.header-tools button:hover,
.header-tools a.tool-icon-link:hover {
    transform: scale(1.15);
    border-color: var(--primary);
    background: rgba(243, 156, 18, 0.1);
}

@keyframes bgFlashRed {
    0%, 100% { background-color: rgba(0, 0, 0, 1); }
    50% { background-color: rgba(231, 76, 60, 1); }
}

.timer-alert-active {
    animation: bgFlashRed 0.5s infinite !important;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: all var(--transition);
    border: none;
}

.btn-primary {
    background: var(--primary);
    color: var(--bg-dark);
}

.btn-primary:hover {
    background: var(--primary-hover);
    color: var(--bg-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(243, 156, 18, 0.4);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--text-main);
    color: var(--text-main);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Cards */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: transform var(--transition);
}

.card:hover {
    transform: translateY(-5px);
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-muted);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 0.8rem;
    border-radius: 8px;
    background: var(--surface-light);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    transition: border-color var(--transition);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
}

/* Hide default spin buttons for number inputs */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type="number"] {
    -moz-appearance: textfield;
}

/* Custom steppers for score inputs */
.btn-stepper {
    background: var(--surface-light);
    color: var(--text-main);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: bold;
    font-size: 1.2rem;
    padding: 0;
    transition: background var(--transition);
}
.btn-stepper:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-stepper-minus:hover, .btn-stepper-minus:active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.btn-stepper-plus:hover, .btn-stepper-plus:active {
    background: #2ecc71; /* Vert flat UI */
    border-color: #2ecc71;
    color: white;
}

/* Footer */
.main-footer {
    text-align: center;
    padding: 2rem 0;
    background: var(--surface);
    color: var(--text-muted);
    font-size: 0.9rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Responsive Header & Navigation */
@media (max-width: 768px) {
    .main-header .container {
        display: grid;
        grid-template-columns: 1fr auto;
        grid-template-areas: 
            "logo logo"
            "tools burger";
        justify-items: center;
        align-items: center;
        gap: 0.8rem 0;
        padding: 0.8rem 0;
    }

    .logo {
        grid-area: logo;
        display: flex;
        justify-content: center;
        align-items: center;
        width: 100%;
        gap: 0.5rem;
    }

    .logo img {
        height: 48px !important;
        width: 48px !important;
    }

    .logo-text {
        font-size: 1.4rem;
    }

    .header-tools {
        grid-area: tools;
        margin: 0;
        justify-self: center;
        padding-left: 2.5rem; /* Balance the burger menu icon on the right */
        gap: 0.8rem;
    }
    
    .header-tools button,
    .header-tools a.tool-icon-link {
        font-size: 1.2rem;
        width: 36px;
        height: 36px;
    }

    #mobile-menu-btn {
        grid-area: burger;
        display: block !important;
        background: none;
        border: none;
        color: white;
        font-size: 2rem;
        cursor: pointer;
        padding: 0;
        line-height: 1;
        justify-self: end;
        margin-right: 0.5rem;
    }
    
    .main-nav {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: rgba(30, 39, 46, 0.98);
        padding: 1rem 0;
        box-shadow: var(--shadow);
        border-radius: 0 0 12px 12px;
        border: 1px solid rgba(255, 255, 255, 0.05);
        border-top: none;
    }
    
    .main-nav.active {
        display: flex;
    }
    
    .main-nav a {
        padding: 0.8rem 2rem;
        width: 100%;
        text-align: center;
        border-bottom: 1px solid rgba(255,255,255,0.05);
    }
    
    .main-nav a.btn {
        width: 80%;
        margin: 1rem auto;
    }
}

@media (max-width: 600px) {
    .logo img {
        height: 38px !important;
        width: 38px !important;
    }
    .logo-text {
        font-size: 1.25rem;
    }
    .header-tools {
        gap: 0.6rem;
    }
    .header-tools button,
    .header-tools a.tool-icon-link {
        font-size: 1.1rem;
        width: 32px;
        height: 32px;
    }
}

@media (max-width: 380px) {
    .logo img {
        height: 32px !important;
        width: 32px !important;
    }
    .logo-text {
        font-size: 1.1rem;
    }
    .header-tools {
        gap: 0.4rem;
        padding-left: 2rem;
    }
    .header-tools button,
    .header-tools a.tool-icon-link {
        font-size: 1rem;
        width: 28px;
        height: 28px;
    }
    #mobile-menu-btn {
        font-size: 1.7rem;
    }
}
