/* ============================================
   VOIDBOUND - AAA HUD REDESIGN
   Mass Effect meets Dead Space with Star Citizen detail
   ============================================ */

/* ============================================
   MAIN GRID LAYOUT - Full Screen
   ============================================ */
.game-screen-hud {
    display: grid;
    grid-template-columns: 280px 1fr 300px;
    grid-template-rows: 60px 1fr 120px;
    grid-template-areas:
        "top-bar    top-bar     top-bar"
        "left-panel main-area   right-panel"
        "bottom-bar bottom-bar  bottom-bar";
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(0, 50, 80, 0.3) 0%, transparent 60%),
        radial-gradient(circle at 80% 80%, rgba(50, 0, 80, 0.2) 0%, transparent 40%),
        linear-gradient(180deg, var(--bg-dark) 0%, #050508 100%);
    position: relative;
}

/* ============================================
   TOP BAR - Header
   ============================================ */
.hud-top-bar {
    grid-area: top-bar;
    display: grid;
    grid-template-columns: 280px 1fr 180px auto 280px;
    align-items: center;
    gap: 0.75rem;
    padding: 0 1.25rem;
    background: linear-gradient(
        180deg,
        rgba(21, 21, 32, 0.95) 0%,
        rgba(21, 21, 32, 0.85) 100%
    );
    border-bottom: 2px solid var(--border-color);
    box-shadow:
        0 2px 20px rgba(0, 240, 255, 0.1),
        inset 0 -1px 0 rgba(0, 240, 255, 0.3);
    backdrop-filter: blur(10px);
    z-index: 100;
}

.hud-ship-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.hud-ship-icon {
    width: 32px;
    height: 32px;
    background: radial-gradient(circle, var(--primary) 0%, var(--primary-dim) 100%);
    border-radius: 50%;
    box-shadow: 0 0 15px var(--primary);
    animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {
    0%, 100% { box-shadow: 0 0 15px var(--primary); }
    50% { box-shadow: 0 0 25px var(--primary), 0 0 40px rgba(0, 240, 255, 0.5); }
}

.hud-ship-name {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    text-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
    letter-spacing: 0.15em;
}

.hud-location-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
}

.hud-location-icon {
    color: var(--warning);
    font-size: 1.1rem;
}

.hud-location-text {
    font-family: var(--font-mono);
    font-size: 1rem;
    color: var(--text-bright);
    text-transform: uppercase;
}

.hud-stardate-display {
    font-family: var(--font-mono);
    font-size: 1rem;
    color: var(--secondary);
    text-align: center;
    padding: 0.5rem 1rem;
    background: rgba(255, 107, 0, 0.1);
    border: 1px solid rgba(255, 107, 0, 0.3);
    border-radius: 4px;
}

.hud-icons {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.hud-icon-btn {
    position: relative;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 240, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.hud-icon-btn:hover {
    background: rgba(0, 240, 255, 0.15);
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.3);
}

.hud-icon-btn.has-notification::after {
    content: '';
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--danger);
    animation: notificationPulse 1s ease-in-out infinite;
}

@keyframes notificationPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.8; }
}

/* ============================================
   LEFT PANEL - Character & Status
   ============================================ */
.hud-left-panel {
    grid-area: left-panel;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
    background: linear-gradient(
        90deg,
        rgba(21, 21, 32, 0.95) 0%,
        rgba(21, 21, 32, 0.75) 100%
    );
    border-right: 2px solid var(--border-color);
    box-shadow: inset -1px 0 0 rgba(0, 240, 255, 0.2);
    overflow-y: auto;
    overflow-x: hidden;
}

/* Character Portrait */
.hud-portrait-container {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    margin-bottom: 0.5rem;
}

.hud-portrait-frame {
    width: 100%;
    height: 100%;
    position: relative;
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.1), transparent);
    border: 2px solid var(--primary);
    box-shadow:
        0 0 20px rgba(0, 240, 255, 0.3),
        inset 0 0 20px rgba(0, 240, 255, 0.1);
    clip-path: polygon(
        0 0,
        calc(100% - 20px) 0,
        100% 20px,
        100% 100%,
        20px 100%,
        0 calc(100% - 20px)
    );
    overflow: hidden;
}

.hud-portrait-frame::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 240, 255, 0.03) 2px,
        rgba(0, 240, 255, 0.03) 4px
    );
    animation: scanlineMove 3s linear infinite;
    pointer-events: none;
}

@keyframes scanlineMove {
    0% { transform: translateY(0); }
    100% { transform: translateY(50px); }
}

.hud-portrait-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter:
        contrast(1.1)
        brightness(1.05)
        drop-shadow(0 0 10px rgba(0, 240, 255, 0.3));
}

.hud-character-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.75rem;
    background: linear-gradient(
        180deg,
        transparent 0%,
        rgba(0, 0, 0, 0.9) 100%
    );
    font-family: var(--font-display);
    font-size: 0.9rem;
    color: var(--primary);
    text-align: center;
    text-shadow: 0 0 10px rgba(0, 240, 255, 0.8);
}

/* Stats Container */
.hud-stats-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--primary);
}

.hud-stat-row {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.hud-stat-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.hud-stat-value {
    font-family: var(--font-display);
    font-size: 0.85rem;
    color: var(--text-bright);
}

.hud-stat-bar-container {
    position: relative;
    height: 12px;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
}

.hud-stat-bar-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        90deg,
        transparent,
        transparent 10px,
        rgba(255, 255, 255, 0.05) 10px,
        rgba(255, 255, 255, 0.05) 11px
    );
    pointer-events: none;
}

.hud-stat-bar-fill {
    height: 100%;
    transition: width 0.5s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.hud-stat-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 100%
    );
    animation: barShine 2s linear infinite;
}

@keyframes barShine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.hud-stat-bar-fill.health {
    background: linear-gradient(90deg, #ff1744 0%, #ff4444 100%);
    box-shadow: 0 0 10px rgba(255, 23, 68, 0.5);
}

.hud-stat-bar-fill.energy {
    background: linear-gradient(90deg, #ffa000 0%, #ffaa00 100%);
    box-shadow: 0 0 10px rgba(255, 160, 0, 0.5);
}

.hud-stat-bar-fill.shield {
    background: linear-gradient(90deg, #00b0ff 0%, #00aaff 100%);
    box-shadow: 0 0 10px rgba(0, 176, 255, 0.5);
}

.hud-stat-bar-fill.warning {
    animation: warningPulse 1s ease-in-out infinite;
}

@keyframes warningPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Section Cards */
.hud-section-card {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--primary);
    padding: 0.75rem;
}

.hud-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-display);
    font-size: 0.8rem;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(0, 240, 255, 0.2);
}

.hud-section-icon {
    font-size: 1rem;
}

/* Mission List */
.hud-mission-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.hud-mission-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.5rem;
    background: rgba(255, 170, 0, 0.05);
    border-left: 2px solid var(--warning);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-normal);
    cursor: pointer;
    transition: all 0.2s ease;
}

.hud-mission-item:hover {
    background: rgba(255, 170, 0, 0.15);
    transform: translateX(3px);
}

.hud-mission-bullet {
    color: var(--warning);
    font-weight: bold;
}

/* Quick Inventory */
.hud-quick-inventory {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.hud-quick-item {
    aspect-ratio: 1;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.hud-quick-item:hover {
    border-color: var(--primary);
    background: rgba(0, 240, 255, 0.1);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.3);
}

.hud-quick-item-icon {
    font-size: 1.5rem;
}

.hud-quick-item-count {
    position: absolute;
    bottom: 2px;
    right: 4px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-bright);
    background: rgba(0, 0, 0, 0.8);
    padding: 1px 4px;
    border-radius: 2px;
}

/* Nearby Objects */
.hud-objects-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.hud-object-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-dim);
    cursor: pointer;
    transition: all 0.2s ease;
    border-left: 2px solid transparent;
}

.hud-object-item:hover {
    color: var(--primary);
    background: rgba(0, 240, 255, 0.1);
    border-left-color: var(--primary);
    transform: translateX(3px);
}

.hud-object-icon {
    font-size: 0.9rem;
}

/* ============================================
   CENTER MAIN AREA - Narrative & Scene
   ============================================ */
.hud-main-area {
    grid-area: main-area;
    display: flex;
    flex-direction: column;
    background: var(--bg-dark);
    overflow: hidden;
    position: relative;
}

/* Scene Display */
.hud-scene-container {
    position: relative;
    width: 100%;
    height: 35vh;
    min-height: 280px;
    max-height: 400px;
    overflow: hidden;
    background: #000;
    flex-shrink: 0;
}

.hud-scene-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter:
        contrast(1.15)
        brightness(0.95)
        saturate(1.1);
    transition: all 0.5s ease;
}

.hud-scene-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        180deg,
        transparent 0%,
        transparent 60%,
        rgba(10, 10, 15, 0.5) 80%,
        rgba(10, 10, 15, 0.95) 100%
    );
    pointer-events: none;
}

/* Cinematic letterbox bars */
.hud-scene-container::before,
.hud-scene-container::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 30px;
    background: linear-gradient(
        180deg,
        rgba(10, 10, 15, 0.9) 0%,
        transparent 100%
    );
    pointer-events: none;
    z-index: 10;
}

.hud-scene-container::before {
    top: 0;
}

.hud-scene-container::after {
    bottom: 0;
    transform: rotate(180deg);
}

/* Scene Loading */
.hud-scene-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    z-index: 20;
}

.hud-scene-loading-spinner {
    width: 60px;
    height: 60px;
    border: 3px solid rgba(0, 240, 255, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.hud-scene-loading-text {
    font-family: var(--font-mono);
    color: var(--primary);
    font-size: 0.9rem;
    letter-spacing: 0.2em;
    text-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
}

/* Narrative Text Area */
.hud-narrative-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1.5rem 2rem;
    scroll-behavior: smooth;
}

.hud-narrative-entry {
    margin-bottom: 1.25rem;
    animation: narrativeFadeIn 0.5s ease;
}

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

.hud-narrative-text {
    font-family: var(--font-body);
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--text-normal);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.hud-narrative-text.player-action {
    color: var(--primary);
    font-family: var(--font-mono);
    padding-left: 1.5rem;
    border-left: 3px solid var(--primary);
    font-style: italic;
}

.hud-narrative-text.player-action::before {
    content: '> ';
    color: var(--primary);
    font-weight: bold;
}

.hud-narrative-text.dialogue {
    color: var(--secondary);
    padding: 0.75rem 1rem;
    background: rgba(255, 107, 0, 0.05);
    border-left: 3px solid var(--secondary);
    font-style: italic;
}

.hud-narrative-text.dialogue .speaker {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--secondary);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    display: block;
    margin-bottom: 0.25rem;
}

.hud-narrative-text.ai-message {
    color: var(--accent);
    padding: 1rem;
    background: linear-gradient(
        90deg,
        rgba(123, 46, 255, 0.15) 0%,
        rgba(123, 46, 255, 0.05) 100%
    );
    border: 1px solid var(--accent);
    border-left: 3px solid var(--accent);
    box-shadow: 0 0 20px rgba(123, 46, 255, 0.2);
}

.hud-narrative-text.system {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-dim);
    font-style: italic;
    opacity: 0.7;
}

.hud-narrative-text.critical {
    color: var(--danger);
    font-weight: 600;
    text-shadow: 0 0 10px rgba(255, 68, 68, 0.5);
    animation: criticalPulse 1s ease-in-out infinite;
}

@keyframes criticalPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

/* ============================================
   RIGHT PANEL - NPC/AI Interaction
   ============================================ */
.hud-right-panel {
    grid-area: right-panel;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
    background: linear-gradient(
        270deg,
        rgba(21, 21, 32, 0.95) 0%,
        rgba(21, 21, 32, 0.75) 100%
    );
    border-left: 2px solid var(--border-color);
    box-shadow: inset 1px 0 0 rgba(0, 240, 255, 0.2);
    overflow-y: auto;
    overflow-x: hidden;
}

/* NPC/AI Portrait */
.hud-npc-portrait-container {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    margin-bottom: 0.5rem;
}

.hud-npc-portrait-frame {
    width: 100%;
    height: 100%;
    position: relative;
    background: linear-gradient(225deg, rgba(123, 46, 255, 0.1), transparent);
    border: 2px solid var(--accent);
    box-shadow:
        0 0 20px rgba(123, 46, 255, 0.3),
        inset 0 0 20px rgba(123, 46, 255, 0.1);
    clip-path: polygon(
        20px 0,
        100% 0,
        100% calc(100% - 20px),
        calc(100% - 20px) 100%,
        0 100%,
        0 20px
    );
    overflow: hidden;
}

/* Mood indicator ring */
.hud-npc-mood-ring {
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border: 3px solid transparent;
    pointer-events: none;
    z-index: 10;
    animation: moodPulse 2s ease-in-out infinite;
}

.hud-npc-mood-ring.friendly {
    border-color: var(--success);
    box-shadow: 0 0 20px var(--success);
}

.hud-npc-mood-ring.neutral {
    border-color: var(--warning);
    box-shadow: 0 0 20px var(--warning);
}

.hud-npc-mood-ring.hostile {
    border-color: var(--danger);
    box-shadow: 0 0 20px var(--danger);
}

@keyframes moodPulse {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.02); }
}

.hud-npc-portrait-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter:
        contrast(1.1)
        brightness(1.1)
        drop-shadow(0 0 15px rgba(123, 46, 255, 0.4));
}

/* Holographic scan effect */
.hud-npc-portrait-frame::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(123, 46, 255, 0.3) 50%,
        transparent 100%
    );
    animation: holographicScan 3s ease-in-out infinite;
}

@keyframes holographicScan {
    0% { left: -100%; }
    100% { left: 200%; }
}

/* NPC Info Card */
.hud-npc-info-card {
    background: rgba(123, 46, 255, 0.1);
    border: 1px solid var(--accent);
    border-left: 3px solid var(--accent);
    padding: 1rem;
}

.hud-npc-name {
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
    text-shadow: 0 0 10px rgba(123, 46, 255, 0.5);
}

.hud-npc-role {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-bottom: 0.75rem;
}

.hud-npc-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-normal);
}

.hud-npc-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    animation: statusPulse 2s ease-in-out infinite;
}

.hud-npc-status-dot.connected {
    background: var(--success);
    box-shadow: 0 0 10px var(--success);
}

.hud-npc-status-dot.offline {
    background: var(--danger);
    opacity: 0.5;
}

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

/* Relationship Meters */
.hud-relationship-container {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--accent);
    padding: 1rem;
}

.hud-relationship-meter {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 0.75rem;
}

.hud-relationship-meter:last-child {
    margin-bottom: 0;
}

.hud-relationship-label {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-dim);
    text-transform: uppercase;
}

.hud-relationship-value {
    color: var(--accent);
    font-family: var(--font-display);
    font-size: 0.8rem;
}

.hud-relationship-bar {
    height: 8px;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
    position: relative;
}

.hud-relationship-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent) 0%, #9c4dff 100%);
    box-shadow: 0 0 10px rgba(123, 46, 255, 0.5);
    transition: width 0.5s ease;
}

/* Dialogue Options */
.hud-dialogue-container {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--accent);
    border-left: 3px solid var(--accent);
    padding: 1rem;
}

.hud-dialogue-title {
    font-family: var(--font-display);
    font-size: 0.8rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(123, 46, 255, 0.3);
}

.hud-dialogue-options-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.hud-dialogue-option {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    background: rgba(123, 46, 255, 0.05);
    border: 1px solid rgba(123, 46, 255, 0.3);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.hud-dialogue-option::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--accent);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.hud-dialogue-option:hover {
    background: rgba(123, 46, 255, 0.15);
    border-color: var(--accent);
    transform: translateX(3px);
    box-shadow: 0 0 15px rgba(123, 46, 255, 0.2);
}

.hud-dialogue-option:hover::before {
    opacity: 1;
}

.hud-dialogue-number {
    font-family: var(--font-display);
    font-size: 0.9rem;
    color: var(--accent);
    min-width: 20px;
}

.hud-dialogue-text {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--text-normal);
    line-height: 1.5;
}

.hud-dialogue-option.important .hud-dialogue-text {
    color: var(--warning);
}

.hud-dialogue-option.danger .hud-dialogue-text {
    color: var(--danger);
}

/* Typing indicator */
.hud-typing-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: rgba(123, 46, 255, 0.1);
    border: 1px solid rgba(123, 46, 255, 0.3);
    margin-top: 1rem;
}

.hud-typing-dots {
    display: flex;
    gap: 0.25rem;
}

.hud-typing-dot {
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
    animation: typingDot 1.4s infinite;
}

.hud-typing-dot:nth-child(1) { animation-delay: 0s; }
.hud-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.hud-typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingDot {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-8px); opacity: 1; }
}

/* ============================================
   BOTTOM BAR - Actions & Input
   ============================================ */
.hud-bottom-bar {
    grid-area: bottom-bar;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: linear-gradient(
        0deg,
        rgba(21, 21, 32, 0.98) 0%,
        rgba(21, 21, 32, 0.92) 100%
    );
    border-top: 2px solid var(--border-color);
    box-shadow:
        0 -2px 20px rgba(0, 240, 255, 0.1),
        inset 0 1px 0 rgba(0, 240, 255, 0.3);
    backdrop-filter: blur(10px);
    z-index: 100;
}

/* Primary Actions Row */
.hud-primary-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.hud-actions-grid {
    display: flex;
    gap: 0.5rem;
    flex: 1;
}

.hud-action-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.75rem;
    background: linear-gradient(
        135deg,
        rgba(0, 240, 255, 0.05) 0%,
        rgba(0, 240, 255, 0.02) 100%
    );
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.hud-action-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(0, 240, 255, 0.2) 50%,
        transparent 100%
    );
    transition: left 0.3s ease;
}

.hud-action-btn:hover::before {
    left: 100%;
}

.hud-action-btn:hover {
    background: linear-gradient(
        135deg,
        rgba(0, 240, 255, 0.15) 0%,
        rgba(0, 240, 255, 0.08) 100%
    );
    border-color: var(--primary);
    box-shadow:
        0 0 15px rgba(0, 240, 255, 0.3),
        inset 0 0 10px rgba(0, 240, 255, 0.1);
    transform: translateY(-2px);
}

.hud-action-btn.active {
    background: linear-gradient(
        135deg,
        rgba(0, 240, 255, 0.25) 0%,
        rgba(0, 240, 255, 0.15) 100%
    );
    border-color: var(--primary);
    box-shadow:
        0 0 20px rgba(0, 240, 255, 0.4),
        inset 0 0 15px rgba(0, 240, 255, 0.2);
}

.hud-action-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.hud-action-btn:disabled:hover {
    transform: none;
    box-shadow: none;
}

.hud-action-icon {
    font-size: 1.75rem;
    color: var(--primary);
    filter: drop-shadow(0 0 5px rgba(0, 240, 255, 0.5));
}

.hud-action-label {
    font-family: var(--font-display);
    font-size: 0.7rem;
    color: var(--text-normal);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.hud-action-btn:hover .hud-action-label {
    color: var(--primary);
}

/* Voice Input Button */
.hud-voice-input-container {
    display: flex;
    gap: 0.5rem;
}

.hud-voice-btn {
    width: 100px;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    background: linear-gradient(
        135deg,
        rgba(255, 107, 0, 0.1) 0%,
        rgba(255, 107, 0, 0.05) 100%
    );
    border: 1px solid var(--secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.hud-voice-btn:hover {
    background: linear-gradient(
        135deg,
        rgba(255, 107, 0, 0.2) 0%,
        rgba(255, 107, 0, 0.1) 100%
    );
    box-shadow: 0 0 15px rgba(255, 107, 0, 0.3);
}

.hud-voice-btn.active {
    background: linear-gradient(
        135deg,
        rgba(255, 107, 0, 0.3) 0%,
        rgba(255, 107, 0, 0.2) 100%
    );
    box-shadow:
        0 0 20px rgba(255, 107, 0, 0.5),
        inset 0 0 15px rgba(255, 107, 0, 0.3);
    animation: voicePulse 1s ease-in-out infinite;
}

@keyframes voicePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.hud-voice-icon {
    font-size: 1.5rem;
    color: var(--secondary);
}

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

/* Context Actions Row */
.hud-context-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.hud-context-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    padding: 0 0.5rem;
}

.hud-context-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--warning);
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--text-bright);
    cursor: pointer;
    transition: all 0.2s ease;
}

.hud-context-btn:hover {
    background: rgba(255, 170, 0, 0.1);
    border-color: var(--warning);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 170, 0, 0.2);
}

.hud-context-icon {
    font-size: 1rem;
    color: var(--warning);
}

/* ============================================
   VISUAL EFFECTS
   ============================================ */

/* Scanlines (global) */
.hud-scanlines {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.05) 0px,
        rgba(0, 0, 0, 0.05) 1px,
        transparent 1px,
        transparent 3px
    );
    pointer-events: none;
    z-index: 10000;
    opacity: 0.4;
}

/* Data stream background */
.hud-data-stream {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(90deg, transparent 0%, rgba(0, 240, 255, 0.02) 50%, transparent 100%),
        linear-gradient(0deg, transparent 0%, rgba(0, 240, 255, 0.02) 50%, transparent 100%);
    background-size: 50px 50px;
    animation: dataFlow 20s linear infinite;
    pointer-events: none;
    z-index: 1;
}

@keyframes dataFlow {
    0% { background-position: 0 0; }
    100% { background-position: 50px 50px; }
}

/* Corner bracket decoration */
.hud-bracketed {
    position: relative;
    padding: 1rem;
}

.hud-bracketed::before,
.hud-bracketed::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid var(--primary);
}

.hud-bracketed::before {
    top: 0;
    left: 0;
    border-right: none;
    border-bottom: none;
}

.hud-bracketed::after {
    bottom: 0;
    right: 0;
    border-left: none;
    border-top: none;
}

/* Holographic glow effect */
.hud-holographic-element {
    position: relative;
}

.hud-holographic-element::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(0, 240, 255, 0.1) 50%,
        transparent 70%
    );
    background-size: 200% 200%;
    animation: holographicShift 3s linear infinite;
    pointer-events: none;
    z-index: -1;
}

@keyframes holographicShift {
    0% { background-position: 0% 0%; }
    100% { background-position: 200% 200%; }
}

/* ============================================
   RESPONSIVE - Tablet (1024px - 1366px)
   ============================================ */
@media (max-width: 1366px) {
    .game-screen-hud {
        grid-template-columns: 240px 1fr 260px;
    }

    .hud-left-panel,
    .hud-right-panel {
        padding: 0.75rem;
    }

    .hud-scene-container {
        height: 30vh;
        min-height: 250px;
    }

    .hud-top-bar {
        grid-template-columns: 250px 1fr 180px 260px;
    }

    .hud-ship-name {
        font-size: 1.1rem;
    }
}

/* ============================================
   RESPONSIVE - Mobile (< 768px)
   ============================================ */
@media (max-width: 768px) {
    .game-screen-hud {
        grid-template-columns: 1fr;
        grid-template-rows: 50px 1fr 100px;
        grid-template-areas:
            "top-bar"
            "main-area"
            "bottom-bar";
    }

    /* Side panels become slide-out drawers - hidden by default */
    .hud-left-panel,
    .hud-right-panel {
        position: fixed;
        top: 50px;
        bottom: 100px;
        width: 280px;
        z-index: 200;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        background: rgba(21, 21, 32, 0.98);
        border: 1px solid var(--border-color);
        overflow-y: auto;
        visibility: hidden;
    }

    .hud-left-panel {
        left: 0;
    }

    .hud-right-panel {
        right: 0;
        transform: translateX(100%);
    }

    .hud-left-panel.open,
    .hud-right-panel.open {
        visibility: visible;
    }

    .hud-left-panel.open {
        transform: translateX(0);
    }

    .hud-right-panel.open {
        transform: translateX(0);
    }

    /* Panel toggle buttons */
    .hud-panel-toggle {
        width: 44px;
        height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(0, 240, 255, 0.1);
        border: 1px solid var(--border-color);
        cursor: pointer;
    }

    .hud-panel-toggle:hover {
        background: rgba(0, 240, 255, 0.2);
        border-color: var(--primary);
    }

    /* Top bar mobile */
    .hud-top-bar {
        grid-template-columns: 44px 1fr 44px;
        padding: 0 0.5rem;
        gap: 0.5rem;
    }

    .hud-ship-info {
        display: none;
    }

    .hud-stardate-display {
        display: none;
    }

    .hud-location-display {
        flex: 1;
    }

    .hud-icons {
        display: none;
    }

    /* Scene */
    .hud-scene-container {
        height: 25vh;
        min-height: 180px;
        max-height: 250px;
    }

    /* Bottom bar mobile */
    .hud-bottom-bar {
        padding: 0.5rem;
    }

    .hud-actions-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 0.25rem;
    }

    .hud-action-btn {
        padding: 0.5rem;
        min-height: 60px;
    }

    .hud-action-icon {
        font-size: 1.5rem;
    }

    .hud-action-label {
        font-size: 0.6rem;
    }

    .hud-context-actions {
        display: none;
    }

    .hud-voice-input-container {
        display: none;
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
@media (prefers-contrast: high) {
    :root {
        --border-color: rgba(0, 240, 255, 0.8);
        --text-normal: #ffffff;
    }

    .hud-action-btn,
    .hud-icon-btn {
        border-width: 2px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus indicators */
.hud-action-btn:focus-visible,
.hud-icon-btn:focus-visible,
.hud-dialogue-option:focus-visible,
.hud-context-btn:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
}

/* ============================================
   PERFORMANCE
   ============================================ */
.hud-top-bar,
.hud-bottom-bar,
.hud-left-panel,
.hud-right-panel {
    will-change: transform;
    transform: translateZ(0);
}

.hud-scene-image,
.hud-portrait-image,
.hud-npc-portrait-image {
    content-visibility: auto;
}
