:root {
    --bg-base: #07090e;
    --bg-surface: #0d111a;
    --bg-surface-elevated: #141b29;
    --bg-surface-hover: #1c263b;
    
    --border-subtle: rgba(0, 240, 255, 0.15);
    --border-bright: #00f0ff;
    --border-gold: #ffd000;
    --border-crimson: #ff2a55;
    --border-purple: #bd34fe;
    
    --text-main: #e2e8f0;
    --text-muted: #7987a1;
    --text-bright: #ffffff;
    
    --accent-cyan: #00f0ff;
    --accent-gold: #ffd000;
    --accent-crimson: #ff2a55;
    --accent-emerald: #00ff9d;
    --accent-purple: #c084fc;
    --accent-amber: #fb923c;
    
    --font-display: 'Syncopate', -apple-system, sans-serif;
    --font-mono: 'Share Tech Mono', 'Courier New', monospace;
    
    --glow-cyan: 0 0 20px rgba(0, 240, 255, 0.25);
    --glow-crimson: 0 0 20px rgba(255, 42, 85, 0.35);
    --glow-gold: 0 0 20px rgba(255, 208, 0, 0.3);
}

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

body {
    background-color: var(--bg-base);
    background-image: 
        radial-gradient(circle at 50% 0%, rgba(0, 240, 255, 0.08) 0%, transparent 60%),
        radial-gradient(circle at 80% 100%, rgba(189, 52, 254, 0.06) 0%, transparent 50%),
        linear-gradient(rgba(0, 240, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 240, 255, 0.04) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 32px 32px, 32px 32px;
    background-attachment: fixed;
    color: var(--text-main);
    font-family: var(--font-mono);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 16px;
    overflow-x: hidden;
}

/* App Main Container */
.terminal-container {
    width: 100%;
    max-width: 1240px;
    height: 94vh;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(0, 240, 255, 0.07);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

/* Header Decorator Corners */
.terminal-container::before, .terminal-container::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    pointer-events: none;
    z-index: 100;
}
.terminal-container::before {
    top: 0; left: 0;
    border-top: 2px solid var(--accent-cyan);
    border-left: 2px solid var(--accent-cyan);
}
.terminal-container::after {
    bottom: 0; right: 0;
    border-bottom: 2px solid var(--accent-cyan);
    border-right: 2px solid var(--accent-cyan);
}

/* Status Bar Top */
.status-bar {
    background: var(--bg-surface-elevated);
    border-bottom: 1px solid var(--border-subtle);
    padding: 12px 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.9rem;
    position: relative;
    z-index: 10;
}

.status-row-primary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.brand-badge {
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    color: var(--accent-gold);
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.stat-pill {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-subtle);
    padding: 4px 10px;
    border-radius: 2px;
    font-size: 0.82rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.stat-pill .label {
    color: var(--text-muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-pill .val {
    color: var(--text-bright);
    font-weight: bold;
}

.stat-pill.gold .val { color: var(--accent-gold); }
.stat-pill.diamond .val { color: var(--accent-cyan); }
.stat-pill.soul .val { color: var(--accent-purple); }
.stat-pill.sp .val { color: var(--accent-emerald); }

/* Meter Bars (HP / XP) */
.status-meters {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.meter-wrapper {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.meter-label-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.meter-bar {
    width: 100%;
    height: 7px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
    overflow: hidden;
}

.meter-fill {
    height: 100%;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.meter-fill.hp {
    background: linear-gradient(90deg, #ff2a55, #ff5e7e);
    box-shadow: 0 0 10px rgba(255, 42, 85, 0.5);
}
.meter-fill.xp {
    background: linear-gradient(90deg, #00f0ff, #00ff9d);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
}
.meter-fill.enemy-hp {
    background: linear-gradient(90deg, #991b1b, #ef4444);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

/* Secondary Gear Bar */
.status-gear-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 0.78rem;
    color: var(--text-muted);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 6px;
}

.status-gear-row span {
    color: var(--text-main);
}
.status-gear-row strong {
    color: var(--accent-cyan);
}

/* Viewport Layout */
.main-viewport {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

/* Console Feed */
.output-console {
    flex: 1;
    padding: 24px 28px;
    overflow-y: auto;
    font-size: 1.05rem;
    line-height: 1.65;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scroll-behavior: smooth;
}

.output-console::-webkit-scrollbar {
    width: 6px;
}
.output-console::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}
.output-console::-webkit-scrollbar-thumb {
    background: var(--border-subtle);
    border-radius: 3px;
}
.output-console::-webkit-scrollbar-thumb:hover {
    background: var(--accent-cyan);
}

/* Typography styles inside log */
.output-line {
    animation: lineSlideIn 0.25s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

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

.title-hero {
    font-family: var(--font-display);
    font-size: clamp(1.4rem, 2.5vw, 2.2rem);
    font-weight: 700;
    color: var(--accent-crimson);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    text-shadow: 0 0 25px rgba(255, 42, 85, 0.5);
    margin-bottom: 8px;
    display: inline-block;
}

.subtitle-hero {
    font-size: 0.95rem;
    color: var(--accent-gold);
    letter-spacing: 0.1em;
    margin-bottom: 16px;
    text-transform: uppercase;
}

.section-header {
    font-family: var(--font-display);
    font-size: 1.25rem;
    color: var(--accent-cyan);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin: 8px 0;
    border-left: 3px solid var(--accent-cyan);
    padding-left: 10px;
}

.combat-enemy-banner {
    background: rgba(255, 42, 85, 0.08);
    border: 1px solid rgba(255, 42, 85, 0.3);
    padding: 14px 18px;
    margin: 12px 0;
    border-radius: 2px;
}

.enemy-name {
    font-family: var(--font-display);
    font-size: 1.2rem;
    color: var(--accent-crimson);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.highlight-cyan { color: var(--accent-cyan); font-weight: bold; }
.highlight-gold { color: var(--accent-gold); font-weight: bold; }
.highlight-green { color: var(--accent-emerald); font-weight: bold; }
.highlight-crimson { color: var(--accent-crimson); font-weight: bold; }
.highlight-purple { color: var(--accent-purple); font-weight: bold; }

.combat-log-player {
    color: var(--accent-emerald);
    padding-left: 12px;
    border-left: 2px solid var(--accent-emerald);
}
.combat-log-enemy {
    color: var(--accent-crimson);
    padding-left: 12px;
    border-left: 2px solid var(--accent-crimson);
}
.combat-log-event {
    color: var(--accent-gold);
    padding-left: 12px;
    border-left: 2px solid var(--accent-gold);
}

/* Action Control Deck */
.action-deck {
    background: var(--bg-surface-elevated);
    border-top: 1px solid var(--border-subtle);
    padding: 18px 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 40vh;
    overflow-y: auto;
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 10px;
}

.btn-command {
    background: rgba(13, 17, 26, 0.8);
    border: 1px solid var(--border-subtle);
    color: var(--text-main);
    font-family: var(--font-mono);
    font-size: 0.95rem;
    padding: 12px 16px;
    text-align: left;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    transition: all 0.15s cubic-bezier(0.2, 0.8, 0.2, 1);
    transform: translateZ(0);
}

.btn-command:hover {
    background: var(--bg-surface-hover);
    border-color: var(--accent-cyan);
    color: #ffffff;
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.2), inset 0 0 10px rgba(0, 240, 255, 0.08);
    transform: translateY(-1px);
}

.btn-command:active {
    transform: translateY(1px);
}

.btn-command .btn-num {
    font-size: 0.75rem;
    color: var(--accent-cyan);
    opacity: 0.7;
    font-weight: bold;
}

.btn-command .btn-cost {
    font-size: 0.8rem;
    color: var(--accent-gold);
    margin-left: auto;
    white-space: nowrap;
}

.btn-command.variant-danger:hover {
    border-color: var(--accent-crimson);
    box-shadow: 0 0 15px rgba(255, 42, 85, 0.25);
}
.btn-command.variant-gold:hover {
    border-color: var(--accent-gold);
    box-shadow: 0 0 15px rgba(255, 208, 0, 0.25);
}
.btn-command.variant-purple:hover {
    border-color: var(--accent-purple);
    box-shadow: 0 0 15px rgba(189, 52, 254, 0.25);
}

/* Quick Nav Tabs */
.quick-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.tab-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    padding: 4px 10px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.15s;
}

.tab-btn:hover {
    color: var(--accent-cyan);
}
.tab-btn.active {
    color: var(--accent-cyan);
    border-color: var(--border-subtle);
    background: rgba(0, 240, 255, 0.05);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .terminal-container {
        height: 98vh;
    }
    .status-meters {
        grid-template-columns: 1fr;
    }
    .action-grid {
        grid-template-columns: 1fr;
    }
}
