/* ═══════════════════════════════════════════════════════════════════════
   Minecraft Live Tab — Visualiser Dashboard
   Dark stone-themed UI with pixel-art accents
   ═══════════════════════════════════════════════════════════════════════ */

#view-minecraft.active {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 56px);
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    padding: 0;
    overflow: hidden;
}

/* ─── Offline State ─────────────────────────────────────────────────── */

.mc-offline {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 16px;
    animation: mc-breathe 3s ease-in-out infinite;
}

.mc-offline-icon {
    font-size: 64px;
    filter: grayscale(0.5);
}

.mc-offline-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 20px;
    color: #8892b0;
    font-weight: 600;
}

.mc-offline-subtitle {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: #4a5568;
}

@keyframes mc-breathe {

    0%,
    100% {
        opacity: 0.7;
    }

    50% {
        opacity: 1;
    }
}

/* ─── Live Dashboard Grid ───────────────────────────────────────────── */

.mc-dashboard {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    grid-template-rows: auto 1fr auto;
    gap: 12px;
    padding: 16px;
    height: 100%;
    overflow: hidden;
}

/* ─── Status Header Bar ─────────────────────────────────────────────── */

.mc-status-bar {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 16px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(76, 175, 80, 0.3);
    border-radius: 8px;
    font-family: 'JetBrains Mono', monospace;
    flex-wrap: wrap;
}

.mc-status-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #c5c6c7;
}

.mc-status-label {
    color: #6b7280;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mc-status-value {
    font-weight: 600;
}

/* Health bar */
.mc-bar {
    display: flex;
    align-items: center;
    gap: 4px;
}

.mc-bar-fill {
    height: 10px;
    border-radius: 2px;
    transition: width 0.5s ease;
    min-width: 2px;
}

.mc-bar-health .mc-bar-fill {
    background: linear-gradient(90deg, #e53e3e, #fc8181);
}

.mc-bar-food .mc-bar-fill {
    background: linear-gradient(90deg, #d69e2e, #fbd38d);
}

.mc-bar-bg {
    width: 100px;
    height: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.mc-hearts {
    display: flex;
    gap: 1px;
}

.mc-heart {
    font-size: 12px;
    transition: opacity 0.3s;
}

.mc-heart.empty {
    opacity: 0.2;
}

.mc-heart.half {
    opacity: 0.6;
}

/* ─── 3D Viewer Panel (Center) ──────────────────────────────────────── */

.mc-viewer-panel {
    grid-row: 2;
    grid-column: 2;
    position: relative;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    overflow: hidden;
    min-height: 300px;
}

.mc-viewer-panel iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.mc-viewer-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 12px;
    color: #6b7280;
    font-family: 'JetBrains Mono', monospace;
}

.mc-viewer-placeholder .mc-icon {
    font-size: 48px;
    opacity: 0.4;
}

/* ─── Left Panel: Position + Entities ───────────────────────────────── */

.mc-left-panel {
    grid-row: 2;
    grid-column: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
}

/* ─── Right Panel: Inventory + Log ──────────────────────────────────── */

.mc-right-panel {
    grid-row: 2;
    grid-column: 3;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
}

/* ─── Shared Panel Card Style ───────────────────────────────────────── */

.mc-card {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 12px;
    font-family: 'JetBrains Mono', monospace;
}

.mc-card-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #4ade80;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(74, 222, 128, 0.15);
}

/* ─── Position Card ─────────────────────────────────────────────────── */

.mc-position-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 4px 12px;
    font-size: 13px;
}

.mc-coord-label {
    color: #6b7280;
    font-weight: 500;
}

.mc-coord-value {
    color: #e2e8f0;
    font-weight: 600;
    text-align: right;
}

.mc-coord-x {
    color: #fc8181;
}

.mc-coord-y {
    color: #68d391;
}

.mc-coord-z {
    color: #63b3ed;
}

/* ─── Goal Card ─────────────────────────────────────────────────────── */

.mc-goal-text {
    font-size: 13px;
    color: #fbd38d;
    font-weight: 500;
    line-height: 1.4;
}

.mc-following {
    margin-top: 6px;
    font-size: 12px;
    color: #90cdf4;
}

/* ─── Entity Radar ──────────────────────────────────────────────────── */

.mc-entity-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 200px;
    overflow-y: auto;
}

.mc-entity-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.03);
    font-size: 12px;
}

.mc-entity-name {
    color: #e2e8f0;
}

.mc-entity-distance {
    color: #6b7280;
    font-size: 11px;
}

.mc-entity-hostile {
    border-left: 2px solid #fc8181;
}

.mc-entity-passive {
    border-left: 2px solid #68d391;
}

.mc-entity-player {
    border-left: 2px solid #63b3ed;
}

.mc-empty {
    color: #4a5568;
    font-size: 12px;
    font-style: italic;
}

/* ─── Inventory Grid ────────────────────────────────────────────────── */

.mc-inventory-grid {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 2px;
}

.mc-inv-slot {
    aspect-ratio: 1;
    background: rgba(139, 139, 139, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #e2e8f0;
    position: relative;
    min-width: 0;
    overflow: hidden;
    cursor: default;
}

.mc-inv-slot.has-item {
    background: rgba(74, 222, 128, 0.08);
    border-color: rgba(74, 222, 128, 0.2);
}

.mc-inv-slot .mc-inv-count {
    position: absolute;
    bottom: 1px;
    right: 2px;
    font-size: 8px;
    color: #fbd38d;
    font-weight: 700;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.8);
}

.mc-inv-slot .mc-inv-name {
    font-size: 7px;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
    padding: 0 1px;
}

.mc-inv-slot:hover {
    background: rgba(74, 222, 128, 0.15);
    border-color: rgba(74, 222, 128, 0.4);
}

/* ─── Activity Log ──────────────────────────────────────────────────── */

.mc-log {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.mc-log-entries {
    display: flex;
    flex-direction: column;
    gap: 3px;
    overflow-y: auto;
    flex: 1;
    max-height: 250px;
}

.mc-log-entry {
    font-size: 11px;
    color: #a0aec0;
    padding: 2px 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.02);
    font-family: 'JetBrains Mono', monospace;
    line-height: 1.3;
}

.mc-log-entry:nth-child(odd) {
    background: rgba(255, 255, 255, 0.04);
}

/* ─── Footer Bar ────────────────────────────────────────────────────── */

.mc-footer {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: #4a5568;
}

.mc-footer-live {
    display: flex;
    align-items: center;
    gap: 6px;
}

.mc-live-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #4ade80;
    animation: mc-pulse 1.5s ease-in-out infinite;
}

@keyframes mc-pulse {

    0%,
    100% {
        opacity: 1;
        box-shadow: 0 0 4px rgba(74, 222, 128, 0.6);
    }

    50% {
        opacity: 0.5;
        box-shadow: 0 0 8px rgba(74, 222, 128, 0.3);
    }
}

/* ─── Responsive ────────────────────────────────────────────────────── */

@media (max-width: 900px) {
    .mc-dashboard {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto 1fr auto;
    }

    .mc-status-bar {
        grid-column: 1 / -1;
    }

    .mc-viewer-panel {
        grid-column: 1 / -1;
        grid-row: 2;
        min-height: 200px;
    }

    .mc-left-panel {
        grid-row: 3;
        grid-column: 1;
    }

    .mc-right-panel {
        grid-row: 3;
        grid-column: 2;
    }

    .mc-footer {
        grid-column: 1 / -1;
        grid-row: 4;
    }
}

@media (max-width: 600px) {
    .mc-dashboard {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto auto auto;
    }

    .mc-viewer-panel {
        grid-column: 1;
        grid-row: 2;
    }

    .mc-left-panel {
        grid-column: 1;
        grid-row: 3;
    }

    .mc-right-panel {
        grid-column: 1;
        grid-row: 4;
    }

    .mc-footer {
        grid-column: 1;
        grid-row: 5;
    }

    .mc-inventory-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}