@import url(./navigationMobile.css);
@import url(./navigationDesktop.css);
@import url(./title_scores.css);


*,
*::before,
*::after {
    box-sizing: border-box;
}


body {
    background-color: #1c1c1a;
    color: white;
    font-family: 'Lucida Console', monospace;
}


main {
    display: flex;
    flex-direction: row;
    justify-content: space-evenly;
    margin: auto;
}


.invisible,
.hidden {
    display: none !important;
}

/* =========================================
   OVERLAY & UI STYLES
   ========================================= */

/* =========================================
   OVERLAY & UI STYLES
   ========================================= */

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(10, 10, 12, 0.92);
    /* mask/grid pattern for cyber feel */
    background-image:
        linear-gradient(rgba(247, 147, 26, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(247, 147, 26, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    backdrop-filter: blur(10px);
    z-index: 100;
    text-align: center;
    overflow: hidden;
    perspective: 1000px;
}

.overlay::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, transparent 0%, rgba(0, 0, 0, 0.8) 100%);
    pointer-events: none;
    z-index: 1;
}

.overlay::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background-image:
        radial-gradient(circle, rgba(247, 147, 26, 0.1) 1px, transparent 1px),
        radial-gradient(circle, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 60px 60px, 30px 30px;
    animation: backgroundScroll 20s linear infinite;
    z-index: 0;
    transform: rotate(15deg);
}

.game-title {
    font-size: 6rem;
    font-weight: 900;
    margin-bottom: 0.5rem;
    color: #fff;
    text-transform: uppercase;
    /* Layered text shadows for neon effect */
    text-shadow:
        0 0 5px #fff,
        0 0 10px #fff,
        0 0 20px #f7931a,
        0 0 40px #f7931a,
        0 0 80px #f7931a;
    animation: neonPulse 2s infinite alternate;
    position: relative;
    z-index: 10;
}

.game-title::after {
    content: attr(data-text);
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    filter: blur(15px);
    opacity: 0.7;
    animation: neonPulse 2s infinite alternate-reverse;
}

.subtitle {
    font-size: 1.8rem;
    color: #e0e0e0;
    margin-bottom: 4rem;
    letter-spacing: 4px;
    text-transform: uppercase;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

.score-display {
    font-size: 2.5rem;
    color: #fff;
    margin-bottom: 2rem;
    text-shadow: 0 0 10px rgba(247, 147, 26, 0.8);
}

.primary-btn {
    padding: 1.2rem 4rem;
    font-size: 2rem;
    font-family: inherit;
    font-weight: 900;
    color: #000;
    background: #f7931a;
    border: none;
    border-radius: 4px;
    /* More blocky/digital look */
    cursor: pointer;
    z-index: 100;
    box-shadow:
        0 0 10px #f7931a,
        0 0 20px rgba(247, 147, 26, 0.4);
    transition: all 0.2s ease;
    text-transform: uppercase;
    position: relative;
    overflow: hidden;
}

.primary-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: 0.5s;
    z-index: -1;
    pointer-events: none;
}

.primary-btn:hover {
    transform: scale(1.05);
    background: #ffaa3b;
    box-shadow:
        0 0 20px #f7931a,
        0 0 40px #f7931a;
}

.primary-btn:hover::before {
    left: 100%;
}

.primary-btn:active {
    transform: scale(0.98);
}

/* INPUTS */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
    width: 400px;
    max-width: 90%;
}

input[type="text"] {
    padding: 1.2rem;
    font-size: 1.4rem;
    font-family: inherit;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid #555;
    border-radius: 4px;
    color: #f7931a;
    text-align: center;
    transition: all 0.3s;
    text-transform: uppercase;
}

input[type="text"]::placeholder {
    color: #666;
}

input[type="text"]:focus {
    outline: none;
    border-color: #f7931a;
    box-shadow: 0 0 15px rgba(247, 147, 26, 0.2);
    background: rgba(0, 0, 0, 0.8);
}

/* SCORES LIST */
.scores-container {
    background: rgba(10, 10, 15, 0.9);
    padding: 2rem;
    border-radius: 8px;
    width: 700px;
    max-width: 95%;
    margin-bottom: 2rem;
    border: 2px solid #f7931a;
    box-shadow: 0 0 20px rgba(247, 147, 26, 0.2);
    max-height: 60vh;
    overflow-y: auto;
    position: relative;
    background: linear-gradient(180deg, rgba(20, 20, 30, 0.95), rgba(10, 10, 15, 0.98));
}

@keyframes backgroundScroll {
    from {
        transform: rotate(15deg) translateY(0);
    }

    to {
        transform: rotate(15deg) translateY(-50px);
    }
}

/* Scrollbar styling */
.scores-container::-webkit-scrollbar {
    width: 10px;
}

.scores-container::-webkit-scrollbar-track {
    background: #111;
}

.scores-container::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 5px;
}

.scores-container::-webkit-scrollbar-thumb:hover {
    background: #f7931a;
}

#highScoreList {
    list-style: none;
    padding: 0;
    margin: 0;
}

.high-score-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    margin-bottom: 0.5rem;
    background: rgba(255, 255, 255, 0.03);
    border-left: 4px solid transparent;
    transition: all 0.2s;
}

.high-score-item:hover {
    background: rgba(247, 147, 26, 0.1);
    border-left: 4px solid #f7931a;
    padding-left: 1.5rem;
}

.high-score-item:nth-child(1) {
    border-left-color: #ffd700;
    color: #ffd700;
}

/* Gold */
.high-score-item:nth-child(2) {
    border-left-color: #c0c0c0;
    color: #c0c0c0;
}

/* Silver */
.high-score-item:nth-child(3) {
    border-left-color: #cd7f32;
    color: #cd7f32;
}

/* Bronze */

.hs-rank {
    font-size: 1.5rem;
    width: 50px;
    opacity: 0.7;
    font-weight: bold;
}

.hs-name {
    font-weight: bold;
    flex-grow: 1;
    text-align: left;
    font-size: 1.4rem;
}

.hs-msg {
    color: #aaa;
    font-style: italic;
    margin-right: 2rem;
    font-size: 1rem;
    max-width: 250px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.hs-score {
    font-weight: bold;
    font-size: 1.5rem;
    color: inherit;
    /* Inherit logic for top 3 */
}

/* Default color for others */
.high-score-item .hs-score {
    color: #fff;
}

.high-score-item:nth-child(1) .hs-score {
    color: #ffd700;
}

.high-score-item:nth-child(2) .hs-score {
    color: #c0c0c0;
}

.high-score-item:nth-child(3) .hs-score {
    color: #cd7f32;
}


/* ANIMATIONS */
@keyframes neonPulse {
    from {
        text-shadow:
            0 0 5px #fff, 0 0 10px #fff,
            0 0 20px #f7931a, 0 0 35px #f7931a;
    }

    to {
        text-shadow:
            0 0 2px #fff, 0 0 5px #fff,
            0 0 15px #f7931a, 0 0 25px #f7931a;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

#titleScreen>* {
    animation: fadeIn 0.8s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
    position: relative;
    z-index: 10;
}

#titleScreen h1 {
    animation-delay: 0.1s;
}

#titleScreen p {
    animation-delay: 0.3s;
}

#titleScreen button {
    animation-delay: 0.5s;
}

#gameOverScreen>*,
#highScoreScreen>* {
    position: relative;
    z-index: 10;
}