* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --green: #69a84f;
    --green-dark: #3e7d35;

    --blue: #2d7ff9;

    --yellow: #ffd84d;

    --red: #ef5350;

    --white: #ffffff;

    --dark: #18231a;

    --muted: #687268;
}

body {
    min-height: 100vh;

    font-family:
        Arial,
        Helvetica,
        sans-serif;

    background: #eef3eb;

    color: var(--dark);
}


/* =========================
   APP
========================= */

.app {
    min-height: 100vh;
}


/* =========================
   TOP BAR
========================= */

.topbar {
    height: 68px;

    padding: 0 4%;

    display: flex;
    align-items: center;
    justify-content: space-between;

    background: white;

    border-bottom:
        1px solid #dce6d7;
}

.back-button {
    text-decoration: none;

    color: var(--green-dark);

    font-weight: 800;
}

.brand {
    font-size: 22px;
    font-weight: 900;
}

.brand span {
    color: var(--green);
}

.settings-button {
    padding: 10px 15px;

    border: 0;
    border-radius: 10px;

    background: #edf6e9;

    color: var(--green-dark);

    font-weight: 800;

    cursor: pointer;
}


/* =========================
   INFORMATION
========================= */

.information-bar {
    max-width: 1100px;

    margin: 16px auto;

    padding: 0 15px;

    display: grid;

    grid-template-columns:
        repeat(4, 1fr);

    gap: 10px;
}

.information-box {
    padding: 10px 15px;

    background: white;

    border-radius: 12px;

    border:
        1px solid #dfe8db;

    display: flex;
    align-items: center;
    justify-content: space-between;
}

.information-box span {
    font-size: 13px;

    color: var(--muted);

    font-weight: 700;
}

.information-box strong {
    font-size: 20px;
}


/* =========================
   GAME AREA
========================= */

.game-area {
    position: relative;

    width: calc(100% - 30px);

    max-width: 1200px;

    height: 680px;

    margin: auto;

    overflow: hidden;

    border-radius: 22px;

    background:
        linear-gradient(
            rgba(0, 0, 0, 0.08),
            rgba(0, 0, 0, 0.08)
        ),
        #dcebd6;

    box-shadow:
        0 15px 40px
        rgba(35, 60, 30, 0.15);
}


/* =========================
   CAMERA
========================= */

#camera {
    position: absolute;

    inset: 0;

    width: 100%;
    height: 100%;

    object-fit: cover;

    transform: scaleX(-1);

    z-index: 1;

    background: #18231a;
}


/* =========================
   HAND CANVAS
========================= */

#hand-canvas {
    position: absolute;

    inset: 0;

    width: 100%;
    height: 100%;

    z-index: 20;

    pointer-events: none;
}


/* =========================
   START SCREEN
========================= */

.start-screen {
    position: absolute;

    inset: 0;

    z-index: 50;

    display: grid;

    place-items: center;

    padding: 20px;

    background:
        linear-gradient(
            135deg,
            rgba(241, 249, 237, 0.97),
            rgba(255, 249, 220, 0.96)
        );
}

.start-screen.hidden {
    display: none;
}

.start-card {
    width: min(650px, 95%);

    text-align: center;
}

.target-logo {
    font-size: 70px;

    margin-bottom: 10px;
}

.start-card h1 {
    font-size: 50px;

    margin-bottom: 15px;
}

.start-card h1 span {
    color: var(--green);
}

.start-card > p {
    max-width: 600px;

    margin:
        0 auto 25px;

    line-height: 1.6;

    color: var(--muted);
}

.instructions {
    display: grid;

    grid-template-columns:
        repeat(3, 1fr);

    gap: 10px;

    margin-bottom: 25px;
}

.instructions div {
    padding: 18px 10px;

    border-radius: 14px;

    background: white;

    display: flex;

    flex-direction: column;

    gap: 8px;

    font-size: 30px;
}

.instructions span {
    font-size: 13px;

    font-weight: 800;
}

.start-button {
    border: 0;

    padding: 15px 25px;

    border-radius: 13px;

    background: var(--green);

    color: white;

    font-size: 16px;

    font-weight: 900;

    cursor: pointer;

    box-shadow:
        0 8px 18px
        rgba(60, 120, 50, 0.25);
}

.start-button:hover {
    background: var(--green-dark);
}

.camera-note {
    margin-top: 15px !important;

    font-size: 12px !important;
}


/* =========================
   QUESTION
========================= */

.question-panel {
    position: absolute;

    top: 20px;
    left: 50%;

    transform:
        translateX(-50%);

    z-index: 30;

    width:
        min(650px, 80%);

    padding: 15px 20px;

    text-align: center;

    background:
        rgba(255,255,255,0.94);

    border-radius: 15px;

    box-shadow:
        0 8px 25px
        rgba(0,0,0,0.15);
}

.question-label {
    display: block;

    margin-bottom: 5px;

    font-size: 11px;

    font-weight: 900;

    letter-spacing: 1px;

    color: var(--green-dark);
}

#clue {
    font-size: 22px;

    font-weight: 900;
}


/* =========================
   TARGETS
========================= */

.targets {
    position: absolute;

    inset:
        115px 40px 70px;

    z-index: 10;

  pointer-events: auto;
}

.word-target {
    position: absolute;

    min-width: 145px;

    padding: 17px 22px;

    text-align: center;

    border-radius: 50px;

    background:
        rgba(255,255,255,0.93);

    border:
        4px solid var(--yellow);

    box-shadow:
        0 7px 18px
        rgba(0,0,0,0.18);

    font-size: 19px;

    font-weight: 900;

    transition:
        transform .15s,
        background .15s;

    user-select: none;
    pointer-events: auto;
cursor: crosshair;
}

.word-target.aimed {
    transform: scale(1.12);

    background: #fff5bb;

    border-color: #ffb300;
}

.word-target.correct {
    background: #dff6d5;

    border-color: #4caf50;

    animation:
        explode .35s ease forwards;
}

.word-target.wrong {
    background: #ffd9d9;

    border-color: #ef5350;

    animation:
        shake .3s;
}


/* =========================
   AIM CURSOR
========================= */

.aim-cursor {
    position: absolute;

    width: 55px;
    height: 55px;

    border:
        3px solid #ff3434;

    border-radius: 50%;

    z-index: 40;

    pointer-events: none;

    transform:
        translate(-50%, -50%);

    display: none;

    box-shadow:
        0 0 15px
        rgba(255, 0, 0, .45);
}

.cross-horizontal,
.cross-vertical {
    position: absolute;

    background: #ff3434;

    left: 50%;
    top: 50%;

    transform:
        translate(-50%, -50%);
}

.cross-horizontal {
    width: 70px;

    height: 2px;
}

.cross-vertical {
    width: 2px;

    height: 70px;
}

.cross-dot {
    position: absolute;

    width: 8px;
    height: 8px;

    background: red;

    border-radius: 50%;

    left: 50%;
    top: 50%;

    transform:
        translate(-50%, -50%);
}


/* =========================
   SHOOT EFFECT
========================= */

.shoot-effect {
    position: absolute;

    z-index: 60;

    font-size: 55px;

    pointer-events: none;

    display: none;

    transform:
        translate(-50%, -50%);
}


/* =========================
   FEEDBACK
========================= */

.feedback {
    position: absolute;

    left: 50%;
    bottom: 25px;

    transform:
        translateX(-50%);

    z-index: 45;

    padding: 10px 20px;

    border-radius: 30px;

    background:
        rgba(20,30,20,.82);

    color: white;

    font-weight: 900;

    opacity: 0;

    transition:
        opacity .2s;
}

.feedback.show {
    opacity: 1;
}


/* =========================
   CAMERA STATUS
========================= */

.camera-status {
    position: absolute;

    left: 18px;
    bottom: 18px;

    z-index: 35;

    padding: 8px 12px;

    border-radius: 20px;

    background:
        rgba(0,0,0,.55);

    color: white;

    font-size: 12px;

    font-weight: 800;
}

.status-dot {
    display:
        inline-block;

    width: 8px;
    height: 8px;

    margin-right: 5px;

    border-radius: 50%;

    background: #ef5350;
}

.camera-status.active .status-dot {
    background: #69d35c;
}


/* =========================
   CONTROLS
========================= */

.controls {
    max-width: 1200px;

    margin:
        15px auto 30px;

    padding: 0 15px;

    display: flex;

    justify-content: center;

    gap: 10px;
}

.control-button {
    padding: 11px 16px;

    border: 0;

    border-radius: 10px;

    background: white;

    color: var(--dark);

    font-weight: 800;

    cursor: pointer;

    box-shadow:
        0 4px 12px
        rgba(0,0,0,.08);
}

.restart {
    background: #edf6e9;

    color: var(--green-dark);
}


/* =========================
   SETTINGS DIALOG
========================= */

.settings-dialog {
    width:
        min(850px, 94%);

    max-height: 90vh;

    margin: auto;

    padding: 0;

    border: 0;

    border-radius: 20px;

    background: white;

    box-shadow:
        0 25px 80px
        rgba(0,0,0,.35);

    overflow: auto;
}

.settings-dialog::backdrop {
    background:
        rgba(15,25,15,.60);

    backdrop-filter:
        blur(4px);
}

.settings-header {
    padding: 22px;

    display: flex;

    align-items: center;

    justify-content:
        space-between;

    border-bottom:
        1px solid #e5eadf;
}

.teacher-label {
    font-size: 11px;

    font-weight: 900;

    letter-spacing: 1px;

    color: var(--green);
}

.settings-header h2 {
    margin-top: 4px;
}

.close-button {
    width: 40px;
    height: 40px;

    border: 0;

    border-radius: 50%;

    background: #f0f2ee;

    font-size: 24px;

    cursor: pointer;
}

.settings-description {
    padding:
        18px 22px 0;

    color: var(--muted);

    line-height: 1.5;
}


/* =========================
   ADD WORD
========================= */

.add-word-box {
    margin: 20px;

    padding: 18px;

    border-radius: 15px;

    background: #f4f9f1;
}

.add-word-box h3 {
    margin-bottom: 15px;
}

.add-form {
    display: grid;

    grid-template-columns:
        1fr 1.5fr auto;

    gap: 10px;

    align-items: end;
}

.add-form label {
    font-size: 12px;

    font-weight: 800;
}

.add-form input {
    width: 100%;

    margin-top: 6px;

    padding: 11px;

    border:
        1px solid #ccd8c7;

    border-radius: 9px;

    outline: none;
}

.add-form input:focus {
    border-color:
        var(--green);
}

#add-word-button {
    padding: 12px 16px;

    border: 0;

    border-radius: 9px;

    background:
        var(--green);

    color: white;

    font-weight: 900;

    cursor: pointer;
}


/* =========================
   WORD EDITOR
========================= */

.word-list-section {
    padding:
        0 20px 20px;
}

.word-list-heading {
    display: flex;

    align-items: center;

    justify-content:
        space-between;

    margin-bottom: 12px;
}

#word-count {
    padding: 6px 10px;

    border-radius: 20px;

    background: #edf6e9;

    color: var(--green-dark);

    font-size: 12px;

    font-weight: 800;
}

.word-row {
    display: grid;

    grid-template-columns:
        1fr 2fr auto;

    gap: 8px;

    margin-bottom: 8px;

    padding: 9px;

    border-radius: 10px;

    background: #f7f8f6;
}

.word-row input {
    width: 100%;

    padding: 9px;

    border:
        1px solid #d5ddd1;

    border-radius: 8px;
}

.delete-word {
    width: 38px;

    border: 0;

    border-radius: 8px;

    background: #ffe4e4;

    color: #c62828;

    font-size: 17px;

    cursor: pointer;
}


/* =========================
   SETTINGS FOOTER
========================= */

.settings-footer {
    padding: 18px 20px;

    display: flex;

    justify-content:
        space-between;

    gap: 10px;

    border-top:
        1px solid #e5eadf;
}

.reset-button,
.save-button {
    padding: 11px 16px;

    border: 0;

    border-radius: 9px;

    font-weight: 800;

    cursor: pointer;
}

.reset-button {
    background: #f1f2ef;
}

.save-button {
    background:
        var(--green);

    color: white;
}


/* =========================
   ANIMATIONS
========================= */

@keyframes explode {

    100% {
        transform:
            scale(1.7);

        opacity: 0;
    }

}

@keyframes shake {

    25% {
        transform:
            translateX(-7px);
    }

    50% {
        transform:
            translateX(7px);
    }

    75% {
        transform:
            translateX(-5px);
    }

}


/* =========================
   RESPONSIVE
========================= */

@media(max-width:700px) {

    .information-bar {
        grid-template-columns:
            repeat(2,1fr);
    }

    .game-area {
        height: 620px;
    }

    .add-form {
        grid-template-columns:
            1fr;
    }

    .word-row {
        grid-template-columns:
            1fr;
    }

    .instructions {
        grid-template-columns:
            1fr;
    }

    .start-card h1 {
        font-size: 38px;
    }

    .settings-button {
        font-size: 0;
    }

    .settings-button::before {
        content: "⚙";

        font-size: 20px;
    }

}