/* Game styles */
@import url('https://fonts.googleapis.com/css2?family=Creepster&family=VT323&display=swap');

body {
    margin: 0;
    padding: 0;
    background-color: #000;
    font-family: 'VT323', monospace;
    color: #fff;
    overflow: hidden;
}

#game-container {
    position: relative;
    width: 1000px;
    height: 800px;
    margin: 0 auto;
    overflow: hidden;
}

#gameCanvas {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    background-color: #000;
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    background: linear-gradient(0deg, rgba(0, 0, 10, 0.95) 0%, rgba(20, 0, 40, 0.95) 100%);
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;

    /* Subtle grid pattern overlay */
    background-image:
        radial-gradient(circle at 25% 25%, rgba(40, 0, 80, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(0, 20, 40, 0.2) 0%, transparent 50%),
        linear-gradient(rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 0.25) 50%);
    background-size: 100% 100%, 100% 100%, 4px 4px;
    background-repeat: no-repeat, no-repeat, repeat;
}

.screen.hidden {
    display: none;
}

.title-animated {
    font-family: 'Creepster', cursive;
    font-size: 80px;
    color: #bd0000; /* Less bright red */
    text-shadow:
        0 0 10px #9000ff,  /* Purple glow */
        0 0 20px #4b0082,  /* Indigo glow */
        0 0 30px #500,     /* Dark red glow */
        0 0 40px #300;     /* Very dark red glow */
    margin-top: 20px;
    margin-bottom: 30px;
    text-align: center;
    letter-spacing: 2px;
    animation: pulse 3s infinite;
    position: relative;
}

.title-animated:after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(150, 0, 255, 0.5) 20%,
        rgba(255, 0, 0, 0.8) 50%,
        rgba(150, 0, 255, 0.5) 80%,
        transparent 100%);
}

@keyframes pulse {
    0%, 100% {
        text-shadow:
            0 0 10px #9000ff,
            0 0 20px #4b0082,
            0 0 30px #500,
            0 0 40px #300;
    }
    50% {
        text-shadow:
            0 0 15px #a020f0,
            0 0 25px #800080,
            0 0 35px #700,
            0 0 45px #500;
    }
}

.game-btn {
    font-family: 'VT323', monospace;
    font-size: 28px;
    background: linear-gradient(to bottom, #305 0%, #203 100%);
    color: #fff;
    border: 2px solid #407;
    border-radius: 5px;
    padding: 18px 35px;
    margin: 15px;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 200px;
    text-align: center;
    text-shadow: 0 2px 2px rgba(0, 0, 0, 0.5);
    box-shadow:
        0 5px 15px rgba(0, 0, 0, 0.3),
        inset 0 1px 1px rgba(255, 100, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.game-btn:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.5s;
}

.game-btn:hover {
    background: linear-gradient(to bottom, #407 0%, #305 100%);
    transform: scale(1.05);
    box-shadow:
        0 5px 20px rgba(100, 0, 200, 0.3),
        inset 0 1px 1px rgba(200, 100, 255, 0.4);
}

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

.game-btn:active {
    transform: translateY(2px);
    box-shadow:
        0 2px 5px rgba(0, 0, 0, 0.3),
        inset 0 1px 1px rgba(200, 100, 255, 0.2);
}

.game-controls-container {
    margin: 20px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

#buttons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    max-width: 500px;
    gap: 15px;
}

#instructions {
    font-size: 20px;
    text-align: center;
    margin: 25px 0 15px;
    line-height: 1.6;
    background-color: rgba(0, 0, 0, 0.4);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid rgba(100, 0, 0, 0.4);
    max-width: 80%;
}

#game-description {
    font-size: 18px;
    text-align: center;
    margin: 20px 0;
    padding: 15px;
    background-color: rgba(50, 0, 0, 0.5);
    border-radius: 8px;
    border: 1px solid rgba(150, 0, 0, 0.3);
    max-width: 80%;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

#game-description p {
    margin: 10px 0;
}

#sound-controls {
    position: absolute;
    bottom: 20px;
    left: 20px;
}

.control-btn {
    font-family: 'VT323', monospace;
    font-size: 18px;
    background-color: #222;
    color: #fff;
    border: 1px solid #444;
    border-radius: 4px;
    padding: 8px 15px;
    cursor: pointer;
    transition: all 0.3s;
}

.control-btn:hover {
    background-color: #444;
}

#game-over-title {
    font-family: 'Creepster', cursive;
    font-size: 64px;
    color: #ff0000;
    margin-top: 100px;
    text-shadow: 0 0 10px #ff0000;
}

#score-display {
    font-size: 32px;
    margin: 30px 0;
    text-align: center;
}

/* Creator message */
#creator-message {
    margin: 20px auto;
    max-width: 80%;
    text-align: center;
    padding: 20px;
    background-color: rgba(50, 0, 0, 0.5);
    border-radius: 8px;
    border: 1px solid rgba(150, 0, 0, 0.3);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

#carter-message {
    font-size: 18px;
    line-height: 1.5;
}

.support-btn {
    display: inline-block;
    font-family: 'VT323', monospace;
    font-size: 20px;
    background: linear-gradient(to bottom, #085 0%, #063 100%);
    color: #fff;
    text-decoration: none;
    padding: 10px 20px;
    margin-top: 15px;
    border-radius: 5px;
    transition: all 0.3s;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.5);
    box-shadow: 
        0 4px 8px rgba(0, 0, 0, 0.3),
        inset 0 1px 1px rgba(100, 255, 100, 0.2);
}

.support-btn:hover {
    background: linear-gradient(to bottom, #0a6 0%, #085 100%);
    transform: scale(1.05);
    box-shadow: 
        0 5px 15px rgba(0, 100, 0, 0.3),
        inset 0 1px 1px rgba(120, 255, 120, 0.3);
}

/* Achievement notification */
.achievement-notification {
    position: fixed;
    top: 20px;
    right: -350px;
    width: 300px;
    background: linear-gradient(to right, rgba(50, 0, 80, 0.95), rgba(80, 0, 80, 0.9));
    border: 2px solid #a040a0;
    border-radius: 8px;
    padding: 15px;
    display: flex;
    align-items: center;
    z-index: 1000;
    transition: right 0.5s ease-in-out;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
}

.achievement-notification.show {
    right: 20px;
}

.achievement-icon {
    font-size: 40px;
    margin-right: 15px;
    text-shadow: 0 0 10px rgba(255, 100, 255, 0.8);
}

.achievement-text h3 {
    margin: 0 0 5px 0;
    color: #ff80ff;
    font-size: 20px;
    text-shadow: 0 0 5px rgba(255, 0, 255, 0.5);
}

.achievement-text p {
    margin: 5px 0;
    font-size: 16px;
}

/* Modal for achievements */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: linear-gradient(to bottom, #300 0%, #200 100%);
    border: 2px solid #700;
    border-radius: 8px;
    padding: 25px;
    max-width: 80%;
    max-height: 80%;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.modal h2 {
    text-align: center;
    color: #ff4040;
    margin-top: 0;
    text-shadow: 0 0 10px rgba(255, 0, 0, 0.3);
}

.stats-summary {
    margin: 20px 0;
    padding: 15px;
    background-color: rgba(50, 0, 0, 0.5);
    border-radius: 8px;
    border: 1px solid rgba(150, 0, 0, 0.3);
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.achievement-card {
    background-color: #300;
    border: 1px solid #600;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    opacity: 0.7;
    transition: all 0.3s;
}

.achievement-card.unlocked {
    background: linear-gradient(to bottom, #400050 0%, #300040 100%);
    border-color: #800080;
    opacity: 1;
    box-shadow: 0 5px 15px rgba(128, 0, 128, 0.3);
}

.achievement-card .achievement-icon {
    font-size: 40px;
    margin: 0 0 10px 0;
}

.achievement-card h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
}

.achievement-card p {
    margin: 0;
    font-size: 14px;
}

.fade-out {
    animation: fadeOut 0.5s;
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}