@import url('https://fonts.googleapis.com/css2?family=VT323&family=Press+Start+2P&display=swap');

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

body {
    font-family: 'VT323', monospace;
    background: #000;
    color: #ff0000;
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

/* Matrix Rain Background Effect */
.matrix-rain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: linear-gradient(180deg,
        rgba(0,0,0,0.8) 0%,
        rgba(20,0,0,0.9) 50%,
        rgba(0,0,0,1) 100%);
    z-index: 1;
}

.matrix-rain::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(255, 0, 0, 0.03) 2px,
        rgba(255, 0, 0, 0.03) 4px
    );
    animation: scanlines 8s linear infinite;
}

@keyframes scanlines {
    0% { transform: translateY(0); }
    100% { transform: translateY(10px); }
}

.terminal-container {
    position: relative;
    z-index: 2;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    overflow-x: hidden; /* Prevent horizontal overflow */
    box-sizing: border-box;
}

/* ASCII Art Header */
.ascii-art {
    color: #ff0000;
    font-size: 10px;
    line-height: 1;
    text-align: center;
    margin-bottom: 20px;
    text-shadow: 0 0 10px #ff0000, 0 0 20px #ff0000;
    animation: flicker 2s infinite;
}

@keyframes flicker {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

/* Warning Banner */
.warning-banner {
    background: #ff0000;
    color: #000;
    padding: 5px;
    margin-bottom: 20px;
    border: 2px solid #fff;
    font-family: 'Press Start 2P', cursive;
    font-size: 12px;
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.8);
    overflow: hidden; /* Keep marquee inside the banner */
    width: 100%;
}

.warning-banner marquee {
    width: 100%;
    display: block;
}

/* Wallet Section */
.wallet-section {
    margin-bottom: 20px;
    text-align: center;
}

.cyber-button {
    background: linear-gradient(45deg, #ff0000, #8b0000);
    border: 2px solid #ff0000;
    color: #fff;
    padding: 15px 30px;
    font-size: 18px;
    font-family: 'Press Start 2P', cursive;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    transition: all 0.3s;
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.5);
}

.cyber-button:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(255, 0, 0, 0.8);
}

.button-glitch {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    animation: glitch 3s infinite;
}

@keyframes glitch {
    0%, 90%, 100% { opacity: 0; }
    95% {
        opacity: 1;
        filter: hue-rotate(90deg);
        transform: translate(-2px, 2px);
    }
}

.wallet-info {
    background: rgba(0,0,0,0.8);
    border: 1px solid #ff0000;
    padding: 10px;
    display: inline-block;
    margin-top: 10px;
}

.wallet-address {
    color: #ff0000;
    font-size: 16px;
    margin-right: 10px;
}

.disconnect-btn {
    background: #8b0000;
    color: #fff;
    border: 1px solid #ff0000;
    padding: 5px 10px;
    cursor: pointer;
    font-family: 'VT323', monospace;
    font-size: 16px;
}

.hidden {
    display: none !important;
}

/* Main Terminal */
.terminal {
    background: #0a0a0a;
    border: 3px solid #ff0000;
    border-radius: 0;
    box-shadow: 0 0 50px rgba(255, 0, 0, 0.5),
                inset 0 0 20px rgba(255, 0, 0, 0.1);
    overflow: hidden;
}

.terminal-header {
    background: linear-gradient(90deg, #ff0000, #8b0000);
    padding: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #ff0000;
}

.terminal-title {
    color: #000;
    font-weight: bold;
    font-size: 14px;
    font-family: 'Press Start 2P', cursive;
}

.terminal-buttons {
    display: flex;
    gap: 5px;
}

.terminal-button {
    width: 20px;
    height: 20px;
    background: #000;
    color: #ff0000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 1px solid #ff0000;
    font-weight: bold;
}

.terminal-body {
    padding: 20px;
    background: rgba(0, 0, 0, 0.9);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.stat-box {
    background: rgba(139, 0, 0, 0.2);
    border: 2px solid #ff0000;
    padding: 15px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.stat-box::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg,
        transparent 30%,
        rgba(255, 0, 0, 0.1) 50%,
        transparent 70%);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.stat-label {
    font-size: 12px;
    color: #ff6666;
    margin-bottom: 5px;
    letter-spacing: 2px;
}

.stat-value {
    font-size: 24px;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 0 10px #ff0000;
}

.chaos-bar {
    width: 100%;
    height: 20px;
    background: #1a0000;
    border: 1px solid #ff0000;
    position: relative;
    overflow: hidden;
}

.chaos-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff0000, #ff6600);
    width: 0%;
    transition: width 0.5s;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Burn Board */
.burn-board {
    background: rgba(20, 0, 0, 0.8);
    border: 2px solid #ff0000;
    margin-bottom: 20px;
    padding: 0;
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.3);
}

.board-header {
    background: linear-gradient(90deg, #ff0000, #8b0000);
    padding: 10px;
    text-align: center;
    border-bottom: 2px solid #ff0000;
}

.board-title {
    font-size: 16px;
    font-weight: bold;
    color: #000;
    font-family: 'Press Start 2P', cursive;
}

.board-subtitle {
    display: block;
    font-size: 10px;
    color: #000;
    opacity: 0.8;
    margin-top: 5px;
}

.saboteur-list {
    padding: 10px;
    max-height: 150px;
    overflow-y: auto;
}

.saboteur-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    margin-bottom: 5px;
    background: rgba(255, 0, 0, 0.1);
    border-left: 3px solid #ff0000;
    transition: all 0.3s;
    animation: slideIn 0.3s ease-out;
}

.saboteur-item:hover {
    background: rgba(255, 0, 0, 0.2);
    transform: translateX(5px);
}

.saboteur-rank {
    font-size: 20px;
    color: #ff6600;
    margin-right: 10px;
    font-weight: bold;
    min-width: 30px;
}

.saboteur-wallet {
    flex: 1;
    color: #ff0000;
    font-family: 'VT323', monospace;
    font-size: 16px;
}

.saboteur-stats {
    text-align: right;
}

.saboteur-burned {
    font-size: 18px;
    color: #fff;
    font-weight: bold;
    text-shadow: 0 0 5px #ff0000;
}

.saboteur-commands {
    font-size: 12px;
    color: #ff6666;
    opacity: 0.8;
}

.saboteur-placeholder {
    text-align: center;
    color: #666;
    padding: 20px;
    font-style: italic;
}


/* Command Section */
.command-section {
    margin-bottom: 20px;
    width: 100%;
    box-sizing: border-box;
}

.input-container {
    display: flex;
    align-items: center;
    background: #000;
    border: 2px solid #ff0000;
    padding: 10px;
    margin-bottom: 10px;
}

.prompt {
    color: #ff0000;
    margin-right: 10px;
    font-weight: bold;
    font-size: 18px;
}

.command-input {
    flex: 1;
    background: none;
    border: none;
    color: #fff;
    font-family: 'VT323', monospace;
    font-size: 18px;
    outline: none;
}

.command-input::placeholder {
    color: #666;
    font-size: 14px;
}

.burn-button {
    width: 100%;
    max-width: 100%;
    padding: 15px;
    background: linear-gradient(45deg, #ff0000, #ff6600);
    border: 3px solid #ff0000;
    color: #000;
    font-family: 'Press Start 2P', cursive;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    transition: all 0.3s;
    box-sizing: border-box;
}

.burn-button:hover:not(:disabled) {
    transform: scale(1.02);
    box-shadow: 0 0 30px rgba(255, 102, 0, 0.8);
}

.burn-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.burn-flames {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    animation: flames 0.5s infinite;
}

@keyframes flames {
    0%, 100% { transform: translateY(-50%) scale(1); }
    50% { transform: translateY(-50%) scale(1.2); }
}

/* Command Grid */
.command-grid {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
    gap: 20px;
}

.dpad {
    display: grid;
    grid-template-columns: repeat(3, 50px);
    grid-template-rows: repeat(3, 50px);
    gap: 5px;
}

.dpad button:nth-child(1) { grid-column: 2; grid-row: 1; }
.dpad button:nth-child(2) { grid-column: 1; grid-row: 2; }
.dpad button:nth-child(3) { grid-column: 2; grid-row: 3; }
.dpad button:nth-child(4) { grid-column: 3; grid-row: 2; }

.action-buttons {
    display: grid;
    grid-template-columns: repeat(2, 60px);
    gap: 10px;
}

.cmd-btn {
    background: #1a0000;
    border: 2px solid #ff0000;
    color: #ff0000;
    font-family: 'Press Start 2P', cursive;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.3);
}

.cmd-btn:hover {
    background: #ff0000;
    color: #000;
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.8);
}

.action-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    font-size: 20px;
}

.small-btn {
    font-size: 8px;
    padding: 5px;
}

/* Live Feed */
.live-feed {
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #ff0000;
    margin-bottom: 20px;
    max-height: 200px;
    overflow: hidden;
}

.feed-header {
    background: #1a0000;
    padding: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #ff0000;
}

.feed-title {
    font-size: 14px;
    font-weight: bold;
    color: #ff0000;
}

.blink {
    color: #00ff00;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50%, 100% { opacity: 1; }
    25%, 75% { opacity: 0; }
}

.feed-content {
    padding: 10px;
    height: 150px;
    overflow-y: auto;
    font-size: 14px;
}

.feed-message {
    color: #0f0;
    margin-bottom: 5px;
    padding: 5px;
    border-left: 2px solid #0f0;
    animation: slideIn 0.3s;
}

@keyframes slideIn {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.feed-message.error {
    color: #ff0000;
    border-left-color: #ff0000;
}

.feed-message.success {
    color: #00ff00;
    border-left-color: #00ff00;
}

/* Status Bar */
.status-bar {
    background: #1a0000;
    border: 1px solid #ff0000;
    padding: 10px;
    text-align: center;
    color: #ff6666;
    font-size: 14px;
    letter-spacing: 1px;
}

/* Footer */
.footer {
    margin-top: 30px;
    text-align: center;
    color: #ff0000;
}

.footer-text {
    font-size: 12px;
    letter-spacing: 2px;
    margin-bottom: 10px;
    opacity: 0.8;
}

.meowth {
    text-align: center;
}

.meowth-art {
    color: #ff0000;
    font-size: 10px;
    line-height: 1.2;
    opacity: 0.6;
    margin-bottom: 5px;
}

.meowth-text {
    color: #ff0000;
    font-size: 8px;
    opacity: 0.6;
    font-family: 'Press Start 2P', cursive;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #1a0000;
}

::-webkit-scrollbar-thumb {
    background: #ff0000;
    border: 1px solid #000;
}

::-webkit-scrollbar-thumb:hover {
    background: #ff6600;
}

/* Loading Animation */
@keyframes loading {
    0% { content: 'BURNING.'; }
    33% { content: 'BURNING..'; }
    66% { content: 'BURNING...'; }
    100% { content: 'BURNING.'; }
}

.loading::after {
    content: 'BURNING.';
    animation: loading 1s infinite;
}

/* Blasting Off Screen */
.blasting-off-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.blast-container {
    text-align: center;
    animation: floatUp 3s ease-in-out infinite;
}

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

.blast-rocket {
    color: #ff0000;
    font-size: 14px;
    line-height: 1.2;
    margin-bottom: 30px;
    text-shadow: 0 0 20px #ff0000;
    animation: rocketLaunch 4s ease-in-out infinite;
}

@keyframes rocketLaunch {
    0% { transform: translateY(0) scale(1); }
    25% { transform: translateY(-10px) scale(1.05); }
    50% { transform: translateY(0) scale(1); }
    75% { transform: translateY(10px) scale(0.95); }
    100% { transform: translateY(0) scale(1); }
}

.blast-title {
    color: #ff0000;
    font-size: 32px;
    font-family: 'Press Start 2P', cursive;
    margin-bottom: 20px;
    text-shadow: 0 0 30px #ff0000;
    animation: blastPulse 1.5s infinite;
}

@keyframes blastPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.05); }
}

.blast-subtitle {
    color: #ff6600;
    font-size: 16px;
    font-family: 'Press Start 2P', cursive;
    margin-bottom: 30px;
    animation: slideText 2s ease-in-out infinite;
}

@keyframes slideText {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.blast-message {
    color: #ff6666;
    font-size: 14px;
    font-family: 'VT323', monospace;
    line-height: 1.8;
    margin-bottom: 20px;
}

.blast-stars {
    color: #ffff00;
    font-size: 24px;
    animation: twinkle 2s infinite;
}

@keyframes twinkle {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Responsive styles for mobile devices */
@media screen and (max-width: 768px) {
    .terminal-container {
        padding: 10px;
    }

    /* Fix ASCII art overflow */
    .ascii-art {
        font-size: 6px;
        overflow-x: auto;
        white-space: pre;
    }

    /* Center wallet section properly */
    .wallet-section {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        width: 100%;
    }

    .cyber-button {
        width: 90%;
        max-width: 300px;
        padding: 12px 20px;
        font-size: 14px;
        margin: 0 auto;
    }

    /* Fix command section alignment */
    .command-section {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
        padding: 0 10px;
    }

    .input-container {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        justify-content: center;
    }

    .prompt {
        font-size: 14px;
        white-space: nowrap;
    }

    .command-input {
        font-size: 14px;
        width: 100%;
    }

    /* Center burn button */
    .burn-button {
        width: 90%;
        max-width: 350px;
        padding: 12px;
        font-size: 12px;
        margin: 0 auto;
        display: block;
        box-sizing: border-box;
    }

    .burn-flames {
        right: 10px;
        font-size: 16px;
    }

    /* Adjust stats grid */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 10px;
    }

    .stat-box {
        padding: 15px;
    }

    .stat-label {
        font-size: 10px;
    }

    .stat-value {
        font-size: 20px;
    }

    /* Command grid responsiveness */
    .command-grid {
        padding: 10px;
        gap: 10px;
    }

    .dpad {
        transform: scale(0.8);
    }

    .action-buttons {
        transform: scale(0.8);
        gap: 10px;
    }

    /* Adjust live feed */
    .live-feed {
        margin: 10px;
    }

    .feed-message {
        font-size: 12px;
    }

    /* Burn board adjustments */
    .burn-board {
        margin: 10px;
        padding: 15px;
    }

    .board-title {
        font-size: 14px;
    }

    /* Footer adjustments */
    .footer-text {
        font-size: 10px;
        padding: 0 10px;
    }

    /* Blasting off screen for mobile */
    .blast-title {
        font-size: 18px;
    }

    .blast-subtitle {
        font-size: 12px;
    }

    .blast-rocket {
        font-size: 10px;
    }
}

/* Extra small devices */
@media screen and (max-width: 480px) {
    /* Further reduce padding */
    .terminal-container {
        padding: 5px;
    }

    /* Make ASCII art even smaller on very small screens */
    .ascii-art {
        font-size: 4px;
    }

    /* Ensure wallet button is properly centered */
    .cyber-button {
        width: 95%;
        font-size: 12px;
        padding: 10px 15px;
    }

    /* Make command input more compact */
    .input-container {
        padding: 8px;
    }

    .prompt {
        font-size: 12px;
        margin-right: 5px;
    }

    .command-input {
        font-size: 12px;
    }

    .command-input::placeholder {
        font-size: 10px;
    }

    /* Ensure burn button is centered and properly sized */
    .burn-button {
        width: 95%;
        font-size: 10px;
        padding: 10px;
    }

    /* Scale down command buttons even more */
    .dpad, .action-buttons {
        transform: scale(0.7);
    }

    /* Adjust terminal header */
    .terminal-title {
        font-size: 10px;
    }

    /* Warning banner text */
    .warning-banner {
        font-size: 10px;
        padding: 3px;
    }
}