/* Colors */
:root {
    --bad: #ff4d6d;
    --warn: #ffb703;
    --ok: #2ee59d;
    --acc: #00e5ff;
    --pri: #7c4dff;
}

* {
    box-sizing: border-box;
}

/* Base layout */
body {
    margin: 0;
    min-height: 100vh;
    color: #fff;
    font-family: "Trebuchet MS", system-ui, sans-serif;
    background: linear-gradient(135deg, #1a1052, #4b1d96 55%, #0e6ba8) fixed;
}

.bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(circle at 15% 20%, #00e5ff33, transparent 40%), radial-gradient(circle at 85% 80%, #ff4dd233, transparent 40%);
}

main {
    position: relative;
    max-width: 780px;
    margin: 0 auto;
    padding: 18px 14px 40px;
}

h1 {
    font-size: clamp(1.8rem, 6vw, 2.8rem);
    margin: .2em 0;
    text-shadow: 0 3px 0 #0006;
}

h2 {
    margin: .2em 0;
}

/* Home screen */
.hero {
    text-align: center;
}

.mascot,
.big {
    font-size: 4.5rem;
    animation: bob 2s ease-in-out infinite;
    text-align: center;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px;
    margin: 18px 0;
}

.lvl {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 14px;
    border: 0;
    border-radius: 18px;
    color: #fff;
    font: inherit;
    cursor: pointer;
    background: #ffffff22;
    box-shadow: 0 5px 0 #0005;
    transition: .15s;
    animation: pop .4s both;
}

.lvl:hover {
    transform: translateY(-4px);
    background: #ffffff33;
}

.lvl.done {
    background: #2ee59d44;
}

.lvl .ic {
    font-size: 2.4rem;
}

/* Cards and buttons */
.card {
    background: #ffffff1f;
    backdrop-filter: blur(6px);
    border: 2px solid #ffffff33;
    border-radius: 22px;
    padding: 20px;
    margin: 14px 0;
    animation: pop .35s both;
}

.row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    margin: 12px 0;
}

.btn {
    border: 0;
    border-radius: 16px;
    padding: 14px 22px;
    font: inherit;
    font-weight: bold;
    font-size: 1.05rem;
    color: #fff;
    cursor: pointer;
    background: linear-gradient(#9b6bff, var(--pri));
    box-shadow: 0 5px 0 #3b1d99;
    transition: .1s;
}

.btn:active {
    transform: translateY(4px);
    box-shadow: 0 1px 0 #3b1d99;
}

.btn:disabled {
    opacity: .4;
    cursor: not-allowed;
}

.btn.alt {
    background: linear-gradient(#27d6f5, #0aa5c4);
    box-shadow: 0 5px 0 #06687d;
}

.btn.ghost {
    background: #ffffff22;
    box-shadow: none;
}

/* Game screen */
.hud {
    display: flex;
    justify-content: space-between;
    font-size: 1.3rem;
    font-weight: bold;
}

.prog {
    height: 10px;
    background: #0004;
    border-radius: 9px;
    overflow: hidden;
    margin: 8px 0;
}

.prog i {
    display: block;
    height: 100%;
    background: var(--acc);
    transition: .4s;
}

.q {
    font-size: 1.25rem;
    line-height: 1.5;
}

.q.xl {
    font-size: clamp(1.5rem, 4vw, 2.2rem);
}

.opts {
    display: grid;
    gap: 10px;
    margin: 14px 0;
}

.opt {
    text-align: left;
    padding: 14px 16px;
    border: 2px solid #ffffff44;
    border-radius: 14px;
    background: #ffffff1a;
    color: #fff;
    font: inherit;
    font-size: 1.05rem;
    cursor: pointer;
    transition: .15s;
}

button.opt:hover:not(:disabled) {
    background: #ffffff33;
    transform: scale(1.02);
}

.opt.ok {
    background: #2ee59d66;
    border-color: var(--ok);
}

.opt.bad {
    background: #ff4d6d66;
    border-color: var(--bad);
}

.fb {
    padding: 14px;
    border-radius: 14px;
    margin-top: 10px;
    animation: pop .3s both;
}

.fb.good {
    background: #2ee59d33;
}

.fb.nope {
    background: #ff4d6d33;
}

.shake {
    animation: shake .4s;
}

/* Form fields and password meter */
input,
select {
    width: 100%;
    padding: 14px;
    border-radius: 14px;
    border: 2px solid #fff5;
    background: #0004;
    color: #fff;
    font: inherit;
    font-size: 1.1rem;
    margin: 8px 0;
}

.meter {
    height: 14px;
    background: #0005;
    border-radius: 9px;
    overflow: hidden;
}

.meter i {
    display: block;
    height: 100%;
    width: 0;
    transition: .3s;
}

.checks {
    list-style: none;
    padding: 0;
}

.checks li {
    padding: 4px 0;
}

.checks li.ok {
    color: var(--ok);
}

/* Class mode */
.teams {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3, 5 and 6 teams: every team has the same width */
    gap: 10px;
    margin-top: 18px;
}

.teams.n2 {
    grid-template-columns: repeat(2, 1fr);
}

.teams.n4 {
    grid-template-columns: repeat(4, 1fr);
}

.team {
    text-align: center;
    padding: 10px;
    border-radius: 14px;
    background: #ffffff22;
}

.team b {
    display: block;
    font-size: 2rem;
}

.team:nth-child(1) {
    border-bottom: 5px solid #ff4d6d;
}

.team:nth-child(2) {
    border-bottom: 5px solid #ffb703;
}

.team:nth-child(3) {
    border-bottom: 5px solid #2ee59d;
}

.team:nth-child(4) {
    border-bottom: 5px solid #00e5ff;
}

.team:nth-child(5) {
    border-bottom: 5px solid #b388ff;
}

.team:nth-child(6) {
    border-bottom: 5px solid #ff80ab;
}

.team button {
    border: 0;
    border-radius: 10px;
    padding: 6px 16px;
    font: inherit;
    font-weight: bold;
    cursor: pointer;
}

.team .pts {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 6px;
}

.team .minus {
    background: #fff;
    color: #2b1a6b;
}

.team .plus {
    background: var(--ok);
    color: #0b3d2a;
}

.team .minus:disabled {
    opacity: .35;
    cursor: not-allowed;
}

@media (max-width: 520px) {
    .teams,
    .teams.n4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

.meta {
    opacity: .8;
    margin-bottom: 6px;
}

/* Diploma and final score */
.dip {
    margin: 14px 0;
    padding: 26px;
    text-align: center;
    border: 6px double #ffd54a;
    border-radius: 16px;
    background: #fff;
    color: #2b1a6b;
}

.confetti {
    font-size: 2rem;
    text-align: center;
    animation: fall 2.5s ease-out;
}

/* Animations */
@keyframes bob {
    50% {
        transform: translateY(-10px);
    }
}

@keyframes pop {
    from {
        opacity: 0;
        transform: scale(.92) translateY(10px);
    }
}

@keyframes shake {
    25% {
        transform: translateX(-10px);
    }
    75% {
        transform: translateX(10px);
    }
}

@keyframes fall {
    from {
        transform: translateY(-60px);
        opacity: 0;
    }
}

.pct {
    font-size: 4.5rem;
    font-weight: bold;
    line-height: 1.1;
}

.pct.pass {
    color: var(--ok);
}

.pct.low {
    color: var(--warn);
}

.tbl {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
    text-align: left;
}

.tbl td {
    padding: 7px;
    border-bottom: 1px solid #fff3;
}
