/* Custom Styles for Game-Based Assessment - Dart Target Edition */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    --brand-primary: #086FB2;
    --brand-accent: #00ACED;
}

body {
    font-family: var(--font-sans);
    background-color: #f8fafc;
    color: #1e293b;
}

/* Light Glassmorphism panel styling */
.glass-panel {
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(226, 232, 240, 0.9);
    box-shadow: 0 20px 40px -15px rgba(8, 111, 178, 0.08), 0 0 1px 1px rgba(8, 111, 178, 0.04);
}

.glass-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px -2px rgba(0, 0, 0, 0.02);
}

/* Brand gradient text using #086FB2 and #00ACED */
.gradient-text {
    background: linear-gradient(135deg, #086FB2 0%, #00ACED 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Arena Shooting Range Styling */
.arena-box {
    position: relative;
    width: 100%;
    height: 380px;
    background: radial-gradient(circle at 50% 100%, #eff6ff 0%, #f8fafc 80%);
    border: 2px dashed rgba(8, 111, 178, 0.25);
    border-radius: 1.25rem;
    overflow: hidden;
    cursor: crosshair;
    user-select: none;
    -webkit-user-select: none;
}

/* Subtle range grid marks */
.arena-box::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: 
        radial-gradient(circle at 50% 100%, rgba(8, 111, 178, 0.08) 120px, transparent 121px),
        radial-gradient(circle at 50% 100%, rgba(8, 111, 178, 0.06) 240px, transparent 241px),
        radial-gradient(circle at 50% 100%, rgba(8, 111, 178, 0.04) 340px, transparent 341px);
    pointer-events: none;
}

/* Target Bubble Card moving horizontally */
.target-bubble {
    position: absolute;
    will-change: transform;
    border-radius: 9999px;
    background: #ffffff;
    border: 2px solid #cbd5e1;
    box-shadow: 0 8px 20px -4px rgba(8, 111, 178, 0.12), 0 2px 4px rgba(0, 0, 0, 0.04);
    top: 0;
    left: 0;
    display: flex;
    align-items: center;
    padding: 0.5rem 0.875rem;   /* same as Tailwind py-2 px-3.5 */
    max-width: 280px;
    overflow: hidden;
    white-space: nowrap;
    /* transform is animated per-frame in JS, so it must NOT be transitioned here */
    transition: border-color 0.15s ease, background-color 0.15s ease;
    cursor: pointer;
    z-index: 10;
}

@media (min-width: 640px) {
    .target-bubble { max-width: 340px; }
}

/* Same as Tailwind space-x-2.5, declared here so the first render doesn't wait for the Tailwind CDN */
.target-bubble > * + * {
    margin-left: 0.625rem;
}

.target-letter {
    width: 1.75rem;
    height: 1.75rem;
    flex-shrink: 0;
}

/* Briefly ignore the pointer after a question loads (prevents stray hover/click on option cards) */
.arena-box.arming .target-bubble {
    pointer-events: none;
}

.target-bubble:hover {
    border-color: #00ACED;
    box-shadow: 0 10px 25px -4px rgba(0, 172, 237, 0.35);
}

.target-bubble.correct-hit {
    border-color: #10b981 !important;
    background-color: #ecfdf5 !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.4), 0 10px 25px rgba(16, 185, 129, 0.25) !important;
}

.target-bubble.wrong-hit {
    border-color: #ef4444 !important;
    background-color: #fef2f2 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.4), 0 10px 25px rgba(239, 68, 68, 0.25) !important;
}

.target-bubble.reveal-correct {
    border-color: #10b981 !important;
    background-color: #f0fdf4 !important;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.5) !important;
}

.target-bubble.selected-hit {
    border-color: #086FB2 !important;
    background-color: #f0f9ff !important;
    box-shadow: 0 0 0 3px rgba(8, 111, 178, 0.35), 0 10px 25px rgba(8, 111, 178, 0.18) !important;
}

.target-bubble.selected-hit .target-letter {
    background-color: #086FB2 !important;
    color: #ffffff !important;
    border-color: #086FB2 !important;
}

/* Dart Projectile */
.dart-element {
    position: absolute;
    width: 14px;
    height: 38px;
    pointer-events: none;
    z-index: 25;
    transform-origin: center center;
    filter: drop-shadow(0 4px 6px rgba(8, 111, 178, 0.3));
}

/* 2D Player Character at Bottom Center */
.player-character {
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 82px;
    z-index: 20;
    pointer-events: none;
    user-select: none;
}

.player-body {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 4px 8px rgba(8, 111, 178, 0.25));
}

.player-arm-pivot {
    position: absolute;
    bottom: 34px;
    left: 20px;
    width: 20px;
    height: 50px;
    transform-origin: 10px 38px;
    z-index: 22;
    transition: transform 0.04s ease-out;
}

.player-arm-pivot svg {
    width: 100%;
    height: 100%;
    transform-origin: 10px 38px;
    transition: transform 0.08s ease-out;
}

.player-arm-pivot.throw-recoil svg {
    transform: translateY(-5px) scale(1.12);
}

/* Reticle / Crosshair indicator */
.arena-crosshair {
    display: none; /* shown by JS on mouseenter */
    position: absolute;
    width: 24px;
    height: 24px;
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: 30;
    opacity: 0.8;
}

/* Impact Sparkle / Particle */
.impact-particle {
    position: absolute;
    pointer-events: none;
    border-radius: 50%;
    z-index: 28;
    animation: particleFade 0.6s ease-out forwards;
}

@keyframes particleFade {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(var(--tx), var(--ty)) scale(0);
    }
}

/* Shake animation for missed dart or wrong target */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

.shake {
    animation: shake 0.4s ease-in-out;
}

.score-penalty {
    color: #ef4444 !important;
    animation: shake 0.4s ease-in-out;
}

/* Pop/Pulse animation for score updates */
@keyframes pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

.pop {
    animation: pop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Fade in smooth entrance */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeInUp 0.35s ease forwards;
}

/* Progress bar glowing transition */
.progress-fill {
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Custom Scrollbar for review modal */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}