/* ========================================
   Galaxy Sandbox - Styles
   ======================================== */

:root {
    --bg-dark: #0a0a12;
    --bg-panel: #12121c;
    --bg-panel-hover: #1a1a28;
    --border-color: #2a2a3c;
    --text-primary: #e0e0e0;
    --text-secondary: #8888aa;
    --accent-blue: #4a9eff;
    --accent-gold: #ffd700;
    --accent-green: #4caf50;
    --accent-red: #f44336;
    --accent-purple: #9c27b0;
    --font-main: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --font-mono: 'Consolas', 'Courier New', monospace;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background: var(--bg-dark);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
}

#app {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* ========================================
   Top Bar
   ======================================== */

#top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border-color);
    height: 40px;
}

.bar-section {
    display: flex;
    gap: 16px;
    align-items: center;
}

.bar-section.center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.bar-section.right {
    margin-left: auto;
}

#game-time {
    color: var(--accent-blue);
    font-family: var(--font-mono);
}

#time-speed {
    background: var(--accent-blue);
    color: var(--bg-dark);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    min-width: 40px;
    text-align: center;
    transition: background 0.2s;
}

#time-speed:hover {
    background: #6ab0ff;
}

#time-speed.paused {
    background: var(--accent-red);
    animation: pulse-pause 1.5s infinite;
}

@keyframes pulse-pause {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

#current-location {
    font-weight: 600;
    color: var(--accent-gold);
}

#player-credits {
    color: var(--accent-green);
    font-family: var(--font-mono);
    font-weight: 600;
}

.lang-toggle {
    margin-left: 12px;
    background: var(--bg-panel);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    font-family: var(--font-mono);
}

.lang-toggle:hover {
    color: var(--accent-blue);
    border-color: var(--accent-blue);
}

/* ========================================
   Main Content
   ======================================== */

#main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Panels */
aside {
    width: 280px;
    background: var(--bg-panel);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

#right-panel {
    border-right: none;
    border-left: 1px solid var(--border-color);
}

.panel {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
}

.panel h3 {
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 8px;
    letter-spacing: 1px;
}

/* Game Container */
#game-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: var(--bg-dark);
}

#game-canvas {
    width: 100%;
    height: 100%;
}

/* View Controls */
#view-controls {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 4px;
    background: var(--bg-panel);
    padding: 4px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

#view-controls button {
    padding: 6px 16px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 4px;
    font-size: 13px;
    transition: all 0.2s;
}

#view-controls button:hover {
    background: var(--bg-panel-hover);
    color: var(--text-primary);
}

#view-controls button.active {
    background: var(--accent-blue);
    color: var(--bg-dark);
}

#btn-toggle-travelers {
    margin-left: 8px;
    padding: 6px 10px !important;
}

#btn-toggle-travelers.active {
    background: var(--accent-gold);
}

/* Zoom Controls */
#zoom-controls {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

#zoom-controls button {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border-color);
    background: var(--bg-panel);
    color: var(--text-primary);
    cursor: pointer;
    border-radius: 4px;
    font-size: 18px;
    transition: all 0.2s;
}

#zoom-controls button:hover {
    background: var(--accent-blue);
    color: var(--bg-dark);
}

/* ========================================
   Bottom Bar
   ======================================== */

#bottom-bar {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-panel);
    border-top: 1px solid var(--border-color);
}

#bottom-bar button {
    padding: 8px 20px;
    border: 1px solid var(--border-color);
    background: var(--bg-panel);
    color: var(--text-primary);
    cursor: pointer;
    border-radius: 4px;
    font-size: 13px;
    transition: all 0.2s;
}

#bottom-bar button:hover {
    background: var(--accent-blue);
    color: var(--bg-dark);
    border-color: var(--accent-blue);
}

/* ========================================
   Modal
   ======================================== */

#modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

#modal-overlay.hidden {
    display: none;
}

#modal-content {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 24px;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

#modal-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 24px;
    border-radius: 4px;
}

#modal-close:hover {
    background: var(--accent-red);
    color: white;
}

/* ========================================
   Character Creation
   ======================================== */

.modal-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-dark);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-y: auto;
}

.modal-fullscreen.hidden {
    display: none;
}

.creation-content {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 32px;
    width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

/* 3-act card-based creation (GDD § 63.5) — wider canvas for card grids */
.creation-content--cards {
    width: min(960px, 95vw);
    max-width: 960px;
}

.creation-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
    font-size: 13px;
    margin: -12px 0 24px;
}

.act-label {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--accent-gold);
    font-size: 18px;
    margin-bottom: 4px !important;
    letter-spacing: 0.3px;
}

.act-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px solid var(--accent-gold);
    border-radius: 50%;
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-gold);
    background: rgba(255, 215, 0, 0.05);
}

.act-prompt {
    font-size: 12px;
    color: var(--text-secondary);
    font-style: italic;
    margin: -2px 0 10px;
}

.identity-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 4px;
}

.identity-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 10px;
    margin-top: 4px;
}

.cards-grid--single {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.creation-card {
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-dark);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, transform 0.1s;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.creation-card:hover {
    border-color: var(--accent-blue);
    border-left-color: var(--accent-blue);
    background: var(--bg-panel-hover, rgba(40, 40, 60, 0.4));
}

.creation-card.selected {
    border-color: var(--accent-gold);
    border-left-color: var(--accent-gold);
    background: rgba(255, 215, 0, 0.08);
    transform: translateY(-1px);
}

.creation-card-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.creation-card-body {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.45;
}

.creation-portrait {
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
    margin-top: 8px;
}

.portrait-text {
    padding: 14px 18px;
    background: rgba(255, 215, 0, 0.04);
    border-left: 2px solid var(--accent-gold);
    border-radius: 0 4px 4px 0;
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.55;
    min-height: 80px;
    font-style: italic;
}

.portrait-text .portrait-line {
    margin: 0 0 8px;
}

.portrait-text .portrait-line:last-child {
    margin-bottom: 0;
}

.portrait-placeholder {
    color: var(--text-secondary);
    font-style: italic;
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.creation-content h1 {
    text-align: center;
    margin-bottom: 24px;
    color: var(--accent-gold);
}

.creation-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.form-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-section label {
    font-size: 14px;
    color: var(--text-secondary);
}

.form-section h3 {
    color: var(--text-primary);
    font-size: 16px;
    margin-bottom: 8px;
}

.form-section input[type="text"],
.form-section select {
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-dark);
    color: var(--text-primary);
    border-radius: 4px;
    font-size: 14px;
}

.form-section input[type="text"]:focus,
.form-section select:focus {
    outline: none;
    border-color: var(--accent-blue);
}

/* Gender radio (character creation) */
.gender-choice {
    display: flex;
    gap: 16px;
    margin-top: 6px;
}

.gender-option {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 14px;
}

.gender-option input[type="radio"] {
    accent-color: var(--accent-blue);
    cursor: pointer;
}

/* Personality Sliders */
.personality-sliders {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.slider-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.slider-group label {
    display: flex;
    justify-content: space-between;
    color: var(--text-primary);
}

.slider-group label span {
    color: var(--accent-blue);
    font-family: var(--font-mono);
}

.slider-group input[type="range"] {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--bg-dark);
    border-radius: 3px;
    outline: none;
}

.slider-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent-blue);
    cursor: pointer;
}

.trait-desc {
    font-size: 11px;
    color: var(--text-secondary);
    font-style: italic;
}

/* Goals Selection */
.goals-selection {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.goal-item {
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.goal-item:hover {
    border-color: var(--accent-blue);
    background: var(--bg-panel-hover);
}

.goal-item.selected {
    border-color: var(--accent-gold);
    background: rgba(255, 215, 0, 0.1);
}

.goal-item .goal-name {
    font-weight: 600;
    margin-bottom: 4px;
}

.goal-item .goal-desc {
    font-size: 11px;
    color: var(--text-secondary);
}

/* Start Button */
.btn-primary {
    padding: 14px 24px;
    border: none;
    background: var(--accent-gold);
    color: var(--bg-dark);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
    margin-top: 16px;
}

.btn-primary:hover {
    background: #ffed4a;
    transform: translateY(-2px);
}

.btn-primary:disabled {
    background: var(--text-secondary);
    cursor: not-allowed;
    transform: none;
}

/* ========================================
   Panel Content Styles
   ======================================== */

/* Player Info */
#player-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.player-stat {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
}

.player-stat .label {
    color: var(--text-secondary);
}

.player-stat .value {
    color: var(--text-primary);
}

/* Location Info */
#location-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 13px;
}

.location-type {
    color: var(--accent-purple);
    font-size: 11px;
    text-transform: uppercase;
}

.location-desc {
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.4;
}

/* NPCs List */
#npcs-here-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 200px;
    overflow-y: auto;
}

.npc-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    background: var(--bg-dark);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.npc-item:hover {
    background: var(--bg-panel-hover);
}

.npc-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
}

.npc-info {
    flex: 1;
    min-width: 0;
}

.npc-name {
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.npc-occupation {
    font-size: 10px;
    color: var(--text-secondary);
}

/* Actions List */
#actions-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.action-btn {
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-dark);
    color: var(--text-primary);
    cursor: pointer;
    border-radius: 4px;
    text-align: left;
    font-size: 13px;
    transition: all 0.2s;
}

.action-btn:hover {
    border-color: var(--accent-blue);
    background: var(--bg-panel-hover);
}

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.action-btn .action-time {
    float: right;
    color: var(--text-secondary);
    font-size: 11px;
    background: var(--bg-panel);
    padding: 2px 6px;
    border-radius: 3px;
}

/* Log Panel */
#log-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    max-height: 300px;
    overflow-y: auto;
}

.log-entry {
    padding: 4px 0;
    border-bottom: 1px solid var(--border-color);
}

.log-entry .log-time {
    color: var(--text-secondary);
    font-size: 10px;
    font-family: var(--font-mono);
}

.log-entry .log-text {
    color: var(--text-primary);
}

.log-entry.event-travel { color: var(--accent-blue); }
.log-entry.event-trade { color: var(--accent-green); }
.log-entry.event-social { color: var(--accent-purple); }
.log-entry.event-danger { color: var(--accent-red); }

/* Journal Modal */
.journal-entries {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 8px;
}

.journal-day {
    margin-bottom: 16px;
}

.journal-day-header {
    font-weight: bold;
    color: var(--accent-blue);
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 8px;
    position: sticky;
    top: 0;
    background: var(--bg-panel);
}

.journal-day-entries {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.journal-entry {
    display: grid;
    grid-template-columns: 50px 120px 1fr;
    gap: 8px;
    padding: 6px 8px;
    background: var(--bg-dark);
    border-radius: 4px;
    font-size: 12px;
}

.journal-time {
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

.journal-location {
    color: var(--accent-gold);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.journal-text {
    color: var(--text-primary);
}

.journal-entry.event-travel .journal-text { color: var(--accent-blue); }
.journal-entry.event-trade .journal-text { color: var(--accent-green); }
.journal-entry.event-social .journal-text { color: var(--accent-purple); }
.journal-entry.event-danger .journal-text { color: var(--accent-red); }

/* ========================================
   Activity Panel
   ======================================== */

#activity-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 200px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.panel-header h3 {
    margin: 0;
}

.btn-icon {
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: var(--bg-panel-hover);
    color: var(--accent-blue);
}

.btn-icon.active {
    color: var(--accent-blue);
}

/* Activity Filters */
.filters-container {
    background: var(--bg-dark);
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 10px;
}

.filter-group {
    margin-bottom: 10px;
}

.filter-group:last-child {
    margin-bottom: 0;
}

.filter-group label {
    display: block;
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
}

.filter-group select {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-panel);
    color: var(--text-primary);
    border-radius: 4px;
    font-size: 12px;
}

.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.filter-chip {
    padding: 4px 8px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    border-radius: 12px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-chip:hover {
    border-color: var(--accent-blue);
    color: var(--text-primary);
}

.filter-chip.active {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: var(--bg-dark);
}

/* Activity Stats */
#activity-stats {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    padding: 8px;
    background: var(--bg-dark);
    border-radius: 6px;
}

.stat-mini {
    flex: 1;
    text-align: center;
    font-size: 11px;
    color: var(--text-secondary);
}

.stat-mini .stat-icon {
    display: block;
    font-size: 14px;
    margin-bottom: 2px;
}

.stat-mini span:not(.stat-icon) {
    color: var(--accent-blue);
    font-weight: 600;
}

/* Activity Feed */
#activity-feed {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 300px;
}

.activity-item {
    display: flex;
    gap: 8px;
    padding: 6px 8px;
    background: var(--bg-dark);
    border-radius: 4px;
    font-size: 11px;
    animation: fadeIn 0.3s ease;
    border-left: 3px solid transparent;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.activity-item.type-travel { border-left-color: var(--accent-blue); }
.activity-item.type-work { border-left-color: var(--accent-green); }
.activity-item.type-social { border-left-color: var(--accent-purple); }
.activity-item.type-trade { border-left-color: var(--accent-gold); }
.activity-item.type-rest { border-left-color: var(--text-secondary); }

.activity-icon {
    font-size: 14px;
    flex-shrink: 0;
}

.activity-content {
    flex: 1;
    min-width: 0;
}

.activity-text {
    color: var(--text-primary);
    line-height: 1.3;
}

.activity-text .npc-name {
    color: var(--accent-blue);
    font-weight: 500;
}

.activity-text .location-name {
    color: var(--accent-gold);
}

.activity-text .amount {
    color: var(--accent-green);
}

.activity-meta {
    display: flex;
    justify-content: space-between;
    margin-top: 2px;
    font-size: 10px;
    color: var(--text-secondary);
}

.activity-location {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.activity-time {
    flex-shrink: 0;
}

/* Pause indicator */
.activity-paused {
    text-align: center;
    padding: 20px;
    color: var(--text-secondary);
    font-style: italic;
}

/* ========================================
   Scrollbar
   ======================================== */

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* ========================================
   Utility
   ======================================== */

.hidden {
    display: none !important;
}

.text-gold { color: var(--accent-gold); }
.text-blue { color: var(--accent-blue); }
.text-green { color: var(--accent-green); }
.text-red { color: var(--accent-red); }
.text-purple { color: var(--accent-purple); }

/* ========================================
   Character Modal Status
   ======================================== */

.character-status {
    padding: 8px 12px;
    border-radius: 4px;
    margin: 10px 0;
    font-size: 13px;
}

.character-status.status-here {
    background: rgba(76, 175, 80, 0.15);
    color: var(--accent-green);
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.character-status.status-away {
    background: rgba(136, 136, 170, 0.15);
    color: var(--text-secondary);
    border: 1px solid rgba(136, 136, 170, 0.3);
}

/* Location display */
.location-name-large {
    font-size: 16px;
    font-weight: 600;
    color: var(--accent-gold);
    margin: 4px 0;
}

.location-type {
    font-size: 12px;
    color: var(--text-secondary);
}

.travel-progress {
    margin-top: 8px;
    font-size: 12px;
    color: var(--accent-blue);
}

/* Activity item importance */
.activity-item.important {
    background: rgba(255, 215, 0, 0.1);
    border-left: 2px solid var(--accent-gold);
}

.activity-item.known-person {
    background: rgba(74, 158, 255, 0.08);
}

.activity-item .activity-location-badge {
    display: inline-block;
    padding: 1px 6px;
    background: rgba(255, 215, 0, 0.2);
    border-radius: 3px;
    font-size: 10px;
    margin-left: 4px;
}

/* ========================================
   Population Table Modal
   ======================================== */

.population-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.population-filters input[type="text"] {
    flex: 1;
    min-width: 150px;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-dark);
    color: var(--text-primary);
    border-radius: 4px;
    font-size: 13px;
}

.population-filters input[type="text"]:focus {
    border-color: var(--accent-blue);
    outline: none;
}

.population-filters select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-dark);
    color: var(--text-primary);
    border-radius: 4px;
    font-size: 12px;
    min-width: 120px;
}

.population-stats {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--bg-dark);
    border-radius: 4px;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.population-table-container {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.population-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.population-table thead {
    position: sticky;
    top: 0;
    background: var(--bg-panel);
    z-index: 1;
}

.population-table th {
    padding: 10px 8px;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
}

.population-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: color 0.2s;
}

.population-table th.sortable:hover {
    color: var(--accent-blue);
}

.population-table td {
    padding: 8px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.population-table tr.npc-row {
    cursor: pointer;
    transition: background 0.2s;
}

.population-table tr.npc-row:hover {
    background: var(--bg-panel-hover);
}

.npc-name-cell {
    font-weight: 500;
    color: var(--accent-blue);
}

/* Wealth classes */
.wealth-high {
    color: var(--accent-gold);
    font-weight: 600;
}

.wealth-medium {
    color: var(--accent-green);
}

.wealth-low {
    color: var(--text-secondary);
}

/* State classes */
.state-idle {
    color: var(--text-secondary);
}

.state-traveling {
    color: var(--accent-blue);
}

.state-working {
    color: var(--accent-green);
}

.state-socializing {
    color: var(--accent-purple);
}

.state-resting {
    color: var(--text-secondary);
    font-style: italic;
}

.state-trading {
    color: var(--accent-gold);
}

/* ========================================
   Personality Bars
   ======================================== */

.personality-bars {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 12px 0;
}

.personality-bar-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.personality-bar-item .bar-label {
    width: 100px;
    font-size: 11px;
    color: var(--text-secondary);
}

.personality-bar-item .bar-container {
    flex: 1;
    height: 8px;
    background: var(--bg-dark);
    border-radius: 4px;
    overflow: hidden;
}

.personality-bar-item .bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple));
    border-radius: 4px;
    transition: width 0.3s ease;
}

.personality-bar-item .bar-value {
    width: 30px;
    text-align: right;
    font-size: 11px;
    color: var(--accent-blue);
    font-family: var(--font-mono);
}

.attitude-display {
    font-size: 16px;
    font-weight: 600;
    padding: 8px 0;
}

/* ========================================
   Talk NPC List
   ======================================== */

.talk-npc-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 350px;
    overflow-y: auto;
    margin-top: 12px;
}

.talk-npc-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--bg-dark);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.talk-npc-item:hover {
    background: var(--bg-panel-hover);
    border-color: var(--accent-blue);
}

.talk-npc-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: white;
    flex-shrink: 0;
}

.talk-npc-info {
    flex: 1;
    min-width: 0;
}

.talk-npc-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.talk-npc-details {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.talk-npc-relation {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

/* ========================================
   Enhanced Contacts List
   ======================================== */

.contacts-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 400px;
    overflow-y: auto;
    margin-top: 12px;
}

.contact-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: var(--bg-dark);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.contact-item:hover {
    background: var(--bg-panel-hover);
    border-color: var(--accent-blue);
}

.contact-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    color: white;
    flex-shrink: 0;
}

.contact-main {
    flex: 1;
    min-width: 0;
}

.contact-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 6px;
}

.contact-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.contact-occupation {
    font-size: 11px;
    color: var(--text-secondary);
}

.contact-opinion-bar {
    height: 6px;
    background: var(--bg-panel);
    border-radius: 3px;
    position: relative;
    margin-bottom: 6px;
}

.contact-opinion-bar .opinion-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.contact-opinion-bar .opinion-fill.opinion-positive {
    background: linear-gradient(90deg, var(--accent-green), #81c784);
}

.contact-opinion-bar .opinion-fill.opinion-neutral {
    background: linear-gradient(90deg, var(--text-secondary), #aaa);
}

.contact-opinion-bar .opinion-fill.opinion-negative {
    background: linear-gradient(90deg, #e57373, var(--accent-red));
}

.contact-opinion-bar .opinion-marker {
    position: absolute;
    top: -2px;
    width: 2px;
    height: 10px;
    background: var(--text-secondary);
    transform: translateX(-50%);
}

.contact-details {
    display: flex;
    gap: 6px;
    font-size: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.contact-location {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* ========================================
   Energy & Survival System
   ======================================== */

.player-energy {
    padding: 8px;
    background: var(--bg-dark);
    border-radius: 6px;
    margin: 4px 0;
}

.energy-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 13px;
}

.energy-header .label {
    color: var(--text-secondary);
}

.energy-bar-container {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.energy-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease, background-color 0.3s ease;
}

.exhaustion-warning {
    margin-top: 8px;
    padding: 6px 10px;
    background: linear-gradient(90deg, rgba(244, 67, 54, 0.3), rgba(244, 67, 54, 0.1));
    border: 1px solid var(--accent-red);
    border-radius: 4px;
    color: var(--accent-red);
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    animation: pulse-danger 1s infinite;
}

@keyframes pulse-danger {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.energy-warning-box {
    padding: 10px 12px;
    background: linear-gradient(90deg, rgba(255, 152, 0, 0.2), rgba(255, 152, 0, 0.05));
    border: 1px solid #ff9800;
    border-radius: 6px;
    color: #ff9800;
    font-size: 12px;
    margin-bottom: 10px;
    text-align: center;
}

/* Death Notice */
.death-notice {
    text-align: center;
    padding: 20px;
}

.death-notice p {
    font-size: 18px;
    color: var(--accent-red);
    margin-bottom: 16px;
}

.death-notice .action-btn {
    background: var(--accent-red);
    border-color: var(--accent-red);
    color: white;
    font-weight: 600;
}

.death-notice .action-btn:hover {
    background: #e53935;
}

/* Death Modal */
.death-modal-content {
    text-align: center;
    padding: 20px;
}

.death-modal-content .death-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.death-modal-content h2 {
    color: var(--accent-red);
    margin-bottom: 12px;
}

.death-modal-content .death-cause {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 20px;
    line-height: 1.6;
}

.death-modal-content .death-stats {
    background: var(--bg-dark);
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.death-modal-content .death-stats h4 {
    color: var(--text-secondary);
    margin-bottom: 12px;
    font-size: 12px;
    text-transform: uppercase;
}

.death-modal-content .stat-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 13px;
}

.death-modal-content .stat-row .label {
    color: var(--text-secondary);
}

.death-modal-content .btn-restart {
    padding: 12px 32px;
    background: var(--accent-blue);
    border: none;
    border-radius: 6px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.death-modal-content .btn-restart:hover {
    background: #6ab0ff;
    transform: translateY(-2px);
}

/* ========================================
   Trade / Market System
   ======================================== */

.trade-header {
    display: flex;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-dark);
    border-radius: 8px;
    margin-bottom: 16px;
}

.trade-header .label {
    color: var(--text-secondary);
    font-size: 12px;
}

.trade-header .value {
    font-size: 16px;
    font-weight: 600;
    color: var(--accent-gold);
}

.trade-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.trade-tab {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    background: var(--bg-dark);
    color: var(--text-secondary);
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.trade-tab:hover {
    background: var(--bg-panel-hover);
    color: var(--text-primary);
}

.trade-tab.active {
    background: var(--accent-blue);
    color: white;
    border-color: var(--accent-blue);
}

.trade-content {
    max-height: 400px;
    overflow-y: auto;
}

.trade-category {
    margin-bottom: 16px;
}

.trade-category h4 {
    color: var(--text-secondary);
    font-size: 12px;
    text-transform: uppercase;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 8px;
}

.trade-goods {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.trade-good-item {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 12px;
    align-items: center;
    padding: 10px 12px;
    background: var(--bg-dark);
    border-radius: 6px;
    transition: background 0.2s;
}

.trade-good-item:hover {
    background: var(--bg-panel-hover);
}

.trade-good-info {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.trade-good-name {
    font-size: 13px;
    font-weight: 500;
}

.trade-good-qty {
    color: var(--text-secondary);
    font-size: 12px;
}

.trade-good-supply {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 3px;
    text-transform: uppercase;
}

.trade-good-supply.supply-high {
    background: rgba(76, 175, 80, 0.2);
    color: var(--accent-green);
}

.trade-good-supply.supply-mid {
    background: rgba(255, 152, 0, 0.2);
    color: #ff9800;
}

.trade-good-supply.supply-low {
    background: rgba(244, 67, 54, 0.2);
    color: var(--accent-red);
}

.trade-tag {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 3px;
}

.trade-tag.produced {
    background: rgba(76, 175, 80, 0.15);
    color: var(--accent-green);
}

.trade-tag.consumed {
    background: rgba(74, 158, 255, 0.15);
    color: var(--accent-blue);
}

.trade-good-price {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    min-width: 80px;
}

.buy-price {
    color: var(--accent-gold);
    font-weight: 600;
    font-size: 14px;
}

.sell-price {
    color: var(--accent-green);
    font-weight: 600;
    font-size: 14px;
}

.trade-profit {
    font-size: 11px;
}

.trade-profit.profit-positive {
    color: var(--accent-green);
}

.trade-profit.profit-negative {
    color: var(--accent-red);
}

.btn-trade {
    padding: 6px 14px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-trade.btn-buy {
    background: var(--accent-blue);
    color: white;
}

.btn-trade.btn-buy:hover:not(.disabled) {
    background: #6ab0ff;
}

.btn-trade.btn-sell {
    background: var(--accent-green);
    color: white;
}

.btn-trade.btn-sell:hover {
    background: #66bb6a;
}

.btn-trade.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.text-center {
    text-align: center;
    padding: 20px;
}

/* ========================================
   Inventory Modal
   ======================================== */

.inventory-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.inventory-stat {
    background: var(--bg-dark);
    padding: 12px;
    border-radius: 8px;
    text-align: center;
}

.inventory-stat .label {
    display: block;
    color: var(--text-secondary);
    font-size: 11px;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.inventory-stat .value {
    font-size: 16px;
    font-weight: 600;
}

.inventory-stat .value.credits {
    color: var(--accent-gold);
}

.inventory-stat .value.fortune {
    color: var(--accent-blue);
}

.cargo-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cargo-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: var(--bg-dark);
    border-radius: 6px;
}

.cargo-info {
    display: flex;
    gap: 8px;
    align-items: center;
}

.cargo-name {
    font-weight: 500;
}

.cargo-qty {
    color: var(--text-secondary);
    font-size: 12px;
}

.cargo-value {
    display: flex;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

/* ========================================
   Galactic Market Info
   ======================================== */

.market-filters {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    padding: 12px;
    background: var(--bg-dark);
    border-radius: 8px;
}

.market-filters .filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.market-filters label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.market-filters select {
    padding: 8px 12px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    min-width: 180px;
}

/* Single good price view */
.good-price-analysis {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.good-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.good-header h3 {
    margin: 0;
    color: var(--accent-gold);
}

.base-price {
    color: var(--text-secondary);
    font-size: 13px;
}

.price-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.price-column h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: var(--text-secondary);
}

.price-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: var(--bg-dark);
    border-radius: 6px;
    border-left: 3px solid transparent;
}

.price-row.best-price {
    border-left-color: var(--accent-green);
    background: rgba(76, 175, 80, 0.1);
}

.price-row.player-here {
    background: rgba(74, 158, 255, 0.15);
}

.price-row .location-info {
    display: flex;
    flex-direction: column;
}

.price-row .location-name {
    font-weight: 500;
    font-size: 13px;
}

.price-row .system-name {
    font-size: 11px;
    color: var(--text-secondary);
}

.price-row .price-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.price-row .price {
    font-weight: 600;
    font-size: 14px;
}

.price-row .price-diff {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 3px;
}

.price-diff.price-good {
    background: rgba(76, 175, 80, 0.2);
    color: var(--accent-green);
}

.price-diff.price-bad {
    background: rgba(244, 67, 54, 0.2);
    color: var(--accent-red);
}

.tag-produced, .tag-consumed {
    font-size: 9px;
    padding: 2px 4px;
    border-radius: 2px;
    text-transform: uppercase;
}

.tag-produced {
    background: rgba(76, 175, 80, 0.2);
    color: var(--accent-green);
}

.tag-consumed {
    background: rgba(74, 158, 255, 0.2);
    color: var(--accent-blue);
}

.trade-opportunity {
    padding: 12px 16px;
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.1), rgba(255, 215, 0, 0.05));
    border: 1px solid var(--accent-gold);
    border-radius: 8px;
}

.trade-opportunity h4 {
    margin: 0 0 8px 0;
    color: var(--accent-gold);
}

.trade-opportunity .profit {
    color: var(--accent-green);
    font-weight: 600;
}

/* Market table view */
.market-table-container {
    max-height: 350px;
    overflow: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.market-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.market-table th,
.market-table td {
    padding: 8px 10px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.market-table th {
    background: var(--bg-panel);
    position: sticky;
    top: 0;
    z-index: 2;
}

.market-table th.player-here {
    background: rgba(74, 158, 255, 0.2);
}

.market-table .th-location {
    font-weight: 600;
    font-size: 11px;
}

.market-table .th-system {
    font-size: 10px;
    color: var(--text-secondary);
}

.market-table .sticky-col {
    position: sticky;
    left: 0;
    background: var(--bg-panel);
    z-index: 1;
    text-align: left;
}

.market-table .good-name {
    font-weight: 500;
    white-space: nowrap;
}

.market-table td.price-low {
    background: rgba(76, 175, 80, 0.15);
}

.market-table td.price-mid {
    background: transparent;
}

.market-table td.price-high {
    background: rgba(244, 67, 54, 0.1);
}

.market-table td.player-here {
    background: rgba(74, 158, 255, 0.1) !important;
}

.market-table .cell-buy {
    font-weight: 600;
    color: var(--text-primary);
}

.market-table .cell-sell {
    font-size: 10px;
    color: var(--text-secondary);
}

.market-table .cell-tag {
    font-size: 9px;
    color: var(--accent-blue);
    margin-left: 2px;
}

.market-legend {
    display: flex;
    gap: 16px;
    margin-top: 12px;
    font-size: 11px;
    color: var(--text-secondary);
}

.legend-color {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 3px;
    vertical-align: middle;
    margin-right: 4px;
}

.legend-color.price-low {
    background: rgba(76, 175, 80, 0.3);
}

.legend-color.price-high {
    background: rgba(244, 67, 54, 0.2);
}

/* ========================================
   Travel Modal
   ======================================== */

.travel-header {
    display: flex;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-dark);
    border-radius: 8px;
    margin-bottom: 16px;
}

.travel-header .label {
    color: var(--text-secondary);
    font-size: 12px;
    margin-right: 8px;
}

.travel-header .value {
    font-weight: 600;
}

.travel-header .value.credits {
    color: var(--accent-gold);
}

/* Travel modal CSS — see the single-column refactor block lower in this
 * file (search `Travel modal — refactored Phase 2.1`). The legacy 3-column
 * grid block that sat here was removed in the layout-bug fix : it shared
 * the same selectors as the refactored block (style.css ≈4400) and was
 * the indirect cause of clipping on long location names. */

/* ========================================
   Pause Active — bandeau & action en cours
   (GDD § 36, § 62.4.4, § 62.4.5)
   ======================================== */

#pause-banner {
    background: linear-gradient(90deg, rgba(244, 67, 54, 0.12), rgba(255, 215, 0, 0.12));
    border-bottom: 1px solid var(--accent-gold);
    color: var(--accent-gold);
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    animation: pause-banner-glow 2s ease-in-out infinite;
}

#pause-banner.hidden {
    display: none;
}

.pause-banner-icon {
    font-size: 16px;
}

.pause-banner-label {
    color: var(--text-secondary);
}

.pause-banner-reason {
    color: var(--text-primary);
    font-weight: 600;
    flex: 1;
}

.pause-banner-btn {
    background: var(--accent-gold);
    color: var(--bg-dark);
    border: none;
    padding: 6px 14px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.pause-banner-btn:hover {
    background: #ffea7a;
}

@keyframes pause-banner-glow {
    0%, 100% { box-shadow: inset 0 0 0 rgba(255, 215, 0, 0); }
    50% { box-shadow: inset 0 -2px 8px rgba(255, 215, 0, 0.25); }
}

/* Current action block inside the actions panel */
.current-action {
    background: var(--bg-panel-hover);
    border: 1px solid var(--accent-blue);
    border-radius: 6px;
    padding: 10px 12px;
    margin-bottom: 8px;
}

.current-action-label {
    color: var(--accent-blue);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
}

.current-action-progress {
    height: 8px;
    background: var(--bg-dark);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 6px;
}

.current-action-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-green));
    transition: width 0.3s ease-out;
}

.current-action-time {
    font-size: 11px;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    text-align: right;
}

/* ========================================
   Sauvegardes (GDD § 62.4.7)
   ======================================== */

.saves-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 16px 0;
}

.save-slot {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 10px 12px;
    background: var(--bg-panel);
    transition: border-color 0.15s;
}

.save-slot:hover {
    border-color: var(--accent-blue);
}

.save-slot.empty {
    opacity: 0.7;
}

.save-slot.corrupt {
    border-color: var(--accent-red);
    background: rgba(244, 67, 54, 0.06);
}

.save-slot-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 4px;
}

.save-slot-name {
    font-weight: 600;
    color: var(--accent-blue);
}

.save-slot-meta {
    color: var(--text-secondary);
    font-size: 12px;
}

.save-slot-state {
    color: var(--text-secondary);
    font-size: 11px;
    font-style: italic;
}

.save-slot-times {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 8px;
    font-size: 12px;
    font-family: var(--font-mono);
}

.save-slot-gametime {
    color: var(--accent-gold);
}

.save-slot-realtime {
    color: var(--text-secondary);
}

.save-slot-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.btn-save-act {
    background: var(--bg-panel-hover);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-save-act:hover {
    background: var(--accent-blue);
    color: var(--bg-dark);
    border-color: var(--accent-blue);
}

.btn-save-act.danger:hover {
    background: var(--accent-red);
    border-color: var(--accent-red);
}

.saves-io {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    flex-wrap: wrap;
}

/* ========================================
   Epitaph modal — GDD § 63.4.4 proof point
   ======================================== */

.epitaph-modal-content {
    text-align: center;
    padding: 16px 8px;
}

.epitaph-icon {
    font-size: 64px;
    margin-bottom: 8px;
    filter: grayscale(20%);
}

.epitaph-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin: 12px 0 24px 0;
}

.epitaph-name {
    font-size: 22px;
    color: var(--accent-gold);
    font-weight: 600;
}

.epitaph-age {
    font-size: 13px;
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

.epitaph-paragraphs {
    text-align: left;
    max-width: 540px;
    margin: 0 auto 24px auto;
    line-height: 1.6;
    color: var(--text-primary);
}

.epitaph-paragraphs p {
    margin-bottom: 10px;
    font-size: 14px;
}

.epitaph-paragraphs p:first-child {
    font-size: 15px;
    color: var(--accent-gold);
}

.epitaph-stats {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 12px 16px;
    max-width: 400px;
    margin: 0 auto 24px auto;
}

.epitaph-stats h4 {
    text-align: center;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.epitaph-stats .stat-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 13px;
}

.epitaph-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-restart {
    background: var(--accent-blue);
    color: var(--bg-dark);
    border: none;
    padding: 10px 24px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-restart:hover {
    background: #6ab0ff;
}

/* ─── Dialogue scene (GDD § 63.4.5 — DialogueEngine v0) ───────────── */

.dialogue-scene {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 360px;
}

.dialogue-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid #2a3548;
}

.dialogue-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 18px;
    flex-shrink: 0;
}

.dialogue-header-info h2 {
    margin: 0 0 4px 0;
    font-size: 18px;
}

.dialogue-header-info p {
    margin: 0;
    font-size: 13px;
}

.dialogue-history {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px 0;
    min-height: 80px;
    max-height: 280px;
    overflow-y: auto;
}

.dialogue-empty-hint {
    font-style: italic;
    padding: 24px 8px;
    text-align: center;
}

/* ── Beat history cards (one per topic pick) ─────────────────────── */

.dialogue-beat {
    background: #1a2233;
    border-left: 3px solid #6cb6ff;
    padding: 12px 14px;
    border-radius: 4px;
}

.dialogue-beat.dialogue-tone-pos    { border-left-color: #4caf50; }
.dialogue-beat.dialogue-tone-dark   { border-left-color: #b07eec; }
.dialogue-beat.dialogue-tone-tendre { border-left-color: #ec7eb5; }
.dialogue-beat.dialogue-tone-dur    { border-left-color: #e05050; }
.dialogue-beat.dialogue-tone-neu    { border-left-color: #6cb6ff; }

.dialogue-beat-meta {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #8a96aa;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.dialogue-beat-topic {
    font-weight: 600;
    color: #b0bcd0;
}

.dialogue-beat-tone {
    font-style: italic;
}

.dialogue-beat-text {
    margin: 0;
    line-height: 1.5;
    color: #dfe6f0;
    font-size: 13px;
}

/* ── Modal scaffolding (header, history, controls) ───────────────── */

.dialogue-controls {
    margin-top: auto;
    border-top: 1px solid #2a3548;
    padding-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dialogue-actes-remaining {
    margin: 0;
    font-size: 12px;
    color: #8a96aa;
    text-align: center;
}

.dialogue-picker-title {
    margin: 4px 0 6px 0;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #a0acc0;
}

.dialogue-finish-btn {
    margin-top: 4px;
}

.dialogue-finished-hint,
.dialogue-empty-hint {
    font-style: italic;
    text-align: center;
    padding: 12px 4px;
    color: #8a96aa;
}

/* ── Topic chip grid (Sims-style picker) ─────────────────────────── */

.dialogue-topic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 8px;
}

.dialogue-topic-chip {
    background: #1f2a3d;
    border: 1px solid #2e3a52;
    border-left-width: 3px;
    color: #dfe6f0;
    padding: 10px 12px;
    border-radius: 6px;
    cursor: pointer;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 2px;
    transition: background 0.15s, border-color 0.15s, transform 0.05s;
    font-family: inherit;
}

.dialogue-topic-chip:hover {
    background: #283449;
    border-color: #4a9eff;
}

.dialogue-topic-chip:active {
    transform: translateY(1px);
}

.dialogue-topic-icon {
    font-size: 16px;
    line-height: 1;
}

.dialogue-topic-title {
    font-weight: 600;
    font-size: 13px;
    line-height: 1.3;
}

.dialogue-topic-cat {
    font-size: 10px;
    color: #8a96aa;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

/* Category accent on the left border of each chip — keeps the grid readable
   at a glance and signals what kind of move the player is about to make. */
.dialogue-topic-chip.dialogue-cat-connaitre   { border-left-color: #6cb6ff; }
.dialogue-topic-chip.dialogue-cat-bavarder    { border-left-color: #8a96aa; }
.dialogue-topic-chip.dialogue-cat-approfondir { border-left-color: #ec7eb5; }
.dialogue-topic-chip.dialogue-cat-sonder      { border-left-color: #b07eec; }
.dialogue-topic-chip.dialogue-cat-confronter  { border-left-color: #e05050; }
.dialogue-topic-chip.dialogue-cat-affecter    { border-left-color: #ffd166; }

/* ─── Contracts modal (GDD § 39, § 63.4.7) ──────────────────────── */

.contracts-tabs {
    display: flex;
    gap: 6px;
    border-bottom: 1px solid #2a3548;
    margin: 10px 0 14px 0;
}

.contracts-tab {
    background: transparent;
    border: none;
    color: #8a96aa;
    padding: 8px 14px;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    border-bottom: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s;
}

.contracts-tab:hover {
    color: #b0bcd0;
}

.contracts-tab.active {
    color: #dfe6f0;
    border-bottom-color: #4a9eff;
    font-weight: 600;
}

.contracts-content {
    min-height: 200px;
}

.contracts-empty {
    text-align: center;
    padding: 32px 16px;
    font-style: italic;
}

.contracts-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.contract-card {
    background: #1a2233;
    border: 1px solid #2a3548;
    border-left: 3px solid #4a9eff;
    border-radius: 4px;
    padding: 12px 14px;
}

.contract-card.contract-type-livraison_locale { border-left-color: #4caf50; }
.contract-card.contract-type-filature         { border-left-color: #b07eec; }

.contract-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.contract-type-badge {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #b0bcd0;
}

.contract-issuer {
    font-size: 13px;
    color: #dfe6f0;
    font-weight: 600;
}

.contract-description {
    margin: 0 0 10px 0;
    line-height: 1.4;
    font-size: 13px;
    color: #dfe6f0;
}

.contract-progress {
    background: #232c3d;
    padding: 6px 10px;
    border-radius: 3px;
    font-size: 12px;
    color: #b0bcd0;
    margin-bottom: 8px;
}

.contract-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #8a96aa;
    margin-bottom: 8px;
}

.contract-meta strong {
    color: #ffd166;
}

.btn-contract-accept {
    width: 100%;
}

.contract-status {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    font-size: 11px;
}

.contract-status-completed { color: #4caf50; }
.contract-status-failed    { color: #e05050; }
.contract-status-expired   { color: #8a96aa; }

/* Card is clickable — subtle affordance on hover. */
.contract-card {
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.contract-card:hover {
    background: #20283a;
    border-color: #4a9eff;
}

/* Detail view */
.contract-detail {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.contract-detail-back {
    align-self: flex-start;
    background: transparent;
    border: none;
    color: #8a96aa;
    cursor: pointer;
    padding: 4px 0;
    font-family: inherit;
    font-size: 13px;
    transition: color 0.15s;
}
.contract-detail-back:hover {
    color: #4a9eff;
}

.contract-detail-header {
    border-left: 3px solid #4a9eff;
    padding-left: 12px;
}
.contract-detail-header.contract-type-livraison_locale { border-left-color: #4caf50; }
.contract-detail-header.contract-type-filature         { border-left-color: #b07eec; }

.contract-detail-table {
    width: 100%;
    border-collapse: collapse;
}
.contract-detail-table tr {
    border-bottom: 1px solid #232a36;
}
.contract-detail-table tr:last-child {
    border-bottom: none;
}
.contract-detail-label {
    padding: 8px 12px 8px 0;
    color: #8a96aa;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    width: 40%;
    vertical-align: top;
}
.contract-detail-value {
    padding: 8px 0;
    color: #dfe6f0;
    font-size: 13px;
    line-height: 1.4;
}
.contract-detail-value strong {
    color: #ffd166;
}

/* Chance bars inside the contract detail (filature risk readout) */
.contract-chances {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 12px;
}
.chance {
    padding: 4px 8px;
    border-radius: 3px;
    font-weight: 600;
}
.chance {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.chance strong {
    font-weight: 700;
    letter-spacing: 0.2px;
}
.chance-good { background: #1e2e1e; color: #6ec97a; }
.chance-mid  { background: #2e2820; color: #ffd166; }
.chance-bad  { background: #2e1e1e; color: #e05050; }

.contract-chances-precision {
    margin-top: 6px;
    font-size: 11px;
    font-style: italic;
    color: #8a96aa;
    line-height: 1.4;
}

/* Character modal — refused-to-speak banner */
.character-refused-banner {
    background: #2e1e1e;
    border-left: 3px solid #e05050;
    color: #f0c0c0;
    padding: 10px 14px;
    border-radius: 4px;
    margin: 12px 0;
    font-size: 13px;
    line-height: 1.4;
}

/* Refused-conversation explanation modal */
.refused-modal {
    text-align: center;
    padding: 14px 20px 24px 20px;
}
.refused-modal .refused-icon {
    font-size: 40px;
    margin-bottom: 8px;
}
.refused-modal h2 {
    margin: 0 0 14px 0;
    color: #e05050;
}
.refused-body {
    color: #dfe6f0;
    line-height: 1.55;
    margin: 0 0 20px 0;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}

/* ─── Combat scene (GDD § 40, § 63.4.8) ──────────────────────────── */

.combat-scene {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 4px;
}

.combat-scene h2 {
    margin: 0;
    color: #e05050;
    letter-spacing: 0.3px;
}

.combat-tense {
    /* subtle red urgency */
    background: linear-gradient(180deg, #281616 0%, #1a2233 60%);
    border-radius: 6px;
    padding: 16px;
}

.combat-intro {
    margin: 0;
    line-height: 1.5;
    font-size: 14px;
    color: #f0c0c0;
}

.combat-hint {
    margin: 0;
    text-align: center;
    font-size: 11px;
    font-style: italic;
    color: #8a96aa;
}

.combat-choices {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
}

.combat-choice {
    background: #1f2a3d;
    border: 1px solid #2e3a52;
    color: #dfe6f0;
    padding: 14px 12px;
    border-radius: 6px;
    cursor: pointer;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: background 0.15s, border-color 0.15s, transform 0.05s;
    font-family: inherit;
}

.combat-choice:hover {
    background: #283449;
    border-color: #4a9eff;
}
.combat-choice:active {
    transform: translateY(1px);
}

.combat-choice-confront  { border-left: 3px solid #e05050; }
.combat-choice-flee      { border-left: 3px solid #6cb6ff; }
.combat-choice-negotiate { border-left: 3px solid #ffd166; }

.combat-choice-label {
    font-weight: 700;
    font-size: 15px;
}

.combat-choice-power {
    font-size: 11px;
    align-self: center;
    padding: 3px 8px;
    border-radius: 3px;
}

/* Resolved view */
.combat-resolved {
    background: #1a2233;
    border-radius: 6px;
    padding: 16px;
}

.combat-outcome {
    background: #232c3d;
    border-left: 3px solid #6cb6ff;
    padding: 12px 14px;
    border-radius: 4px;
    line-height: 1.6;
    color: #dfe6f0;
    font-size: 14px;
}

.combat-outcome.combat-outcome-net_victory     { border-left-color: #6ec97a; }
.combat-outcome.combat-outcome-costly_victory  { border-left-color: #ffd166; }
.combat-outcome.combat-outcome-forced_retreat  { border-left-color: #b07eec; }
.combat-outcome.combat-outcome-wound           { border-left-color: #e05050; }
.combat-outcome.combat-outcome-successful_flight    { border-left-color: #6cb6ff; }
.combat-outcome.combat-outcome-failed_flight        { border-left-color: #e05050; }
.combat-outcome.combat-outcome-negotiation_paid     { border-left-color: #ffd166; }
.combat-outcome.combat-outcome-negotiation_failed   { border-left-color: #e05050; }

.combat-effects-row {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.combat-effect {
    padding: 4px 10px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
}
.combat-effect.good { background: #1e2e1e; color: #6ec97a; }
.combat-effect.bad  { background: #2e1e1e; color: #e05050; }

/* ─── Dev toggle in top bar ──────────────────────────────────────── */

.dev-toggle {
    background: transparent;
    border: 1px solid #2a3548;
    color: #b0bcd0;
    border-radius: 4px;
    padding: 2px 8px;
    margin: 0 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.dev-toggle:hover {
    background: #283449;
    border-color: #ffd166;
    color: #ffd166;
}

/* ─── Dev modal layout ──────────────────────────────────────────── */

.dev-modal {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.dev-modal h2 {
    margin: 0;
    color: #ffd166;
    letter-spacing: 0.3px;
}

.dev-section {
    background: #1a2233;
    border: 1px solid #232a36;
    border-radius: 6px;
    padding: 12px 14px;
}

.dev-section h3 {
    margin: 0 0 10px 0;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #8a96aa;
}

.dev-state-grid {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    color: #dfe6f0;
}

.dev-label {
    color: #8a96aa;
    margin-right: 6px;
}

.dev-cmd {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 0;
    border-top: 1px solid #232a36;
}
.dev-cmd:first-of-type {
    border-top: none;
    padding-top: 0;
}

.dev-cmd-head {
    flex: 1;
    min-width: 0;
}

.dev-cmd-name {
    display: inline-block;
    background: #232c3d;
    color: #ffd166;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-family: 'Consolas', 'Monaco', monospace;
    margin-bottom: 4px;
}

.dev-cmd-desc {
    margin: 0;
    font-size: 12px;
    color: #b0bcd0;
    line-height: 1.4;
}

.dev-cmd-controls {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-shrink: 0;
}

.dev-input {
    background: #0e1420;
    border: 1px solid #2a3548;
    color: #dfe6f0;
    padding: 6px 8px;
    border-radius: 3px;
    font-size: 12px;
    width: 110px;
    font-family: inherit;
}

.dev-btn {
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
}

.dev-btn-danger {
    background: #4a1a1a;
    color: #f0c0c0;
    border-color: #6e2828;
}
.dev-btn-danger:hover {
    background: #6e2828;
    border-color: #e05050;
}

.dev-npc-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dev-npc-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    background: #1f2a3d;
    border-radius: 4px;
    font-size: 12px;
}

.dev-npc-name {
    flex: 0 0 auto;
    color: #dfe6f0;
    font-weight: 600;
}

.dev-npc-meta {
    flex: 1;
    font-size: 11px;
}

.dev-npc-actions {
    display: flex;
    gap: 4px;
}

.dev-btn-mini {
    background: #2a3548;
    border: 1px solid #3a455a;
    color: #b0bcd0;
    padding: 3px 8px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 11px;
    transition: background 0.15s, color 0.15s;
    font-family: inherit;
}
.dev-btn-mini:hover {
    background: #3a455a;
    color: #ffd166;
}

/* ─── Performance section (dev modal) ───────────────────────────── */

.dev-perf-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 12px;
    font-family: 'Consolas', 'Monaco', monospace;
    color: #dfe6f0;
}
.dev-perf-table th {
    text-align: right;
    color: #8a96aa;
    font-weight: 600;
    padding: 3px 10px;
    border-bottom: 1px solid #232a36;
}
.dev-perf-table th:first-child { text-align: left; }
.dev-perf-table td {
    text-align: right;
    padding: 3px 10px;
}
.dev-perf-table td:first-child { text-align: left; }
.dev-perf-table tbody tr:nth-child(odd) { background: #161d2b; }

.dev-perf-bench-result:not(:empty) {
    margin-top: 10px;
    padding: 10px 12px;
    background: #0e1420;
    border: 1px solid #2a3548;
    border-radius: 5px;
}
.dev-perf-bench-grid { font-family: 'Consolas', 'Monaco', monospace; }

/* ─── Live perf overlay (HUD — F3) ──────────────────────────────── */

.perf-overlay {
    position: fixed;
    top: 44px;
    left: 8px;
    z-index: 900;                 /* below the modal overlay (1000) */
    pointer-events: none;         /* never intercept clicks — pure HUD */
    min-width: 188px;
    padding: 8px 10px;
    background: rgba(10, 14, 22, 0.82);
    border: 1px solid #2a3548;
    border-radius: 6px;
    color: #dfe6f0;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 11px;
    line-height: 1.5;
    backdrop-filter: blur(3px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
    user-select: none;
}
.perf-overlay.hidden { display: none; }

.perf-overlay-title {
    color: #ffd166;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.perf-overlay-hint {
    color: #5a6678;
    border: 1px solid #2a3548;
    border-radius: 3px;
    padding: 0 4px;
    font-size: 9px;
}
.perf-overlay-row { white-space: nowrap; }
.perf-overlay-row b { color: #fff; }

/* Frame-budget colour cues mirror the FPS thresholds in the snapshot. */
.perf-overlay-row.perf-ok b   { color: #6ee7a8; }   /* < 16.7 ms (60 fps) */
.perf-overlay-row.perf-warn b { color: #ffd166; }   /* < 33 ms (30 fps)   */
.perf-overlay-row.perf-bad b  { color: #ff6b6b; }   /* janky              */

/* ─── Resolution modal (contracts, mirrors combat-resolved) ──────── */

.result-modal {
    display: flex;
    flex-direction: column;
    gap: 14px;
    align-items: center;
    padding: 16px 8px 8px 8px;
    text-align: center;
}

.result-modal .result-icon {
    font-size: 40px;
    line-height: 1;
}

.result-modal h2 {
    margin: 0;
    color: #dfe6f0;
}

.result-modal.result-accent-good h2     { color: #6ec97a; }
.result-modal.result-accent-bad h2      { color: #ffd166; }
.result-modal.result-accent-critical h2 { color: #e05050; }

.result-body {
    margin: 0;
    line-height: 1.55;
    font-size: 14px;
    color: #dfe6f0;
    max-width: 520px;
}

.result-effects {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    margin: 4px 0 6px 0;
}

.result-chip {
    padding: 5px 12px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
}
.result-chip.good     { background: #1e2e1e; color: #6ec97a; }
.result-chip.bad      { background: #2e2820; color: #ffd166; }
.result-chip.critical { background: #2e1e1e; color: #e05050; }

/* ─── Contract cargo warning (Trade sell list) ───────────────────── */

.trade-good-contract {
    border-left: 3px solid #ffd166;
    padding-left: 8px;
}

.cargo-contract-warn {
    display: inline-block;
    margin-left: 8px;
    font-size: 11px;
    background: #2e2820;
    color: #ffd166;
    padding: 2px 8px;
    border-radius: 3px;
    font-weight: 600;
}

/* ─── Divert confirmation modal ──────────────────────────────────── */

.divert-modal {
    display: flex;
    flex-direction: column;
    gap: 14px;
    align-items: center;
    padding: 8px 6px;
    text-align: center;
}

.divert-modal .divert-icon {
    font-size: 36px;
    line-height: 1;
    color: #ffd166;
}

.divert-modal h2 {
    margin: 0;
    color: #ffd166;
}

.divert-body {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    color: #dfe6f0;
    max-width: 520px;
}

.divert-breakdown {
    width: 100%;
    max-width: 460px;
    border-collapse: collapse;
    margin: 6px 0;
}
.divert-breakdown tr {
    border-bottom: 1px solid #232a36;
}
.divert-breakdown tr:last-child { border-bottom: none; }
.divert-breakdown tr.divert-row-delivered {
    background: rgba(108, 182, 255, 0.05);
}
.divert-breakdown tr.divert-row-net {
    background: rgba(255, 209, 102, 0.06);
    font-weight: 600;
}
.divert-label {
    text-align: left;
    padding: 8px 10px 8px 0;
    color: #b0bcd0;
    font-size: 12px;
}
.divert-value {
    text-align: right;
    padding: 8px 0;
    font-size: 13px;
    font-weight: 600;
}
.divert-value.good { color: #6ec97a; }
.divert-value.bad  { color: #e05050; }

.divert-actions {
    display: flex;
    gap: 10px;
    margin-top: 6px;
}

/* ─── Feed importance tiers (GDD § 63.4.10) ──────────────────────── */

.activity-item.importance-critical {
    border-left: 3px solid #e05050;
    background: linear-gradient(90deg, rgba(224, 80, 80, 0.08), transparent 60%);
}
.activity-item.importance-high {
    border-left: 3px solid #ffd166;
}
.activity-item.importance-medium {
    border-left: 3px solid #6cb6ff;
}
.activity-item.importance-low {
    border-left: 3px solid transparent;
}
.activity-item.importance-background {
    border-left: 3px solid transparent;
    opacity: 0.7;
}

/* ─── Corporations modal (GDD § 16) ──────────────────────────────── */

.modal-subtitle {
    margin-top: -6px;
    font-size: 12px;
    color: #8a96aa;
}

.corps-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}

.corp-card {
    background: #1a2233;
    border: 1px solid #232a36;
    border-left: 3px solid #4a9eff;
    border-radius: 4px;
    padding: 12px 14px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.corp-card:hover {
    background: #20283a;
    border-color: #4a9eff;
}

.corp-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.corp-name {
    font-weight: 700;
    color: #dfe6f0;
    font-size: 14px;
}

.corp-rep-chip {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 3px;
    font-weight: 600;
    letter-spacing: 0.2px;
}
.corp-rep-bare      { background: #232a36; color: #8a96aa; }
.corp-rep-wary      { background: #2e1e1e; color: #e05050; }
.corp-rep-known     { background: #1e2e1e; color: #6ec97a; }
.corp-rep-insider   { background: #1e2c3e; color: #6cb6ff; }
.corp-rep-confidant { background: #2c1e3e; color: #b07eec; }

.corp-card-meta {
    display: flex;
    gap: 14px;
    font-size: 12px;
    color: #8a96aa;
}
.corp-sector {
    color: #b0bcd0;
    font-weight: 600;
}

/* Detail view */
.corp-detail {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.corp-detail-header {
    border-left: 3px solid #4a9eff;
    padding-left: 12px;
}
.corp-detail-header h2 {
    margin: 0 0 6px 0;
}
.corp-detail-meta {
    margin: 0;
    font-size: 12px;
    color: #8a96aa;
}
.corp-detail-rep {
    margin: 6px 0 0 0;
    font-size: 12px;
    color: #b0bcd0;
}

.corp-tier-block {
    background: #1a2233;
    border: 1px solid #232a36;
    border-radius: 6px;
    padding: 12px 14px;
}
.corp-tier-block h3 {
    margin: 0 0 8px 0;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #b0bcd0;
}

.corp-tier-block.locked {
    background: #141923;
    border: 1px dashed #2a3548;
    color: #5d6677;
}
.corp-tier-block.locked h3 {
    color: #5d6677;
}
.corp-tier-block.locked .corp-lock-hint {
    margin: 0;
    font-size: 12px;
    font-style: italic;
}

.corp-tier-block.unlocked.corp-tier-known    { border-left: 3px solid #6ec97a; }
.corp-tier-block.unlocked.corp-tier-insider  { border-left: 3px solid #6cb6ff; }
.corp-tier-block.unlocked.corp-tier-confidant { border-left: 3px solid #b07eec; }

.corp-pitch, .corp-signature, .corp-fronts, .corp-secret {
    margin: 0;
    line-height: 1.55;
    font-size: 13px;
    color: #dfe6f0;
}
.corp-secret {
    color: #f0c0c0;
    font-style: italic;
}

.corp-label {
    color: #8a96aa;
    font-size: 12px;
    margin-right: 6px;
}

.corp-exec-list {
    margin: 6px 0 0 0;
    padding-left: 20px;
    font-size: 12px;
    color: #dfe6f0;
}

/* On contract cards : "Au nom de Helix Logistics" */
.contract-corp-line {
    font-size: 11px;
    color: #b0bcd0;
    font-style: italic;
    margin: -4px 0 4px 0;
}

/* ─── Scene activity cards (GDD § 63.4.6 — SceneEngine v0) ───────── */

.activity-item.type-scene {
    background: #1a1f2c;
    border-left-width: 3px;
    padding: 12px 14px;
    margin: 8px 0;
    border-radius: 4px;
}

.activity-item.type-scene .scene-icon {
    font-size: 18px;
    line-height: 1;
    padding-top: 2px;
}

.scene-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.scene-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.scene-category-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #2a3548;
    color: #b0bcd0;
}

.scene-player-tag {
    font-size: 11px;
    color: #ffd166;
    font-weight: 600;
}

.scene-text {
    color: #dfe6f0;
    line-height: 1.5;
    font-size: 13px;
}

/* Per-category accents on the left border + badge tint. */
.activity-item.scene-category-intime {
    border-left-color: #ec7eb5;
}
.activity-item.scene-category-intime .scene-category-badge {
    background: #3a2330;
    color: #ec7eb5;
}

.activity-item.scene-category-sombre {
    border-left-color: #e05050;
}
.activity-item.scene-category-sombre .scene-category-badge {
    background: #3a1f1f;
    color: #e05050;
}

.activity-item.scene-category-macro {
    border-left-color: #ffd166;
}
.activity-item.scene-category-macro .scene-category-badge {
    background: #3a3220;
    color: #ffd166;
}

.activity-item.scene-category-info {
    border-left-color: #6cb6ff;
}
.activity-item.scene-category-info .scene-category-badge {
    background: #1f2c3a;
    color: #6cb6ff;
}

.activity-item.scene-category-orionum {
    border-left-color: #b07eec;
}
.activity-item.scene-category-orionum .scene-category-badge {
    background: #2c1f3a;
    color: #b07eec;
}

.activity-item.scene-category-quotidien {
    border-left-color: #8a96aa;
}
.activity-item.scene-category-quotidien .scene-category-badge {
    background: #232a36;
    color: #b0bcd0;
}

.activity-item.scene-involves-player {
    box-shadow: 0 0 0 1px rgba(255, 209, 102, 0.35);
    background: #20242f;
}

/* ─────────────────────────────────────────────────────────────
 * Factions modal (GDD § 63.6 — Faction v0 alive)
 *
 * Mirror of the corp styling, but the left accent reads --faction-color
 * (set inline from Faction.color) so each card visually carries its
 * faction's identity colour without needing a per-faction class.
 * ───────────────────────────────────────────────────────────── */

.factions-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}

.faction-card {
    background: #1a2233;
    border: 1px solid #232a36;
    border-left: 4px solid var(--faction-color, #4a9eff);
    border-radius: 4px;
    padding: 12px 14px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.faction-card:hover {
    background: #20283a;
    border-color: var(--faction-color, #4a9eff);
}

.faction-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.faction-name {
    font-weight: 700;
    color: #dfe6f0;
    font-size: 14px;
}

.faction-rep-chip {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 3px;
    font-weight: 600;
    letter-spacing: 0.2px;
}
.faction-rep-inconnu      { background: #232a36; color: #8a96aa; }
.faction-rep-sympathisant { background: #1e2e1e; color: #6ec97a; }
.faction-rep-membre       { background: #1e2c3e; color: #6cb6ff; }
.faction-rep-officier     { background: #2c1e3e; color: #b07eec; }

.faction-card-meta {
    display: flex;
    gap: 14px;
    font-size: 12px;
    color: #8a96aa;
    align-items: center;
}
.faction-systems {
    color: #b0bcd0;
    font-weight: 600;
}

.faction-hostility {
    font-size: 11px;
    padding: 2px 7px;
    border-radius: 3px;
    font-weight: 600;
}
.faction-hostility-wary    { background: #2e2418; color: #d6a567; }
.faction-hostility-hostile { background: #2e1818; color: #e05050; }

.faction-motto {
    margin: 6px 0 0 0;
    font-size: 12px;
    font-style: italic;
    color: #8a96aa;
}

/* Detail view */
.faction-detail {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.faction-detail-header {
    border-left: 3px solid var(--faction-color, #4a9eff);
    padding-left: 12px;
}
.faction-detail-header h2 {
    margin: 0 0 6px 0;
}
.faction-detail-motto {
    margin: 0;
    font-size: 13px;
    color: #b0bcd0;
    font-style: italic;
}
.faction-detail-rep {
    margin: 6px 0 0 0;
    font-size: 12px;
    color: #b0bcd0;
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.faction-tier-block {
    background: #1a2233;
    border: 1px solid #232a36;
    border-radius: 6px;
    padding: 12px 14px;
}
.faction-tier-block h3 {
    margin: 0 0 8px 0;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #b0bcd0;
}
.faction-tier-block.unlocked {
    border-left: 3px solid var(--faction-color, #4a9eff);
}

.faction-tier-block.locked {
    background: #141923;
    border: 1px dashed #2a3548;
    color: #5d6677;
}
.faction-tier-block.locked h3 {
    color: #5d6677;
}
.faction-lock-hint {
    margin: 0;
    font-size: 12px;
    font-style: italic;
}

.faction-desc, .faction-lore, .faction-secret, .faction-territory-list {
    margin: 0;
    line-height: 1.55;
    font-size: 13px;
    color: #dfe6f0;
}
.faction-secret {
    color: #f0c0c0;
    font-style: italic;
}

.faction-tensions {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.faction-tension {
    font-size: 13px;
    padding: 4px 8px;
    border-radius: 3px;
    background: #141923;
}
.faction-tension-good    { color: #6ec97a; }
.faction-tension-neutral { color: #b0bcd0; }
.faction-tension-bad     { color: #e08070; }

/* ─────────────────────────────────────────────────────────────
 * Contract route profitability chip (Phase 2.1)
 *
 * Shown on each available-contract card with anticipated travel
 * time / cost / net profit. Colored by margin so the player can
 * scan the missions board for the best deals at a glance.
 * ───────────────────────────────────────────────────────────── */

.contract-route-row {
    margin: 6px 0 4px;
}

.contract-route {
    display: inline-block;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 3px;
    background: #141923;
    color: #b0bcd0;
    border-left: 3px solid #4a9eff;
}
.contract-route-good { border-left-color: #6ec97a; color: #cfe5d0; }
.contract-route-lean { border-left-color: #d6a567; color: #e0cba0; }
.contract-route-loss { border-left-color: #e05050; color: #e8b0b0; }
.contract-route-unknown { border-left-color: #5d6677; color: #8a96aa; font-style: italic; }

/* Detail view route block */
.contract-route-summary {
    padding: 10px 12px;
    border-radius: 4px;
    background: #141923;
    border-left: 3px solid #4a9eff;
    margin-bottom: 8px;
    line-height: 1.5;
}
.contract-route-summary.contract-route-good { border-left-color: #6ec97a; }
.contract-route-summary.contract-route-lean { border-left-color: #d6a567; }
.contract-route-summary.contract-route-loss { border-left-color: #e05050; }

.contract-route-margin {
    display: inline-block;
    margin-left: 8px;
    font-size: 11px;
    padding: 2px 7px;
    border-radius: 3px;
    font-weight: 600;
    letter-spacing: 0.2px;
}
.contract-route-good-chip { background: #1e2e1e; color: #6ec97a; }
.contract-route-lean-chip { background: #2e2418; color: #d6a567; }
.contract-route-loss-chip { background: #2e1818; color: #e05050; }

.contract-route-legs {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.contract-route-legs li {
    font-size: 12px;
    color: #b0bcd0;
    padding: 4px 8px;
    background: #141923;
    border-radius: 3px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.route-leg-icon { opacity: 0.85; }
.route-leg-meta {
    margin-left: auto;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    color: #8a96aa;
}

/* ─────────────────────────────────────────────────────────────
 * Activity feed clickable rows + detail modal
 * (Phase 2.1 — feed grew with the 12-system cluster)
 * ───────────────────────────────────────────────────────────── */

.activity-item {
    cursor: pointer;
    transition: background 0.12s ease;
}
.activity-item:hover {
    background: rgba(74, 158, 255, 0.06);
}

.activity-detail {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.activity-detail-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 12px;
    background: #1a2233;
    border-radius: 6px;
    border-left: 3px solid #4a9eff;
}
.activity-detail-header h2 {
    margin: 4px 0 0;
    font-size: 18px;
    color: #dfe6f0;
}
.activity-detail-icon {
    font-size: 28px;
    line-height: 1;
}
.activity-detail-badge {
    display: inline-block;
    font-size: 11px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    background: #232a36;
    color: #b0bcd0;
    padding: 2px 8px;
    border-radius: 3px;
    margin-right: 8px;
}

.activity-detail-scene {
    border-left-width: 4px;
}
.activity-detail-scene.scene-category-intime   { border-left-color: #e09cb8; }
.activity-detail-scene.scene-category-sombre   { border-left-color: #c14a4a; }
.activity-detail-scene.scene-category-macro    { border-left-color: #d6a567; }
.activity-detail-scene.scene-category-info     { border-left-color: #6cb6ff; }
.activity-detail-scene.scene-category-orionum  { border-left-color: #9c70d6; }
.activity-detail-scene.scene-category-quotidien{ border-left-color: #b0bcd0; }

.activity-detail-body {
    font-size: 14px;
    line-height: 1.6;
    color: #dfe6f0;
    padding: 0 4px;
    margin: 0;
}
.activity-detail-scene-text {
    font-style: italic;
    color: #e6e2d4;
}

.activity-detail-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.activity-detail-table td {
    padding: 6px 8px;
    border-bottom: 1px solid #232a36;
    color: #dfe6f0;
}
.activity-detail-table td:first-child {
    color: #8a96aa;
    width: 35%;
    font-size: 12px;
}

.activity-detail-section h3 {
    margin: 4px 0 8px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #b0bcd0;
}
.activity-detail-participants {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.activity-detail-npc-link {
    background: #141923;
    border: 1px solid #232a36;
    color: #dfe6f0;
    padding: 6px 10px;
    border-radius: 4px;
    text-align: left;
    cursor: pointer;
    font-size: 13px;
    transition: border-color 0.12s, background 0.12s;
}
.activity-detail-npc-link:hover {
    border-color: #4a9eff;
    background: #1a2233;
}

.activity-detail-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

/* ─────────────────────────────────────────────────────────────
 * Travel modal — single-column card pattern (Phase 2.1 layout fix)
 *
 * The earlier 3-column grid (1fr auto auto) overcommitted the 552 px
 * usable width of #modal-content : `min-width: 110px` on actions +
 * `min-width: 90px` on meta + an icon-name-chip row on a 1fr track
 * with `flex-wrap: wrap` produced unbreakable content that pushed the
 * right side off-canvas. Combined with `overflow: hidden` on
 * .travel-group, the overflow was silently chopped — rows with long
 * location names appeared empty, short ones showed only their name.
 *
 * Fix : single-column card with three stacked rows (header /
 * meta-line / footer with stats + actions), borrowing the corp-card
 * shape that already fits the default modal width comfortably.
 * Headers stick during scroll so the system context never disappears.
 * ───────────────────────────────────────────────────────────── */

.travel-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 12px 0;
    padding: 10px;
    background: #141923;
    border-radius: 6px;
}

.travel-control-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.travel-control-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #8a96aa;
    min-width: 70px;
}

.travel-chip-row {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    /* Let the chip row consume the remaining track inside its control-group
     * so chips flow horizontally and only wrap when truly necessary. */
    flex: 1 1 auto;
    min-width: 0;
}

.travel-chip {
    background: #1a2233;
    border: 1px solid #232a36;
    color: #b0bcd0;
    padding: 4px 10px;
    border-radius: 14px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.12s ease;
}
.travel-chip:hover {
    border-color: #4a9eff;
    color: #dfe6f0;
}
.travel-chip.active {
    background: #1e2c3e;
    border-color: #6cb6ff;
    color: #6cb6ff;
    font-weight: 600;
}

.travel-search {
    width: 100%;
    background: #1a2233;
    border: 1px solid #232a36;
    color: #dfe6f0;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
}
.travel-search:focus {
    outline: none;
    border-color: #6cb6ff;
}

.travel-stats {
    font-size: 11px;
    color: #8a96aa;
    text-align: right;
    font-family: 'Courier New', monospace;
}

/* Destination list owns no inner scrollbar — #modal-content already
 * scrolls vertically. Two nested scrollbars hide rows and steal width. */
.travel-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: none;
    overflow: visible;
}

.travel-group {
    border: 1px solid #232a36;
    border-radius: 6px;
    overflow: visible;
}

.travel-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: #1a2233;
    border-bottom: 1px solid #232a36;
    border-radius: 6px 6px 0 0;
    position: sticky;
    top: 0;
    /* z-index 10 keeps the sticky header above any scroll-track artifacts
     * Firefox/macOS render on top of the modal's scrollable content. */
    z-index: 10;
}

.travel-group-system {
    font-weight: 600;
    color: #f4d8a8;
    font-size: 14px;
    letter-spacing: 0.3px;
}

.travel-group-jumps {
    font-size: 11px;
    color: #8a96aa;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ── Destination card — 3 stacked rows, single column ───────────── */
.travel-dest {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 12px;
    background: #141923;
    border-bottom: 1px solid #1a2233;
    border-left: 3px solid transparent;
    min-width: 0; /* allow ellipsis on overflowing names */
}
.travel-dest:last-child {
    border-bottom: none;
    border-radius: 0 0 6px 6px;
}
.travel-margin-good    { border-left-color: #6ec97a; }
.travel-margin-loss    { border-left-color: #e05050; }
.travel-margin-unknown { border-left-color: #5d6677; }

/* Row 1 — title (icon + name, ellipsised) ←→ faction chip (anchored right) */
.travel-dest-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
}
.travel-dest-title {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1 1 auto;
}
.travel-dest-icon {
    flex-shrink: 0;
    font-size: 18px;
    line-height: 1;
}
.travel-dest-name {
    font-weight: 600;
    color: #dfe6f0;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.travel-faction-chip {
    flex-shrink: 0;
    font-size: 10px;
    padding: 1px 7px;
    border-radius: 3px;
    background: #1a2233;
    color: #b0bcd0;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    border: 1px solid #232a36;
    white-space: nowrap;
}
.travel-faction-coalition  { color: #6cb6ff; border-color: #2b4566; }
.travel-faction-consortium { color: #d6a567; border-color: #4a3d20; }
.travel-faction-cercle     { color: #b07eec; border-color: #3a2750; }
.travel-faction-clans      { color: #e05050; border-color: #503030; }
.travel-faction-neutral    { color: #8a96aa; border-color: #2a3548; }

/* Row 2 — type · system · via (one muted line, ellipsised if too long) */
.travel-dest-meta-line {
    font-size: 12px;
    color: #8a96aa;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}
.travel-dest-meta-sep {
    margin: 0 6px;
    opacity: 0.5;
}
.travel-dest-via {
    color: #d6a567;
    font-style: italic;
}

/* Row 3 — stats (time / cost / jumps) left ←→ action buttons right */
.travel-dest-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}
.travel-dest-stats {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: #b0bcd0;
    /* Allow the stats line to shrink so the action buttons stay on the same
     * row at narrow widths. Without `flex-shrink: 1` + `min-width: 0`, the
     * actions (flex-shrink: 0) would force the stats to overflow and the
     * footer's `flex-wrap: wrap` would push the buttons to a new line. */
    flex: 1 1 auto;
    min-width: 0;
    flex-wrap: wrap;
}
.travel-stat-time  { color: #b0bcd0; }
.travel-stat-cost  { color: #f4d8a8; font-weight: 600; }
.travel-stat-cost.insufficient { color: #e05050; }
.travel-stat-jumps {
    font-size: 11px;
    color: #8a96aa;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.travel-dest-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.travel-dest-actions .action-btn {
    padding: 5px 12px;
    font-size: 12px;
    line-height: 1.2;
}
.btn-travel-auto {
    background: #4a9eff;
    color: #ffffff;
    font-weight: 600;
}
.btn-travel-auto:hover:not(:disabled) {
    background: #6cb6ff;
}
.btn-travel-hop {
    background: #1e2c3e;
    color: #6cb6ff;
    border: 1px solid #4a9eff;
    font-weight: 500;
}
.btn-travel-hop:hover:not(:disabled) {
    background: #243749;
}
.btn-travel-auto.disabled,
.btn-travel-hop.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.travel-unreachable {
    font-size: 11px;
    color: #5d6677;
    font-style: italic;
    padding: 4px 0;
}

.travel-empty {
    text-align: center;
    padding: 24px;
    font-style: italic;
}

/* ─────────────────────────────────────────────────────────────
 * NPC profile : Plan section + Recent actions timeline +
 * Follow/Unfollow button (chantier 2.4 — Follow / Comprendre).
 *
 * Plan + timeline are gated by the player following the NPC ; the
 * button toggles it. Marker style ★ added inline on the title +
 * contact rows.
 * ───────────────────────────────────────────────────────────── */

.plan-goal {
    margin: 4px 0 8px;
    font-size: 12px;
}
.plan-steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-left: 2px solid #232a36;
    padding-left: 12px;
}
.plan-steps li {
    font-size: 13px;
    line-height: 1.5;
    color: #b0bcd0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.plan-step-marker {
    display: inline-block;
    width: 16px;
    text-align: center;
    font-family: 'Courier New', monospace;
    font-weight: bold;
}
.plan-step-done {
    color: #6ec97a;
    opacity: 0.7;
    text-decoration: line-through;
}
.plan-step-current {
    color: #f4d8a8;
    font-weight: 600;
}
.plan-step-pending {
    color: #8a96aa;
}

.recent-actions-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 240px;
    overflow-y: auto;
}
.recent-action-row {
    display: grid;
    grid-template-columns: 24px 80px 1fr auto;
    gap: 8px;
    padding: 4px 8px;
    background: #141923;
    border-radius: 3px;
    font-size: 12px;
    color: #b0bcd0;
    align-items: center;
}
.recent-action-row.recent-action-fail {
    color: #c9a0a0;
    background: #1f1414;
}
.recent-action-icon { font-size: 14px; text-align: center; }
.recent-action-kind { color: #dfe6f0; font-weight: 600; }
.recent-action-where {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}
.recent-action-when {
    font-family: 'Courier New', monospace;
    font-size: 11px;
    color: #8a96aa;
    text-align: right;
}

.btn-follow {
    background: #1e2c3e;
    color: #6cb6ff;
    border: 1px solid #4a9eff;
    font-weight: 500;
}
.btn-follow:hover {
    background: #243749;
}
.btn-following {
    background: #2c1e3e;
    color: #b07eec;
    border: 1px solid #b07eec;
    font-weight: 600;
}
.btn-following:hover {
    background: #3a2750;
}

/* Contacts modal — followed filter visual cue */
.contact-followed {
    border-left: 3px solid #b07eec;
}
.contact-followed .contact-name {
    color: #b07eec;
}

/* ─────────────────────────────────────────────────────────────
 * Contact request status + narrative (GDD § 64.1 — chantier 64.1)
 *
 * Six outcome chips + a one-paragraph narrative line under each.
 * Coloured by the same palette as the rest of the social UI :
 *   warm  → green, cold → blue, ghost → gray, refus_poli → amber,
 *   refus_aggressif / refus_factionnel → red.
 * ───────────────────────────────────────────────────────────── */

.contact-status {
    margin: 12px 0;
    padding: 10px 12px;
    background: #141923;
    border-radius: 4px;
    border-left: 3px solid #232a36;
}
.contact-status .contact-chip {
    display: inline-block;
    font-size: 11px;
    padding: 3px 9px;
    border-radius: 3px;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    margin-bottom: 6px;
}
.contact-chip-accept_warm        { background: #1e2e1e; color: #6ec97a; }
.contact-chip-accept_cold        { background: #1e2c3e; color: #6cb6ff; }
.contact-chip-ghost              { background: #232a36; color: #8a96aa; font-style: italic; }
.contact-chip-refus_poli         { background: #2e2418; color: #d6a567; }
.contact-chip-refus_aggressif    { background: #2e1818; color: #e05050; }
.contact-chip-refus_factionnel   { background: #2e1818; color: #e05050; }

.contact-status .contact-narrative {
    margin: 0;
    font-size: 13px;
    line-height: 1.55;
    color: #d8d2bf;
    font-style: italic;
}

.btn-contact-request {
    background: #1e2c3e;
    color: #6cb6ff;
    border: 1px solid #4a9eff;
    font-weight: 500;
}
.btn-contact-request:hover:not(:disabled) {
    background: #243749;
}
.btn-in-contact {
    background: #1e2e1e;
    color: #6ec97a;
    border: 1px solid #4d8055;
    font-weight: 600;
    cursor: default;
    opacity: 0.85;
}
.btn-contact-blocked {
    background: #2e1818;
    color: #e05050;
    border: 1px solid #6e2e2e;
    font-weight: 500;
    cursor: not-allowed;
    opacity: 0.7;
}

/* ─────────────────────────────────────────────────────────────
 * NPC interpellation modal (GDD § 28.7) — a curious NPC walks up.
 * Small modal : avatar + name + occupation + one-paragraph opening
 * + three choice buttons. Sober, no chrome ; mirrors the dialogue
 * scene's quiet typography rather than the loud combat tense modal.
 * ───────────────────────────────────────────────────────────── */

.interpellation-modal {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 4px;
}
.interpellation-header {
    display: flex;
    align-items: center;
    gap: 14px;
}
.interpellation-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: 700;
    font-size: 18px;
    letter-spacing: 1px;
    flex-shrink: 0;
}
.interpellation-id h2 {
    margin: 0 0 2px 0;
    font-size: 18px;
    color: #dfe6f0;
}
.interpellation-opening {
    margin: 0;
    line-height: 1.65;
    font-size: 15px;
    color: #d8d2bf;
    font-style: italic;
    padding: 14px 16px;
    background: #141923;
    border-left: 3px solid #6cb6ff;
    border-radius: 0 4px 4px 0;
}
.interpellation-choices {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 4px;
}
.interpellation-choice-accept {
    background: #1e2e1e;
    color: #6ec97a;
    border: 1px solid #4d8055;
    font-weight: 600;
    text-align: left;
}
.interpellation-choice-accept:hover {
    background: #243a25;
}
.interpellation-choice-decline {
    background: #232a36;
    color: #b0bcd0;
    border: 1px solid #2f3a4b;
    text-align: left;
}
.interpellation-choice-decline:hover {
    background: #2a3344;
}
.interpellation-choice-ignore {
    background: #2e1818;
    color: #e05050;
    border: 1px solid #5e2828;
    text-align: left;
}
.interpellation-choice-ignore:hover {
    background: #3a1d1d;
}

/* ─────────────────────────────────────────────────────────────
 * Intro cinematic (GDD § 63.7 — First Light)
 *
 * Five-beat opening sequence after character creation. Full-screen
 * overlay, deep noir-sci-fi background gradient, sober text reveals.
 * Skippable with Space / Click / Escape (handled in IntroCinematic.js).
 * ───────────────────────────────────────────────────────────── */

#intro-cinematic {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at center, #14122a 0%, #0a0814 60%, #050307 100%);
    color: #e6e2d4;
    font-family: 'Georgia', 'Times New Roman', serif;
    cursor: pointer;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.7s ease-out;
}
#intro-cinematic.intro-fade-in   { opacity: 1; }
#intro-cinematic.intro-fade-out  { opacity: 0; transition: opacity 0.7s ease-in; }

/* Subtle starfield — three layered radial gradients. Pure CSS, no JS, no
 * image asset ; readable on every monitor without burning a lot of paint
 * budget. The animation is a very slow drift to feel "alive without moving". */
.intro-stars {
    position: absolute;
    inset: -50px;
    background-image:
        radial-gradient(1px 1px at 20% 30%, rgba(255,255,255,0.4), transparent 50%),
        radial-gradient(1px 1px at 70% 60%, rgba(255,255,255,0.3), transparent 50%),
        radial-gradient(1.5px 1.5px at 40% 80%, rgba(255,255,255,0.35), transparent 50%),
        radial-gradient(1px 1px at 80% 20%, rgba(255,200,180,0.3), transparent 50%),
        radial-gradient(1.5px 1.5px at 15% 70%, rgba(180,200,255,0.3), transparent 50%),
        radial-gradient(1px 1px at 90% 90%, rgba(255,255,255,0.4), transparent 50%);
    background-size: 600px 600px;
    background-repeat: repeat;
    opacity: 0.45;
    animation: intro-stars-drift 90s linear infinite;
}
@keyframes intro-stars-drift {
    from { transform: translate(0, 0); }
    to   { transform: translate(-300px, -200px); }
}

.intro-stage {
    position: relative;
    z-index: 1;
    width: min(720px, 86vw);
    text-align: center;
    pointer-events: none;
}

.intro-beat {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.9s ease-out, transform 1.1s ease-out;
    line-height: 1.7;
    letter-spacing: 0.2px;
    text-wrap: balance;
}
.intro-beat--in {
    opacity: 1;
    transform: translateY(0);
}

/* Per-beat typography — calibrated to feel like opening titles, not paragraphs */
.intro-beat--setting {
    font-size: 22px;
    font-style: italic;
    color: #d8d2bf;
    text-shadow: 0 0 12px rgba(180, 160, 200, 0.2);
}
.intro-beat--origin {
    font-size: 17px;
    color: #d8d2bf;
    max-width: 600px;
    margin: 0 auto;
}
.intro-beat--event {
    font-size: 17px;
    color: #c8b8b0;
    max-width: 600px;
    margin: 0 auto;
    border-left: 2px solid rgba(180, 100, 100, 0.4);
    padding-left: 18px;
    text-align: left;
    animation: intro-event-pulse 4s ease-in-out infinite;
}
@keyframes intro-event-pulse {
    0%, 100% { border-left-color: rgba(180, 100, 100, 0.4); }
    50%      { border-left-color: rgba(220, 120, 120, 0.7); }
}
.intro-beat--motivations {
    font-size: 17px;
    color: #d8d2bf;
    max-width: 600px;
    margin: 0 auto;
    font-style: italic;
}
.intro-beat--arrival {
    font-size: 22px;
    color: #e6e2d4;
    font-style: italic;
    text-shadow: 0 0 18px rgba(255, 220, 180, 0.25);
}
.intro-beat--arrival strong {
    display: block;
    margin-top: 14px;
    font-size: 18px;
    color: #f4d8a8;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    font-style: normal;
}

/* Skip hint bottom-right corner — discreet, doesn't fight the text */
.intro-skip-hint {
    position: absolute;
    bottom: 24px;
    right: 32px;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    color: rgba(230, 226, 212, 0.4);
    letter-spacing: 0.5px;
    pointer-events: none;
    user-select: none;
}
