/* --- VARIABLES --- */
:root {
    --bg-dark: #0b0b0b;
    --card-bg: #1a1a1a;
    --border-subtle: #3f3f46;
    --accent-gold: #d97706;
    --text-primary: #e8e8e8;
}

/* --- RESET --- */
* {
    box-sizing: border-box;
}

body, html {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    overflow: auto;
}

#title{
    font-family: "Jua", sans-serif;
    font-weight: 400; 
    font-size: 2.8rem;
    margin-bottom: 25px;
    color: var(--text-primary);
}

.game-viewport {
    width: 800px;  
    height: 600px; /* 4:3 aspect ratio like webcam*/
    position: relative;
    background: var(--card-bg);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
    overflow: hidden; 
}

#webcam {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.6;
    transform: scaleX(-1);
    z-index: 1;
}

#gameCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    pointer-events: none; /* Lets clicks pass through */
}

/* --- GUIDE BOX --- */
.npc-box {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    max-width: 450px;
    background: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 20px;
    z-index: 10;
    text-align: center;
}

.npc-header {
    color: var(--accent-gold);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 8px;
}

#guide-text {
    font-family: "Jua", sans-serif;
    font-size: 1.1rem; 
    letter-spacing: 1px; 
    line-height: 1.5;
    margin: 0;
    color: var(--text-primary);
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

.npc-footer {
    margin-top: 10px;
    font-size: 0.75rem;
    color: #888;
}

.success-flash {
    border-color: #4CAF50 !important;
    background: rgba(76, 175, 80, 0.2) !important;
}

@keyframes slideOutDown {
    from { opacity: 1; transform: translateX(-50%) translateY(0); }
    to   { opacity: 0; transform: translateX(-50%) translateY(50px); }
}

@keyframes slideInUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}

.npc-box.sliding-out {
    animation: slideOutDown 0.5s ease forwards;
    pointer-events: none;
}

.npc-box.playground-guide {
    position: static;
    bottom: auto;
    left: auto;
    transform: none;
    width: 854px;
    max-width: 100%;
    margin-top: 16px;
    text-align: left;
    animation: slideInUp 0.6s ease forwards;
}

html.playground-mode,
body.playground-mode {
    height: auto;
    min-height: 100vh;
    overflow-y: auto;
    justify-content: flex-start;
    padding: 24px 0;
}