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

body {
    font-family: 'Courier New', monospace;
    background: #0a0e27;
    color: #00ff00;
    height: 100vh;
    overflow: hidden;
}

/* Character Selection Screen */
#char-select-screen {
    display: none; /* Hidden by default - splash will show it */
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    opacity: 0;
    animation: fadeIn 2.5s ease-in forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

#char-select-screen.hidden {
    display: none;
}

.select-panel {
    background: #1a1a1a;
    border: 3px solid #00ff00;
    padding: 40px;
    max-width: 700px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.select-panel h1 {
    color: #00ff00;
    text-align: center;
    font-size: 28px;
    margin-bottom: 10px;
    text-shadow: 0 0 10px #00ff00;
}

.select-panel .subtitle {
    color: #aaffaa;
    text-align: center;
    font-size: 13px;
    margin-bottom: 30px;
    font-style: italic;
}

.char-list {
    margin: 20px 0;
    max-height: 300px;
    overflow-y: auto;
}

.char-card {
    background: #0a0a0a;
    border: 2px solid #00ff00;
    padding: 15px;
    margin: 10px 0;
    cursor: pointer;
    transition: all 0.3s;
}

.char-card:hover {
    background: #1a1a1a;
    border-color: #00ffff;
    transform: translateX(5px);
}

.char-card .name {
    color: #ffff00;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 5px;
}

.char-card .details {
    color: #aaffaa;
    font-size: 13px;
}

.divider {
    height: 2px;
    background: #00ff00;
    margin: 20px 0;
    opacity: 0.3;
}

.new-char-section {
    margin-top: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: #00ff00;
    margin-bottom: 8px;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    background: #0a0a0a;
    border: 2px solid #00ff00;
    color: #00ff00;
    padding: 12px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
}

.form-group input:focus {
    outline: none;
    border-color: #00ffff;
}

.class-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 10px;
}

.class-card {
    background: #0a0a0a;
    border: 2px solid #00ff00;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s;
}

.class-card:hover {
    border-color: #00ffff;
}

.class-card.selected {
    background: #1a3300;
    border-color: #ffff00;
}

.class-card .class-name {
    color: #ffff00;
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 5px;
}

.class-card .class-desc {
    color: #aaffaa;
    font-size: 12px;
    margin-bottom: 8px;
}

.class-card .class-stats {
    color: #00ff00;
    font-size: 11px;
}

button {
    width: 100%;
    padding: 15px;
    background: #00ff00;
    color: #0a0a0a;
    border: none;
    font-family: 'Courier New', monospace;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 10px;
    transition: all 0.3s;
}

button:hover {
    background: #00ffff;
}

button:disabled {
    background: #333;
    color: #666;
    cursor: not-allowed;
}

/* Donation Link at Bottom */
.donation-footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #333;
    text-align: center;
}

.donation-footer p {
    color: #888;
    font-size: 0.9em;
    margin-bottom: 10px;
    line-height: 1.5;
}

.donation-footer a {
    display: inline-block;
    color: #00ff00;
    text-decoration: none;
    padding: 8px 20px;
    border: 1px solid #00ff00;
    border-radius: 4px;
    font-size: 0.9em;
    transition: all 0.3s ease;
}

.donation-footer a:hover {
    background: rgba(0, 255, 0, 0.1);
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
}

/* ============================================
   MOBILE RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
    body {
        font-size: 14px;
    }
    
    /* Character Selection - Mobile */
    .select-panel {
        padding: 20px;
        max-width: 95%;
    }
    
    .select-panel h1 {
        font-size: 22px;
    }
    
    .class-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    /* Game Screen - Stack vertically on mobile */
    #main-display {
        flex-direction: column;
    }
    
    #stats-sidebar {
        width: 100%;
        max-height: 200px;
        border-right: none;
        border-bottom: 2px solid #00ff00;
        padding: 10px;
        overflow-y: auto;
    }
    
    .stat-section {
        margin-bottom: 10px;
    }
    
    .stat-section h3 {
        font-size: 12px;
    }
    
    .stat-line {
        font-size: 11px;
        margin: 3px 0;
    }
    
    #output-container {
        padding: 10px;
        font-size: 13px;
    }
    
    #header h1 {
        font-size: 18px;
    }
    
    #command-input {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Touch-friendly buttons */
    button {
        padding: 12px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    /* Extra small screens */
    .select-panel h1 {
        font-size: 18px;
    }
    
    .select-panel .subtitle {
        font-size: 11px;
    }
    
    #output-container {
        font-size: 12px;
    }
    
    #stats-sidebar {
        max-height: 180px;
        padding: 8px;
    }
}

/* Landscape mode on mobile */
@media (max-width: 768px) and (orientation: landscape) {
    #stats-sidebar {
        max-height: 150px;
    }
}

/* Game Screen */
#game-screen {
    display: none;
    flex-direction: column;
    height: 100vh;
}

#game-screen.active {
    display: flex;
}

#header {
    background: #1a1a1a;
    padding: 15px;
    border-bottom: 2px solid #00ff00;
    text-align: center;
}

#header h1 {
    color: #00ff00;
    font-size: 24px;
    text-shadow: 0 0 10px #00ff00;
}

#main-display {
    display: flex;
    flex: 1;
    overflow: hidden;
}

#stats-sidebar {
    width: 300px;
    background: #111;
    border-right: 2px solid #00ff00;
    padding: 20px;
    overflow-y: auto;
}

.stat-section {
    margin-bottom: 20px;
}

.stat-section h3 {
    color: #ffff00;
    border-bottom: 1px solid #00ff00;
    padding-bottom: 5px;
    margin-bottom: 10px;
    font-size: 14px;
}

.stat-line {
    display: flex;
    justify-content: space-between;
    margin: 5px 0;
    font-size: 12px;
}

#output-container {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #000;
}

#output {
    font-size: 14px;
    line-height: 1.6;
}

.message {
    margin: 5px 0;
}

.room-title { color: #ffff00; font-weight: bold; }
.room-desc { color: #aaffaa; }
.exits { color: #00aaff; }
.combat { color: #ff4444; font-weight: bold; }
.success { color: #44ff44; }
.error { color: #ff4444; }
.info { color: #aaaaff; }
.system { color: #e0e0e0; }
.player { color: #ffff00; }

#input-container {
    display: flex;
    padding: 20px;
    background: #111;
    border-top: 2px solid #00ff00;
}

#command-input {
    flex: 1;
    background: #000;
    border: 2px solid #00ff00;
    color: #00ff00;
    padding: 10px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
}

#command-input:focus {
    outline: none;
    border-color: #00ffff;
}

/* End Credits Overlay */
#credits-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 2s ease-in;
    color: #e0e0e0;
    text-align: center;
    padding: 20px;
}

#credits-overlay.show {
    display: flex;
    opacity: 1;
}

.credits-content {
    max-width: 600px;
    animation: fadeSlideUp 2s ease-out;
}

@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.credits-title {
    font-size: 3em;
    font-weight: bold;
    margin-bottom: 30px;
    color: #ffd700;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.credits-text {
    font-size: 1.3em;
    line-height: 1.8;
    margin-bottom: 40px;
    color: #e0e0e0;
}

.credits-donation {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid #ffd700;
    border-radius: 10px;
    padding: 30px;
    margin-bottom: 30px;
}

.credits-donation h3 {
    color: #ffd700;
    font-size: 1.5em;
    margin-bottom: 15px;
}

.credits-donation p {
    margin-bottom: 20px;
    font-size: 1.1em;
}

.donation-button {
    display: inline-block;
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #1a1a2e;
    padding: 15px 40px;
    font-size: 1.2em;
    font-weight: bold;
    text-decoration: none;
    border-radius: 5px;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
}

.donation-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.6);
}

.credits-restart {
    font-size: 1em;
    color: #888;
    margin-top: 20px;
}

/* Splash Screen */
#splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    opacity: 0;
    animation: splashFadeIn 1.5s ease-in forwards;
}

#splash-screen.hidden {
    animation: splashFadeOut 1s ease-out forwards;
    pointer-events: none;
}

@keyframes splashFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes splashFadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

#splash-image {
    max-width: 100%;
    max-height: 100vh;
    object-fit: contain;
}

#splash-prompt {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 18px;
    font-family: 'Courier New', monospace;
    text-shadow: 2px 2px 4px #000;
    animation: promptPulse 2s ease-in-out infinite;
    text-align: center;
    padding: 0 20px;
    max-width: 90%;
    white-space: nowrap;
}

@media (max-width: 600px) {
    #splash-prompt {
        font-size: 14px;
        bottom: 60px;
        padding: 0 10px;
    }
}

@media (max-width: 400px) {
    #splash-prompt {
        font-size: 12px;
        bottom: 50px;
    }
}

@keyframes promptPulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}
