
:root {
    --ba-blue: #1289f0;
    --ba-dark: #2c3e50;
    --ba-white: #ffffff;
    --glass: rgba(255, 255, 255, 0.95);
}

body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    font-family: 'Noto Sans', sans-serif;
    overflow: hidden;
    background-color: #379eb8;
}

#start-screen {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: url('assets/bg/main_office.webp'), linear-gradient(135deg, #e0f7fa 0%, #1289f0 100%);
    background-size: cover;
    background-position: center;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease;
}

.login-box {
    background: rgba(255, 255, 255, 0.95);
    padding: 40px 50px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    text-align: center;
    border-top: 8px solid var(--ba-blue);
    transform: skewX(-5deg);
}

.login-box h1 { margin: 0 0 10px 0; color: var(--ba-dark); font-weight: 900; }
.login-box p { color: #666; margin-bottom: 25px; }
.login-box .subtext { font-size: 0.8rem; margin-top: 20px; opacity: 0.7; }

.input-group {
    display: flex;
    gap: 10px;
    justify-content: center;
}

#senseiNameInput {
    padding: 10px 15px;
    font-size: 1rem;
    border: 2px solid #ddd;
    border-radius: 5px;
    outline: none;
    font-family: 'Noto Sans', sans-serif;
}
#senseiNameInput:focus { border-color: var(--ba-blue); }

#app-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

#sandbox {
    position: absolute;
    top: 50%; 
    left: 50%;
    
    width: 1920px;
    height: 1080px;
    background-color: #333;
    box-shadow: 0 0 10px rgba(0,0,0,0.8);
    
    transform-origin: center center;
    transform: translate(-50%, -50%) scale(1);
}

#bg-layer {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: url('assets/bg/main_office.webp'), linear-gradient(135deg, #e0f7fa 0%, #1289f0 100%);
    background-size: cover;
    background-position: center;
    z-index: 1;
}

.ba-header {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 5000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-end;
}

/* .selection-group label {
    font-size: 0.8rem;
    font-weight: bold;
    color: var(--ba-dark);
} */

.student-selector, .btn {
    font-family: 'Noto Sans', sans-serif;
    transform: skewX(-10deg);
    box-shadow: 2px 2px 5px rgba(0,0,0,0.2);
}
.student-selector { padding: 10px 20px; border: none; border-left: 5px solid var(--ba-blue); }
.controls { display: flex; gap: 10px; }
.btn { padding: 10px 20px; border: none; background: #2c3e50; color: white; cursor: pointer; }
.btn:hover { background: var(--ba-blue); }

#character-layer {
    position: absolute;
    bottom: 0;
    left: 0; width: 100%; height: 100%;
    z-index: 10; pointer-events: none;
    display: flex; justify-content: center; align-items: flex-end;
}
#character-img {
    height: 95%; width: auto;
    object-fit: contain;
    filter: drop-shadow(0 0 10px rgba(0,0,0,0.3));
    transform: translateY(20px);
}
#l2d-canvas { width: 100%; height: 100%; }

.dialogue-wrapper {
    position: absolute; z-index: 999;
    top: 300px; left: 1090px;
    display: flex;
    opacity: 0; transform: scale(0.9) translateX(-60px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}
.dialogue-wrapper.active { opacity: 1; transform: scale(1) translateX(0); }

.dialogue-box {
    background: var(--glass);
    padding: 25px 30px; border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
    backdrop-filter: blur(5px);
    width: fit-content; max-width: 450px; min-width: 200px;
    position: relative;
}
.dialogue-box::before {
    content: ''; position: absolute;
    left: -20px; top: 30px;
    border-width: 12px 20px 12px 0;
    border-style: solid; border-color: transparent var(--glass) transparent transparent;
}
.dialogue-text {
    font-size: 1.6rem; color: var(--ba-dark);
    line-height: 1.4; white-space: pre-wrap;
}

#loader {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    z-index: 6000;
    background: rgba(0,0,0,0.85); color: white;
    padding: 15px 30px; border-radius: 50px;
    display: flex; gap: 15px; align-items: center;
    font-size: 1.2rem;
}
.loader-spinner {
    width: 20px; height: 20px;
    border: 3px solid white; border-top-color: transparent;
    border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }