/* ===== VARIABLES ===== */
:root {
    --bg-main: #010105;
    --panel-bg: rgba(0, 10, 20, 0.88);
    --accent-primary: #00f2ff;
    --accent-secondary: #ffaa00;
    --accent-success: #00ffaa;
    --text-main: #ffffff;
    --glow-soft: 0 0 10px rgba(0,242,255,0.3);
    --glow-strong: 0 0 20px rgba(0,242,255,0.6);
    --shadow-panel: 0 8px 25px rgba(0,0,0,0.6);
    --npc-msg-bg: rgba(32, 44, 51, 0.95);
    --npc-msg-border: rgba(0, 242, 255, 0.2);
    --player-msg-bg: rgba(0, 92, 75, 0.95);
    --player-msg-border: rgba(0, 255, 170, 0.2);
    --choice-hover-text: #000;
}

/* ===== BASE ===== */
html, body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: var(--bg-main);
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
    user-select: none;
    width: 100%;
    height: 100%;
}

canvas {
    display: block;
    width: 100vw;
    height: 100vh;
}

/* ===== BUTTONS ===== */
.ui-toggle {
    width: 48px;
    height: 48px;
    padding: 0;
    background: rgba(0,10,20,0.8);
    border: 1px solid var(--accent-primary);
    color: var(--accent-primary);
    cursor: pointer;
    font-size: 1.2em;
    border-radius: 4px;
    transition: transform 0.12s ease, background 0.2s, box-shadow 0.2s;
    box-shadow: var(--glow-soft);
    display: flex;
    align-items: center;
    justify-content: center;
}

#btn-quest-toggle,
#btn-inv-toggle,
#btn-actions-toggle,
#btn-sound-toggle,
#btn-cycle-toggle {
    width: 48px;
    height: 48px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Smaller buttons on mobile */
@media (max-width: 480px) {
    .ui-toggle {
        width: 44px;
        height: 44px;
    }

    #btn-quest-toggle,
    #btn-inv-toggle,
    #btn-actions-toggle,
    #btn-sound-toggle,
    #btn-cycle-toggle {
        width: 44px;
        height: 44px;
    }
}
.ui-toggle:hover {
    background: rgba(0,242,255,0.2);
    box-shadow: var(--glow-strong);
}
.ui-toggle:active {
    transform: scale(0.9);
}
.ui-toggle.active {
    background: rgba(0,242,255,0.3);
    border-color: var(--accent-success);
    color: var(--accent-success);
}

/* ===== SIDEBAR ===== */
#right-sidebar {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px;
    pointer-events: none;
    z-index: 500;
}
#sidebar-top, #sidebar-bottom {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    pointer-events: auto;
    margin-bottom: 40px;
}
.sidebar-row {
    display: flex;
    gap: 8px;
}

/* ===== TEXT ===== */
h3 {
    margin: 0 0 10px 0;
    font-size: 0.8em;
    color: var(--accent-secondary);
    opacity: 0.6;
    border-bottom: 1px solid #333;
}

/* ===== LOCATION BOX ===== */
#loc-box {
    position: absolute; bottom: 20%; left: 5%;
    text-align: center; pointer-events: none; display: none; z-index: 150;
    opacity: 1;
    transition: opacity 0.5s ease-out;
}
#loc-box.fade-out {
    opacity: 0;
}
#loc-name {
    font-size: 2.8em; color: var(--accent-secondary);
    margin: 0; text-shadow: 0 0 20px #000;
}

/* ===== OVERLAY SCREENS ===== */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    z-index: 1000;
    text-align: center;
    background: rgba(0, 0, 0, 0.95);
}
#start-screen h1 {
    color: var(--accent-secondary);
    font-size: 4em;
    margin: 0;
    letter-spacing: 10px;
}
#start-screen p {
    color: var(--accent-secondary);
    font-size: 1.2em;
    margin-bottom:30px; opacity:0.6; letter-spacing:3px;
}
#win-screen h1 {
    color: var(--accent-success);
    font-size: 4em;
    margin: 0;
    letter-spacing: 10px;
}
#win-screen p {
    color: var(--accent-success);
    font-size: 1.2em;
    margin:20px 0; opacity:0.8; letter-spacing:2px;
}

button#btn-start, button#btn-replay {
    background:#ffaa00; border:none; padding:15px 40px; cursor:pointer;
    font-weight:bold; font-size:1.2em; color: black;
}
button#btn-replay { background:#00ffaa; color:#000; }

/* ===== NPC INTERACTION PROMPT (World-space UI) ===== */
#npc-indicator-container {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 600; /* Above sidebar (500) */
    overflow: hidden;
}

.interact-prompt {
    position: absolute;
    transform: translate(-50%, -50%);
    background: rgba(0, 10, 20, 0.9);
    border: 1px solid var(--accent-primary);
    color: var(--accent-primary);
    padding: 10px 20px;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 4px;
    box-shadow: var(--glow-soft);
    white-space: nowrap;
    display: none;
    pointer-events: auto;
    cursor: pointer;
    transition: opacity 0.2s ease;
    z-index: 1000; /* Above sidebar (500) and other UI */
}

.interact-prompt:hover {
    background: rgba(0, 242, 255, 0.15);
    box-shadow: var(--glow-strong);
}

.result-card {
    max-height: 70vh;
    overflow-y: auto;
}
