/* ================= RESET ================= */
* {
    box-sizing: border-box;
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
}

/* ================= HEADINGS ================= */
h1 {
    text-align: center;
    margin: 10px 0;
}

/* ================= LAYOUT ================= */
.wrapper {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 20px;
    border-radius: 22px;
}

.side-panel {
    padding: 15px;
    border-radius: 14px;
    width: 180px;
}

.side-panel h2 {
    margin-bottom: 10px;
}

.game-container {
    padding: 20px;
    border-radius: 14px;
    width: 420px;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

/* ================= BUTTONS ================= */
.shape-btn,
.duration-btn,
.controls button,
.action-btn {
    width: 100%;
    padding: 10px;
    margin: 8px 0;
    font-size: 18px;
    border-radius: 10px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: 0.2s ease;
}

.shape-btn.active {
    box-shadow: 0 0 10px currentColor;
}

.locked {
    cursor: not-allowed;
}

/* ================= GAME AREA ================= */
#gameArea {
    width: 100%;
    height: 300px;
    border-radius: 14px;
    position: relative;
    overflow: hidden;
}

/* ================= TARGET ================= */
.target {
    position: absolute;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;

}

/* HIT / BOUNCE EFFECT */
.hit-effect {
    animation: bounce 0.15s;
}

@keyframes bounce {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.3);
    }

    100% {
        transform: scale(1);
    }
}

/* MISS SHAKE */
/* STRONG VIBRATION EFFECT */
.shake {
    animation: vibrate 0.4s linear;
}

@keyframes vibrate {
    0% {
        transform: translate(0);
    }

    10% {
        transform: translate(-4px, 4px);
    }

    20% {
        transform: translate(-4px, -4px);
    }

    30% {
        transform: translate(4px, 4px);
    }

    40% {
        transform: translate(4px, -4px);
    }

    50% {
        transform: translate(-3px, 3px);
    }

    60% {
        transform: translate(-3px, -3px);
    }

    70% {
        transform: translate(3px, 3px);
    }

    80% {
        transform: translate(3px, -3px);
    }

    90% {
        transform: translate(-2px, 2px);
    }

    100% {
        transform: translate(0);
    }
}


/* ================= HIGHSCORE LEFT ================= */
#highscoreDisplayLeft {
    margin-top: 10px;
    padding: 8px;
    border-radius: 8px;
    text-align: center;
    display: none;
    background: rgba(255, 159, 28, 0.8);
    /* orange highlight */
    color: #fff;
    font-weight: bold;
}

/* ===================== DARK MODE ===================== */
body.dark-mode {
    background: linear-gradient(135deg, #000000 0%, #C2B280 100%);
    color: #f5f5f5;
}

.dark-mode h1 {
    color: #ff9f1c;
}

.dark-mode .side-panel,
.dark-mode .game-container {
    background: #1a1a1a;
}

.dark-mode .side-panel h2 {
    color: #ff9f1c;
}

.dark-mode .shape-btn,
.dark-mode .duration-btn,
.dark-mode .controls button,
.dark-mode .action-btn {
    background: #111;
    color: #ff9f1c;
    border-color: #333;
}

.dark-mode #gameArea {
    background: #0f0f0f;
}

.dark-mode .target {
    background: #ff9f1c;
}

/* ===================== LIGHT MODE ===================== */
body.light-mode {
    min-height: 100vh;
    padding: 40px;
    background: linear-gradient(135deg, #eb9864 0%, #E5E4DE 100%);
    color: #1E4D4D;
}

.light-mode h1 {
    color: #1E4D4D;
}

.light-mode .wrapper {
    background: rgba(255, 255, 255, 0.35);
}

.light-mode .side-panel {
    background: #D4D9DD;
    color: #1E4D4D;
}

.light-mode .side-panel h2 {
    color: #AA7744;
}

.light-mode .game-container {
    background: #DEE3E6;
}

.light-mode #gameArea {
    background: #F1F3F4;
    border: 2px solid #C4CBD1;
}

.light-mode .shape-btn,
.light-mode .duration-btn,
.light-mode .controls button,
.light-mode .action-btn {
    background: #AA7744;
    /* wood-brown */
    color: #FFFFFF;
    border-color: #8B5E3C;
}

.light-mode .shape-btn.locked {
    background: #C9D1D6;
    color: #111111;
    border-color: #9EA8AE;
}

.light-mode .target {
    background: #7F4C25;
}

/* ================== TOGGLE + HIGHSCORE BUTTON COLORS ================== */

/* Dark mode */
body.dark-mode #themeToggle,
body.dark-mode #highscoreBtn {
    background-color: #ff9f1c !important;
    /* bright orange */
    color: #0b0b0b !important;
    border-color: #ffa500 !important;
}

/* Light mode */
body.light-mode #themeToggle,
body.light-mode #highscoreBtn {
    background-color: #D2A679 !important;
    /* wood-brown */
    color: #fff !important;
    border-color: #A67C52 !important;
}

/* ================== RESPONSIVE BEHAVIOUR ================== */

/* small phones */
@media (max-width: 480px) {

    body {
        padding: 10px;
    }

    h1 {
        font-size: 1.5rem;
        text-align: center;
    }

    .container {
        flex-direction: column;
        gap: 15px;
    }

    .left-panel,
    .right-panel {
        width: 100%;
        padding: 12px;
    }

    #gameArea {
        width: 100%;
        height: 280px;
    }

    button {
        width: 100%;
        font-size: 0.9rem;
        padding: 10px;
    }

    .stats p {
        font-size: 0.9rem;
    }
}

/* medium devices */
@media (max-width: 768px) {

    h1 {
        font-size: 1.8rem;
    }

    .container {
        gap: 20px;
    }

    .left-panel,
    .right-panel {
        padding: 15px;
    }

    #gameArea {
        height: 350px;
    }

    button {
        font-size: 1rem;
    }
}

/* small laptops */
@media (max-width: 1024px) {

    .container {
        max-width: 95%;
    }

    #gameArea {
        height: 400px;
    }
}
