/* ── Toast ── */
.gui-toast {
    position: fixed;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: #000;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    font-weight: bold;
    letter-spacing: 0.1em;
    padding: 10px 24px;
    border-radius: 6px;
    z-index: 10000;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease;
    user-select: none;
}

/* ── Online Splash ── */
.gui-splash {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100001;
    transition: opacity 1s ease;
}

.gui-splash-title {
    font-family: 'Courier New', monospace;
    font-size: clamp(18px, 4vw, 36px);
    color: #fff;
    text-shadow: 0 0 10px #ff0055, 0 0 30px #ff0055, 0 0 60px #00ccff;
    letter-spacing: 0.3em;
    margin-bottom: 40px;
}

.gui-splash-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.gui-splash-input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(0, 204, 255, 0.3);
    border-radius: 6px;
    padding: 10px 16px;
    color: #fff;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    text-align: center;
    outline: none;
    width: 240px;
}

.gui-splash-label {
    font-family: 'Courier New', monospace;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 0.2em;
}

.gui-splash-color {
    width: 60px;
    height: 30px;
    border: 1px solid rgba(0, 204, 255, 0.3);
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
    padding: 0;
}

.gui-splash-btn {
    margin-top: 12px;
    background: rgba(0, 204, 255, 0.15);
    border: 1px solid rgba(0, 204, 255, 0.4);
    border-radius: 6px;
    padding: 10px 32px;
    color: #fff;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    letter-spacing: 0.2em;
    cursor: pointer;
}

.gui-splash-btn:hover {
    background: rgba(0, 204, 255, 0.3);
}

/* ── WebRTC Debug Panel ── */
.gui-debug-panel {
    position: fixed;
    bottom: 20px;
    right: 20px;
    color: rgba(255, 255, 255, 0.7);
    font-family: 'Courier New', monospace;
    font-size: 11px;
    letter-spacing: 0.1em;
    background: rgba(5, 0, 20, 0.7);
    border-radius: 6px;
    border: 1px solid rgba(255, 0, 85, 0.3);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 99990;
    user-select: none;
    padding: 10px 14px;
    line-height: 1.7;
    min-width: 180px;
}

/* ── Shared Panel Base ── */
.gui-panel {
    position: fixed;
    color: rgba(255, 255, 255, 0.7);
    font-family: 'Courier New', monospace;
    letter-spacing: 0.1em;
    background: rgba(5, 0, 20, 0.7);
    border-radius: 6px;
    border: 1px solid rgba(0, 204, 255, 0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    pointer-events: auto;
    z-index: 99990;
    user-select: none;
    line-height: 1.6;
    overflow: hidden;
    transition: max-height 0.35s ease, max-width 0.35s ease;
    max-height: 40px;
}

/* ── Debug Panel Container ── */
#debug-panel {
    top: 10px;
    right: 10px;
    font-size: 11px;
    max-width: 44px;
}

/* ── WebRTC Panel Container ── */
#webrtc-panel {
    bottom: 20px;
    left: 20px;
    font-size: 12px;
    letter-spacing: 0.15em;
    background: rgba(5, 0, 20, 0.6);
    max-width: 60px;
}

/* ── Tab ── */
.gui-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    cursor: pointer;
    overflow: hidden;
    border-bottom: 1px solid rgba(0, 204, 255, 0.15);
    background: rgba(5, 0, 20, 0.85);
}

#webrtc-tab {
    padding: 8px 16px;
    background: rgba(5, 0, 20, 0.8);
}

.gui-tab-arrow {
    font-size: 10px;
    color: rgba(0, 204, 255, 0.7);
    transition: transform 0.35s ease;
    display: inline-block;
    transform: rotate(180deg);
}

/* ── Content ── */
.gui-content {
    padding: 0 14px;
    overflow-y: auto;
    overflow-x: hidden;
    opacity: 0;
    transition: opacity 0.25s ease, padding 0.35s ease;
}

.gui-content.open {
    padding: 10px 14px;
    opacity: 1;
}

#webrtc-content {
    padding: 0 16px;
}

#webrtc-content.open {
    padding: 12px 16px;
}

/* ── Folder Header ── */
.gui-folder-header {
    margin-top: 10px;
    margin-bottom: 4px;
    font-size: 10px;
    color: rgba(0, 204, 255, 0.6);
    letter-spacing: 0.2em;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

.gui-folder-header:hover {
    color: rgba(0, 204, 255, 0.9) !important;
}

/* ── Folder Arrow ── */
.gui-folder-arrow {
    font-size: 8px;
    transition: transform 0.2s ease;
    display: inline-block;
}

/* ── Folder Body ── */
.gui-folder-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, opacity 0.25s ease;
    opacity: 0;
}

.gui-folder-body.expanded {
    max-height: 900px;
    opacity: 1;
}

/* ── Row ── */
.gui-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 4px;
    gap: 6px;
}

.gui-row-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 2;
}

/* ── Label ── */
.gui-label {
    flex: 1;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
}

/* ── Value ── */
.gui-value {
    font-size: 10px;
    color: #00ccff;
    min-width: 36px;
    text-align: right;
}

/* ── Slider ── */
.gui-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100px;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    cursor: pointer;
}

.gui-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #00ccff;
    cursor: pointer;
}

.gui-slider::-moz-range-thumb {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #00ccff;
    cursor: pointer;
    border: none;
}

.gui-slider:hover::-webkit-slider-thumb {
    background: #33ddff;
    transform: scale(1.2);
}

/* ── WebRTC Info Text ── */
.gui-info-text {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.3);
    margin-top: 4px;
    letter-spacing: 0.1em;
}

.gui-info-text-highlight {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 4px;
}

/* ── WebRTC ID Row ── */
.gui-id-row {
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.gui-id-text {
    flex: 1;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
    word-break: break-all;
}

/* ── WebRTC Small Button ── */
.gui-btn-small {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(0, 204, 255, 0.2);
    border-radius: 4px;
    padding: 2px 8px;
    color: rgba(255, 255, 255, 0.5);
    font-family: 'Courier New', monospace;
    font-size: 9px;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
}

.gui-btn-small:hover {
    background: rgba(0, 204, 255, 0.15);
    border-color: rgba(0, 204, 255, 0.4);
    color: rgba(255, 255, 255, 0.8);
}

/* ── WebRTC Input Row ── */
.gui-input-row {
    margin-top: 10px;
    display: flex;
    gap: 6px;
}

/* ── WebRTC Input ── */
.gui-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(0, 204, 255, 0.2);
    border-radius: 4px;
    padding: 4px 8px;
    color: rgba(255, 255, 255, 0.8);
    font-family: 'Courier New', monospace;
    font-size: 11px;
    outline: none;
}

.gui-input::placeholder {
    color: rgba(255, 255, 255, 0.25);
}

/* ── WebRTC Connect Button ── */
.gui-btn-connect {
    background: rgba(0, 204, 255, 0.15);
    border: 1px solid rgba(0, 204, 255, 0.3);
    border-radius: 4px;
    padding: 4px 10px;
    color: rgba(255, 255, 255, 0.7);
    font-family: 'Courier New', monospace;
    font-size: 10px;
    cursor: pointer;
    white-space: nowrap;
}

.gui-btn-connect:hover {
    background: rgba(0, 204, 255, 0.25);
    border-color: rgba(0, 204, 255, 0.5);
}

/* ── WebRTC Teleport Button ── */
.gui-btn-teleport {
    margin-top: 10px;
    width: 100%;
    background: rgba(255, 0, 85, 0.15);
    border: 1px solid rgba(255, 0, 85, 0.3);
    border-radius: 4px;
    padding: 6px 10px;
    color: rgba(255, 255, 255, 0.7);
    font-family: 'Courier New', monospace;
    font-size: 10px;
    letter-spacing: 0.15em;
    cursor: pointer;
}

.gui-btn-teleport:hover {
    background: rgba(255, 0, 85, 0.25) !important;
    border-color: rgba(255, 0, 85, 0.5) !important;
}

.gui-btn-teleport:disabled {
    opacity: 0.15;
    cursor: not-allowed;
}

/* ── WebRTC QR Overlay ── */
.gui-qr-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100002;
}

.gui-qr-canvas {
    width: 80%;
    max-width: 20em;
    height: auto;
    border-radius: 8px;
}

.gui-qr-close {
    position: fixed;
    top: 20px; right: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 40px; height: 40px;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    z-index: 100003;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gui-qr-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ── Button ── */
.gui-btn {
    margin-top: 6px;
    width: 100%;
    background: rgba(0, 204, 255, 0.12);
    border: 1px solid rgba(0, 204, 255, 0.25);
    border-radius: 4px;
    padding: 5px 10px;
    color: rgba(255, 255, 255, 0.7);
    font-family: 'Courier New', monospace;
    font-size: 10px;
    letter-spacing: 0.15em;
    cursor: pointer;
}

.gui-btn:hover {
    background: rgba(0, 204, 255, 0.25) !important;
    border-color: rgba(0, 204, 255, 0.5) !important;
}

.gui-btn:active {
    transform: scale(0.97);
}

.gui-btn-wrapper {
    position: relative;
    margin-top: 6px;
}

/* ── Disabled Text ── */
.gui-disabled-text {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.3);
    margin-top: 4px;
}

/* ── Color Row ── */
.gui-color-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 4px;
    gap: 6px;
}

/* ── Color Swatch ── */
.gui-color-swatch {
    height: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    cursor: pointer;
    padding: 0;
    background: transparent;
}

/* ── Info Icon ── */
.gui-info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    font-size: 9px;
    font-weight: bold;
    line-height: 1;
    color: rgba(0, 204, 255, 0.6);
    background: rgba(0, 204, 255, 0.1);
    border: 1px solid rgba(0, 204, 255, 0.2);
    border-radius: 50%;
    cursor: help;
    user-select: none;
    margin-left: 4px;
    transition: background 0.2s ease, color 0.2s ease;
}

.gui-info-icon:hover {
    background: rgba(0, 204, 255, 0.25);
    color: rgba(0, 204, 255, 0.9);
}

/* ── Tooltip ── */
.gui-tooltip {
    position: fixed;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    color: rgba(0, 204, 255, 0.9);
    background: rgba(5, 0, 20, 0.7);
    border-radius: 4px;
    padding: 4px 8px;
}

/* ── Scrollbar ── */
.gui-content::-webkit-scrollbar {
    width: 3px;
}

.gui-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 2px;
    margin: 4px 0;
}

.gui-content::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(0, 204, 255, 0.35), rgba(0, 204, 255, 0.15));
    border-radius: 3px;
    min-height: 20px;
    transition: background 0.2s ease;
}

.gui-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(0, 204, 255, 0.6), rgba(0, 204, 255, 0.3));
}

.gui-content {
    scrollbar-color: rgba(0, 204, 255, 0.3) rgba(0, 0, 0, 0.15);
    scrollbar-width: thin;
}