/* Arcade-Style Main Styles */

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

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

body {
    font-family: 'Press Start 2P', monospace;
    background: #1a1a2e;
    background-image:
            repeating-linear-gradient(
                    0deg,
                    transparent,
                    transparent 2px,
                    rgba(0, 0, 0, 0.1) 2px,
                    rgba(0, 0, 0, 0.1) 4px
            );
    color: #eee;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Animated background stars */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
            radial-gradient(2px 2px at 20% 30%, white, transparent),
            radial-gradient(2px 2px at 60% 70%, white, transparent),
            radial-gradient(1px 1px at 50% 50%, white, transparent),
            radial-gradient(1px 1px at 80% 10%, white, transparent),
            radial-gradient(2px 2px at 90% 60%, white, transparent),
            radial-gradient(1px 1px at 33% 80%, white, transparent);
    background-size: 200% 200%;
    animation: twinkle 8s infinite;
    opacity: 0.3;
    z-index: -1;
}

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

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Main Header Banner */
.main-header {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    border: 6px solid #000;
    border-radius: 0;
    padding: 20px 30px;
    margin-bottom: 30px;
    box-shadow: inset 0 0 0 4px #d68910, 0 8px 0 #000, 0 8px 25px rgba(0,0,0,0.7);
    position: relative;
    overflow: hidden;
}

/* Animated background pattern */
.main-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: repeating-linear-gradient(
            45deg,
            transparent,
            transparent 10px,
            rgba(0,0,0,0.1) 10px,
            rgba(0,0,0,0.1) 20px
    );
    animation: headerPattern 20s linear infinite;
    pointer-events: none;
}

@keyframes headerPattern {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

.header-content {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.main-header h1 {
    margin: 0;
    font-size: 2.5em;
    color: #000;
    text-shadow: 3px 3px 0 rgba(255,255,255,0.3),
    -1px -1px 0 rgba(0,0,0,0.2);
    letter-spacing: 2px;
    animation: titleGlow 2s ease-in-out infinite;
}

@keyframes titleGlow {
    0%, 100% { filter: drop-shadow(0 0 5px rgba(255,255,255,0.5)); }
    50% { filter: drop-shadow(0 0 15px rgba(255,255,255,0.8)); }
}

.header-info {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

/* Contract Address Display */
.contract-address {
    background: rgba(0,0,0,0.3);
    border: 3px solid #000;
    padding: 10px 20px;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    gap: 10px;
}

.ca-label {
    font-size: 0.9em;
    color: #fff;
    font-weight: bold;
    text-shadow: 2px 2px 0 #000;
}

.ca-text {
    font-size: 0.75em;
    color: #ffd700;
    text-shadow: 1px 1px 0 #000;
    font-family: monospace;
    letter-spacing: 1px;
}

/* X Community Button */
.x-community-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #000;
    color: #fff;
    padding: 12px 24px;
    text-decoration: none;
    font-size: 0.8em;
    font-weight: bold;
    border: 4px solid #000;
    box-shadow: 0 4px 0 #1a1a1a, 0 4px 10px rgba(0,0,0,0.5);
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

.x-community-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: left 0.5s;
}

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

.x-community-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #1a1a1a, 0 6px 15px rgba(0,0,0,0.7);
    background: #1a1a1a;
}

.x-community-btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #1a1a1a;
}

.x-icon {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.game-section {
    display: flex;
    gap: 30px;
    background: #2c3e50;
    border: 6px solid #000;
    border-radius: 0;
    padding: 30px;
    box-shadow:
            inset 0 0 0 4px #34495e,
            0 10px 0 #000,
            0 10px 30px rgba(0,0,0,0.7);
    position: relative;
}

/* Corner decorations */
.game-section::before,
.game-section::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: #f39c12;
    border: 3px solid #000;
}

.game-section::before {
    top: -3px;
    left: -3px;
    box-shadow:
            calc(100% + 6px) 0 0 #f39c12,
            calc(100% + 6px) 0 0 3px #000;
}

.game-section::after {
    bottom: -3px;
    left: -3px;
    box-shadow:
            calc(100% + 6px) 0 0 #f39c12,
            calc(100% + 6px) 0 0 3px #000;
}

.game-container {
    flex: 2;
    position: relative;
}

#gameCanvas {
    border: 6px solid #000;
    border-radius: 0;
    background: #0f1419;
    box-shadow:
            inset 0 0 20px rgba(0,0,0,0.8),
            0 4px 0 #1a252f,
            0 8px 20px rgba(0,0,0,0.5);
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    display: block;
}

.game-stats {
    display: flex;
    justify-content: space-around;
    margin-top: 20px;
    padding: 20px;
    background: #1a252f;
    border: 4px solid #000;
    border-radius: 0;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.5);
    position: relative;
}

.game-stats::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg,
    transparent,
    #3498db 20%,
    #3498db 80%,
    transparent);
    animation: statsLine 2s infinite;
}

@keyframes statsLine {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.stat-item {
    text-align: center;
    position: relative;
}

.stat-item label {
    display: block;
    font-size: 0.75em;
    font-weight: bold;
    margin-bottom: 10px;
    color: #95a5a6;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-item span {
    font-size: 2.2em;
    font-weight: bold;
    color: #2ecc71;
    text-shadow:
            0 0 5px #2ecc71,
            2px 2px 0 #000;
    display: inline-block;
    animation: statPulse 1s infinite;
}

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

.info-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.current-player, .player-queue, .result-history {
    background: #1a252f;
    border: 4px solid #000;
    border-radius: 0;
    padding: 20px;
    box-shadow:
            inset 0 0 10px rgba(0,0,0,0.5),
            0 4px 0 #000;
    position: relative;
    overflow: hidden;
}

.current-player::before,
.player-queue::before,
.result-history::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg,
    rgba(52, 73, 94, 0.3) 0%,
    transparent 100%);
    pointer-events: none;
}

.current-player h3, .player-queue h3, .result-history h3 {
    margin-bottom: 15px;
    color: #f39c12;
    border-bottom: 3px solid #000;
    padding-bottom: 10px;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 2px 2px 0 #000;
    position: relative;
    z-index: 1;
}

.current-player h3::after,
.player-queue h3::after,
.result-history h3::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 30%;
    height: 3px;
    background: #f39c12;
    animation: underlinePulse 2s infinite;
}

@keyframes underlinePulse {
    0%, 100% { width: 30%; }
    50% { width: 60%; }
}

.wallet-address {
    font-family: 'Courier New', monospace;
    background: #0f1419;
    padding: 15px;
    border: 3px solid #000;
    border-left: 6px solid #3498db;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.5);
    word-break: break-all;
    font-size: 0.65em;
    color: #3498db;
    text-shadow: 0 0 5px rgba(52, 152, 219, 0.5);
    letter-spacing: 1px;
    position: relative;
    z-index: 1;
}

.queue-list, .history-list {
    max-height: 200px;
    overflow-y: auto;
    background: #0f1419;
    border: 3px solid #000;
    padding: 10px;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.5);
    position: relative;
    z-index: 1;
}

.queue-item, .history-item {
    padding: 12px 14px;
    border-bottom: 2px solid #2c3e50;
    font-family: 'Courier New', monospace;
    font-size: 0.65em;
    transition: all 0.3s;
    position: relative;
}

.queue-item:hover, .history-item:hover {
    background: rgba(52, 152, 219, 0.1);
    transform: translateX(5px);
}

.queue-item:last-child, .history-item:last-child {
    border-bottom: none;
}

.queue-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #95a5a6;
}

.queue-position {
    background: #3498db;
    color: #fff;
    padding: 5px 12px;
    border: 2px solid #000;
    font-size: 0.9em;
    font-weight: bold;
    box-shadow: 2px 2px 0 #000;
    animation: positionBlink 2s infinite;
}

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

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #7f8c8d;
}

.history-result {
    font-weight: bold;
    padding: 5px 12px;
    border: 2px solid #000;
    font-size: 0.85em;
    box-shadow: 2px 2px 0 #000;
    text-transform: uppercase;
}

.result-coin {
    background: #f1c40f;
    color: #000;
    animation: coinShine 1s infinite alternate;
}

@keyframes coinShine {
    from { box-shadow: 2px 2px 0 #000, 0 0 5px #f1c40f; }
    to { box-shadow: 2px 2px 0 #000, 0 0 10px #f1c40f; }
}

.result-solana {
    background: #2ecc71;
    color: #000;
    animation: solanaGlow 1s infinite alternate;
}

@keyframes solanaGlow {
    from { box-shadow: 2px 2px 0 #000, 0 0 5px #2ecc71; }
    to { box-shadow: 2px 2px 0 #000, 0 0 10px #2ecc71; }
}

.result-empty {
    background: #95a5a6;
    color: #2c3e50;
}

.empty-message {
    text-align: center;
    padding: 30px;
    color: #7f8c8d;
    font-size: 0.65em;
    font-style: italic;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .game-section {
        flex-direction: column;
    }

    #gameCanvas {
        max-width: 100%;
        height: auto;
    }

    .main-header h1 {
        font-size: 2.2em;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .main-header h1 {
        font-size: 1.8em;
    }

    .header-info {
        width: 100%;
        justify-content: space-between;
    }

    .contract-address {
        flex: 1;
    }

    .ca-label, .ca-text {
        font-size: 0.7em;
    }

    .x-community-btn {
        padding: 10px 16px;
        font-size: 0.7em;
    }

    .main-header {
        padding: 15px 20px;
    }
}

@media (max-width: 480px) {
    .header-info {
        flex-direction: column;
        width: 100%;
    }

    .contract-address, .x-community-btn {
        width: 100%;
        justify-content: center;
    }
}

/* Scrollbar Styles - Retro Arcade */
.queue-list::-webkit-scrollbar,
.history-list::-webkit-scrollbar {
    width: 10px;
}

.queue-list::-webkit-scrollbar-track,
.history-list::-webkit-scrollbar-track {
    background: #1a252f;
    border: 2px solid #000;
}

.queue-list::-webkit-scrollbar-thumb,
.history-list::-webkit-scrollbar-thumb {
    background: #f39c12;
    border: 2px solid #000;
}

.queue-list::-webkit-scrollbar-thumb:hover,
.history-list::-webkit-scrollbar-thumb:hover {
    background: #e67e22;
}

/* Pixel border effect */
.pixel-border {
    position: relative;
    box-shadow:
            0 0 0 2px #000,
            0 0 0 4px #f39c12,
            0 0 0 6px #000;
}

/* Loading animation for retro feel */
@keyframes pixelate {
    0% { transform: scale(1); }
    50% { transform: scale(0.98); }
    100% { transform: scale(1); }
}

/* Arcade button style (for future use) */
.arcade-button {
    background: #e74c3c;
    color: #fff;
    border: 4px solid #000;
    padding: 15px 30px;
    font-family: 'Press Start 2P', monospace;
    font-size: 0.7em;
    cursor: pointer;
    box-shadow:
            0 6px 0 #c0392b,
            0 6px 10px rgba(0,0,0,0.5);
    transition: all 0.1s;
    text-transform: uppercase;
}

.arcade-button:hover {
    background: #c0392b;
    transform: translateY(2px);
    box-shadow:
            0 4px 0 #a93226,
            0 4px 8px rgba(0,0,0,0.5);
}

.arcade-button:active {
    transform: translateY(6px);
    box-shadow:
            0 0 0 #a93226,
            0 0 5px rgba(0,0,0,0.5);
}
