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

body {
    background-color: #0a0a1a;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    font-family: 'Courier New', monospace;
    overflow: hidden;
}

#game-container {
    position: relative;
    width: 800px;
    height: 600px;
    touch-action: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

#game-canvas {
    display: block;
    width: 100%;
    height: 100%;
    background-color: #1a1a2e;
    border: 4px solid #4a4a6a;
    border-radius: 8px;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

#loading-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: #1a1a2e;
    z-index: 100;
}

#loading-screen.hidden {
    display: none;
}

.loading-text {
    color: #00ff88;
    font-size: 24px;
    margin-bottom: 20px;
    text-shadow: 0 0 10px #00ff88;
}

.loading-bar {
    width: 300px;
    height: 20px;
    background-color: #2a2a4a;
    border: 2px solid #4a4a6a;
    border-radius: 4px;
    overflow: hidden;
}

.loading-progress {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #00ff88, #00aaff);
    transition: width 0.3s ease;
}

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

.loading-text {
    animation: pulse 1.5s infinite;
}

#question-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.75);
    z-index: 50;
}

#question-overlay.hidden {
    display: none;
}

#question-box {
    background-color: #1a1a2e;
    border: 3px solid #00ccff;
    border-radius: 8px;
    padding: 24px 32px;
    width: 520px;
    max-width: 90%;
    text-align: center;
}

#question-title {
    color: #00ccff;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 16px;
    text-shadow: 0 0 8px #00ccff;
}

#question-text {
    color: #ffffff;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 20px;
}

#question-select {
    width: 100%;
    padding: 10px 12px;
    font-size: 13px;
    font-family: 'Courier New', monospace;
    background-color: #2a2a4a;
    color: #ffffff;
    border: 2px solid #4a4a6a;
    border-radius: 4px;
    margin-bottom: 16px;
    cursor: pointer;
    appearance: auto;
}

#question-select:focus {
    outline: none;
    border-color: #00ccff;
}

/* Touch Controls */
#touch-controls {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

#touch-joystick-zone {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40%;
    height: 60%;
    pointer-events: auto;
    touch-action: none;
}

#touch-joystick-base {
    position: absolute;
    bottom: 20%;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

#touch-joystick-thumb {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 255, 136, 0.35);
    border: 2px solid rgba(0, 255, 136, 0.6);
    transition: transform 0.15s ease-out;
}

#touch-buttons {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 45%;
    height: 60%;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: flex-end;
    padding: 0 16px 20px 0;
    gap: 12px;
}

.touch-btn {
    pointer-events: auto;
    touch-action: none;
    border: none;
    border-radius: 50%;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
}

.touch-btn-shoot {
    width: 72px;
    height: 72px;
    background: rgba(255, 68, 68, 0.3);
    border: 2px solid rgba(255, 68, 68, 0.6);
    color: rgba(255, 68, 68, 0.9);
    font-size: 14px;
    letter-spacing: 1px;
}

.touch-btn-shoot:active {
    background: rgba(255, 68, 68, 0.6);
    border-color: rgba(255, 68, 68, 1);
}

.touch-btn-small {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
}

.touch-btn-small:active {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

#touch-btn-pause {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 12px;
}

#touch-btn-group {
    display: flex;
    gap: 8px;
}
