*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #0a0a0a;
    font-family:
        -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #e0e0e0;
    -webkit-user-select: none;
    user-select: none;
    touch-action: none;
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
    position: fixed;
    top: 0;
    left: 0;
    touch-action: none;
    z-index: 1;
}

.hidden {
    display: none !important;
}

/* Landing Screen */
#landing {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #0a0a0a;
    z-index: 100;
}

#landing h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
    color: #e6a817;
}

#landing .subtitle {
    font-size: 0.95rem;
    color: #999;
    margin-bottom: 2.5rem;
    text-align: center;
    padding: 0 2rem;
}

#start-btn {
    background: #e6a817;
    color: #0a0a0a;
    border: none;
    padding: 1rem 3rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    letter-spacing: 0.05em;
}

#start-btn:active {
    opacity: 0.8;
}

/* Loading */
#loading {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #0a0a0a;
    z-index: 99;
}

.loading-text {
    font-size: 0.95rem;
    color: #999;
    margin-bottom: 1.5rem;
}

.loading-bar-track {
    width: 60%;
    max-width: 300px;
    height: 4px;
    background: #222;
    border-radius: 2px;
    overflow: hidden;
}

.loading-bar-fill {
    width: 0%;
    height: 100%;
    background: #e6a817;
    transition: width 0.2s ease;
}

#loading-percent {
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.75rem;
}

/* UI Overlay */
#ui-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    z-index: 10;
    pointer-events: none;
}

#info-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    background: rgba(0, 0, 0, 0.5);
    color: #e0e0e0;
    font-size: 1rem;
    font-style: italic;
    font-weight: 600;
    cursor: pointer;
    pointer-events: auto;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

#compass {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    background: rgba(0, 0, 0, 0.5);
    color: #e6a817;
    font-size: 0.85rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* Off-site Banner */
#offsite-banner {
    position: fixed;
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    padding: 0.85rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    z-index: 20;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

#offsite-banner span {
    font-size: 0.82rem;
    color: #ccc;
    flex: 1;
}

#banner-close {
    background: none;
    border: none;
    color: #999;
    font-size: 1.3rem;
    cursor: pointer;
    padding: 0 0.25rem;
    flex-shrink: 0;
}

/* Info Panel */
#info-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 60vh;
    background: rgba(15, 15, 20, 0.95);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px 16px 0 0;
    padding: 1.25rem 1.5rem 2rem;
    z-index: 30;
    overflow-y: auto;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.info-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.info-panel-header h2 {
    font-size: 1.1rem;
    color: #e6a817;
}

#info-close {
    background: none;
    border: none;
    color: #999;
    font-size: 1.4rem;
    cursor: pointer;
}

#info-panel p {
    font-size: 0.9rem;
    line-height: 1.5;
    color: #bbb;
    margin-bottom: 0.75rem;
}

#info-panel .info-note {
    font-size: 0.8rem;
    color: #777;
    font-style: italic;
}

/* Room Info Card */
#room-card {
    position: fixed;
    bottom: 5rem;
    left: 1rem;
    right: 1rem;
    background: rgba(15, 15, 20, 0.92);
    border: 1px solid rgba(230, 168, 23, 0.3);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    z-index: 25;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

#room-card h3 {
    font-size: 0.95rem;
    color: #e6a817;
    margin-bottom: 0.4rem;
}

#room-card p {
    font-size: 0.85rem;
    color: #bbb;
    line-height: 1.4;
}
