@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;700;900&display=swap');

:root {
    /* ~50% más claro que el tono base unificado (interpolación hacia blanco + alpha) */
    --ui-text: rgba(221, 222, 225, 0.912);
}

body { 
    margin: 0; 
    overflow: hidden; 
    background-color: #000000; 
    color: var(--ui-text); 
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; 
}
canvas { display: block; }

.apple-panel {
    background: rgba(8, 10, 14, 0.1);
    backdrop-filter: blur(14px) saturate(120%);
    -webkit-backdrop-filter: blur(14px) saturate(120%);
    border: none;
    border-radius: 24px;
    box-shadow: none;
}

/* Panel de control a la IZQUIERDA */
.ui-panel {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 300px;
    /* Altura definida: sin esto flex:1 en .ui-panel-tabs colapsa a 0 y no se ven las pestañas */
    height: 90vh;
    max-height: 90vh;
    padding: 24px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 100;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}
.ui-panel-head {
    flex-shrink: 0;
}
.ui-panel-tabs {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.ui-tab-pane {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
}
.ui-tab-pane:not(.hidden) {
    display: flex;
    flex-direction: column;
}
.ui-panel.collapsed {
    transform: translateX(-320px);
    opacity: 0;
    pointer-events: none;
}
.panel-toggle {
    position: absolute;
    top: 24px;
    left: 24px;
    z-index: 101;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.12);
    border: none;
    color: var(--ui-text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    backdrop-filter: blur(12px);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), left 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.panel-toggle.panel-open { left: 330px; }
.panel-toggle:hover { background: rgba(255,255,255,0.15); }

/* Panel de información a la DERECHA (envoltorio + panel + flecha como el principal) */
.info-panel-wrap {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 100;
    display: none;
    flex-direction: row;
    align-items: flex-start;
    gap: 10px;
    pointer-events: none;
}
.info-panel-wrap.info-panel-wrap--visible {
    pointer-events: auto;
}
.info-panel-wrap .info-panel,
.info-panel-wrap .info-panel-toggle {
    pointer-events: auto;
}
.info-panel-wrap.collapsed .info-panel {
    width: 0;
    min-width: 0;
    max-width: 0;
    overflow: hidden;
    opacity: 0;
    padding: 0;
    margin: 0;
    border: none;
    pointer-events: none;
    transform: none;
}
.info-panel {
    position: relative;
    top: 0;
    right: auto;
    width: 260px;
    padding: 20px;
    display: block;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease, max-width 0.35s ease, padding 0.35s ease;
}
.info-panel-toggle {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    margin-top: 2px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.12);
    border: none;
    color: var(--ui-text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: opacity 0.2s ease;
    z-index: 101;
}
.info-panel-toggle:hover {
    background: rgba(255,255,255,0.15);
}
.info-panel details summary {
    list-style: none;
}
.info-panel details summary::-webkit-details-marker { display: none; }
.info-panel details > summary::before {
    content: '▸ ';
    display: inline-block;
    transition: transform 0.2s ease;
    opacity: 0.95;
}
.info-panel details[open] > summary::before {
    content: '▾ ';
}

.info-comp-heading {
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ui-text);
    margin-top: 0.75rem;
    margin-bottom: 0.2rem;
}
.info-comp-label {
    color: var(--ui-text);
}
.info-comp-val {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    color: var(--ui-text);
    font-weight: 400;
}

.element-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.028);
    border-radius: 10px;
    margin-top: 4px;
    overflow: hidden;
}
.element-fill {
    height: 100%;
    transition: width 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    filter: saturate(0.42) brightness(0.48);
    opacity: 0.72;
}
.element-perc-muted {
    color: var(--ui-text) !important;
}
.element-name-muted {
    color: var(--ui-text) !important;
}

input[type="checkbox"] {
    accent-color: rgb(221, 222, 225);
    opacity: 1;
}

input[type=range], select {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    background: transparent;
}
select {
    background: rgba(255, 255, 255, 0.04);
    border: none;
    border-radius: 8px;
    padding: 6px;
    color: var(--ui-text);
    font-size: 0.75rem;
    outline: none;
    cursor: pointer;
}
select option {
    background: #0a0a0c;
    color: var(--ui-text);
}
input[type=range]:focus { outline: none; }
input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 5px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.038);
    border-radius: 10px;
}
input[type=range]::-webkit-slider-thumb {
    height: 13px;
    width: 13px;
    border-radius: 50%;
    background: rgba(58, 60, 68, 0.92);
    cursor: pointer;
    -webkit-appearance: none;
    margin-top: -4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}
input[type=range]::-moz-range-track {
    width: 100%;
    height: 5px;
    background: rgba(255, 255, 255, 0.038);
    border-radius: 10px;
}
input[type=range]::-moz-range-thumb {
    width: 13px;
    height: 13px;
    border-radius: 50%;
    border: none;
    background: rgba(58, 60, 68, 0.92);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.label-group {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--ui-text);
}

.btn-apple {
    background: rgba(255, 255, 255, 0.05);
    color: var(--ui-text);
    font-weight: 600;
    border-radius: 14px;
    padding: 10px;
    transition: all 0.2s ease;
    margin-top: 10px;
    border: none;
}
.btn-apple:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: scale(1.02);
}
.btn-apple:active { transform: scale(0.98); }

.fullscreen-toggle {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 120;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: none;
    background: rgba(0, 0, 0, 0.16);
    color: var(--ui-text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    line-height: 1;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: background 0.2s ease, transform 0.2s ease, color 0.2s ease;
}

.fullscreen-toggle:hover {
    background: rgba(255, 255, 255, 0.14);
    color: var(--ui-text);
    transform: scale(1.04);
}

.fullscreen-toggle:active {
    transform: scale(0.97);
}
