/* ==========================================================================
   VOYAGES EXTRAORDINAIRES - VICTORIAN STEAMPUNK UI STYLING
   ========================================================================== */

/* CSS Variables - Victorian Steampunk Color Palette */
:root {
    --primary-dark: #1A0F0A;
    --primary-wood: #2C1810;
    --secondary-brass: #8B7355;
    --accent-parchment: #D4A574;
    --text-cream: #F5E6D3;
    --text-faded: #A67B5B;
    --danger-crimson: #C41E3A;
    --success-seagreen: #2E8B57;
    --magic-royalblue: #4169E1;
    --bg-deep: #0D0807;
    
    --brass-gradient: linear-gradient(135deg, #8B7355 0%, #D4A574 50%, #8B7355 100%);
    --wood-gradient: linear-gradient(180deg, #2C1810 0%, #1A0F0A 100%);
    --parchment-gradient: linear-gradient(135deg, #F5E6D3 0%, #E8D5B7 100%);
    
    --border-brass: 2px solid var(--secondary-brass);
    --shadow-brass: 0 4px 15px rgba(139, 115, 85, 0.3);
    --shadow-deep: 0 8px 30px rgba(0, 0, 0, 0.5);
    
    --font-heading: 'Cinzel Decorative', serif;
    --font-body: 'Crimson Text', serif;
    --font-mono: 'Special Elite', monospace;
    
    --transition-fast: 0.15s ease;
    --transition-medium: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--bg-deep);
    color: var(--text-cream);
    min-height: 100vh;
    overflow: hidden;
    line-height: 1.5;
}

#app {
    width: 100%;
    height: 100vh;
    position: relative;
}

/* Screen Management */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    opacity: 0;
    transition: opacity var(--transition-medium);
    z-index: 1;
}

.screen.active {
    display: flex;
    opacity: 1;
}

/* ==========================================================================
   BOOT SCREEN
   ========================================================================== */

#boot-screen {
    background: var(--bg-deep);
    justify-content: center;
    align-items: center;
}

.boot-content {
    text-align: center;
}

.loading-brass {
    width: 120px;
    height: 4px;
    background: var(--brass-gradient);
    border-radius: 2px;
    margin: 0 auto 30px;
    box-shadow: 0 0 20px rgba(212, 165, 116, 0.5);
}

.boot-title {
    margin-bottom: 40px;
}

.boot-title h1 {
    font-family: var(--font-heading);
    font-size: 3rem;
    color: var(--accent-parchment);
    text-shadow: 0 0 30px rgba(212, 165, 116, 0.4);
    letter-spacing: 4px;
}

.boot-title .subtitle {
    font-family: var(--font-body);
    font-size: 1.2rem;
    color: var(--text-faded);
    font-style: italic;
    margin-top: 10px;
}

.loading-bar-container {
    width: 300px;
    height: 8px;
    background: var(--primary-wood);
    border: var(--border-brass);
    border-radius: 4px;
    overflow: hidden;
    margin: 0 auto 20px;
}

.loading-bar {
    width: 0%;
    height: 100%;
    background: var(--brass-gradient);
    transition: width 0.3s ease;
    box-shadow: 0 0 10px var(--accent-parchment);
}

.loading-text {
    font-family: var(--font-mono);
    color: var(--text-faded);
    font-size: 0.9rem;
}

/* ==========================================================================
   MAIN MENU
   ========================================================================== */

#main-menu {
    background: 
        radial-gradient(ellipse at center, rgba(44, 24, 16, 0.8) 0%, transparent 70%),
        url('assets/images/menu_background.jpg') center/cover no-repeat,
        var(--bg-deep);
    justify-content: center;
    align-items: center;
}

.menu-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 30%, rgba(139, 115, 85, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(212, 165, 116, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

.menu-panel {
    position: relative;
    background: var(--wood-gradient);
    border: var(--border-brass);
    border-radius: 8px;
    padding: 50px 60px;
    max-width: 500px;
    width: 90%;
    box-shadow: var(--shadow-deep), inset 0 0 60px rgba(0, 0, 0, 0.3);
    text-align: center;
}

.menu-panel::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border: 3px solid var(--accent-parchment);
    border-radius: 12px;
    pointer-events: none;
    opacity: 0.3;
}

.menu-title {
    font-size: 2.2rem;
    color: var(--accent-parchment);
    margin-bottom: 5px;
    text-shadow: 0 2px 10px rgba(212, 165, 116, 0.3);
}

.menu-panel .subtitle {
    font-size: 1rem;
    color: var(--text-faded);
    font-style: italic;
    margin-bottom: 35px;
}

.menu-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 25px;
}

.menu-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: linear-gradient(180deg, rgba(44, 24, 16, 0.9) 0%, rgba(26, 15, 10, 0.9) 100%);
    border: var(--border-brass);
    border-radius: 4px;
    padding: 14px 20px;
    color: var(--text-cream);
    font-family: var(--font-body);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.menu-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--brass-gradient);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.menu-button:hover {
    background: linear-gradient(180deg, rgba(60, 35, 25, 0.9) 0%, rgba(40, 22, 15, 0.9) 100%);
    border-color: var(--accent-parchment);
    transform: translateY(-2px);
    box-shadow: var(--shadow-brass);
}

.menu-button:hover::before {
    opacity: 1;
}

.menu-button:active {
    transform: translateY(0);
}

.menu-button.primary {
    background: linear-gradient(135deg, rgba(139, 115, 85, 0.3) 0%, rgba(44, 24, 16, 0.9) 100%);
    border-color: var(--accent-parchment);
}

.menu-button.primary:hover {
    background: linear-gradient(135deg, rgba(139, 115, 85, 0.5) 0%, rgba(60, 35, 25, 0.9) 100%);
}

.button-icon {
    font-size: 1.3rem;
}

.button-text {
    flex: 1;
}

.demo-notice {
    background: rgba(196, 30, 58, 0.2);
    border: 1px solid var(--danger-crimson);
    border-radius: 4px;
    padding: 10px 15px;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.demo-badge {
    display: inline-block;
    background: var(--danger-crimson);
    color: var(--text-cream);
    padding: 2px 8px;
    border-radius: 3px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    margin-right: 8px;
    vertical-align: middle;
}

.license-button {
    display: block;
    width: 100%;
    background: transparent;
    border: 1px dashed var(--text-faded);
    border-radius: 4px;
    padding: 12px;
    color: var(--text-faded);
    font-family: var(--font-body);
    font-size: 0.95rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-top: 10px;
}

.license-button:hover {
    border-color: var(--accent-parchment);
    color: var(--text-cream);
    background: rgba(212, 165, 116, 0.1);
}

/* ==========================================================================
   SETTINGS SCREEN
   ========================================================================== */

#settings-screen {
    background: var(--bg-deep);
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.settings-panel {
    background: var(--wood-gradient);
    border: var(--border-brass);
    border-radius: 8px;
    padding: 40px;
    width: 100%;
    max-width: 450px;
    box-shadow: var(--shadow-deep);
}

.settings-panel h2 {
    font-size: 1.8rem;
    color: var(--accent-parchment);
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--secondary-brass);
}

.settings-group {
    margin-bottom: 25px;
}

.settings-group h3 {
    font-size: 1.1rem;
    color: var(--text-cream);
    margin-bottom: 12px;
    font-weight: 600;
}

.language-toggle {
    display: flex;
    gap: 10px;
}

.lang-btn {
    flex: 1;
    padding: 10px;
    background: rgba(44, 24, 16, 0.8);
    border: 1px solid var(--secondary-brass);
    border-radius: 4px;
    color: var(--text-faded);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.lang-btn:hover {
    border-color: var(--accent-parchment);
    color: var(--text-cream);
}

.lang-btn.active {
    background: var(--brass-gradient);
    color: var(--primary-dark);
    border-color: var(--accent-parchment);
    font-weight: bold;
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 15px;
}

.volume-control input[type="range"] {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: var(--primary-wood);
    border: 1px solid var(--secondary-brass);
    border-radius: 3px;
    outline: none;
}

.volume-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--brass-gradient);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(212, 165, 116, 0.4);
}

.volume-control input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--brass-gradient);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

#volume-value {
    font-family: var(--font-mono);
    color: var(--accent-parchment);
    min-width: 50px;
    text-align: right;
}

.display-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: var(--text-cream);
}

.checkbox-label input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--primary-wood);
    border: 1px solid var(--secondary-brass);
    border-radius: 3px;
    cursor: pointer;
    position: relative;
}

.checkbox-label input[type="checkbox"]:checked {
    background: var(--brass-gradient);
    border-color: var(--accent-parchment);
}

.checkbox-label input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: bold;
}

#settings-back {
    display: block;
    width: 100%;
    margin-top: 10px;
}

/* ==========================================================================
   DIALOGUE VIEW
   ========================================================================== */

#dialogue-screen {
    background: var(--bg-deep);
}

.dialogue-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    filter: brightness(0.4);
}

.dialogue-container {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 30px;
    padding: 20px;
    padding-bottom: 100px;
    max-width: 900px;
}

.dialogue-portrait {
    width: 200px;
    height: 280px;
    background: var(--primary-wood);
    border: var(--border-brass);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-brass);
    flex-shrink: 0;
}

.dialogue-portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dialogue-text-panel {
    flex: 1;
    background: var(--wood-gradient);
    border: var(--border-brass);
    border-radius: 8px;
    padding: 25px;
    max-width: 600px;
    box-shadow: var(--shadow-deep);
}

.dialogue-speaker {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: var(--accent-parchment);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--secondary-brass);
}

.dialogue-box {
    min-height: 100px;
    background: rgba(245, 230, 211, 0.05);
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 15px;
}

.dialogue-text {
    font-size: 1.1rem;
    color: var(--text-cream);
    line-height: 1.6;
    margin-bottom: 5px;
}

.dialogue-typo {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-faded);
    min-height: 1em;
}

.dialogue-choices {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.dialogue-choice {
    background: rgba(44, 24, 16, 0.8);
    border: 1px solid var(--secondary-brass);
    border-radius: 4px;
    padding: 12px 15px;
    color: var(--text-cream);
    font-family: var(--font-body);
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: left;
}

.dialogue-choice:hover {
    background: rgba(139, 115, 85, 0.3);
    border-color: var(--accent-parchment);
    transform: translateX(5px);
}

.dialogue-hud {
    position: absolute;
    top: 15px;
    left: 15px;
    right: 15px;
    display: flex;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.hud-item {
    background: rgba(26, 15, 10, 0.85);
    border: 1px solid var(--secondary-brass);
    border-radius: 4px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.hud-label {
    color: var(--text-faded);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    text-transform: uppercase;
}

.hud-value {
    color: var(--text-cream);
    font-weight: 600;
}

.alignment-bar {
    width: 120px;
    height: 8px;
    background: var(--primary-wood);
    border: 1px solid var(--secondary-brass);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.alignment-sci {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--magic-royalblue), #7B68EE);
    transition: width var(--transition-medium);
}

.alignment-eth {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    background: linear-gradient(90deg, #7B68EE, var(--success-seagreen));
    transition: width var(--transition-medium);
}

.survival-stats {
    display: flex;
    gap: 12px;
    margin-left: 5px;
}

.stat-row {
    display: flex;
    align-items: center;
    gap: 5px;
}

.stat-icon {
    font-size: 1rem;
}

.stat-bar {
    width: 50px;
    height: 6px;
    background: var(--primary-wood);
    border: 1px solid var(--secondary-brass);
    border-radius: 3px;
    overflow: hidden;
}

.stat-fill {
    height: 100%;
    background: var(--brass-gradient);
    transition: width var(--transition-medium);
}

.stat-value {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-cream);
    min-width: 35px;
}

/* ==========================================================================
   MAP NAVIGATION
   ========================================================================== */

#map-screen {
    background: var(--bg-deep);
}

.map-container {
    width: 100%;
    height: 100%;
    position: relative;
}

#map-canvas {
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse at center, var(--primary-wood) 0%, var(--bg-deep) 100%);
}

.map-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--wood-gradient);
    border-top: var(--border-brass);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.5);
}

.map-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.map-header h2 {
    font-size: 1.5rem;
    color: var(--accent-parchment);
}

.map-controls {
    display: flex;
    gap: 8px;
}

.map-btn {
    width: 40px;
    height: 35px;
    background: var(--primary-wood);
    border: 1px solid var(--secondary-brass);
    border-radius: 4px;
    color: var(--text-cream);
    font-family: var(--font-mono);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.map-btn:hover {
    background: var(--secondary-brass);
    color: var(--primary-dark);
}

.map-btn.primary {
    background: var(--brass-gradient);
    color: var(--primary-dark);
    font-weight: bold;
    height: 40px;
}

.map-btn.primary:hover {
    background: var(--accent-parchment);
}

.map-legend {
    display: flex;
    gap: 20px;
    font-size: 0.85rem;
    color: var(--text-faded);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.legend-marker {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid;
}

.legend-marker.current {
    background: var(--magic-royalblue);
    box-shadow: 0 0 8px var(--magic-royalblue);
}

.legend-marker.destination {
    background: var(--accent-parchment);
    border-color: var(--accent-parchment);
}

.legend-marker.visited {
    background: var(--success-seagreen);
}

.legend-marker.locked {
    background: var(--primary-wood);
    border-color: var(--text-faded);
    opacity: 0.5;
}

.map-location-info {
    background: rgba(245, 230, 211, 0.05);
    border-radius: 4px;
    padding: 12px 15px;
    font-size: 0.95rem;
}

.location-name {
    font-weight: 600;
    color: var(--text-cream);
    margin-bottom: 5px;
}

.location-description {
    color: var(--text-faded);
    font-style: italic;
}

.map-actions {
    display: flex;
    gap: 10px;
}

.map-actions .map-btn {
    flex: 1;
    height: 40px;
    font-family: var(--font-body);
    font-size: 0.95rem;
}

/* ==========================================================================
   TACTICAL COMBAT
   ========================================================================== */

#combat-screen {
    background: var(--bg-deep);
}

.combat-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 15px;
    gap: 10px;
}

.combat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--wood-gradient);
    border: var(--border-brass);
    border-radius: 6px;
    padding: 12px 20px;
}

.combat-title {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    color: var(--accent-parchment);
}

.combat-turn {
    font-family: var(--font-mono);
    color: var(--text-faded);
    margin-left: 20px;
}

.status-indicators {
    display: flex;
    gap: 15px;
}

.status-icon {
    font-size: 1.5rem;
    cursor: help;
}

.combat-stage {
    flex: 1;
    position: relative;
    background: 
        radial-gradient(ellipse at center, rgba(44, 24, 16, 0.8) 0%, transparent 70%),
        var(--primary-wood);
    border: var(--border-brass);
    border-radius: 6px;
    overflow: hidden;
    min-height: 300px;
}

#combat-canvas {
    width: 100%;
    height: 100%;
}

.combat-units {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
}

.unit-panel {
    background: rgba(26, 15, 10, 0.9);
    border: 1px solid var(--secondary-brass);
    border-radius: 4px;
    padding: 10px;
    min-width: 200px;
    pointer-events: auto;
}

.unit-panel h3 {
    font-size: 0.9rem;
    color: var(--text-faded);
    text-transform: uppercase;
    margin-bottom: 8px;
    text-align: center;
    letter-spacing: 1px;
}

.unit-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.unit-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    background: rgba(44, 24, 16, 0.8);
    border: 1px solid var(--secondary-brass);
    border-radius: 3px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.unit-card:hover {
    border-color: var(--accent-parchment);
}

.unit-card.selected {
    border-color: var(--magic-royalblue);
    box-shadow: 0 0 10px rgba(65, 105, 225, 0.4);
}

.unit-card .unit-portrait {
    width: 32px;
    height: 32px;
    background: var(--primary-wood);
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.unit-card .unit-portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.unit-card .unit-info {
    flex: 1;
    min-width: 0;
}

.unit-card .unit-name {
    font-size: 0.85rem;
    color: var(--text-cream);
    font-weight: 600;
}

.unit-card .unit-hp {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--success-seagreen);
}

.unit-card .unit-hp.low {
    color: var(--danger-crimson);
}

.unit-card .unit-stunned {
    font-size: 0.7rem;
    color: var(--magic-royalblue);
    font-style: italic;
}

.combat-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--wood-gradient);
    border: var(--border-brass);
    border-radius: 6px;
    padding: 12px 20px;
}

.action-bar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.combat-action {
    padding: 10px 15px;
    background: rgba(44, 24, 16, 0.9);
    border: 1px solid var(--secondary-brass);
    border-radius: 4px;
    color: var(--text-cream);
    font-family: var(--font-body);
    font-size: 0.95rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.combat-action:hover:not(:disabled) {
    background: rgba(139, 115, 85, 0.3);
    border-color: var(--accent-parchment);
}

.combat-action:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.combat-action.selected {
    background: var(--brass-gradient);
    color: var(--primary-dark);
    border-color: var(--accent-parchment);
}

.ap-display {
    font-family: var(--font-mono);
    font-size: 1.1rem;
}

.ap-label {
    color: var(--text-faded);
    margin-right: 5px;
}

.ap-value {
    color: var(--accent-parchment);
    font-weight: bold;
}

.combat-log {
    background: var(--primary-wood);
    border: var(--border-brass);
    border-radius: 6px;
    padding: 12px;
    height: 100px;
    overflow-y: auto;
}

.log-header {
    font-size: 0.9rem;
    color: var(--text-faded);
    text-transform: uppercase;
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.log-content {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-cream);
    line-height: 1.4;
}

.log-content .log-entry {
    opacity: 0;
    animation: fadeIn 0.3s ease forwards;
}

.log-entry.damage {
    color: var(--danger-crimson);
}

.log-entry.healing {
    color: var(--success-seagreen);
}

.log-entry.status {
    color: var(--magic-royalblue);
}

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

/* ==========================================================================
   INVENTORY MANAGEMENT
   ========================================================================== */

#inventory-screen {
    background: var(--bg-deep);
    padding: 20px;
}

.inventory-container {
    max-width: 1000px;
    margin: 0 auto;
    background: var(--wood-gradient);
    border: var(--border-brass);
    border-radius: 8px;
    padding: 25px;
    box-shadow: var(--shadow-deep);
}

.inventory-container h2 {
    font-size: 1.8rem;
    color: var(--accent-parchment);
    text-align: center;
    margin-bottom: 20px;
}

.inventory-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.inv-tab {
    padding: 8px 15px;
    background: rgba(44, 24, 16, 0.8);
    border: 1px solid var(--secondary-brass);
    border-radius: 4px;
    color: var(--text-faded);
    font-family: var(--font-body);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.inv-tab:hover {
    border-color: var(--accent-parchment);
    color: var(--text-cream);
}

.inv-tab.active {
    background: var(--brass-gradient);
    color: var(--primary-dark);
    border-color: var(--accent-parchment);
}

.inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 8px;
    margin-bottom: 20px;
    min-height: 150px;
}

.inv-slot {
    aspect-ratio: 1;
    background: rgba(245, 230, 211, 0.05);
    border: 1px solid var(--secondary-brass);
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    padding: 4px;
    position: relative;
    overflow: hidden;
}

.inv-slot:hover {
    border-color: var(--accent-parchment);
    background: rgba(139, 115, 85, 0.2);
}

.inv-slot.selected {
    border-color: var(--magic-royalblue);
    box-shadow: 0 0 10px rgba(65, 105, 225, 0.4);
}

.inv-slot .item-icon {
    font-size: 1.5rem;
    margin-bottom: 2px;
}

.inv-slot .item-count {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-faded);
}

.inv-slot .item-durability {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-wood);
}

.inv-slot .item-durability::before {
    content: '';
    height: 100%;
    background: var(--success-seagreen);
}

.inventory-details {
    background: rgba(245, 230, 211, 0.05);
    border: 1px solid var(--secondary-brass);
    border-radius: 4px;
    padding: 15px;
    min-height: 100px;
    margin-bottom: 15px;
}

.detail-empty {
    color: var(--text-faded);
    font-style: italic;
    text-align: center;
}

.detail-content {
    display: flex;
    gap: 20px;
}

.detail-icon {
    font-size: 3rem;
    text-align: center;
}

.detail-info {
    flex: 1;
}

.detail-name {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    color: var(--accent-parchment);
    margin-bottom: 5px;
}

.detail-type {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-faded);
    text-transform: uppercase;
    margin-bottom: 10px;
}

.detail-description {
    font-size: 0.95rem;
    color: var(--text-cream);
    line-height: 1.5;
    margin-bottom: 10px;
}

.detail-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
}

.detail-stat {
    display: flex;
    justify-content: space-between;
    padding: 3px 8px;
    background: rgba(44, 24, 16, 0.5);
    border-radius: 2px;
}

.detail-stat .stat-label {
    color: var(--text-faded);
}

.detail-stat .stat-value {
    color: var(--text-cream);
    font-weight: bold;
}

.inventory-weight {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text-cream);
    margin-bottom: 15px;
}

.inventory-weight .weight-bar {
    flex: 1;
    height: 8px;
    background: var(--primary-wood);
    border: 1px solid var(--secondary-brass);
    border-radius: 4px;
    overflow: hidden;
}

.inventory-weight .weight-fill {
    height: 100%;
    background: var(--brass-gradient);
    transition: width var(--transition-medium);
}

.inventory-stats {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.stat-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 12px;
    background: rgba(44, 24, 16, 0.8);
    border: 1px solid var(--secondary-brass);
    border-radius: 4px;
    min-width: 60px;
}

.stat-block .stat-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-faded);
    text-transform: uppercase;
}

.stat-block .stat-value {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: var(--accent-parchment);
}

.inventory-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 15px;
}

.inv-btn {
    padding: 10px 18px;
    background: rgba(44, 24, 16, 0.9);
    border: 1px solid var(--secondary-brass);
    border-radius: 4px;
    color: var(--text-cream);
    font-family: var(--font-body);
    font-size: 0.95rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.inv-btn:hover:not(:disabled) {
    background: rgba(139, 115, 85, 0.3);
    border-color: var(--accent-parchment);
}

.inv-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.inv-btn.primary {
    background: var(--brass-gradient);
    color: var(--primary-dark);
    border-color: var(--accent-parchment);
}

/* ==========================================================================
   CHAPTER EVALUATION
   ========================================================================== */

#evaluation-screen {
    background: var(--bg-deep);
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.evaluation-container {
    background: var(--wood-gradient);
    border: var(--border-brass);
    border-radius: 8px;
    padding: 40px;
    max-width: 500px;
    width: 100%;
    text-align: center;
    box-shadow: var(--shadow-deep);
}

.evaluation-grade {
    margin-bottom: 25px;
}

.grade-circle {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--brass-gradient);
    border: 4px solid var(--accent-parchment);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    box-shadow: 0 0 30px rgba(212, 165, 116, 0.4);
}

.grade-letter {
    font-family: var(--font-heading);
    font-size: 3rem;
    color: var(--primary-dark);
}

.evaluation-stats {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 25px;
    padding: 15px;
    background: rgba(44, 24, 16, 0.8);
    border-radius: 4px;
}

.eval-stat {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(245, 230, 211, 0.05);
    border-radius: 3px;
}

.eval-label {
    color: var(--text-faded);
}

.eval-value {
    color: var(--accent-parchment);
    font-weight: bold;
    font-family: var(--font-mono);
}

.evaluation-consequences {
    text-align: left;
    margin-bottom: 25px;
}

.evaluation-consequences h3 {
    font-size: 1rem;
    color: var(--text-faded);
    text-transform: uppercase;
    margin-bottom: 10px;
}

.consequences-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.consequences-list li {
    padding: 8px 12px;
    background: rgba(44, 24, 16, 0.8);
    border-left: 3px solid var(--secondary-brass);
    border-radius: 2px;
    font-size: 0.9rem;
    color: var(--text-cream);
}

.consequences-list li.negative {
    border-left-color: var(--danger-crimson);
}

.consequences-list li.positive {
    border-left-color: var(--success-seagreen);
}

.consequences-list li.neutral {
    border-left-color: var(--text-faded);
}

.evaluation-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.eval-btn {
    padding: 12px 20px;
    background: rgba(44, 24, 16, 0.9);
    border: 1px solid var(--secondary-brass);
    border-radius: 4px;
    color: var(--text-cream);
    font-family: var(--font-body);
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.eval-btn:hover {
    background: rgba(139, 115, 85, 0.3);
    border-color: var(--accent-parchment);
}

.eval-btn.primary {
    background: var(--brass-gradient);
    color: var(--primary-dark);
    border-color: var(--accent-parchment);
}

/* ==========================================================================
   LICENSE MODAL
   ========================================================================== */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--wood-gradient);
    border: var(--border-brass);
    border-radius: 8px;
    padding: 35px;
    max-width: 450px;
    width: 90%;
    text-align: center;
    box-shadow: var(--shadow-deep);
}

.modal-content h2 {
    font-size: 1.6rem;
    color: var(--accent-parchment);
    margin-bottom: 10px;
}

.modal-content > p {
    color: var(--text-faded);
    font-style: italic;
    margin-bottom: 25px;
}

.key-input-container {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.key-input-container input {
    flex: 1;
    padding: 12px 15px;
    background: var(--primary-wood);
    border: 1px solid var(--secondary-brass);
    border-radius: 4px;
    color: var(--text-cream);
    font-family: var(--font-mono);
    font-size: 1rem;
    letter-spacing: 1px;
}

.key-input-container input:focus {
    outline: none;
    border-color: var(--accent-parchment);
}

.license-submit {
    padding: 12px 20px;
    background: var(--brass-gradient);
    border: 1px solid var(--accent-parchment);
    border-radius: 4px;
    color: var(--primary-dark);
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.license-submit:hover {
    background: var(--accent-parchment);
}

.license-error {
    color: var(--danger-crimson);
    font-size: 0.9rem;
    min-height: 1.2em;
    margin-bottom: 10px;
}

.license-success {
    color: var(--success-seagreen);
    font-size: 0.9rem;
    min-height: 1.2em;
    margin-bottom: 10px;
}

.modal-close {
    margin-top: 15px;
    padding: 8px 15px;
    background: transparent;
    border: 1px solid var(--secondary-brass);
    border-radius: 4px;
    color: var(--text-faded);
    font-family: var(--font-body);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    border-color: var(--accent-parchment);
    color: var(--text-cream);
}

.license-demo-notice {
    margin-top: 15px;
    font-size: 0.8rem;
    color: var(--text-faded);
    font-style: italic;
}

/* ==========================================================================
   FLOATING LANGUAGE TOGGLE
   ========================================================================== */

.floating-lang-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    gap: 5px;
    z-index: 100;
}

.floating-lang-toggle .lang-btn {
    width: 40px;
    height: 30px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-wood);
    border: 1px solid var(--secondary-brass);
    border-radius: 4px;
    color: var(--text-faded);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.floating-lang-toggle .lang-btn:hover {
    border-color: var(--accent-parchment);
    color: var(--text-cream);
}

.floating-lang-toggle .lang-btn.active {
    background: var(--brass-gradient);
    color: var(--primary-dark);
    border-color: var(--accent-parchment);
}

/* ==========================================================================
   SCROLLBAR STYLING
   ========================================================================== */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--primary-wood);
}

::-webkit-scrollbar-thumb {
    background: var(--secondary-brass);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-parchment);
}

/* ==========================================================================
   UTILITY CLASSES
   ========================================================================== */

.hidden { display: none !important; }
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */

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

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 10px rgba(212, 165, 116, 0.3); }
    50% { box-shadow: 0 0 20px rgba(212, 165, 116, 0.6); }
}

.pulse { animation: pulse 2s ease-in-out infinite; }
.shake { animation: shake 0.3s ease; }
.glow { animation: glow 2s ease-in-out infinite; }
