@font-face {
    font-family: 'Minecraft';
    src: url('assets/fonts/Minecraft.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow: hidden;
}

body {
    font-family: 'Minecraft', 'Courier New', monospace;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.game-container {
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 30px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 auto;
    width: 100%;
    max-width: 100%;
    height: 100vh;
    max-height: 100vh;
    justify-content: center;
}

h1 {
    color: #4ecca3;
    margin-bottom: 20px;
    font-size: 2.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.score-board {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
}

.score-row {
    display: flex;
    gap: 30px;
    justify-content: center;
}

.game-banner {
    max-width: 100%;
    width: 400px;
    height: auto;
    margin-bottom: 15px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.score, .high-score {
    background: rgba(0, 0, 0, 0.3);
    padding: 10px 20px;
    border-radius: 10px;
    color: #fff;
    font-size: 1.2rem;
}

#score, #high-score, #finalScore {
    color: #4ecca3;
    font-weight: bold;
    font-size: 1.4rem;
}

#gameCanvas {
    max-width: 100%;
    max-height: calc(100vh - 300px);
    width: auto;
    height: auto;
    display: block;
    margin: 0 auto 20px auto;
    border: 4px solid #ff00ff;
    border-radius: 10px;
    box-shadow: 
        0 0 10px #ff00ff,
        0 0 20px #ff00ff,
        0 0 40px #00ffff,
        0 0 60px #00ffff,
        inset 0 0 20px rgba(255, 0, 255, 0.3),
        inset 0 0 40px rgba(0, 255, 255, 0.2);
    animation: neon-pulse 2s ease-in-out infinite;
}

@keyframes neon-pulse {
    0%, 100% {
        box-shadow: 
            0 0 10px #ff00ff,
            0 0 20px #ff00ff,
            0 0 40px #00ffff,
            0 0 60px #00ffff,
            inset 0 0 20px rgba(255, 0, 255, 0.3),
            inset 0 0 40px rgba(0, 255, 255, 0.2);
    }
    50% {
        box-shadow: 
            0 0 15px #ff00ff,
            0 0 30px #ff00ff,
            0 0 50px #00ffff,
            0 0 80px #00ffff,
            inset 0 0 30px rgba(255, 0, 255, 0.5),
            inset 0 0 50px rgba(0, 255, 255, 0.4);
    }
}

#gameCanvas::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border: 4px solid transparent;
    border-image: linear-gradient(
        45deg,
        #ff00ff 0%,
        #ff00ff 25%,
        #00ffff 50%,
        #00ffff 75%,
        #ff00ff 100%
    ) 1;
    border-radius: 10px;
    pointer-events: none;
    animation: border-rotate 4s linear infinite;
}

@keyframes border-rotate {
    0% {
        filter: hue-rotate(0deg);
    }
    100% {
        filter: hue-rotate(360deg);
    }
}

#gameCanvas::after {
    content: '';
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
    background: 
        linear-gradient(90deg, transparent 50%, #ff00ff 50%),
        linear-gradient(0deg, transparent 50%, #00ffff 50%);
    background-size: 20px 20px;
    border-radius: 14px;
    pointer-events: none;
    opacity: 0.5;
    animation: grid-move 20s linear infinite;
}

@keyframes grid-move {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 20px 20px;
    }
}

#startButton {
    margin-top: 20px;
    padding: 15px 40px;
    font-size: 1.3rem;
    font-weight: bold;
    color: #1a1a2e;
    background: #4ecca3;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(78, 204, 163, 0.4);
    display: none;
}

#startButton:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(78, 204, 163, 0.6);
}

#startButton:active {
    transform: translateY(0);
}

.game-over {
    display: none;
    position: fixed;
    top: 55%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.95);
    padding: 40px 60px;
    border-radius: 20px;
    text-align: center;
    z-index: 100;
    border: 3px solid #ff00ff;
    box-shadow: 
        0 0 20px #ff00ff,
        0 0 40px #ff00ff,
        0 0 60px #00ffff,
        0 0 80px #00ffff,
        inset 0 0 30px rgba(255, 0, 255, 0.3),
        inset 0 0 50px rgba(0, 255, 255, 0.2);
    animation: neon-pulse 2s ease-in-out infinite;
}

.game-over h2 {
    color: #eb2bf1ad;
    font-size: 2.5rem;
    margin-bottom: 20px;
    text-shadow: 
        0 0 10px #ff6b6b,
        0 0 20px #ff6b6b,
        0 0 30px #ff6b6b;
    animation: text-glow 1.5s ease-in-out infinite alternate;
}

@keyframes text-glow {
    from {
        text-shadow: 
            0 0 8px #ff6b6b,
            0 0 16px #ff6b6b,
            0 0 30px #ff6b6b;
    }
    to {
        text-shadow: 
            0 0 20px #ff6b6b,
            0 0 30px #ff6b6b,
            0 0 40px #ff6b6b,
            0 0 50px #ff6b6b;
    }
}

.game-over p {
    color: #fff;
    font-size: 1.5rem;
    margin-bottom: 30px;
}

.game-over-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    justify-content: center;
    align-items: center;
}

.play-again-text {
    color: #fff;
    font-size: 1.2rem;
    margin-bottom: 5px;
    font-weight: bold;
}

#playAgainButton, #returnToStartButton {
    padding: 12px 35px;
    font-size: 1.1rem;
    font-weight: bold;
    color: #1a1a2e;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#playAgainButton {
    background: #ff6b6b;
}

#playAgainButton:hover {
    background: #ff8787;
    transform: translateY(-2px);
}

#returnToStartButton {
    background: #4ecca3;
}

#returnToStartButton:hover {
    background: #6ee0b7;
    transform: translateY(-2px);
}

#restartButton {
    padding: 12px 35px;
    font-size: 1.1rem;
    font-weight: bold;
    color: #1a1a2e;
    background: #ff6b6b;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#restartButton:hover {
    background: #ff8787;
    transform: translateY(-2px);
}

.instructions {
    margin-top: 20px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

.question-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.question-modal.active {
    display: flex;
}

.startup-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.startup-modal.active {
    display: flex;
}

.modal-content {
    background: rgba(26, 26, 46, 0.95);
    padding: 35px;
    border-radius: 20px;
    text-align: center;
    min-width: 400px;
    max-width: 500px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(78, 204, 163, 0.3);
    border: 1px solid rgba(78, 204, 163, 0.2);
}

.modal-content h3 {
    color: #4ecca3;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.startup-modal .modal-content h3 {
    color: #4ecca3;
    margin-bottom: 30px;
    font-size: 2rem;
    text-shadow: 0 0 10px rgba(78, 204, 163, 0.5);
}

.startup-modal .form-group {
    margin-bottom: 30px;
    text-align: center;
}

.startup-modal .form-group label {
    display: block;
    color: #4ecca3;
    font-size: 1rem;
    font-weight: bold;
    margin-bottom: 12px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.startup-modal .form-group input[type="text"] {
    width: 100%;
    max-width: 200px;
    padding: 15px 20px;
    font-size: 1.3rem;
    border: 2px solid rgba(78, 204, 163, 0.5);
    border-radius: 10px;
    margin: 0 auto;
    display: block;
    text-align: center;
    text-transform: uppercase;
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    font-family: 'Minecraft', 'Courier New', monospace;
    transition: all 0.3s ease;
}

.startup-modal .form-group input[type="text"]::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.startup-modal .form-group input[type="text"]:focus {
    outline: none;
    border-color: #4ecca3;
    box-shadow: 0 0 20px rgba(78, 204, 163, 0.4);
    background: rgba(0, 0, 0, 0.5);
}

.tile-size-options {
    display: flex;
    justify-content: center;
    gap: 40px;
}

.radio-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
}

.radio-option input[type="radio"] {
    display: none;
}

.radio-option span {
    width: 70px;
    height: 70px;
    background: rgba(255, 255, 255, 0.1);
    border: 3px solid rgba(78, 204, 163, 0.5);
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.8rem;
    font-weight: bold;
    color: #4ecca3;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.radio-option span:hover {
    border-color: #4ecca3;
    box-shadow: 0 0 20px rgba(78, 204, 163, 0.4);
    transform: translateY(-3px);
}

.radio-option input[type="radio"]:checked + span {
    background: rgba(78, 204, 163, 0.2);
    color: #4ecca3;
    border-color: #4ecca3;
    box-shadow: 0 0 30px rgba(78, 204, 163, 0.6), inset 0 0 20px rgba(78, 204, 163, 0.2);
    transform: scale(1.1);
}

.startup-modal .btn-shiny-primary {
    width: 100%;
    max-width: 200px;
    margin-top: 20px;
    font-family: 'Minecraft', 'Courier New', monospace;
    background: #4ecca3;
    color: #1a1a2e;
    font-weight: bold;
    font-size: 1.1rem;
    padding: 15px 40px;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(78, 204, 163, 0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.startup-modal .btn-shiny-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(78, 204, 163, 0.6);
    background: #6ee0b7;
}

.startup-modal .btn-shiny-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(78, 204, 163, 0.3);
}

.question-text {
    font-size: 1.3rem;
    font-weight: bold;
    color: #fffbfb;
    margin-bottom: 20px;
    line-height: 1.4;
}

#answerInput {
    width: 100%;
    padding: 12px 15px;
    font-size: 1.1rem;
    border: 2px solid #4ecca3;
    border-radius: 8px;
    margin-bottom: 15px;
    outline: none;
    text-align: center;
}

#answerInput:focus {
    box-shadow: 0 0 10px rgba(78, 204, 163, 0.5);
}

#submitAnswer {
    padding: 12px 30px;
    font-size: 1.1rem;
    font-weight: bold;
    color: #1a1a2e;
    background: #4ecca3;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#submitAnswer:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(78, 204, 163, 0.6);
}

.hint {
    margin-top: 15px;
    font-size: 0.9rem;
    color: #ff6b6b;
    font-weight: bold;
}

.btn-shiny {
    text-decoration: none;
    border: 1px solid rgb(146, 148, 248);
    position: relative;
    overflow: hidden;
}

.btn-shiny:hover {
    box-shadow: 1px 1px 25px 10px rgba(146, 148, 248, 0.4);
}

.btn-shiny:before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        120deg,
        transparent,
        rgba(146, 148, 248, 0.4),
        transparent
    );
    transition: all 650ms;
}

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

.btn-shiny-primary {
    border-color: #4ecca3;
}

.btn-shiny-primary:hover {
    box-shadow: 1px 1px 25px 10px rgba(78, 204, 163, 0.4);
}

.btn-shiny-primary:before {
    background: linear-gradient(
        120deg,
        transparent,
        rgba(78, 204, 163, 0.4),
        transparent
    );
}

.btn-shiny-danger {
    border-color: #ff6b6b;
}

.btn-shiny-danger:hover {
    box-shadow: 1px 1px 25px 10px rgba(255, 107, 107, 0.4);
}

.btn-shiny-danger:before {
    background: linear-gradient(
        120deg,
        transparent,
        rgba(255, 107, 107, 0.4),
        transparent
    );
}

#openOptionsBtn {
    margin-top: 20px;
    margin-right: 10px;
    padding: 12px 30px;
    font-size: 1.1rem;
    background: #ff6b6b;
    color: #1a1a2e;
    font-weight: bold;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
}

#openOptionsBtn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(255, 107, 107, 0.6);
    background: #ff8787;
}

#openOptionsBtn:active {
    transform: translateY(0);
}

.options-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.options-modal.active {
    display: flex;
}

.options-modal .modal-content h3 {
    color: #4ecca3;
    margin-bottom: 30px;
    font-size: 2rem;
}

.options-modal .form-group {
    margin-bottom: 25px;
}

.options-modal .form-group label {
    display: block;
    color: #4ecca3;
    font-size: 1rem;
    margin-bottom: 10px;
    text-align: center;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.options-modal input[type="range"] {
    width: 100%;
    max-width: 250px;
    margin: 0 auto 10px;
    display: block;
    cursor: pointer;
}

.options-modal .volume-value {
    color: #fff;
    font-size: 1.1rem;
    display: block;
    text-align: center;
    font-weight: bold;
}

.options-modal .btn-shiny-primary {
    background: #4ecca3;
    color: #1a1a2e;
    padding: 12px 30px;
    font-size: 1.1rem;
    font-weight: bold;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-right: 10px;
    box-shadow: 0 4px 15px rgba(78, 204, 163, 0.4);
}

.options-modal .btn-shiny-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(78, 204, 163, 0.6);
    background: #6ee0b7;
}

.options-modal .btn-shiny-danger {
    background: #ff6b6b;
    color: #1a1a2e;
    padding: 12px 30px;
    font-size: 1.1rem;
    font-weight: bold;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
}

.options-modal .btn-shiny-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.6);
    background: #ff8787;
}

.streak-display {
    color: #ff6b6b;
    font-size: 1rem;
    margin-top: 15px;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.3s ease;
    text-shadow: 0 0 10px rgba(255, 107, 107, 0.5);
}

.streak-display.active {
    opacity: 1;
}

.streak-display.bonus {
    animation: streak-pulse 0.5s ease-in-out;
}

@keyframes streak-pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 1;
    }
}