/* ============================================
   CODIE.PRO - ADVENTURE ENGINE STYLES
   Interactive Inventory Widget (Toggle & Drawer)
   ============================================ */

.adventure-inventory-widget {
    position: absolute;
    top: 10px;
    right: 12px;
    z-index: 50;
}

/* Semi-transparent Toggle Button */
.adv-inv-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1.5px solid rgba(255, 255, 255, 0.18);
    border-radius: 30px;
    padding: 6px 14px;
    color: #F1F5F9;
    font-family: 'Fredoka One', cursive;
    font-size: 13px;
    letter-spacing: 0.3px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.adv-inv-toggle-btn:hover {
    background: rgba(15, 23, 42, 0.8);
    border-color: #38BDF8;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(56, 189, 248, 0.25);
}

.adv-inv-toggle-btn .material-symbols-rounded {
    font-size: 18px;
    color: #38BDF8;
}

.adv-inv-badge {
    background: #475569;
    color: #F8FAFC;
    font-size: 11px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 10px;
    transition: all 0.25s ease;
}

.adv-inv-badge.has-items {
    background: linear-gradient(135deg, #0284C7 0%, #0369A1 100%);
    box-shadow: 0 0 10px rgba(2, 132, 199, 0.6);
    color: white;
}

/* Slide-out Opaque Drawer Panel */
.adv-inv-drawer {
    position: absolute;
    top: 0;
    right: 0;
    width: 270px;
    background: #0F172A; /* 100% Solid & Opaque */
    border: 2px solid #334155;
    border-radius: 18px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.08);
    padding: 16px;
    transform: translateX(115%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
    z-index: 100;
}

.adventure-inventory-widget.drawer-open .adv-inv-drawer {
    transform: translateX(0);
    opacity: 1;
    pointer-events: all;
}

.adv-inv-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 10px;
    border-bottom: 1px solid #1E293B;
    margin-bottom: 12px;
}

.adv-inv-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Fredoka One', cursive;
    font-size: 14px;
    color: #F8FAFC;
    letter-spacing: 0.5px;
}

.adv-inv-title .material-symbols-rounded {
    font-size: 20px;
    color: #38BDF8;
}

.adv-inv-count-pill {
    background: #0284C7;
    color: white;
    font-size: 11px;
    padding: 2px 7px;
    border-radius: 10px;
}

.adv-inv-close-btn {
    background: transparent;
    border: none;
    color: #94A3B8;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.adv-inv-close-btn:hover {
    background: #1E293B;
    color: #F8FAFC;
}

.adv-inv-close-btn .material-symbols-rounded {
    font-size: 18px;
}

.adv-inv-body {
    max-height: 240px;
    overflow-y: auto;
}

.adv-inv-empty {
    text-align: center;
    padding: 18px 10px;
    color: #64748B;
}

.adv-inv-empty .material-symbols-rounded {
    font-size: 32px;
    color: #334155;
    margin-bottom: 6px;
}

.adv-inv-empty p {
    font-family: 'Fredoka One', cursive;
    font-size: 13px;
    color: #94A3B8;
    margin: 0 0 4px 0;
}

.adv-inv-empty small {
    font-size: 11px;
    color: #64748B;
}

.adv-inv-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.adv-item-card {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #1E293B;
    border: 1.5px solid;
    border-radius: 12px;
    padding: 8px 10px;
    transition: transform 0.2s ease;
}

.adv-item-card:hover {
    transform: translateX(-2px);
}

.adv-item-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}

.adv-item-icon .material-symbols-rounded {
    font-size: 18px;
}

.adv-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.adv-item-label {
    font-family: 'Fredoka One', cursive;
    font-size: 12.5px;
    color: #F8FAFC;
    letter-spacing: 0.3px;
}

.adv-item-tag {
    font-size: 10px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    letter-spacing: 0.5px;
}

.adv-item-tag .material-symbols-rounded {
    font-size: 12px;
}

/* --- Adventure Grid Elements --- */
.adventure-grid-element {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    transition: transform 0.2s ease, opacity 0.3s ease;
}

/* Key Element */
.adventure-key .key-inner {
    width: 65%;
    height: 65%;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 2px solid currentColor;
    animation: keyFloat 2.5s ease-in-out infinite;
}

/* Item Element (Battery / Power Core) */
.adventure-item .item-inner {
    width: 65%;
    height: 65%;
    border-radius: 10px;
    background: #065F46;
    border: 2px solid #10B981;
    color: #A7F3D0;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.5);
    animation: keyFloat 2.5s ease-in-out infinite;
}

.adventure-item .item-inner .material-symbols-rounded {
    font-size: 20px;
    color: white;
}

@keyframes keyFloat {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-4px) scale(1.05);
    }
}

/* Door Element */
.adventure-door {
    z-index: 15;
}

.door-frame {
    width: 86%;
    height: 86%;
    background: rgba(30, 41, 59, 0.95);
    border: 3px solid;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5), 0 4px 10px rgba(0, 0, 0, 0.3);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.door-lock {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 2px solid;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
}

.door-lock .material-symbols-rounded {
    font-size: 18px;
}

.door-open {
    opacity: 0.35;
    background: transparent;
    border-style: dashed;
    transform: scale(0.9);
}

.door-lock-open {
    color: #10B981;
}

.door-lock-open .material-symbols-rounded {
    font-size: 20px;
}

/* Laser Barrier Element */
.adventure-laser {
    z-index: 14;
}

.laser-beam {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    position: relative;
}

.laser-ray {
    width: 100%;
    height: 4px;
    background: #EF4444;
    box-shadow: 0 0 12px #EF4444, 0 0 24px rgba(239, 68, 68, 0.8);
    animation: laserPulse 1.2s ease-in-out infinite alternate;
}

.laser-emitter {
    position: absolute;
    width: 8px;
    height: 14px;
    background: #1E293B;
    border: 1.5px solid #EF4444;
    border-radius: 3px;
}

.emitter-left { left: 0; }
.emitter-right { right: 0; }

@keyframes laserPulse {
    0% { opacity: 0.7; height: 3px; }
    100% { opacity: 1; height: 5px; }
}

/* Power Socket Element */
.adventure-socket {
    z-index: 12;
}

.socket-core {
    width: 64%;
    height: 64%;
    border-radius: 10px;
    background: #1E293B;
    border: 2px solid #64748B;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #94A3B8;
    transition: all 0.3s ease;
}

.socket-active .socket-core {
    border-color: #10B981;
    color: #10B981;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.5);
}

.socket-core .material-symbols-rounded {
    font-size: 20px;
}

/* Adventure Custom Command Blocks */
.block-adventure-amber {
    background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%) !important;
    border-color: #B45309 !important;
    color: white !important;
}

.block-adventure-blue {
    background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%) !important;
    border-color: #1D4ED8 !important;
    color: white !important;
}

.block-adventure-emerald {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%) !important;
    border-color: #047857 !important;
    color: white !important;
}

@media (max-width: 768px) {
    .adventure-inventory-hud {
        top: 8px;
        right: 8px;
        padding: 5px 10px;
        font-size: 11px;
    }
    .hud-title {
        display: none;
    }
}

/* ============================================
   THEME: MARS BASE (Martian Red Sands & Metal Walls)
   ============================================ */
.theme-mars {
    background: #181216 !important;
}

.theme-mars .cell {
    background-color: #B94A28;
    background-image: 
        radial-gradient(circle at 50% 50%, rgba(234, 114, 66, 0.35) 0%, transparent 80%),
        linear-gradient(rgba(0, 0, 0, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 0, 0, 0.1) 1px, transparent 1px);
    box-shadow: inset 0 -3px 0 rgba(90, 25, 12, 0.5);
}

.theme-mars .cell.wall {
    background: #334155;
    background-image: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.04) 0px, rgba(255, 255, 255, 0.04) 4px, transparent 4px, transparent 8px);
    box-shadow: inset 0 0 0 2px #475569, inset 0 -4px 0 #1E293B;
    border-radius: 6px;
}

.theme-mars .cell.goal {
    background: linear-gradient(135deg, #00D9FF 0%, #0284C7 100%);
    box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.3), 0 0 15px rgba(0, 217, 255, 0.6);
}
