/* ==========================================================================
   Frikik Pro 3D - Modern Style Sheets
   ========================================================================== */

:root {
    --bg-dark: #0b0f19;
    --card-bg: rgba(15, 23, 42, 0.45);
    --card-border: rgba(255, 255, 255, 0.08);
    --glow-color: rgba(59, 130, 246, 0.5);
    --glow-alert: rgba(239, 68, 68, 0.5);
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --success: #10b981;
    --error: #ef4444;
    --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-user-select: none;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: var(--bg-dark);
    font-family: var(--font-family);
    color: var(--text-main);
}

/* 3D Canvas */
#canvas-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Swipe Trail Canvas */
#swipe-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

/* Glassmorphism General Style */
.glass {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* Overlay Screen General */
.overlay-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    background: rgba(8, 12, 22, 0.7);
    transition: opacity 0.5s ease, visibility 0.5s;
    opacity: 1;
    visibility: visible;
}

.overlay-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Menu Card */
.menu-card {
    width: 90%;
    max-width: 480px;
    padding: 2.5rem;
    border-radius: 24px;
    text-align: center;
    transform: translateY(0);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.overlay-screen.hidden .menu-card {
    transform: translateY(40px);
}

/* Logo & Title */
.logo-container {
    margin-bottom: 1.5rem;
}

.glow-logo {
    width: 72px;
    height: 72px;
    margin: 0 auto 1rem;
    background: radial-gradient(circle, var(--primary) 0%, rgba(59, 130, 246, 0.1) 70%);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2.2rem;
    color: var(--text-main);
    box-shadow: 0 0 20px 2px var(--glow-color);
    animation: pulseGlow 2.5s infinite alternate;
}

.alert-glow {
    background: radial-gradient(circle, var(--error) 0%, rgba(239, 68, 68, 0.1) 70%);
    box-shadow: 0 0 20px 2px var(--glow-alert);
}

h1 {
    font-size: 2.4rem;
    font-weight: 800;
    letter-spacing: 2px;
    color: var(--text-main);
}

h1 span {
    font-weight: 300;
    color: var(--primary);
    margin-left: 6px;
}

.subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    letter-spacing: 1px;
}

/* High Score Box */
.high-score-display {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.2);
    padding: 0.6rem 1.2rem;
    border-radius: 50px;
    color: #fbbf24;
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 15px rgba(251, 191, 36, 0.05);
}

.high-score-display i {
    animation: rotateTrophy 4s infinite linear;
}

/* Settings Options */
.settings-group {
    margin-bottom: 2rem;
    text-align: left;
}

.settings-group h3 {
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    padding-left: 4px;
}

/* Mode Selector buttons */
.mode-selector {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.mode-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    padding: 0.85rem 1.2rem;
    color: var(--text-main);
    cursor: pointer;
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 12px;
    text-align: left;
    transition: all 0.25s ease;
}

.mode-btn i {
    font-size: 1.3rem;
    color: var(--text-muted);
    transition: color 0.25s ease;
}

.mode-btn span {
    font-size: 0.95rem;
    font-weight: 600;
}

.mode-btn small {
    grid-column: 2;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.mode-btn:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.15);
}

.mode-btn.active {
    background: rgba(59, 130, 246, 0.12);
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.15);
}

.mode-btn.active i {
    color: var(--primary);
}

/* Difficulty Selector buttons */
.difficulty-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.diff-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 0.7rem 0.5rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.diff-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.07);
}

.diff-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--text-main);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.35);
}

/* Play Button */
.play-btn-main {
    width: 100%;
    background: linear-gradient(135deg, var(--primary) 0%, #1d4ed8 100%);
    border: none;
    border-radius: 16px;
    padding: 1.1rem;
    color: white;
    font-family: var(--font-family);
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}

.play-btn-main::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    transform: rotate(45deg);
    transition: 0.5s;
    opacity: 0;
}

.play-btn-main:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.5);
    background: linear-gradient(135deg, #4f46e5 0%, var(--primary-hover) 100%);
}

.play-btn-main:hover::after {
    left: 120%;
    opacity: 1;
}

.play-btn-main:active {
    transform: translateY(1px);
}

/* HUD Styling */
#hud {
    position: absolute;
    top: 20px;
    left: 5%;
    width: 90%;
    display: grid;
    grid-template-columns: 120px 1fr 120px;
    align-items: center;
    z-index: 5;
    pointer-events: none;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

#hud.hud-hidden {
    opacity: 0;
    transform: translateY(-20px);
    pointer-events: none;
}

.hud-item {
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 0.6rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.hud-label {
    font-size: 0.65rem;
    font-weight: 800;
    color: var(--text-muted);
    letter-spacing: 1.5px;
    margin-bottom: 2px;
}

.hud-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-main);
}

/* HUD Center - Wind & Multiplier */
.center-stats {
    background: transparent;
    border: none;
    backdrop-filter: none;
    box-shadow: none;
    flex-direction: row;
    justify-content: center;
    gap: 15px;
    padding: 0;
    pointer-events: none;
}

#wind-container {
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 0.5rem 1.2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: auto;
}

.wind-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
}

.wind-arrow {
    font-size: 0.95rem;
    color: var(--primary);
    transform-origin: center;
    transition: transform 0.5s ease;
}

.wind-speed {
    font-size: 0.95rem;
    font-weight: 600;
}

#multiplier-container {
    display: flex;
    align-items: center;
}

.multiplier-tag {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border-radius: 12px;
    padding: 0.5rem 1rem;
    font-size: 1.1rem;
    font-weight: 800;
    color: white;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
    animation: pulseMultiplier 1.5s infinite alternate;
    pointer-events: auto;
}

/* Life Counters */
.lives-icons {
    display: flex;
    gap: 6px;
    margin-top: 6px;
}

.ball-life {
    color: var(--success);
    font-size: 0.9rem;
    filter: drop-shadow(0 0 5px rgba(16, 185, 129, 0.4));
    transition: color 0.3s ease, transform 0.3s ease;
}

.ball-life.lost {
    color: rgba(255, 255, 255, 0.15);
    filter: none;
    transform: scale(0.85);
}

.hidden {
    display: none !important;
}

/* Top corner controls */
.top-controls {
    position: absolute;
    top: 75px;
    right: 0;
    display: flex;
    gap: 8px;
    pointer-events: auto;
}

.control-btn {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    color: var(--text-main);
    width: 42px;
    height: 42px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1rem;
    transition: all 0.2s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.control-btn:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: var(--primary);
    transform: scale(1.05);
}

.control-btn:active {
    transform: scale(0.95);
}

/* Feedback Notification Overlay */
#feedback-overlay {
    position: absolute;
    top: 25%;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    pointer-events: none;
    z-index: 4;
}

#feedback-text {
    font-size: 4rem;
    font-weight: 900;
    letter-spacing: 4px;
    text-shadow: 0 0 30px rgba(0, 0, 0, 0.8), 0 5px 15px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transform: scale(0.3);
    transition: none;
    pointer-events: none;
}

.feedback-goal {
    color: #34d399; /* Green */
    animation: scalePopGoal 1.5s cubic-bezier(0.175, 0.885, 0.32, 1.5) forwards;
}

.feedback-save {
    color: #fb7185; /* Coral red */
    animation: scalePopSave 1.5s cubic-bezier(0.175, 0.885, 0.32, 1.5) forwards;
}

.feedback-out {
    color: #fcd34d; /* Amber yellow */
    animation: scalePopOut 1.5s cubic-bezier(0.175, 0.885, 0.32, 1.5) forwards;
}

/* Swipe Indicator Hint */
#swipe-overlay {
    position: absolute;
    bottom: 40px;
    left: 5%;
    width: 90%;
    display: flex;
    justify-content: center;
    pointer-events: none;
    z-index: 3;
    opacity: 1;
    transition: opacity 0.5s ease;
}

#swipe-overlay.fade-out {
    opacity: 0;
}

.swipe-hint {
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(8px);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 0.9rem 1.8rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.animated-arrow {
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 6px;
    animation: bounceArrow 1.2s infinite ease-in-out;
}

.swipe-hint span {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.swipe-hint small {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Game Over Score details */
.score-summary {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--card-border);
    border-radius: 18px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.summary-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 1.2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.summary-item span:first-child {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.summary-val {
    font-size: 2.8rem;
    font-weight: 800;
}

.summary-val.highlight {
    color: #fbbf24;
    text-shadow: 0 0 20px rgba(251, 191, 36, 0.3);
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.summary-sub-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 10px;
    padding: 0.6rem;
}

.summary-sub-item span:first-child {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.summary-sub-item span:last-child {
    font-size: 1.1rem;
    font-weight: 700;
}

.new-record-box {
    margin-bottom: 1.5rem;
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.animated-star {
    animation: spinStar 3s infinite linear;
}

.game-over-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.secondary-btn {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 1rem;
    color: var(--text-main);
    font-family: var(--font-family);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.secondary-btn:active {
    transform: translateY(1px);
}

/* Animations */
@keyframes pulseGlow {
    0% {
        box-shadow: 0 0 15px 1px var(--glow-color);
    }
    100% {
        box-shadow: 0 0 25px 5px var(--glow-color);
    }
}

@keyframes rotateTrophy {
    0%, 90% {
        transform: rotateY(0deg);
    }
    100% {
        transform: rotateY(360deg);
    }
}

@keyframes spinStar {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes pulseMultiplier {
    0% {
        transform: scale(1);
    }
    100% {
        transform: scale(1.08);
        box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5);
    }
}

@keyframes bounceArrow {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
}

@keyframes scalePopGoal {
    0% {
        opacity: 0;
        transform: scale(0.3) rotate(-10deg);
        filter: blur(10px);
    }
    15% {
        opacity: 1;
        transform: scale(1.2) rotate(5deg);
        filter: blur(0);
    }
    20% {
        transform: scale(1) rotate(0deg);
    }
    80% {
        opacity: 1;
        transform: scale(1) translateY(0);
        filter: blur(0);
    }
    100% {
        opacity: 0;
        transform: scale(0.8) translateY(-40px);
        filter: blur(5px);
    }
}

@keyframes scalePopSave {
    0% {
        opacity: 0;
        transform: scale(0.3) rotate(10deg);
        filter: blur(10px);
    }
    15% {
        opacity: 1;
        transform: scale(1.1) rotate(-5deg);
        filter: blur(0);
    }
    20% {
        transform: scale(1) rotate(0deg);
    }
    80% {
        opacity: 1;
        transform: scale(1) translateY(0);
        filter: blur(0);
    }
    100% {
        opacity: 0;
        transform: scale(0.8) translateY(-40px);
        filter: blur(5px);
    }
}

@keyframes scalePopOut {
    0% {
        opacity: 0;
        transform: scale(0.3);
        filter: blur(10px);
    }
    15% {
        opacity: 1;
        transform: scale(1.1);
        filter: blur(0);
    }
    20% {
        transform: scale(1);
    }
    80% {
        opacity: 1;
        transform: scale(1) translateY(0);
        filter: blur(0);
    }
    100% {
        opacity: 0;
        transform: scale(0.8) translateY(-40px);
        filter: blur(5px);
    }
}

/* Mobile Responsiveness styling */
@media (max-width: 580px) {
    .menu-card {
        padding: 1.8rem;
    }
    
    h1 {
        font-size: 1.9rem;
    }
    
    .glow-logo {
        width: 60px;
        height: 60px;
        font-size: 1.8rem;
    }
    
    #hud {
        grid-template-columns: 80px 1fr 80px;
        top: 10px;
        width: 94%;
        left: 3%;
    }
    
    .hud-value {
        font-size: 1.2rem;
    }
    
    .hud-item {
        padding: 0.5rem 0.6rem;
        border-radius: 12px;
    }
    
    #wind-container {
        padding: 0.4rem 0.8rem;
        border-radius: 12px;
    }
    
    .wind-speed {
        font-size: 0.8rem;
    }
    
    .multiplier-tag {
        font-size: 0.85rem;
        padding: 0.4rem 0.7rem;
        border-radius: 10px;
    }
    
    .ball-life {
        font-size: 0.75rem;
    }
    
    #feedback-text {
        font-size: 2.8rem;
    }
    
    .top-controls {
        top: 65px;
    }
    
    .control-btn {
        width: 36px;
        height: 36px;
        border-radius: 10px;
        font-size: 0.85rem;
    }
}

/* Landscape mode check for UI layout */
@media (max-height: 480px) and (orientation: landscape) {
    .overlay-screen {
        overflow-y: auto;
        align-items: flex-start;
        padding: 1rem 0;
    }
    
    .menu-card {
        padding: 1.5rem;
        border-radius: 16px;
    }
    
    .logo-container {
        margin-bottom: 0.8rem;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 15px;
    }
    
    .glow-logo {
        width: 42px;
        height: 42px;
        font-size: 1.3rem;
        margin: 0;
    }
    
    h1 {
        font-size: 1.6rem;
    }
    
    .subtitle {
        margin-bottom: 1rem;
    }
    
    .high-score-display {
        margin-bottom: 1rem;
        padding: 0.4rem 1rem;
    }
    
    .settings-group {
        margin-bottom: 1rem;
    }
    
    .mode-selector {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .mode-btn small {
        display: none;
    }
}

/* ===== Home Link Button ===== */
.home-link {
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 50;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 50px;
    font-family: var(--font-family);
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
    text-decoration: none;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.home-link:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--primary);
    transform: translateX(-3px) scale(1.03);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
}

@media (max-width: 768px) {
    .home-link {
        top: 12px;
        left: 12px;
        padding: 8px 16px;
        font-size: 12px;
    }
}
/* =========================================
   ARROW MODE CONTROLS UI
   ========================================= */
.style-btn {
    background: rgba(255,255,255,0.05);
    border: 2px solid rgba(255,255,255,0.1);
    color: white;
    padding: 10px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}
.style-btn:hover { background: rgba(255,255,255,0.15); }
.style-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.5);
}

.arrow-controls {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(10, 15, 30, 0.8);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    padding: 20px 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 90%;
    max-width: 400px;
    pointer-events: auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    z-index: 100;
}
.arrow-controls.hidden {
    display: none;
}

.control-row {
    display: flex;
    align-items: center;
    gap: 15px;
}
.control-label {
    width: 60px;
    font-weight: 800;
    font-size: 14px;
    color: #cbd5e1;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}
.game-slider {
    flex: 1;
    -webkit-appearance: none;
    height: 10px;
    border-radius: 5px;
    background: rgba(255,255,255,0.1);
    outline: none;
}
.game-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
}
.aim-slider::-webkit-slider-thumb { background: #60a5fa; }
.power-slider::-webkit-slider-thumb { background: #fbbf24; }
.curve-slider::-webkit-slider-thumb { background: #a78bfa; }

.shoot-action-btn {
    width: 100%;
    margin-top: 10px;
    padding: 15px;
    font-size: 20px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 5px 15px rgba(16, 185, 129, 0.4);
}
.shoot-action-btn:hover {
    background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.6);
}
