@import url('/static/typebrawl/css/reset-c6ce964564f1f255b44732fd1857509e.css');
@import url('/static/typebrawl/css/variables-7f55c58a5dc9b5eb197d754240231792.css');
.boot-scene {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.boot-content {
    text-align: center;
}

.boot-logo {
    margin-bottom: 60px;
}

.boot-logo-img {
    max-width: 500px;
    height: auto;
}

.loading-container {
    max-width: 400px;
    margin: 0 auto;
}

.loading-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.loading-progress {
    height: 100%;
    background: linear-gradient(90deg, #ff6b6b, #4ecdc4, #45b7d1);
    background-size: 200% 100%;
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s ease;
}

.loading-text {
    color: #ffffff;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.loading-percentage {
    color: #4ecdc4;
    font-size: 24px;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(78, 205, 196, 0.5);
}

.boot-scene.hidden {
    opacity: 0;
    transition: opacity 0.5s ease-out;
    pointer-events: none;
}

@font-face {
    font-family: 'Varela Round';
    src: url('/static/typebrawl/assets/Varela_Round/VarelaRound-Regular-76b03771cc96ecc229dcf2e463d34eff.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
body {
    font-family: var(--font-family);
    background: #000;
    overflow: hidden;
    user-select: none;
    margin: 0;
    padding: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}
.game-wrapper {
    width: 1530px;
    height: 960px;
    position: relative;
    transform-origin: center center;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
}
.game-container {
    width: 1530px;
    height: 960px;
    display: flex;
    flex-direction: column;
    background: url('/static/typebrawl/assets/images/background-e050c903e25f4414d3bd9e62dccd2fde.png') no-repeat center center;
    background-size: cover;
    position: relative;
    overflow: hidden;
}
.header {
    height: var(--header-height);
    padding: 15px 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    background: transparent;
    margin-top: 10px;
}

.score {
    font-size: var(--font-size-score);
    font-weight: 600;
    min-width: 80px;
    text-align: center;
}

.score-red {
    color: #000;
    text-align: right;
    background: url('/static/typebrawl/assets/images/pointsbg-63123d77346188f62c554d6c31847fe6.png') no-repeat center center;
    background-size: contain;
    padding: 10px 15px;
    min-width: 60px;
}

.score-blue {
    color: #000;
    text-align: left;
    background: url('/static/typebrawl/assets/images/pointsbg-63123d77346188f62c554d6c31847fe6.png') no-repeat center center;
    background-size: contain;
    padding: 10px 15px;
    min-width: 60px;
}
.score-bar-container {
    flex: 1;
    height: 45px;
    margin: 0 20px;
    overflow: hidden;
    display: flex;
    border-radius: 25px;
    box-shadow: 
        inset 0 -4px 8px rgba(0, 0, 0, 0.3),
        0 4px 12px rgba(0, 0, 0, 0.4);
}

.score-bar-red {
    height: 100%;
    transition: width 0.3s ease;
    background: linear-gradient(
        to bottom,
        #ff6b6b 0%,
        #dc2626 30%,
        #b91c1c 70%,
        #991b1b 100%
    );
    box-shadow: 
        inset 0 2px 4px rgba(255, 255, 255, 0.4),
        inset 0 -2px 4px rgba(0, 0, 0, 0.3);
    border-radius: 25px 0 0 25px;
}

.score-bar-blue {
    height: 100%;
    transition: width 0.3s ease;
    background: linear-gradient(
        to bottom,
        #60a5fa 0%,
        #2563eb 30%,
        #1d4ed8 70%,
        #1e40af 100%
    );
    box-shadow: 
        inset 0 2px 4px rgba(255, 255, 255, 0.4),
        inset 0 -2px 4px rgba(0, 0, 0, 0.3);
    border-radius: 0 25px 25px 0;
}
.game-area {
    flex: 1;
    position: relative;
    background: transparent;
    overflow: hidden;
}
.word-sprite {
    position: absolute;
    opacity: 0;
    animation: fadeIn var(--fade-in-duration) ease forwards;
    display: inline-block;
}
.word {
    font-size: var(--font-size-word);
    font-weight: bold;
    text-transform: uppercase;
    cursor: default;
    display: flex;
    align-items: center;
}

.word.red,
.word.blue {
    color: #fff;
    padding: 10px 35px;
    position: relative;
    z-index: 1;
}
.word.red::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: calc(50% + 2px);
    height: 100%;
    background: url('/static/typebrawl/assets/images/redbg-83ca8049fafb3a184644ea41e5bf94a4.png') no-repeat left center;
    background-size: auto 100%;
    z-index: -1;
}

.word.red::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    width: calc(50% + 2px);
    height: 100%;
    background: url('/static/typebrawl/assets/images/redbg-83ca8049fafb3a184644ea41e5bf94a4.png') no-repeat right center;
    background-size: auto 100%;
    z-index: -2;
}
.word.blue::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: calc(50% + 2px);
    height: 100%;
    background: url('/static/typebrawl/assets/images/bluebg-83f569944ee2fcc6856520e7cd353a00.png') no-repeat left center;
    background-size: auto 100%;
    z-index: -1;
}

.word.blue::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    width: calc(50% + 2px);
    height: 100%;
    background: url('/static/typebrawl/assets/images/bluebg-83f569944ee2fcc6856520e7cd353a00.png') no-repeat right center;
    background-size: auto 100%;
    z-index: -2;
}

.word.purple {
    color: #fff;
    font-size: 3rem;
    padding: 12px 40px;
    background: url('/static/typebrawl/assets/images/purplebg-c8b199b84dcca9a9c84d83b43bc1345d.png') no-repeat center center;
    background-size: 100% 100%;
    position: relative;
}

.word-text {
    display: inline-block;
}
.points {
    position: absolute;
    top: -16px;
    right: -16px;
    font-size: 2rem;
    font-weight: bold;
    color: #000;
    background: url('/static/typebrawl/assets/images/pointsbg-63123d77346188f62c554d6c31847fe6.png') no-repeat center center;
    background-size: cover;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}
.word-sprite.bonus-eligible .word.red .points,
.word-sprite.bonus-eligible .word.blue .points {
    background: #22c55e !important;
}
.points-multiplied-1x {
    background: #fbbf24 !important;
    color: #000 !important;
    box-shadow: 0 0 10px rgba(251, 191, 36, 0.5);
}
.points-multiplied-2x {
    background: linear-gradient(135deg, #f59e0b, #d97706, #f59e0b) !important;
    color: #fff !important;
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.8), 0 0 25px rgba(217, 119, 6, 0.4);
    border: 2px solid #f59e0b;
}
.word .typed {
    color: #22c55e;
}
.word-sprite.urgent {
    animation: blink var(--blink-duration) ease-in-out infinite;
}
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}
@keyframes fadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.8);
    }
}

.word-sprite.fading-out {
    animation: fadeOut 0.3s ease forwards;
}
.game-area.paused .word-sprite.urgent:not(.purple) {
    animation-play-state: paused !important;
}
.game-wrapper:has(.pause-screen.active) .word-sprite.purple.urgent {
    animation-play-state: paused !important;
}
.game-container.purple-challenge-active .game-area .word-sprite.urgent:not(.purple) {
    animation-play-state: paused !important;
}
.game-container.purple-challenge-active {
    position: relative;
}

.game-container.purple-challenge-active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(
        ellipse at var(--purple-x, 50%) var(--purple-y, 50%),
        rgba(0, 0, 0, 0.6) 60%,
        rgba(0, 0, 0, 0.8) 80%,
        rgba(0, 0, 0, 0.9) 100%
    );
    pointer-events: none;
    z-index: 15;
    transition: opacity 0.5s ease;
}

.game-container.purple-challenge-active .game-area .word-sprite:not(.purple) {
    opacity: 0.3;
    filter: grayscale(50%);
    transition: all 0.3s ease;
}

.game-container.purple-challenge-active .game-area .word-sprite.purple {
    z-index: 20;
    filter: drop-shadow(0 0 20px rgba(138, 43, 226, 0.8)) 
            drop-shadow(0 0 40px rgba(138, 43, 226, 0.6))
            drop-shadow(0 0 60px rgba(138, 43, 226, 0.4));
    transform: scale(1.1);
    transition: all 0.3s ease;
}

.game-container.purple-challenge-active .header {
    opacity: 0.4;
    filter: grayscale(30%);
    transition: all 0.3s ease;
}

@keyframes purpleDarkeningPulse {
    0%, 100% {
        opacity: 0.8;
    }
    50% {
        opacity: 1;
    }
}
@keyframes blink {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.05);
    }
}

.word-sprite.purple {
    animation: fadeIn var(--fade-in-duration) ease forwards;
}

.word-sprite.purple.urgent {
    animation: blink var(--blink-duration) ease-in-out infinite;
}

.word-sprite.purple.fading-out {
    animation: fadeOut 0.3s ease forwards;
}
.game-over {
    position: absolute;
    top: 0;
    left: 0;
    width: 1530px;
    height: 960px;
    background: rgb(0, 0, 0);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 200;
}

.game-over.active {
    display: flex;
}

.game-over-content {
    text-align: center;
    padding: 60px 80px 40px 80px;
    background: url('/static/typebrawl/assets/images/gameover-panel-cb8db6355c6a094502e6a34cf84c725c.png') no-repeat center center;
    background-size: contain;
    min-width: 600px;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
}

.game-over-content h1 {
    font-size: 4rem;
    margin-bottom: 25px;
    font-family: 'Arial Black', 'Impact', sans-serif;
    font-weight: 900;
    letter-spacing: 4px;
    text-shadow: none;
    position: relative;
    top: 20px;
}

.game-over-content h1.red {
    color: var(--red-color);
}

.game-over-content h1.blue {
    color: var(--blue-color);
}

.game-over-buttons {
    display: flex;
    flex-direction: column;
    gap: 20px;
    justify-content: center;
    align-items: center;
}

.game-over-btn {
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.game-over-btn img {
    display: block;
    width: 210px;
    height: auto;
    filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.35));
    transition: transform 0.2s ease, filter 0.2s ease;
}

.game-over-btn:hover {
    transform: scale(1.05);
}

.game-over-btn:hover img {
    filter: drop-shadow(0 12px 25px rgba(0, 0, 0, 0.4));
}

.game-over-btn:active {
    transform: scale(0.98);
}
.start-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 1530px;
    height: 960px;
    background: url('/static/typebrawl/assets/images/background-e050c903e25f4414d3bd9e62dccd2fde.png') no-repeat center center;
    background-size: cover;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 300;
}

.start-screen-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 45px;
}

.start-screen.hidden {
    display: none;
}

.settings-button {
    cursor: pointer;
    transition: transform 0.2s ease, filter 0.2s ease;
    max-width: 345px;
    width: 100%;
    height: auto;
}

.settings-button:hover {
    transform: scale(1.05);
    filter: brightness(1.08);
}

.settings-button:active {
    transform: scale(0.97);
}


.play-button {
    cursor: pointer;
    transition: transform 0.2s ease, filter 0.2s ease;
    max-width: 400px;
    width: 100%;
    height: auto;
}

.play-button:hover {
    transform: scale(1.08);
    filter: brightness(1.1);
}

.play-button:active {
    transform: scale(0.98);
}
.game-logo {
    max-width: 900px;
    width: 100%;
    height: auto;
    margin-bottom: 20px;
}
@keyframes wordComplete {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.3);
        opacity: 0.8;
    }
    100% {
        transform: scale(0);
        opacity: 0;
    }
}

.word-sprite.completed {
    animation: wordComplete 0.4s ease forwards;
}
.score-change {
    position: absolute;
    font-size: 1.5rem;
    font-weight: bold;
    pointer-events: none;
    animation: scoreFloat 1s ease forwards;
}

.score-change.positive {
    color: #22c55e;
}

.score-change.negative {
    color: #ef4444;
}

@keyframes scoreFloat {
    0% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(-50px);
    }
}
.purple-timer {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 160px;
    min-height: 60px;
    padding: 10px 35px 10px 55px;
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
    background: url('/static/typebrawl/assets/images/timerbg-d139e41c9954aa98a152d2954e469933.png') no-repeat center center;
    background-size: contain;
    z-index: 30;
}
.purple-ready-banner {
    position: absolute;
    z-index: 25;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 15px;
    pointer-events: none;
    animation: fadeIn 0.3s ease forwards;
}

.purple-ready-text {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: 3px;
    text-shadow: 0 3px 10px rgba(0, 0, 0, 0.7);
    white-space: nowrap;
}

.purple-ready-text.red {
    color: #f73636;
}

.purple-ready-text.blue {
    color: #2974cf;
}

.purple-ready-countdown {
    font-size: 1.9rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
    background: url('/static/typebrawl/assets/images/timerbg-d139e41c9954aa98a152d2954e469933.png') no-repeat center center;
    background-size: contain;
    min-width: 120px;
    min-height: 70px;
    padding: 5px 20px 5px 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.purple-explanation {
    /* 1. Positioning & Centering */
    position: absolute;
    bottom: 15px;
    left: 0;
    right: 0;
    margin: 0 auto; /* This centers the block horizontally */
    
    /* 2. Sizing Constraints */
    width: fit-content;    /* Shrinks the box to the text width */
    max-width: 1100px;      /* Your original limit */
    width: -moz-fit-content; /* Compatibility for older Firefox */

    /* 3. Typography & Visuals */
    color: #ffffff;
    font-size: 1.7rem;
    font-weight: 600;
    text-align: center;
    text-shadow: 0 3px 8px rgba(0, 0, 0, 0.7);
    
    /* 4. Functional Styles */
    z-index: 25;
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.purple-explanation strong {
    font-size: 1.15em;
    font-weight: 700;
    color:#ffe600
}

.purple-explanation.visible {
    opacity: 1;
}
.pause-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 1530px;
    height: 960px;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 250;
}

.pause-screen.active {
    display: flex;
}

.pause-content {
    text-align: center;
    padding: 160px 80px 60px 80px;
    background: url('/static/typebrawl/assets/images/settings-pause-panel-79bd7b534c2b56c110e433d48e4992d9.png') no-repeat center center;
    background-size: 100% 100%;
    min-width: 600px;
    min-height: 500px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    position: relative;
}

.pause-content h1 {
    position: absolute;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
    padding: 0 30px;
    font-size: 2.5rem;
    font-weight: 900;
    letter-spacing: 6px;
    color: #eeff00;
    text-transform: uppercase;
    text-shadow: 0 6px 18px rgba(0, 0, 0, 0.6);
    display: block;
}

.pause-buttons {
    display: flex;
    flex-direction: row;
    gap: 20px;
    justify-content: center;
    margin-top: auto;
    padding-bottom: 20px;
}

.pause-btn {
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.pause-btn img {
    display: block;
    width: 210px;
    height: auto;
    filter: drop-shadow(0 12px 25px rgba(0, 0, 0, 0.4));
    transition: transform 0.2s ease, filter 0.2s ease, opacity 0.2s ease;
}

.pause-btn:hover {
    transform: scale(1.05);
}

.pause-btn:hover img {
    filter: drop-shadow(0 16px 30px rgba(0, 0, 0, 0.45));
    opacity: 0.95;
}

.pause-btn:active {
    transform: scale(0.98);
}
.pause-sliders,
.settings-sliders {
    display: flex;
    flex-direction: column;
    gap: 25px;
    margin-bottom: 30px;
    margin-top: 20px;
    width: 100%;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.slider-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: left;
}

.slider-group label {
    font-size: 1.4rem;
    font-weight: 600;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.volume-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 16px;
    border-radius: 6px;
    background: linear-gradient(to right, #e0e0e0, #f5f5f5);
    outline: none;
    cursor: pointer;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 30px;
    height: 30px;
    border-radius: 4px;
    background: linear-gradient(135deg, #d8b4fe 0%, #c084fc 50%, #b57efc 100%);
    cursor: pointer;
}

.volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.05);
}

.volume-slider::-moz-range-thumb {
    width: 30px;
    height: 30px;
    border-radius: 4px;
    background: linear-gradient(135deg, #d8b4fe 0%, #c084fc 50%, #b57efc 100%);
    cursor: pointer;
    border: none;
}

.volume-slider::-moz-range-thumb:hover {
    transform: scale(1.05);
}
.settings-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 1530px;
    height: 960px;
    background: url('/static/typebrawl/assets/images/background-e050c903e25f4414d3bd9e62dccd2fde.png') no-repeat center center;
    background-size: cover;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 350;
}

.settings-screen.active {
    display: flex;
}

.settings-content {
    text-align: center;
    padding: 160px 80px 60px 80px;
    background: url('/static/typebrawl/assets/images/settings-pause-panel-79bd7b534c2b56c110e433d48e4992d9.png') no-repeat center center;
    background-size: 100% 100%;
    min-width: 600px;
    min-height: 500px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    position: relative;
}

.settings-content h1 {
    position: absolute;
    top: 19px;
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
    padding: 0 30px;
    font-size: 2.3rem;
    font-weight: 900;
    letter-spacing: 6px;
    color: #eeff00;
    text-transform: uppercase;
    text-shadow: 0 6px 18px rgba(0, 0, 0, 0.6);
    display: block;
}

.back-btn {
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: transform 0.2s ease;
    margin-top: 20px;
}

.back-btn img {
    display: block;
    width: 210px;
    height: auto;
    filter: drop-shadow(0 12px 25px rgba(0, 0, 0, 0.4));
    transition: transform 0.2s ease, filter 0.2s ease, opacity 0.2s ease;
}

.back-btn:hover {
    transform: scale(1.05);
}

.back-btn:hover img {
    filter: drop-shadow(0 16px 30px rgba(0, 0, 0, 0.45));
    opacity: 0.95;
}

.back-btn:active {
    transform: scale(0.98);
}

/* Ensure letters can be transformed (scaled) */
.word-text span {
    display: inline-block;
    transition: color 0.2s;
}

/* The "Pop" Animation */
.char-pop {
    animation: typePop 0.15s ease-out;
}

@keyframes typePop {
    0% {
        transform: scale(1);
        font-weight: normal;
    }
    50% {
        transform: scale(1.5); /* Makes it 50% bigger */
        font-weight: 900;      /* Makes it extra bold */
        filter: brightness(1.2); /* Makes it glow slightly */
    }
    100% {
        transform: scale(1);
        font-weight: normal;
    }
}

/* Make sure the 'typed' (green) state is clear */
.word-text span.typed {
    color: #22c55e; /* Or your preferred green */
}
