/* ===== RESET & BASE ===== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --neon-pink: #9b51e0; /* Vadaa Purple */
    --neon-cyan: #00f0ff;
    --neon-purple: #8a2be2;
    --neon-green: #39ff14;
    --dark-bg: #100b17; /* More purple-ish dark bg */
    --dark-surface: #151020;
    --text-primary: #ffffff;
    --text-secondary: #9988aa;
}

html,
body {
    width: 100%;
    min-height: 100vh;
    overflow-x: hidden;
    font-family: 'Orbitron', sans-serif;
    background: var(--dark-bg);
    color: var(--text-primary);
}

/* ===== INTRO OVERLAY ===== */
#intro-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: var(--dark-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

#intro-overlay.fade-out {
    opacity: 0;
    visibility: hidden;
}

#intro-text {
    text-align: center;
    position: relative;
}

.intro-line {
    display: block;
    font-size: clamp(1.8rem, 5vw, 3.5rem);
    font-weight: 700;
    color: var(--text-primary);
    opacity: 0;
    transform: scale(0.5);
    position: absolute;
    left: 50%;
    top: 50%;
    translate: -50% -50%;
    white-space: nowrap;
    text-shadow: 0 0 20px rgba(255, 45, 149, 0.6);
}

.intro-line.show {
    animation: introReveal 0.8s ease forwards;
}

.intro-line.hide {
    animation: introHide 0.3s ease forwards;
}

#line3,
#line4,
#line5 {
    font-family: 'Press Start 2P', cursive;
    font-size: clamp(3rem, 10vw, 8rem);
    color: var(--neon-pink);
    text-shadow:
        0 0 20px var(--neon-pink),
        0 0 60px var(--neon-pink),
        0 0 100px var(--neon-pink);
}

@keyframes introReveal {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes introHide {
    0% {
        opacity: 1;
        transform: scale(1);
    }

    100% {
        opacity: 0;
        transform: scale(1.5);
    }
}

/* ===== MAIN CONTENT ===== */
#main-content {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow-x: hidden;
}

#main-content.hidden {
    opacity: 0;
    pointer-events: none;
}

#main-content.visible {
    animation: mainFadeIn 1s ease forwards;
}

@keyframes mainFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ===== BACKGROUND GRID ===== */
#bg-grid {
    position: fixed;
    inset: 0;
    z-index: 0;
    background-image:
        linear-gradient(rgba(255, 45, 149, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 45, 149, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    animation: gridPulse 4s ease-in-out infinite;
}

@keyframes gridPulse {

    0%,
    100% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }
}

/* ===== PARTICLE CANVAS ===== */
#particle-canvas {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

/* ===== HEADER ===== */
#site-header {
    position: relative;
    z-index: 2;
    text-align: center;
    margin-bottom: 3rem;
}

#site-title {
    font-size: clamp(2.5rem, 8vw, 5rem);
    font-weight: 900;
    letter-spacing: 0.2em;
    background: linear-gradient(135deg, var(--neon-pink), var(--neon-cyan), var(--neon-purple));
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease-in-out infinite;
    text-shadow: none;
    filter: drop-shadow(0 0 30px rgba(255, 45, 149, 0.4));
}

@keyframes gradientShift {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

#site-subtitle {
    font-size: clamp(0.7rem, 2vw, 1rem);
    color: var(--text-secondary);
    letter-spacing: 0.5em;
    margin-top: 0.5rem;
    text-transform: uppercase;
}

/* ===== THE BUTTON ===== */
#button-container {
    position: relative;
    z-index: 2;
    margin-bottom: 3rem;
}

#button-glow {
    position: absolute;
    width: 220px;
    height: 220px;
    top: 50%;
    left: 50%;
    translate: -50% -50%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 45, 149, 0.3), transparent 70%);
    animation: glowPulse 2s ease-in-out infinite;
    pointer-events: none;
}

@keyframes glowPulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.6;
    }

    50% {
        transform: scale(1.4);
        opacity: 1;
    }
}

#aminake-btn {
    position: relative;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    border: 3px solid var(--neon-pink);
    background: radial-gradient(circle at 30% 30%, #2a1025, #0a0a0f);
    color: var(--text-primary);
    font-family: 'Orbitron', sans-serif;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: all 0.15s ease;
    box-shadow:
        0 0 15px rgba(255, 45, 149, 0.4),
        0 0 40px rgba(255, 45, 149, 0.15),
        inset 0 0 20px rgba(255, 45, 149, 0.1);
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

#aminake-btn:hover {
    transform: scale(1.08);
    border-color: var(--neon-cyan);
    box-shadow:
        0 0 25px rgba(0, 240, 255, 0.5),
        0 0 60px rgba(0, 240, 255, 0.2),
        inset 0 0 30px rgba(0, 240, 255, 0.15);
}

#aminake-btn:active {
    transform: scale(0.92);
    border-color: var(--neon-green);
    box-shadow:
        0 0 40px rgba(57, 255, 20, 0.6),
        0 0 80px rgba(57, 255, 20, 0.3),
        inset 0 0 40px rgba(57, 255, 20, 0.2);
}

#btn-text {
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: 0.15em;
}

#btn-subtext {
    font-size: 0.65rem;
    color: var(--neon-pink);
    letter-spacing: 0.3em;
    text-transform: lowercase;
    opacity: 0.8;
}

/* ===== HINT TEXT & TIMER ===== */
#hint-text {
    position: relative;
    z-index: 2;
    text-align: center;
    font-size: clamp(0.65rem, 1.8vw, 0.85rem);
    color: var(--neon-cyan);
    letter-spacing: 0.12em;
    margin-bottom: 0.5rem;
    opacity: 0.7;
    animation: hintPulse 2.5s ease-in-out infinite;
}

#pitch-timer {
    position: relative;
    z-index: 2;
    text-align: center;
    font-size: 0.85rem;
    color: var(--neon-pink);
    letter-spacing: 0.1em;
    margin-bottom: 2rem;
    background: rgba(255, 45, 149, 0.1);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 45, 149, 0.3);
    transition: opacity 0.3s ease;
}

#pitch-timer.hidden {
    opacity: 0;
    pointer-events: none;
}

#pitch-time {
    font-weight: bold;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.8rem;
}

@keyframes hintPulse {
    0%, 100% { opacity: 0.4; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.03); text-shadow: 0 0 12px rgba(0, 240, 255, 0.5); }
}

/* ===== COUNTER ===== */
#counter-container {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 1.2rem 2.5rem;
    border: 1px solid rgba(255, 45, 149, 0.15);
    border-radius: 16px;
    background: rgba(18, 18, 26, 0.7);
    backdrop-filter: blur(10px);
}

#counter-label {
    font-size: 0.65rem;
    color: var(--text-secondary);
    letter-spacing: 0.3em;
    text-transform: uppercase;
    margin-bottom: 0.3rem;
}

#counter-value {
    font-family: 'Press Start 2P', cursive;
    font-size: clamp(1.5rem, 5vw, 2.5rem);
    color: var(--neon-cyan);
    text-shadow: 0 0 20px rgba(0, 240, 255, 0.5);
    animation: counterGlow 2s ease-in-out infinite alternate;
}

@keyframes counterGlow {
    from {
        text-shadow: 0 0 10px rgba(0, 240, 255, 0.3);
    }

    to {
        text-shadow: 0 0 30px rgba(0, 240, 255, 0.7);
    }
}

#counter-suffix {
    font-size: 0.65rem;
    color: var(--text-secondary);
    letter-spacing: 0.3em;
    text-transform: uppercase;
    margin-top: 0.3rem;
}

#counter-container.bump {
    animation: counterBump 0.3s ease;
}

@keyframes counterBump {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.12);
        border-color: var(--neon-cyan);
    }

    100% {
        transform: scale(1);
    }
}

/* ===== FOOTER ===== */
#site-footer {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    translate: -50% 0;
    z-index: 2;
    font-size: 0.7rem;
    color: var(--text-secondary);
    letter-spacing: 0.1em;
}

.neon-text {
    color: var(--neon-pink);
    text-shadow: 0 0 10px rgba(255, 45, 149, 0.5);
}

.vada-text {
    color: #ffd700;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.7);
}

/* ===== RUNNING VADAS ===== */
.vada-character {
    position: fixed;
    bottom: 2rem;
    z-index: 100;
    pointer-events: none;
    animation: runAcross 4s linear forwards, bounceVada 0.3s ease-in-out infinite alternate;
    filter: drop-shadow(0 0 10px rgba(155, 81, 224, 0.5));
}

@keyframes runAcross {
    0% { left: -100px; transform: scaleX(1); opacity: 0; }
    5% { opacity: 1; }
    95% { opacity: 1; }
    100% { left: calc(100vw + 100px); transform: scaleX(1); opacity: 0; }
}

@keyframes bounceVada {
    0% { transform: translateY(0); }
    100% { transform: translateY(-20px); }
}

/* ===== SCREEN SHAKE ===== */
body.shake {
    animation: screenShake 0.5s ease;
}

@keyframes screenShake {

    0%,
    100% {
        transform: translate(0);
    }

    10% {
        transform: translate(-8px, 5px);
    }

    20% {
        transform: translate(8px, -5px);
    }

    30% {
        transform: translate(-6px, 3px);
    }

    40% {
        transform: translate(6px, -3px);
    }

    50% {
        transform: translate(-4px, 4px);
    }

    60% {
        transform: translate(4px, -2px);
    }

    70% {
        transform: translate(-2px, 2px);
    }

    80% {
        transform: translate(2px, -1px);
    }

    90% {
        transform: translate(-1px, 1px);
    }
}

/* ===== FLASH OVERLAY ===== */
.flash-overlay {
    position: fixed;
    inset: 0;
    z-index: 999;
    pointer-events: none;
    animation: flashBang 0.4s ease-out forwards;
}

@keyframes flashBang {
    0% {
        background: rgba(255, 45, 149, 0.5);
    }

    100% {
        background: transparent;
    }
}

/* ===== FLOATING TEXT ===== */
.floating-text {
    position: fixed;
    z-index: 100;
    font-family: 'Press Start 2P', cursive;
    font-size: clamp(0.8rem, 3vw, 1.2rem);
    color: var(--neon-green);
    text-shadow: 0 0 10px var(--neon-green);
    pointer-events: none;
    animation: floatUp 1.5s ease-out forwards;
    white-space: nowrap;
}

@keyframes floatUp {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1) rotate(0deg);
    }

    100% {
        opacity: 0;
        transform: translateY(-120px) scale(1.5) rotate(15deg);
    }
}

/* ===== SOCIAL LINKS ===== */
#social-links {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.social-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    padding: 0.5rem 0.8rem;
    border-radius: 30px;
    background: rgba(18, 18, 26, 0.6);
    border: 1px solid rgba(138, 43, 226, 0.2);
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

.social-btn svg {
    color: var(--neon-purple);
    transition: all 0.3s ease;
}

.social-btn:hover {
    color: var(--text-primary);
    border-color: var(--neon-purple);
    box-shadow: 0 0 15px rgba(138, 43, 226, 0.4);
    transform: translateY(-2px);
}

.social-btn:hover svg {
    color: var(--neon-pink);
    filter: drop-shadow(0 0 5px var(--neon-pink));
}

/* ===== LEADERBOARD & AUTH ===== */
#top-panels-container {
    width: 100%;
    pointer-events: none;
}

#auth-panel, #leaderboard-panel {
    pointer-events: auto;
}

#auth-panel {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 50;
    background: rgba(18, 18, 26, 0.7);
    padding: 0.8rem;
    border-radius: 12px;
    border: 1px solid rgba(138, 43, 226, 0.3);
    backdrop-filter: blur(10px);
}

#auth-container {
    display: flex;
    gap: 0.5rem;
}

#username-input {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--neon-purple);
    color: #fff;
    padding: 0.5rem;
    border-radius: 6px;
    outline: none;
    font-family: inherit;
    font-size: 0.85rem;
    width: 140px;
}

#username-input:focus {
    box-shadow: 0 0 10px rgba(138, 43, 226, 0.5);
}

#join-btn {
    background: rgba(138, 43, 226, 0.2);
    border: 1px solid var(--neon-purple);
    color: var(--neon-cyan);
    padding: 0.5rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.55rem;
    transition: all 0.2s;
}

#join-btn:hover {
    background: var(--neon-purple);
    color: #fff;
    box-shadow: 0 0 15px var(--neon-purple);
}

#logged-in-container {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-align: center;
}

#leaderboard-panel {
    position: fixed;
    top: 5rem;
    right: 1rem;
    z-index: 40;
    background: rgba(10, 10, 15, 0.85);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid rgba(138, 43, 226, 0.4);
    backdrop-filter: blur(15px);
    width: 250px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5), 0 0 20px rgba(138, 43, 226, 0.2);
}

#leaderboard-panel h3 {
    text-align: center;
    color: #ffd700;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    border-bottom: 1px solid rgba(255, 215, 0, 0.3);
    padding-bottom: 0.5rem;
}

#leaderboard-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.8rem; /* Increased spacing to prevent overlap */
    max-height: 250px;
    overflow-y: auto;
}

#leaderboard-list::-webkit-scrollbar {
    width: 4px;
}
#leaderboard-list::-webkit-scrollbar-thumb {
    background: var(--neon-purple);
    border-radius: 4px;
}

#leaderboard-list li {
    flex-shrink: 0; /* Ensures items do not squish under parent height constraints */
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
    padding: 0.8rem 1rem;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    border-left: 4px solid transparent;
    margin-bottom: 0.4rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.15);
}

#leaderboard-list li.loading {
    justify-content: center;
    color: var(--text-secondary);
}

/* İlk 3 sıra için özel renkler */
#leaderboard-list li:nth-child(1) {
    border-left-color: #ffd700; /* Gold */
    background: rgba(255, 215, 0, 0.1);
    font-weight: bold;
    color: #ffd700;
    font-size: 0.95rem;
}
#leaderboard-list li:nth-child(2) {
    border-left-color: #c0c0c0; /* Silver */
    background: rgba(192, 192, 192, 0.1);
    color: #c0c0c0;
}
#leaderboard-list li:nth-child(3) {
    border-left-color: #cd7f32; /* Bronze */
    background: rgba(205, 127, 50, 0.1);
    color: #cd7f32;
}

.lb-name {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lb-score {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.55rem;
    color: var(--neon-cyan);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
    #main-content {
        padding: 2rem 0.5rem 1rem 0.5rem;
        justify-content: flex-start;
    }

    #site-header { margin-bottom: 1rem; }
    #button-container { margin-bottom: 1rem; }
    #counter-container { margin-bottom: 2rem; }
    
    #site-footer {
        position: static;
        translate: none;
        width: 100%;
        text-align: center;
        margin-top: 1rem;
        margin-bottom: 0.5rem;
    }
    
    #social-links {
        position: static;
        flex-direction: row;
        justify-content: center;
        gap: 1.5rem;
        margin-top: 0.5rem;
        margin-bottom: 2rem;
    }
    
    #top-panels-container {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
        margin-top: 2rem;
        margin-bottom: 2rem;
        pointer-events: auto;
    }

    #auth-panel, #leaderboard-panel {
        position: static;
        width: 90%;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    #leaderboard-panel {
        padding: 1.2rem;
        max-height: fit-content;
    }
    
    #leaderboard-list {
        max-height: 200px;
        width: 100%;
    }
    #aminake-btn {
        width: 150px;
        height: 150px;
    }

    #button-glow {
        width: 180px;
        height: 180px;
    }

    #btn-text {
        font-size: 1.6rem;
    }

    #counter-container {
        padding: 1rem 1.8rem;
    }

    #site-header {
        margin-bottom: 2rem;
    }

    #site-footer {
        font-size: 0.55rem;
        white-space: nowrap;
    }

    /* Daha Okunabilir Mobil Zamanlayıcı */
    #pitch-timer {
        background: rgba(0, 0, 0, 0.7);
        border: 1px solid var(--neon-pink);
        padding: 0.2rem 0.6rem;
    }

    #pitch-time {
        color: #ffffff;
        text-shadow: none;
        font-size: 0.75rem;
    }

    /* Küçültülmüş Mobil Sosyal Medya İkonları */
    #social-links {
        bottom: 1rem;
        right: 1rem;
        gap: 0.5rem;
    }

    .social-btn {
        padding: 0.4rem;
        border-radius: 50%;
        border-color: rgba(138, 43, 226, 0.4);
    }

    .social-btn span {
        display: none; /* Mobilde sadece logolar kalsın */
    }

    .social-btn svg {
        width: 18px;
        height: 18px;
    }
}