
/* =========================
   MINDSHOT - COMPLETE STYLE
========================= */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg: #100b20;
    --panel: #21183b;
    --panel-light: #2b2050;
    --purple: #a897ff;
    --white: #ffffff;
    --muted: #c5bbdf;
    --green: #91f2be;
    --gold: #ffe28a;
    --blue: #8de8ff;
    --red: #ff8b9d;
}

body {
    min-height: 100vh;
    padding: 28px 16px;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--white);
    background:
        radial-gradient(ellipse at top, #38265f 0%, transparent 55%),
        var(--bg);
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

button:focus-visible,
input:focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: 3px;
}

[hidden] {
    display: none !important;
}

.container {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

/* =========================
   HEADERS AND TEXT
========================= */

header {
    text-align: center;
    margin-bottom: 32px;
}

.logo {
    font-size: 48px;
    margin-bottom: 8px;
    animation: target-float 2.5s ease-in-out infinite;
}

header h1 {
    font-size: clamp(36px, 8vw, 48px);
    letter-spacing: -1px;
    font-weight: 900;
}

header h1 span {
    color: var(--purple);
}

header p {
    color: var(--muted);
    margin-top: 8px;
}

.eyebrow {
    color: var(--purple);
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 2px;
    margin-bottom: 12px;
}

h2 {
    font-size: clamp(23px, 5vw, 30px);
    margin-bottom: 12px;
}

.description {
    color: var(--muted);
    line-height: 1.7;
    margin-bottom: 28px;
}

.section-heading {
    font-size: 16px;
    margin-bottom: 14px;
}

.center {
    text-align: center;
}

/* =========================
   DIFFICULTY CARDS
========================= */

.levels {
    display: grid;
    gap: 12px;
}

.level-card {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
    min-height: 78px;
    padding: 16px;
    border: 1px solid #ffffff18;
    border-radius: 16px;
    color: var(--white);
    background: var(--panel);
    text-align: left;
    transition:
        transform 0.2s ease,
        border-color 0.2s ease,
        background 0.2s ease;
}

.level-card:hover {
    transform: translateY(-3px);
    border-color: var(--purple);
    background: var(--panel-light);
}

.level-icon {
    font-size: 27px;
}

.level-info {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 6px;
}

.level-info strong {
    font-size: 17px;
}

.level-info small {
    color: var(--muted);
    font-size: 13px;
}

.arrow {
    font-size: 24px;
    color: var(--purple);
}

/* =========================
   BEST SCORES
========================= */

.best-box {
    margin-top: 28px;
    padding: 20px;
    border: 1px solid #ffffff16;
    border-radius: 18px;
    background: #1b1431;
}

.best-box h3 {
    margin-bottom: 16px;
    font-size: 17px;
}

.scores {
    display: grid;
    gap: 10px;
}

.score-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 10px;
    background: #ffffff08;
    color: var(--muted);
}

.score-item strong {
    color: var(--gold);
}

/* =========================
   GAME PAGE
========================= */

.back-button {
    display: inline-block;
    margin-bottom: 24px;
    padding: 10px 0;
    border: 0;
    background: transparent;
    color: var(--muted);
}

.back-button:hover {
    color: var(--white);
}

.game-header {
    margin-bottom: 24px;
}

.game-header .logo {
    font-size: 40px;
}

.game-header h1 {
    font-size: 38px;
}

.game-box {
    padding: clamp(20px, 5vw, 32px);
    border: 1px solid #ffffff1c;
    border-radius: 22px;
    background: var(--panel);
    box-shadow: 0 18px 60px #00000025;
}

.range {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 18px;
    margin: 22px 0;
    font-size: 45px;
    font-weight: 900;
}

.range-dash {
    color: var(--purple);
}

.instruction {
    margin-bottom: 24px;
    color: var(--muted);
    text-align: center;
    line-height: 1.7;
}

#guess-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#guess-form label {
    font-size: 14px;
    font-weight: bold;
}

#guess-input {
    width: 100%;
    min-height: 54px;
    padding: 14px;
    border: 1px solid #ffffff25;
    border-radius: 12px;
    color: var(--white);
    background: #130d25;
    font-size: 17px;
}

#guess-input::placeholder {
    color: #9388ac;
}

#guess-input:disabled {
    opacity: 0.6;
}

.shoot-button,
.secondary-button {
    width: 100%;
    min-height: 50px;
    padding: 13px 18px;
    border: 0;
    border-radius: 12px;
    font-weight: bold;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.shoot-button {
    color: #170e2d;
    background: linear-gradient(135deg, #c1b2ff, #9982ff);
}

.shoot-button:hover:not(:disabled) {
    transform: translateY(-2px);
}

.shoot-button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.secondary-button {
    border: 1px solid #ffffff25;
    color: var(--white);
    background: #ffffff0a;
}

.secondary-button:hover {
    background: #ffffff15;
}

#win-buttons {
    display: grid;
    gap: 12px;
    margin-top: 20px;
}

/* =========================
   FEEDBACK
========================= */

.feedback {
    margin-top: 22px;
    padding: 20px 14px;
    border: 1px solid #ffffff14;
    border-radius: 14px;
    background: #ffffff06;
    text-align: center;
}

#feedback-icon {
    margin-bottom: 8px;
    font-size: 28px;
}

#feedback-title {
    margin-bottom: 8px;
    font-size: 18px;
}

#feedback-text {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.7;
}

.feedback.hint {
    border-color: #8de8ff45;
}

.feedback.error {
    border-color: #ff8b9d65;
}

.feedback.win {
    border-color: #91f2be70;
}

.attempts {
    margin-top: 18px;
    color: var(--muted);
    text-align: center;
    font-size: 14px;
}

/* =========================
   WINNING POPUP
========================= */

#win-overlay[hidden] {
    display: none !important;
}

#win-overlay:not([hidden]) {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    padding: 20px;
    background: #090613eF;
    backdrop-filter: blur(8px);
    animation: overlay-fade 0.25s ease;
}

.win-modal {
    position: relative;
    width: 100%;
    max-width: 460px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    padding: 28px 24px;
    border: 1px solid #a897ff65;
    border-radius: 24px;
    color: var(--white);
    background:
        radial-gradient(ellipse at top, #45316b, transparent 65%),
        var(--panel);
    box-shadow: 0 25px 100px #00000070;
    text-align: center;
    animation: modal-pop 0.4s ease;
}

.win-trophy {
    font-size: 58px;
    margin-bottom: 12px;
    animation: trophy-bounce 1s ease-in-out infinite;
}

.win-modal h2 {
    color: var(--gold);
    font-size: 29px;
    margin-bottom: 16px;
}

.win-description {
    color: var(--muted);
    line-height: 1.8;
}

#won-number {
    color: var(--gold);
    font-size: 26px;
}

#win-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    margin: 22px 0;
}

.performance-rank {
    display: inline-block;
    padding: 11px 16px;
    border: 1px solid #a897ff50;
    border-radius: 30px;
    font-size: 14px;
    line-height: 1.6;
    font-weight: bold;
    background: #30245c;
    color: var(--white);
    animation: rank-pop 0.5s ease both;
}

.performance-rank.genius {
    border-color: #ffe28a80;
    background: #594313;
    color: var(--gold);
}

.performance-rank.sharp {
    border-color: #8de8ff80;
    background: #153f56;
    color: var(--blue);
}

.performance-rank.comeback {
    border-color: #91f2be80;
    background: #174832;
    color: var(--green);
}

.performance-quote {
    color: #e5e1ff;
    font-size: 14px;
    line-height: 1.8;
    text-align: center;
    overflow-wrap: anywhere;
}

.win-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 22px;
}

.win-actions button {
    width: 100%;
}

.win-footer {
    margin-top: 20px;
    color: var(--muted);
    font-size: 13px;
}

/* =========================
   FOOTER
========================= */

footer {
    padding: 28px 0 8px;
    color: var(--muted);
    text-align: center;
    font-size: 13px;
}

/* =========================
   ANIMATIONS
========================= */

@keyframes target-float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

@keyframes overlay-fade {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes modal-pop {
    from {
        opacity: 0;
        transform: scale(0.85) translateY(15px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes trophy-bounce {
    0%, 100% {
        transform: translateY(0) rotate(0);
    }
    50% {
        transform: translateY(-7px) rotate(5deg);
    }
}

@keyframes rank-pop {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* =========================
   MOBILE RESPONSIVE
========================= */

@media (max-width: 420px) {
    body {
        padding: 20px 12px;
    }

    .game-box {
        padding: 20px 15px;
    }

    .range {
        font-size: 38px;
    }

    .win-modal {
        padding: 24px 17px;
    }

    .win-modal h2 {
        font-size: 25px;
    }

    .performance-rank {
        font-size: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
    }
}
