:root {
    /* Theme Colors: Blue / Black / Yellow (High Contrast / Flat) */
    --bg-body: #ffffff;
    --bg-card: #f8f9fa;

    --primary: #000000;
    /* Black */
    --primary-hover: #333333;

    --secondary: #0056d2;
    /* Strong Blue */
    --accent: #ffcc00;
    /* Yellow */

    --text-main: #000000;
    --text-muted: #555555;

    --border-color: #000000;

    --success: #198754;
    --error: #dc3545;

    /* Fonts */
    --font-head: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* Flat Design - Box Shadows */
    --card-shadow: 4px 4px 0px rgba(0, 0, 0, 1);
    --hover-shadow: 6px 6px 0px rgba(0, 0, 0, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--accent);
    /* Yellow Background */
    color: var(--text-main);
    font-family: var(--font-body);
    height: 100vh;
    overflow: hidden;
}

/* Home Button - Bold & Flat */
.floating-home {
    position: fixed;
    top: 24px;
    left: 24px;
    z-index: 2000;

    background: var(--primary);
    color: var(--accent);
    border: 2px solid black;

    padding: 12px 24px;
    border-radius: 4px;
    /* Slight round but mostly square */

    display: flex;
    align-items: center;
    gap: 12px;

    box-shadow: 4px 4px 0px rgba(255, 255, 255, 0.5);
    transition: all 0.2s;

    font-family: var(--font-head);
    font-weight: 900;
    text-transform: uppercase;
    cursor: pointer;
}

.floating-home:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0px rgba(255, 255, 255, 0.8);
    background: var(--secondary);
    color: white;
}

.floating-home i {
    font-size: 1.4rem;
}

.floating-home span {
    font-size: 1rem;
    letter-spacing: 1px;
}

.app-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 6rem 1rem 2rem 1rem;
}

/* Remove orbs */
.bg-orb {
    display: none;
}

/* Typography */
h1,
h2,
h3 {
    font-family: var(--font-head);
    font-weight: 900;
    color: black;
    text-transform: uppercase;
}

.text-gradient {
    color: var(--secondary);
    background: none;
    -webkit-text-fill-color: initial;
    text-decoration: underline var(--accent) thickness(4px);
    text-decoration-skip-ink: none;
}

.screen {
    width: 100%;
    max-width: 800px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    animation: none;
    margin: auto;
    flex-shrink: 0;
}

.screen.screen-wide {
    max-width: 95vw;
    /* Wide mode for Admin tables */
}

.screen.hidden {
    display: none;
}

.screen.active {
    display: flex;
}

/* Brutalist Cards */
.glass-card {
    background: white;
    border: 3px solid black;
    border-radius: 0;
    /* Sharp corners */
    padding: 3rem;
    box-shadow: var(--card-shadow);
}

.glass-card::after {
    display: none;
}

/* Remove decorative bar */

/* Buttons */
.btn {
    border: 3px solid black;
    padding: 1rem 2rem;
    border-radius: 0;
    font-family: var(--font-head);
    font-weight: 900;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.1s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    font-size: 1.1rem;
    background: white;
    color: black;
    box-shadow: 4px 4px 0px black;
}

.btn:active {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0px black;
}

.btn-primary {
    background: var(--secondary);
    /* Blue */
    color: white;
}

.btn-primary:hover {
    background: #0044aa;
}

.btn-outline {
    background: white;
}

.btn-outline:hover {
    background: var(--accent);
}

.btn-icon {
    width: 48px;
    height: 48px;
    border: 3px solid black;
    background: white;
    color: black;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 4px 4px 0px black;
    transition: all 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
    /* Sharp */
}

.btn-icon:hover {
    background: var(--accent);
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0px black;
}

.btn-icon:active {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0px black;
}

.btn-icon-sm {
    background: white;
    border: 2px solid black;
    border-radius: 4px;
    padding: 4px;
    cursor: pointer;
    font-size: 1.2rem;
    color: black;
}

.btn-icon-sm:hover {
    background: var(--accent);
}

.btn-danger {
    background: var(--error);
    color: white;
    border-color: black;
}

.btn-success {
    background: var(--success);
    color: white;
    border-color: black;
}

/* Inputs */
input,
select {
    width: 100%;
    padding: 1rem;
    margin-bottom: 1rem;
    background: white;
    border: 3px solid black;
    border-radius: 0;
    color: black;
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 1rem;
    box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.1);
}

input:focus,
select:focus {
    outline: none;
    box-shadow: 4px 4px 0px var(--secondary);
}

/* Specific UI Tweaks */
.hero-card h1 {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.level-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

.level-card {
    background: white;
    border: 3px solid black;
    box-shadow: 4px 4px 0px black;
    border-radius: 0;
    padding: 1.5rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 140px;
    position: relative;
    transition: all 0.1s;
}

.level-card:hover {
    transform: translate(-3px, -3px);
    box-shadow: 7px 7px 0px black;
    border-color: black;
}

.level-card.tier-1 {
    border-left: 8px solid var(--success);
}

.level-card.tier-2 {
    border-left: 8px solid var(--accent);
}

.level-card.tier-3 {
    border-left: 8px solid var(--error);
}

.lvl-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.level-card .lvl-num {
    font-size: 2rem;
    font-weight: 900;
    line-height: 1;
    color: var(--text-muted);
    opacity: 0.3;
    position: absolute;
    bottom: 10px;
    right: 10px;
}

.level-card h3 {
    font-size: 1.1rem;
}

.level-card .score-badge {
    font-weight: bold;
    background: black;
    color: white;
    padding: 2px 6px;
    align-self: flex-start;
    font-size: 0.8rem;
}

.game-hud {
    display: flex;
    justify-content: space-between;
    background: white;
    padding: 1rem;
    border: 3px solid black;
    border-radius: 0;
    box-shadow: var(--card-shadow);
    margin-bottom: 2rem;
}

.hud-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hud-item .label {
    font-size: 0.8rem;
    font-weight: 900;
    text-transform: uppercase;
}

.hud-item .value {
    font-size: 1.5rem;
    font-weight: 700;
}

.answers-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.answer-btn {
    padding: 2rem;
    border: 3px solid black;
    border-radius: 0;
    box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.1);
    font-weight: 700;
    background: white;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.1s;
}

.answer-btn:hover {
    background: var(--accent);
    /* Yellow hover */
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0px black;
}

.answer-btn.correct {
    background: var(--success);
    color: white;
    border-color: black;
}

.answer-btn.wrong {
    background: var(--error);
    color: white;
    border-color: black;
    opacity: 1;
}

.progress-bar {
    height: 8px;
    border: 2px solid black;
    background: white;
    position: relative;
    margin-bottom: 1rem;
}

.progress-bar .fill {
    height: 100%;
    background: var(--secondary);
    width: 0%;
    transition: width 0.3s;
}

/* Admin */
.admin-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 3px solid black;
}

.tab-btn {
    border: none;
    background: none;
    font-weight: 900;
    text-transform: uppercase;
    font-size: 1.2rem;
    padding: 0.5rem 1rem;
    cursor: pointer;
    color: var(--text-muted);
}

.tab-btn.active {
    color: var(--text-main);
    background: var(--accent);
    box-shadow: 4px 4px 0px black;
    border: 2px solid black;
    transform: translateY(2px);
}

.admin-q-item {
    border: 2px solid black;
    border-radius: 0;
    background: white;
    padding: 1rem;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.badge-lvl {
    background: black;
    color: var(--accent);
    border-radius: 0;
    padding: 3px 6px;
    font-weight: bold;
    margin-right: 10px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    border: 2px solid black;
}

.data-table th {
    background: black;
    color: white;
    padding: 1rem;
    text-align: left;
}

.data-table td {
    border-bottom: 1px solid black;
    padding: 1rem;
}

.data-table tr:nth-child(even) {
    background: #f0f0f0;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    max-width: 400px;
    width: 90%;
    text-align: center;
    border: 4px solid black;
    box-shadow: 8px 8px 0px black;
    background: white;
    padding: 2rem;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.hidden {
    display: none;
}

@media (max-width: 600px) {
    .answers-grid {
        grid-template-columns: 1fr;
    }

    .hero-card h1 {
        font-size: 2.5rem;
    }

    .app-container {
        padding-top: 5rem;
    }
}

/* MISSING WIDGET & LEADERBOARD STYLES */

/* User Widget */
.user-widget {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 2000;

    background: white;
    border: 2px solid black;
    box-shadow: 4px 4px 0px black;

    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem 1.2rem;

    animation: slideInRight 0.5s;
}

.user-widget.hidden {
    display: none;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    border-right: 2px solid #eee;
    padding-right: 1rem;
}

.user-avatar {
    background: var(--accent);
    width: 40px;
    height: 40px;
    border: 2px solid black;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.u-name {
    font-weight: 900;
    font-size: 1rem;
    line-height: 1;
}

.u-score {
    font-size: 0.85rem;
    color: var(--secondary);
    font-weight: 700;
}

.btn-icon-nopad {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--error);
}

.btn-icon-nopad:hover {
    transform: scale(1.1);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Level Verified Style */
.level-card.played {
    background: #eef2ff;
    border-color: var(--secondary);
}

.level-card.played .score-badge.on-card {
    position: absolute;
    top: -10px;
    right: -10px;
    background: var(--accent);
    color: black;
    border: 2px solid black;
    box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.2);
    font-size: 0.9rem;
    padding: 4px 8px;
    z-index: 2;
    transform: rotate(5deg);
}

/* Class Leaderboard (Student View) */
#student-dash-header {
    margin-bottom: 2rem;
    padding: 1.5rem;
}

.horizontal-scroll {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding: 1rem 0.5rem;
    /* Space for shadows */
}

.mini-profile {
    background: white;
    border: 2px solid black;
    padding: 0.5rem 1rem;
    border-radius: 0;
    min-width: 140px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.1);
}

.mini-profile strong {
    font-size: 0.9rem;
    margin-bottom: 0.2rem;
}

.mini-profile span {
    color: var(--secondary);
    font-weight: bold;
}

.mini-profile.me {
    background: var(--accent);
    border-color: black;
    box-shadow: 4px 4px 0px black;
    transform: translateY(-2px);
}