:root {
    --app-bg-1: #f7fbff;
    --app-bg-2: #fff7ea;
    --play-bg: #ffffff;
    --shape-shadow: 0 12px 24px rgba(15, 23, 42, 0.18);
    --navbar-height: 68px;
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    padding-top: var(--navbar-height);
    background:
        radial-gradient(circle at top left, rgba(13, 110, 253, 0.14), transparent 30%),
        radial-gradient(circle at bottom right, rgba(255, 193, 7, 0.2), transparent 34%),
        linear-gradient(135deg, var(--app-bg-1), var(--app-bg-2));
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app-navbar {
    min-height: var(--navbar-height);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(14px);
}

.navbar-logo {
    width: 42px;
    height: 42px;
    object-fit: contain;
    border-radius: 12px;
    flex: 0 0 auto;
}

.navbar-title {
    font-size: .95rem;
    font-weight: 800;
    letter-spacing: .02em;
    color: #172033;
    line-height: 1.1;
}

.app-shell {
    min-height: 100vh;
}

.app-logo {
    display: grid;
    place-items: center;
    width: 76px;
    height: 76px;
    border-radius: 26px;
    background: #fff;
    font-size: 2.5rem;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.12);
}

.student-card {
    padding: 1.25rem;
    border-radius: 1.5rem;
    background: linear-gradient(135deg, rgba(13, 202, 240, 0.12), rgba(25, 135, 84, 0.12));
    border: 1px solid rgba(13, 110, 253, 0.12);
}

.student-photo,
.game-student-photo {
    object-fit: cover;
    background: #e9ecef;
    border: 4px solid #fff;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.16);
}

.student-photo {
    width: 112px;
    height: 112px;
    border-radius: 28px;
}

.game-student-photo {
    width: 54px;
    height: 54px;
    border-radius: 16px;
}

.student-meta {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
}

.game-screen {
    min-height: calc(100vh - var(--navbar-height));
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.game-topbar {
    z-index: 20;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    padding: .55rem .75rem;
    flex: 0 0 auto;
}

.game-content {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: .75rem;
    padding-bottom: .75rem;
}

.score-progress,
.timer-progress {
    height: 10px;
    border-radius: 999px;
}

.task-card {
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 1.5rem;
    padding: .8rem 1rem;
    margin-bottom: 0;
    flex: 0 0 auto;
}

.instruction-text {
    font-weight: 800;
    color: #172033;
    line-height: 1.2;
}

.play-area {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    border-radius: 1.5rem;
    border: 3px dashed rgba(13, 110, 253, 0.22);
    background:
        linear-gradient(rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.95)),
        radial-gradient(circle, rgba(13, 110, 253, 0.14) 1px, transparent 1px);
    background-size: auto, 28px 28px;
    user-select: none;
    touch-action: manipulation;
}

.scroll-hint {
    position: absolute;
    left: .75rem;
    bottom: .75rem;
    padding: .4rem .65rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, .86);
    color: #6c757d;
    font-size: .76rem;
    pointer-events: none;
}

.shape {
    position: absolute;
    display: grid;
    place-items: center;
    width: var(--shape-size, 86px);
    height: var(--shape-size, 86px);
    cursor: pointer;
    filter: drop-shadow(var(--shape-shadow));
    transition: transform .12s ease, filter .12s ease;
}

.shape:hover {
    transform: scale(1.08) rotate(2deg);
    filter: drop-shadow(0 16px 28px rgba(15, 23, 42, .25));
}

.shape:active {
    transform: scale(.96);
}

.shape-circle {
    border-radius: 50%;
}

.shape-square {
    border-radius: 18px;
}

.shape-rectangle {
    width: calc(var(--shape-size, 86px) * 1.35);
    border-radius: 18px;
}

.shape-triangle {
    width: 0;
    height: 0;
    background: transparent !important;
    border-left: calc(var(--shape-size, 86px) / 2) solid transparent;
    border-right: calc(var(--shape-size, 86px) / 2) solid transparent;
    border-bottom: var(--shape-size, 86px) solid var(--shape-color);
    filter: drop-shadow(0 12px 16px rgba(15, 23, 42, .22));
}

.shape-star {
    clip-path: polygon(50% 0%, 61% 34%, 98% 34%, 68% 55%, 79% 91%, 50% 70%, 21% 91%, 32% 55%, 2% 34%, 39% 34%);
}

.shape-label {
    pointer-events: none;
    color: rgba(255, 255, 255, .85);
    font-weight: 900;
    font-size: 1.1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, .28);
}

.shape-triangle .shape-label {
    display: none;
}

.feedback-message {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 50;
    padding: 1rem 1.5rem;
    border-radius: 999px;
    color: #fff;
    font-size: 1.4rem;
    font-weight: 900;
    box-shadow: 0 18px 40px rgba(15, 23, 42, .28);
}

.feedback-correct {
    background: #198754;
}

.feedback-wrong {
    background: #dc3545;
}

.result-emoji {
    font-size: 3.5rem;
}

.result-score {
    display: grid;
    place-items: center;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e7f1ff, #e8fff3);
    border: 8px solid #fff;
    box-shadow: 0 14px 34px rgba(15, 23, 42, .14);
    font-weight: 900;
    color: #0d6efd;
}

.result-score span {
    font-size: 3.4rem;
    line-height: 1;
}

.result-score small {
    color: #6c757d;
    font-size: 1rem;
}

@media (max-width: 768px) {
    :root {
        --navbar-height: 60px;
    }

    .navbar-title {
        font-size: .85rem;
    }

    .navbar-logo {
        width: 36px;
        height: 36px;
    }

    .instruction-text {
        font-size: 1.2rem;
    }

    .play-area {
        border-radius: 1rem;
    }

    .shape {
        --shape-size: 70px;
    }

    .task-card {
        padding: .7rem .85rem;
    }
}

.final-summary {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    text-align: center;
    padding: 2rem;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(120px, 1fr));
    gap: 1rem;
    max-width: 560px;
    margin: 1.5rem auto 0;
}

.summary-grid div {
    padding: 1rem;
    background: rgba(13, 110, 253, .08);
    border: 1px solid rgba(13, 110, 253, .12);
    border-radius: 1rem;
}

.summary-grid strong,
.summary-grid span {
    display: block;
}

.summary-grid span {
    margin-top: .35rem;
    font-size: 1.5rem;
    font-weight: 900;
    color: #0d6efd;
}

@media (max-width: 576px) {
    .summary-grid {
        grid-template-columns: 1fr;
    }

    .game-topbar {
        padding: .5rem .6rem;
    }
}
