/* ==========================================================================
   3D Office Stylesheet - Proximity Voice Chat & Nickname Customizer
   ========================================================================== */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-user-select: none;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #0b0f19;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #f0f4f8;
}

.hidden {
    display: none !important;
}

#canvas-container {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

#hud-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: none;
}

#crosshair {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    margin-top: -4px;
    margin-left: -4px;
    background-color: rgba(255, 255, 255, 0.85);
    border: 2px solid rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    transition: transform 0.15s ease, background-color 0.15s ease;
}

#crosshair.active {
    background-color: #38ef7d;
    transform: scale(1.5);
    border-color: #0575e6;
}

#header-info {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    pointer-events: auto;
}

.brand {
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 8px 16px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.logo-icon {
    font-size: 18px;
}

.logo-text {
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, #60a5fa, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.floor-badge {
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(59, 130, 246, 0.4);
    padding: 8px 16px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.floor-label {
    color: #94a3b8;
    font-weight: 600;
}

.floor-value {
    color: #38bdf8;
    font-weight: 800;
    font-size: 14px;
}

.floor-desc {
    color: #cbd5e1;
}

.time-badge {
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(245, 158, 11, 0.4);
    padding: 6px 14px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #fde047;
    font-weight: 700;
}

.time-toggle-btn {
    background: rgba(245, 158, 11, 0.2);
    border: 1px solid rgba(245, 158, 11, 0.5);
    color: #fde047;
    border-radius: 8px;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.time-toggle-btn:hover {
    background: rgba(245, 158, 11, 0.4);
    transform: scale(1.05);
}

.mic-badge-btn {
    border-radius: 12px;
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.mic-badge-btn.off {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.5);
    color: #fca5a5;
}

.mic-badge-btn.on {
    background: rgba(34, 197, 94, 0.2);
    border: 1px solid rgba(34, 197, 94, 0.5);
    color: #86efac;
    animation: pulseMic 1.5s infinite alternate;
}

@keyframes pulseMic {
    0% { box-shadow: 0 0 5px rgba(34, 197, 94, 0.4); }
    100% { box-shadow: 0 0 15px rgba(34, 197, 94, 0.8); }
}

.players-badge-btn, .inventory-badge-btn {
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(168, 85, 247, 0.4);
    color: #e9d5ff;
    border-radius: 12px;
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.players-badge-btn:hover, .inventory-badge-btn:hover {
    background: rgba(168, 85, 247, 0.3);
    transform: scale(1.05);
}

.hud-card {
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
    pointer-events: auto;
}

#minimap-card {
    position: absolute;
    top: 80px;
    left: 20px;
    padding: 12px;
}

.card-header {
    font-size: 11px;
    font-weight: 800;
    color: #94a3b8;
    letter-spacing: 0.8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.dimensions {
    color: #38bdf8;
    font-weight: 700;
}

#minimap-container {
    width: 180px;
    height: 260px;
    background: #020617;
    border-radius: 10px;
    border: 1px solid rgba(56, 189, 248, 0.2);
    overflow: hidden;
}

/* ==========================================================================
   Global Live Chat UI Panel
   ========================================================================== */
#chat-card {
    position: absolute;
    bottom: 20px;
    left: 20px;
    width: 340px;
    height: 230px;
    display: flex;
    flex-direction: column;
    pointer-events: auto;
    background: rgba(15, 23, 42, 0.88);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 16px;
    padding: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    z-index: 100;
}

.chat-messages-box {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-right: 4px;
    user-select: text;
    -webkit-user-select: text;
}

.chat-message {
    font-size: 12px;
    line-height: 1.4;
    word-break: break-word;
}

.chat-message.system {
    color: #94a3b8;
    font-style: italic;
    font-size: 11px;
}

.chat-input-row {
    display: flex;
    gap: 6px;
    pointer-events: auto;
}

#chat-input {
    flex: 1;
    background: rgba(2, 6, 23, 0.9);
    border: 1px solid rgba(56, 189, 248, 0.4);
    border-radius: 8px;
    padding: 6px 10px;
    color: #ffffff;
    font-size: 12px;
    outline: none;
    user-select: text;
    -webkit-user-select: text;
}

.chat-send-btn {
    background: linear-gradient(135deg, #0284c7, #0369a1);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}

.chat-send-btn:hover {
    background: linear-gradient(135deg, #38bdf8, #0284c7);
}

#elevator-ui-card {
    position: absolute;
    top: 80px;
    right: 20px;
    width: 240px;
    padding: 16px;
}

.status-tag {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 800;
}

.status-tag.idle { background: rgba(56, 189, 248, 0.2); color: #38bdf8; }
.status-tag.moving { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }

.elevator-selector label {
    font-size: 11px;
    color: #94a3b8;
    display: block;
    margin-bottom: 6px;
}

.elev-tab-buttons {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
}

.elev-tab-btn {
    flex: 1;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    padding: 6px;
    border-radius: 6px;
    font-weight: 700;
    cursor: pointer;
    font-size: 12px;
}

.elev-tab-btn.active {
    background: #0284c7;
    color: #ffffff;
    border-color: #38bdf8;
}

.elevator-display {
    background: #020617;
    border: 2px solid rgba(56, 189, 248, 0.4);
    border-radius: 10px;
    padding: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

#elevator-digital-num {
    font-size: 28px;
    font-weight: 900;
    color: #ef4444;
    font-family: monospace;
}

#elevator-arrow {
    font-size: 20px;
    color: #ef4444;
}

.elevator-buttons-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.elev-btn {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
    padding: 8px 12px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.elev-btn .num {
    background: rgba(15, 23, 42, 0.8);
    width: 22px;
    height: 22px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 11px;
    color: #38bdf8;
}

.elev-btn .lbl {
    font-size: 12px;
    font-weight: 600;
}

.elev-btn:hover {
    background: rgba(56, 189, 248, 0.2);
    border-color: #38bdf8;
    color: #ffffff;
}

.elev-btn.active {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    border-color: #60a5fa;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.door-btn {
    width: 100%;
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #6ee7b7;
    padding: 8px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.door-btn:hover {
    background: rgba(16, 185, 129, 0.4);
}

#controls-help {
    position: absolute;
    bottom: 20px;
    right: 20px;
    padding: 12px 16px;
}

.help-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 16px;
    font-size: 11px;
    color: #cbd5e1;
}

kbd {
    background: rgba(30, 41, 59, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    padding: 2px 5px;
    font-size: 10px;
    font-weight: 700;
    color: #38bdf8;
    margin-right: 3px;
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.4);
}

#builder-banner {
    position: absolute;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.94);
    border: 2px solid #38ef7d;
    border-radius: 30px;
    padding: 10px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    color: #ffffff;
    font-size: 13px;
    font-weight: bold;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    pointer-events: auto;
}

.hint-tag {
    color: #38ef7d;
    font-size: 11px;
    background: rgba(56, 239, 125, 0.15);
    padding: 4px 10px;
    border-radius: 12px;
}

#interaction-prompt {
    position: absolute;
    top: 60%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid #38bdf8;
    border-radius: 20px;
    padding: 8px 18px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(6px);
}

.key-hint {
    background: #0284c7;
    color: #ffffff;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11px;
}

.hidden {
    display: none !important;
}

#inventory-modal, #players-modal, #start-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(2, 6, 23, 0.85);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    pointer-events: auto;
}

.inventory-dialog, .players-dialog, .start-modal {
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 24px;
    padding: 28px;
    width: 540px;
    max-width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
    color: #ffffff;
}

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

.modal-header h2 {
    font-size: 16px;
    color: #38bdf8;
    font-weight: 800;
}

.close-btn {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fca5a5;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.inventory-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.item-card {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.item-card:hover {
    background: rgba(56, 189, 248, 0.2);
    border-color: #38bdf8;
    transform: translateY(-2px);
}

.item-icon { font-size: 28px; }
.item-title { font-size: 12px; font-weight: 700; color: #f1f5f9; text-align: center; }

.start-modal {
    text-align: center;
    width: 460px;
}

.start-modal h1 {
    font-size: 24px;
    font-weight: 900;
    margin-bottom: 6px;
    background: linear-gradient(135deg, #38bdf8, #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 12px;
    color: #94a3b8;
    margin-bottom: 24px;
}

.nickname-section {
    text-align: left;
    margin-bottom: 18px;
}

.nickname-section label {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 700;
    display: block;
    margin-bottom: 6px;
}

#player-nickname-input {
    width: 100%;
    background: rgba(2, 6, 23, 0.9);
    border: 1px solid rgba(56, 189, 248, 0.4);
    border-radius: 10px;
    padding: 10px 14px;
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    outline: none;
    user-select: text;
    -webkit-user-select: text;
}

.avatar-selection-section {
    text-align: left;
    margin-bottom: 24px;
}

.avatar-selection-section label {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 700;
    display: block;
    margin-bottom: 8px;
}

.color-options-grid {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.color-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.color-btn:hover {
    transform: scale(1.15);
}

.color-btn.active {
    border-color: #ffffff;
    transform: scale(1.2);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.6);
}

.btn-primary {
    width: 100%;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    padding: 16px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.4);
    transition: all 0.2s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(37, 99, 235, 0.6);
}

/* ==========================================================================
   Presentation Mode Full-Screen Immersion & Bottom Prompt Badge Styling 📺
   ========================================================================== */
body.presentation-mode-active #top-bar,
body.presentation-mode-active #minimap-card,
body.presentation-mode-active #elevator-ui-card,
body.presentation-mode-active #elevator-hud-card,
body.presentation-mode-active #chat-card,
body.presentation-mode-active #controls-card,
body.presentation-mode-active #controls-help,
body.presentation-mode-active #auditorium-controls-card,
body.presentation-mode-active #crosshair,
body.presentation-mode-active #screen-share-banner {
    display: none !important;
}

body.presentation-mode-active #interaction-prompt {
    top: auto !important;
    bottom: 28px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    background: rgba(15, 23, 42, 0.92) !important;
    border: 1px solid rgba(56, 189, 248, 0.6) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), 0 0 24px rgba(56, 189, 248, 0.35) !important;
    backdrop-filter: blur(16px) !important;
    border-radius: 9999px !important;
    padding: 10px 28px !important;
    z-index: 10000 !important;
}
