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

:root {
    --bg-primary: #0a0c0f;
    --bg-secondary: #12151a;
    --bg-card: #181c22;
    --accent: #00d4aa;
    --accent-dim: #00d4aa40;
    --text-primary: #e8e8e8;
    --text-secondary: #888;
    --text-dim: #555;
    --border: #2a2f38;
    --danger: #ff4757;
    --warning: #ffa502;
}

body {
    font-family: 'JetBrains Mono', monospace;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    border-bottom: 1px solid var(--border);
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-section img {
    width: 40px;
    height: 40px;
}

.logo-text h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--accent);
    letter-spacing: 3px;
}

.logo-text span {
    font-size: 0.65rem;
    color: var(--text-dim);
    letter-spacing: 2px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.status-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card);
    padding: 10px 18px;
    border-radius: 6px;
    font-size: 0.75rem;
    border: 1px solid var(--border);
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

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

.btn-icon {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    width: 42px;
    height: 42px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.btn-buy {
    background: linear-gradient(135deg, var(--accent), #00a080);
    color: var(--bg-primary);
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-weight: 700;
    font-family: 'Orbitron', sans-serif;
    cursor: pointer;
    font-size: 0.85rem;
}

/* Mission Section */
.mission-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 25px;
    margin: 25px 30px;
}

.mission-title {
    color: var(--accent);
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9rem;
    margin-bottom: 12px;
    letter-spacing: 2px;
}

.mission-text {
    font-size: 0.85rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

.mission-text .highlight {
    color: var(--accent);
    font-weight: 600;
}

.mission-text .goal {
    color: #ff6b6b;
    font-weight: 600;
}

/* Main Grid */
.main-grid {
    display: grid;
    grid-template-columns: 280px 1fr 300px;
    gap: 20px;
    padding: 0 30px 30px;
}

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.card-title {
    font-size: 0.75rem;
    color: var(--text-dim);
    letter-spacing: 2px;
}

.badge {
    font-size: 0.65rem;
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: 600;
}

.badge-live {
    background: var(--accent);
    color: var(--bg-primary);
}

.badge-streaming {
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
}

.badge-excellent {
    background: transparent;
    color: var(--accent);
}

.badge-thinking {
    color: var(--accent);
    background: transparent;
}

/* Census Stats */
.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.stat-value {
    color: var(--accent);
    font-weight: 600;
    font-size: 0.95rem;
}

/* Environment Grid */
.env-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.env-box {
    background: var(--bg-secondary);
    border-radius: 6px;
    padding: 15px;
    text-align: center;
}

.env-label {
    font-size: 0.65rem;
    color: var(--text-dim);
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.env-value {
    font-size: 1.4rem;
    color: var(--text-primary);
    font-weight: 500;
}

.env-value sup {
    font-size: 0.7rem;
}

/* Resources */
.resource-item {
    margin-bottom: 18px;
}

.resource-item:last-child {
    margin-bottom: 0;
}

.resource-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.resource-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.resource-value {
    font-size: 0.8rem;
    color: var(--accent);
    font-weight: 600;
}

.progress-bar {
    height: 6px;
    background: var(--bg-secondary);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #00ffcc);
    border-radius: 3px;
    transition: width 0.5s ease;
}

/* Live Uplink */
.uplink-container {
    position: relative;
    background: var(--bg-secondary);
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 16/10;
    min-height: 450px;
}

.uplink-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.uplink-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.uplink-top {
    position: absolute;
    top: 15px;
    left: 15px;
    display: flex;
    gap: 10px;
}

.uplink-badge {
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
}

.uplink-badge.live {
    background: #ff4757;
    color: white;
}

.uplink-badge.temp {
    background: rgba(0, 212, 170, 0.8);
    color: var(--bg-primary);
}

.uplink-badge.ph {
    background: rgba(0, 0, 0, 0.6);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.uplink-viewers {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.6);
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.uplink-stats {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.uplink-stat {
    background: rgba(0, 100, 80, 0.85);
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.65rem;
}

.uplink-stat-label {
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.uplink-stat-value {
    color: var(--text-primary);
    font-weight: 600;
}

.uplink-energy {
    position: absolute;
    bottom: 15px;
    left: 15px;
    background: rgba(0, 0, 0, 0.7);
    padding: 10px 15px;
    border-radius: 4px;
}

.uplink-energy-label {
    font-size: 0.6rem;
    color: var(--text-dim);
    letter-spacing: 1px;
}

.uplink-energy-value {
    font-size: 1.5rem;
    color: var(--accent);
    font-weight: 700;
}

.uplink-quality {
    position: absolute;
    bottom: 15px;
    right: 15px;
    display: flex;
    gap: 8px;
}

.quality-btn {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border);
    color: var(--text-dim);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.7rem;
    cursor: pointer;
}

.quality-btn.active {
    background: var(--bg-card);
    color: var(--text-primary);
}

/* Claude Analysis */
.analysis-terminal {
    background: var(--bg-secondary);
    border-radius: 6px;
    padding: 20px;
    font-size: 0.8rem;
    line-height: 1.8;
}

.terminal-prompt {
    color: var(--text-dim);
    margin-bottom: 15px;
}

.terminal-line {
    margin-bottom: 8px;
}

.terminal-tag {
    font-weight: 700;
}

.terminal-tag.observation {
    color: #ffd93d;
}

.terminal-tag.aquaculture {
    color: var(--accent);
}

.terminal-tag.recommendation {
    color: #ff6b6b;
}

.terminal-highlight {
    color: var(--accent);
    font-weight: 600;
}

.terminal-cursor {
    display: inline-block;
    width: 8px;
    height: 14px;
    background: var(--accent);
    animation: blink 1s infinite;
    vertical-align: middle;
    margin-left: 4px;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* Energy Output */
.energy-item {
    display: flex;
    align-items: center;
    gap: 15px;
    background: var(--bg-secondary);
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 12px;
}

.energy-item:last-child {
    margin-bottom: 0;
}

.energy-icon {
    width: 40px;
    height: 40px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: var(--text-dim);
}

.energy-info {
    flex: 1;
}

.energy-label {
    font-size: 0.7rem;
    color: var(--text-dim);
    margin-bottom: 4px;
}

.energy-value {
    font-size: 1.1rem;
    color: var(--accent);
    font-weight: 700;
}

.energy-change {
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 4px;
    background: rgba(0, 212, 170, 0.2);
    color: var(--accent);
}

/* Health Score */
.health-circle {
    width: 140px;
    height: 140px;
    margin: 20px auto;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.health-circle svg {
    position: absolute;
    transform: rotate(-90deg);
}

.health-circle-bg {
    fill: none;
    stroke: var(--bg-secondary);
    stroke-width: 8;
}

.health-circle-fill {
    fill: none;
    stroke: var(--accent);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 377;
    stroke-dashoffset: 22.6;
    transition: stroke-dashoffset 1s ease;
}

.health-score {
    font-size: 2.8rem;
    font-weight: 700;
    color: var(--accent);
}

.health-label {
    text-align: center;
    font-size: 0.7rem;
    color: var(--text-dim);
    letter-spacing: 2px;
    margin-top: 10px;
}

/* Activity Stream */
.activity-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.75rem;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-time {
    color: var(--text-dim);
    margin-bottom: 4px;
    font-size: 0.7rem;
}

.activity-text {
    color: var(--text-secondary);
}

.activity-text .highlight {
    color: var(--accent);
    font-weight: 600;
}

.activity-text .sector {
    color: #5dade2;
}

/* Sensors Badge */
.sensors-badge {
    background: var(--accent);
    color: var(--bg-primary);
    font-size: 0.65rem;
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 1200px) {
    .main-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 15px;
    }
    
    .mission-section {
        margin: 20px 15px;
    }
    
    .main-grid {
        padding: 0 15px 30px;
    }
}
