/* General Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Courier New', monospace;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: #e0e0e0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    max-width: 900px;
    width: 100%;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #00d4ff;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.3);
}

/* Screen Management */
.screen {
    display: none;
}

.screen.active {
    display: block;
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Title Screen */
.ascii-art {
    color: #00d4ff;
    font-size: 8px;
    line-height: 1;
    text-align: center;
    margin-bottom: 20px;
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
    white-space: pre;
}

.subtitle {
    text-align: center;
    margin: 30px 0;
}

.subtitle p {
    margin: 10px 0;
    font-size: 16px;
}

.subtitle .author {
    color: #ff00ff;
    font-weight: bold;
}

.subtitle .highlight {
    color: #00ff00;
    font-weight: bold;
    font-size: 14px;
}

.ascii-book {
    color: #00ffff;
    font-size: 10px;
    text-align: center;
    margin: 30px 0;
    white-space: pre;
}

.start-btn {
    display: block;
    margin: 30px auto;
    padding: 15px 40px;
    font-size: 18px;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    background: linear-gradient(135deg, #00d4ff, #0099cc);
    color: #000;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.start-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.6);
}

/* Character Selection */
#character-screen h2 {
    text-align: center;
    color: #ffff00;
    margin-bottom: 30px;
    font-size: 24px;
}

.character-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.character-card {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid #555;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.character-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(0, 212, 255, 0.4);
}

.character-card.helen {
    border-color: #ff0066;
}

.character-card.helen:hover {
    border-color: #ff3388;
    box-shadow: 0 10px 30px rgba(255, 0, 102, 0.4);
}

.character-card.jed {
    border-color: #0066ff;
}

.character-card.jed:hover {
    border-color: #3388ff;
    box-shadow: 0 10px 30px rgba(0, 102, 255, 0.4);
}

.character-card.saunders {
    border-color: #00ff66;
}

.character-card.saunders:hover {
    border-color: #33ff88;
    box-shadow: 0 10px 30px rgba(0, 255, 102, 0.4);
}

.character-ascii {
    color: inherit;
    font-size: 12px;
    margin: 15px 0;
    white-space: pre;
}

.character-card h3 {
    color: #ffff00;
    margin: 15px 0;
    font-size: 24px;
}

.character-card p {
    margin: 10px 0;
    font-size: 14px;
}

.character-desc {
    font-style: italic;
    color: #aaa;
}

/* Game Screen */
.game-header {
    background: rgba(0, 212, 255, 0.1);
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 30px;
    border: 1px solid #00d4ff;
}

.character-info {
    font-weight: bold;
    color: #00d4ff;
    margin-bottom: 10px;
}

.progress-bar {
    height: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    margin: 10px 0;
}

#progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00d4ff, #00ff66);
    width: 0%;
    transition: width 0.5s ease;
}

#progress-text {
    color: #ffff00;
    font-size: 12px;
    margin-top: 5px;
}

.story-content {
    background: rgba(0, 0, 0, 0.5);
    padding: 20px;
    border-radius: 5px;
    margin-bottom: 30px;
    border-left: 4px solid #00d4ff;
    line-height: 1.6;
    min-height: 200px;
    transition: opacity 0.3s ease;
}

.story-content p {
    margin: 10px 0;
}

.choices-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.choice-btn {
    background: rgba(0, 212, 255, 0.2);
    border: 2px solid #00d4ff;
    color: #fff;
    padding: 15px 20px;
    font-size: 16px;
    font-family: 'Courier New', monospace;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
}

.choice-btn:hover {
    background: rgba(0, 212, 255, 0.4);
    transform: translateX(10px);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.5);
}

.consequence-msg {
    background: rgba(255, 215, 0, 0.2);
    border: 2px solid #ffd700;
    color: #ffd700;
    padding: 20px;
    border-radius: 5px;
    text-align: center;
    font-weight: bold;
    animation: pulse 1s ease;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Ending Screen */
#ending-screen h2 {
    text-align: center;
    color: #ffff00;
    font-size: 32px;
    margin-bottom: 20px;
}

.ending-type {
    text-align: center;
    margin: 30px 0;
    font-size: 14px;
}

.ending-type.happy {
    color: #00ff00;
}

.ending-type.sad {
    color: #ff0000;
}

.ending-type.bittersweet {
    color: #ffff00;
}

.ending-type pre {
    font-family: 'Courier New', monospace;
    white-space: pre;
}

.ending-text {
    background: rgba(0, 212, 255, 0.1);
    padding: 20px;
    border-radius: 5px;
    border-left: 4px solid #00d4ff;
    font-size: 16px;
    line-height: 1.6;
    margin: 20px 0;
}

.journey-section {
    margin: 40px 0;
}

.journey-section h3 {
    color: #ff00ff;
    text-align: center;
    margin-bottom: 20px;
    font-size: 20px;
}

#choices-history {
    background: rgba(0, 0, 0, 0.5);
    padding: 20px;
    border-radius: 5px;
    max-height: 300px;
    overflow-y: auto;
}

.history-item {
    padding: 10px;
    margin: 5px 0;
    border-left: 3px solid #00d4ff;
    background: rgba(0, 212, 255, 0.05);
}

.history-number {
    color: #00ffff;
    font-weight: bold;
    margin-right: 10px;
}

.history-segment {
    color: #ff00ff;
    margin-right: 10px;
}

.restart-btn {
    display: block;
    margin: 30px auto;
    padding: 15px 40px;
    font-size: 18px;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    background: linear-gradient(135deg, #ff00ff, #cc00cc);
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.restart-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255, 0, 255, 0.6);
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}

::-webkit-scrollbar-thumb {
    background: #00d4ff;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #00ffff;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }

    .ascii-art {
        font-size: 6px;
    }

    .character-grid {
        grid-template-columns: 1fr;
    }

    #ending-screen h2 {
        font-size: 24px;
    }
}
