



/* Control Panel (Right) styling - mostly unchanged */
.control-panel {
    /* Layout handled in layout.css */
}

.panel-section {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
}

.unit-info h3 { margin: 0 0 5px 0; }
.unit-stats { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 0.9rem; }
.stat-box { background: #000; padding: 4px 8px; border-radius: 4px; display: inline-flex; align-items: center; gap: 4px; }

/* Portrait & Detail Row */
.unit-detail-row {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.unit-portrait img {
    width: 90px;
    height: auto;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    object-fit: cover;
    background: #000;
}

.unit-info-col {
    flex: 1;
}

/* Large Portrait Viewer */
.portrait-viewer {
    flex: 1;
    background: #08080a;
    border-bottom: 1px solid var(--border-color);
    overflow: hidden;
    position: relative; 
    height: 100%; /* Fill remaining space */
    min-height: 300px;
    display: flex;
    flex-direction: column; 
}

/* Top Stats Bar */
.portrait-top-stats {
    width: 100%;
    height: 40px; 
    background: rgba(15, 11, 21, 0.95);
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-evenly; 
    align-items: center;
    z-index: 10;
    flex-shrink: 0;
}

.stat-box-lg {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-label-lg {
    font-family: 'Cinzel', serif;
    color: #9ca3af;
    font-size: 0.8rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.stat-value-lg {
    font-family: 'Cinzel', serif;
    color: #fff;
    font-weight: bold;
    font-size: 1.1rem;
    color: var(--accent-yellow);
}

/* Image Container */
.portrait-image-container {
    position: relative;
    flex: 1;
    width: 100%;
    overflow: hidden;
}

.portrait-bg {
    width: 100%;
    height: 100%;
    object-fit: contain; 
    object-position: center bottom;
}

/* Overlays Layer */
.portrait-overlay-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    padding: 10px;
}

/* Left Column for Status & Progress */
.portrait-left-col {
    position: absolute;
    left: 10px;
    top: 10px;
    bottom: 10px;
    width: 140px; 
    display: flex;
    flex-direction: column;
    justify-content: space-between; 
    pointer-events: none;
}

.status-stack {
    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: flex-start;
}

.progress-stack {
    display: flex;
    flex-direction: column;
    gap: 8px;
    justify-content: flex-end;
}

/* Progress Bar Styles */
.status-progress-wrapper {
    background: rgba(0, 0, 0, 0.8);
    padding: 6px;
    border-radius: 4px;
    border: 1px solid #444;
    width: 100%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.5);
    backdrop-filter: blur(2px);
}

.status-label {
    font-size: 0.7rem;
    color: #ccc;
    margin-bottom: 3px;
    text-transform: uppercase;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
}

.status-bar-track {
    width: 100%;
    height: 6px;
    background: #222;
    border-radius: 2px;
    overflow: hidden;
}

.status-bar-fill {
    height: 100%;
    transition: width 0.3s ease;
}

.bar-blue { background: #3b82f6; box-shadow: 0 0 5px #3b82f6; }
.bar-red { background: #ef4444; box-shadow: 0 0 5px #ef4444; }
.bar-orange { background: #f97316; box-shadow: 0 0 5px #f97316; }

/* Status Icons/Badges */
.status-badge {
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid #555;
    padding: 6px 10px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.5);
    max-width: 100%;
    backdrop-filter: blur(4px);
}

.status-badge.negative { border-color: var(--accent-red); color: #fca5a5; }
.status-badge.purple { border-color: var(--accent-purple); color: #d8b4fe; }
.status-badge.pink { border-color: var(--accent-pink); color: #f9a8d4; }

/* Existing Slots Styles */
.slots-container {
    display: flex;
    gap: 3px;
    flex-wrap: nowrap;
    flex: 1;
    align-items: center;
    overflow-x: hidden;
    margin: 0;
}

.slot {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    color: #fff;
    cursor: pointer;
    text-shadow: 1px 1px 0 #000;
    position: relative;
    flex-shrink: 0;
}

.slot:hover {
    transform: scale(1.1);
    z-index: 5;
}

.slot.purple { background: #a855f7; border-color: #d8b4fe; }
.slot.yellow { background: #eab308; border-color: #fde047; }
.slot.red { background: #ef4444; border-color: #fca5a5; }
.slot.blue { background: #3b82f6; border-color: #93c5fd; }
.slot.green { background: #22c55e; border-color: #86efac; }
.slot.gray { 
    background: #3f3f46; 
    border-color: #52525b; 
    color: #71717a; 
    cursor: not-allowed;
}

/* Tooltip */
.tooltip {
    position: fixed;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid var(--border-color);
    padding: 10px;
    border-radius: 4px;
    color: white;
    font-size: 0.85rem;
    pointer-events: none;
    z-index: 100;
    max-width: 250px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.tooltip h4 { margin: 0 0 5px 0; color: var(--accent-yellow); font-size: 0.95rem; }
.tooltip .meta { color: #94a3b8; font-size: 0.75rem; margin-bottom: 5px; display: flex; gap: 8px;}
.tooltip .desc { line-height: 1.4; }

/* Buttons */
.btn-action {
    width: 100%;
    padding: 12px;
    font-weight: bold;
    margin-top: 5px;
}

.list-section {
    flex: 1;
    overflow-y: auto;
}

.squad-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 8px;
    border: 1px solid #3f3f46;
    margin-bottom: 5px;
    cursor: pointer;
    border-radius: 4px;
    gap: 8px;
}

.squad-item:hover { background: #27272a; }
.squad-item.selected { border-color: var(--accent-yellow); background: #27272a; }
.squad-item.dead { text-decoration: line-through; color: var(--accent-red); }

.squad-item .name-col { 
    font-weight: bold; 
    font-size: 0.85rem; 
    width: 60px;
    flex-shrink: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stats-col {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    font-size: 0.75rem;
    line-height: 1.1;
    flex-shrink: 0;
    width: 50px;
}

.stats-col .hp { color: var(--accent-red); font-weight: bold; }
.stats-col .ap { color: var(--accent-yellow); font-weight: bold; }

/* --- LEFT PANEL STYLES --- */
.panel-header {
    padding: 10px;
    background: #111;
    border-bottom: 1px solid #333;
    font-weight: bold;
    color: #6366f1;
    font-size: 0.9rem;
    letter-spacing: 1px;
    text-align: center;
}

.log-container {
    flex: 1;
    background: #000;
    padding: 10px;
    overflow-y: auto;
    font-family: 'Consolas', monospace;
    font-size: 0.8rem;
    line-height: 1.4;
    border-bottom: 1px solid var(--border-color);
}

.left-action-area {
    padding: 20px;
    background: #0f0b15;
}

.btn-action-main {
    width: 100%;
    height: 50px;
    background: #312e81;
    border: 2px solid #6366f1;
    font-size: 1.1rem;
    font-weight: bold;
    color: white;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-action-main:hover:not(:disabled) {
    background: #4338ca;
    box-shadow: 0 0 15px #6366f1;
    transform: translateY(-2px);
}

.btn-action-main:disabled {
    opacity: 0.5;
    cursor: default;
    border-color: #444;
    background: #222;
}

.log-entry { margin-bottom: 4px; border-bottom: 1px solid #111; padding-bottom: 2px; }
.log-entry.red { color: var(--accent-red); }
.log-entry.purple { color: #d8b4fe; }
.log-entry.green { color: #4ade80; }
.log-entry.gray { color: #64748b; font-style: italic; }
.log-entry.pink { color: var(--accent-pink); }
.log-entry.yellow { color: var(--accent-yellow); }

/* Overlays */
.overlay {
    position: absolute;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.7);
}

/* Boss Resurrection Overlay */
#overlay-boss {
    position: absolute;
    inset: 0;
    z-index: 60;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(20, 0, 0, 0.95);
    pointer-events: auto; /* Block interactions */
    opacity: 0;
    transition: opacity 0.5s ease;
}

#overlay-boss.active {
    opacity: 1;
}

.boss-title {
    font-size: 3rem;
    color: #ef4444;
    text-shadow: 0 0 20px #7f1d1d;
    font-family: 'Cinzel', serif;
    font-weight: bold;
    animation: pulse 1s infinite;
    margin-bottom: 20px;
    text-align: center;
}

.boss-subtitle {
    font-size: 1.2rem;
    color: #fca5a5;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-align: center;
}

.overlay-text {
    font-size: 2rem;
    color: var(--accent-red);
    animation: pulse 1s infinite;
}

.overlay-content {
    background: #18181b;
    padding: 40px;
    border: 2px solid var(--border-color);
    text-align: center;
}

/* QTE Threshold Lines */
.qte-threshold {
    height: 50px;
    width: 2px;
    background-color: rgba(255, 255, 255, 0.2);
    margin: 0 8px;
    position: relative;
    border-radius: 1px;
    display: flex;
    justify-content: center;
}

.qte-threshold::after {
    content: attr(data-label);
    position: absolute;
    bottom: -22px;
    font-size: 0.6rem;
    color: #6b7280;
    text-transform: uppercase;
    white-space: nowrap;
    letter-spacing: 1px;
}

.qte-threshold.active {
    background-color: var(--accent-yellow);
    box-shadow: 0 0 10px var(--accent-yellow);
}
.qte-threshold.active::after {
    color: var(--accent-yellow);
    font-weight: bold;
    text-shadow: 0 0 5px var(--accent-yellow);
}