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

body {
    font-family: 'Share Tech Mono', monospace;
    background: #000;
    height: 100vh;
    overflow: hidden;
    color: #00ff41;
    position: relative;
}

/* Intro Screen Styles */
.intro-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.matrix-bg-intro {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(90deg, transparent 98%, #00ff41 100%),
        linear-gradient(transparent 98%, #00ff41 100%);
    background-size: 30px 30px;
    opacity: 0.1;
    animation: matrix-scroll 15s linear infinite;
}

.intro-visual {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

#introCanvas {
    border: 2px solid #00ffff;
    border-radius: 15px;
    background: rgba(0, 0, 0, 0.8);
    box-shadow: 0 0 30px #00ffff;
}

.intro-overlay {
    position: relative;
    z-index: 10;
    text-align: center;
    max-width: 800px;
    padding: 40px;
}

.game-title .glitch-intro {
    font-family: 'Orbitron', monospace;
    font-size: 4em;
    font-weight: 900;
    color: #00ff41;
    position: relative;
    text-shadow: 0 0 20px #00ff41;
    display: block;
    margin-bottom: 20px;
}

.glitch-intro::before,
.glitch-intro::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch-intro::before {
    animation: glitch-1 3s infinite;
    color: #ff0040;
    z-index: -1;
}

.glitch-intro::after {
    animation: glitch-2 3s infinite;
    color: #00ffff;
    z-index: -2;
}

.subtitle-intro {
    font-size: 1.2em;
    color: #ffff00;
    margin-bottom: 30px;
    text-shadow: 0 0 10px #ffff00;
}

.intro-story {
    margin: 30px 0;
    padding: 20px;
    border: 1px solid #00ff41;
    border-radius: 10px;
    background: rgba(0, 255, 65, 0.1);
}

#intro-text {
    font-size: 1.1em;
    color: #ffffff;
    line-height: 1.8;
    text-align: left;
}

.enter-btn {
    background: linear-gradient(45deg, #ff0040, #ff4060);
    border: 2px solid #ff0040;
    color: #fff;
    padding: 15px 30px;
    font-size: 1.2em;
    cursor: pointer;
    border-radius: 10px;
    font-family: 'Orbitron', monospace;
    font-weight: 700;
    text-transform: uppercase;
    transition: all 0.3s ease;
    box-shadow: 0 0 20px #ff0040;
    margin-top: 20px;
}

.enter-btn:hover {
    background: linear-gradient(45deg, #ff4060, #ff6080);
    box-shadow: 0 0 30px #ff0040;
    transform: translateY(-3px);
}

/* Main Game Interface */
.game-interface {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.matrix-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(90deg, transparent 98%, #00ff41 100%),
        linear-gradient(transparent 98%, #00ff41 100%);
    background-size: 40px 40px;
    opacity: 0.05;
    animation: matrix-scroll 25s linear infinite;
    z-index: -2;
}

.hologram-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, #0ff 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, #f0f 0%, transparent 50%);
    opacity: 0.03;
    animation: hologram-shift 20s ease-in-out infinite;
    z-index: -1;
}

@keyframes matrix-scroll {
    0% { transform: translateY(0); }
    100% { transform: translateY(-40px); }
}

@keyframes hologram-shift {
    0%, 100% { opacity: 0.03; }
    50% { opacity: 0.08; }
}

@keyframes glitch-1 {
    0%, 14%, 15%, 49%, 50%, 99%, 100% { transform: translate(0); }
    15% { transform: translate(-3px, 3px); }
    50% { transform: translate(3px, -3px); }
}

@keyframes glitch-2 {
    0%, 20%, 21%, 62%, 63%, 99%, 100% { transform: translate(0); }
    21% { transform: translate(3px, 0); }
    63% { transform: translate(-3px, 3px); }
}

/* Header */
.game-header {
    height: 80px;
    background: rgba(0, 0, 0, 0.9);
    border-bottom: 2px solid #00ff41;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 30px;
    box-shadow: 0 2px 10px rgba(0, 255, 65, 0.3);
}

.title-section .glitch {
    font-family: 'Orbitron', monospace;
    font-size: 2em;
    font-weight: 900;
    color: #00ff41;
    text-shadow: 0 0 10px #00ff41;
}

.system-status {
    font-size: 0.8em;
    color: #00ffff;
    margin-top: 5px;
}

.separator {
    margin: 0 10px;
    color: #00ff41;
}

.audio-controls {
    display: flex;
    gap: 10px;
}

.audio-btn {
    background: linear-gradient(45deg, #004455, #006677);
    border: 1px solid #00ffff;
    color: #00ffff;
    padding: 8px 15px;
    cursor: pointer;
    border-radius: 5px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.8em;
    transition: all 0.3s ease;
}

.audio-btn:hover {
    background: linear-gradient(45deg, #006677, #008899);
    box-shadow: 0 0 10px #00ffff;
}

/* Main Layout */
.game-layout {
    display: flex;
    flex: 1;
    height: calc(100vh - 140px);
}

/* Left Panel */
.left-panel {
    width: 50%;
    display: flex;
    flex-direction: column;
    border-right: 2px solid #00ff41;
}

.story-section {
    flex: 1;
    background: rgba(0, 0, 0, 0.8);
    border-bottom: 1px solid #00ff41;
}

.chapter-header {
    background: rgba(0, 255, 65, 0.1);
    padding: 15px 20px;
    border-bottom: 1px solid #00ff41;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#current-chapter {
    color: #ffff00;
    font-weight: bold;
    font-size: 1.1em;
}

.progress-container {
    width: 200px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #333;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(45deg, #00ff41, #00ffff);
    width: 0%;
    transition: width 0.5s ease;
    border-radius: 4px;
}

.story-content {
    padding: 20px;
    height: calc(100% - 60px);
    overflow-y: auto;
}

#story-text {
    color: #ffffff;
    line-height: 1.8;
    margin-bottom: 20px;
    padding: 15px;
    border-left: 3px solid #00ff41;
    background: rgba(0, 255, 65, 0.05);
}

#narrative-text {
    color: #ffff00;
    font-style: italic;
    padding: 10px;
    background: rgba(255, 255, 0, 0.05);
    border-radius: 5px;
}

.choices-section {
    min-height: 200px;
    background: rgba(0, 0, 0, 0.9);
    border-top: 1px solid #00ff41;
}

.choices-header {
    background: rgba(255, 0, 64, 0.1);
    color: #ff0040;
    padding: 10px 20px;
    font-weight: bold;
    border-bottom: 1px solid #ff0040;
}

.choices-container {
    padding: 15px;
}

.choice-btn {
    display: block;
    width: 100%;
    background: linear-gradient(45deg, #001122, #003344);
    border: 2px solid #00ff41;
    color: #00ff41;
    padding: 15px 20px;
    margin-bottom: 10px;
    cursor: pointer;
    border-radius: 5px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.9em;
    transition: all 0.3s ease;
    text-align: left;
    position: relative;
    overflow: hidden;
}

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

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

.choice-btn:hover {
    background: linear-gradient(45deg, #002233, #004455);
    box-shadow: 0 0 15px #00ff41;
    transform: translateX(5px);
}

/* Right Panel */
.right-panel {
    width: 50%;
    display: flex;
    flex-direction: column;
}

.visual-section {
    flex: 1;
    background: rgba(0, 0, 0, 0.8);
    border-bottom: 1px solid #00ffff;
}

.visual-header {
    background: rgba(0, 255, 255, 0.1);
    color: #00ffff;
    padding: 10px 20px;
    font-weight: bold;
    border-bottom: 1px solid #00ffff;
}

#gameCanvas {
    width: 100%;
    height: calc(100% - 45px);
    border: none;
    background: #000;
    display: block;
}

.terminal-section {
    height: 250px;
    background: rgba(0, 0, 0, 0.9);
}

.terminal-header {
    background: rgba(0, 255, 65, 0.1);
    color: #00ff41;
    padding: 10px 20px;
    font-weight: bold;
    border-bottom: 1px solid #00ff41;
}

.terminal-screen {
    height: calc(100% - 45px);
    padding: 15px;
    overflow-y: auto;
    background: #000;
    border: 1px solid #00ff41;
    margin: 5px;
    border-radius: 5px;
}

.terminal-content {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.8em;
    line-height: 1.4;
}

.system-ready {
    color: #00ff41;
    text-align: center;
    margin-top: 50px;
    opacity: 0.7;
}

/* Bottom Controls */
.bottom-controls {
    height: 60px;
    background: rgba(0, 0, 0, 0.9);
    border-top: 2px solid #00ff41;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    padding: 0 20px;
}

.control-btn {
    background: linear-gradient(45deg, #444, #666);
    border: 1px solid #888;
    color: #fff;
    padding: 10px 20px;
    cursor: pointer;
    border-radius: 5px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.8em;
    transition: all 0.3s ease;
}

.control-btn:hover {
    background: linear-gradient(45deg, #666, #888);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

/* Modal */
.wisdom-modal, .voice-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
}

.modal-content {
    background: #000;
    margin: 10% auto;
    padding: 30px;
    border: 2px solid #ffff00;
    border-radius: 10px;
    width: 80%;
    max-width: 600px;
    box-shadow: 0 0 30px #ffff00;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #ffff00;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.modal-header h3 {
    color: #ffff00;
    font-family: 'Orbitron', monospace;
}

.close-btn {
    color: #ff0040;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-btn:hover {
    color: #ff4060;
}

.wisdom-content {
    color: #00ff41;
    line-height: 1.8;
}

.voice-settings {
    color: #00ffff;
}

.setting-group {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.setting-group label {
    min-width: 120px;
    color: #00ffff;
    font-weight: bold;
}

.setting-control {
    flex: 1;
    background: rgba(0, 255, 255, 0.1);
    border: 1px solid #00ffff;
    color: #00ffff;
    padding: 8px;
    border-radius: 5px;
    font-family: 'Share Tech Mono', monospace;
}

.setting-control:focus {
    outline: none;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

.setting-control option {
    background: #000;
    color: #00ffff;
}

input[type="range"].setting-control {
    background: transparent;
    -webkit-appearance: none;
    height: 6px;
}

input[type="range"].setting-control::-webkit-slider-track {
    background: rgba(0, 255, 255, 0.3);
    height: 6px;
    border-radius: 3px;
}

input[type="range"].setting-control::-webkit-slider-thumb {
    -webkit-appearance: none;
    background: #00ffff;
    height: 18px;
    width: 18px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 8px rgba(0, 255, 255, 0.8);
}

input[type="range"].setting-control::-moz-range-track {
    background: rgba(0, 255, 255, 0.3);
    height: 6px;
    border-radius: 3px;
    border: none;
}

input[type="range"].setting-control::-moz-range-thumb {
    background: #00ffff;
    height: 18px;
    width: 18px;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 0 8px rgba(0, 255, 255, 0.8);
}

#rate-value, #pitch-value, #volume-value {
    min-width: 40px;
    color: #ffff00;
    font-weight: bold;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .game-layout {
        flex-direction: column;
    }
    
    .left-panel,
    .right-panel {
        width: 100%;
    }
    
    .left-panel {
        height: 60%;
        border-right: none;
        border-bottom: 2px solid #00ff41;
    }
    
    .right-panel {
        height: 40%;
    }
}