﻿/* Global "Funny/Cute" Tweaks */
@import url('https://fonts.googleapis.com/css2?family=Fredoka+One&family=Quicksand:wght@400;500;600;700&display=swap');

:root {
    --primary: #ffb7b2;
    --primary-dark: #ff9e99;
    --secondary: #b5eoad;
    --accent: #ffdac1;
    --text-main: #6d5b6b;
    --text-soft: #8e7f8d;
    --glass-border: 1px solid rgba(255, 255, 255, 0.6);

    /* Theme Variables */
    --theme-bg: linear-gradient(135deg, #fdfbfb 0%, #ebedee 100%);
    --theme-card-bg: rgba(255, 255, 255, 0.85);
    /* More opaque for readability */
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Sour Gummy', sans-serif;
    color: var(--text-main);
    background: var(--theme-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Room Layout should stay fixed and non-scrollable on body */
.room-layout-active {
    overflow: hidden;
    height: 100vh;
    position: fixed;
    width: 100%;
}

/* Allow scrolling on landing page (default) but keep it tidy on big screens */
@media (min-width: 769px) {
    body {
        height: 100vh;
        overflow: hidden;
    }
}

@media (max-width: 768px) {
    body {
        padding: 20px 0;
    }
}


h1,
h2,
h3,
.brand-font,
.room-title,
.btn-primary {
    font-family: 'Agbalumo', system-ui;
}

.hidden {
    display: none !important;
}

/* --- ANIMATIONS --- */
@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }

    50% {
        opacity: 1;
        transform: scale(1.05);
    }

    70% {
        transform: scale(0.9);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

.floating {
    animation: float 3s ease-in-out infinite;
}

/* --- COMPONENTS --- */

/* Buttons */
.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 1rem 2rem;
    font-size: 1.2rem;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.1);
    transition: transform 0.1s, box-shadow 0.1s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary:active {
    transform: translateY(4px);
    box-shadow: 0 0 0 rgba(0, 0, 0, 0.1);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Glass Panels (used in Landing) */
.glass-panel {
    background: var(--theme-card-bg);
    backdrop-filter: blur(12px);
    border-radius: 30px;
    border: var(--glass-border);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    padding: 3rem;
    width: 90%;
    max-width: 600px;
    text-align: center;
    margin: auto;
    /* Center in body flex */
}

/* --- ROOM LAYOUT --- */
.room-layout {
    height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    background-size: cover;
    background-position: center;
    transition: background 1s ease-in-out;
}

.room-layout::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
}

/* Header as a Centered Pill */
.room-header {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    min-width: 400px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(15px);
    padding: 10px 30px;
    border-radius: 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 2px solid white;
    z-index: 1000;
}

.room-title {
    font-size: 1.2rem;
    color: var(--primary-dark);
    background: none;
    box-shadow: none;
    padding: 0;
}

.header-controls {
    display: flex;
    gap: 15px;
}

/* Desk Area */
/* --- COMPOSITING SYSTEM --- */
.desk-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    /* Let clicks pass through to background if needed */
    overflow: hidden;
}

.desk-stage {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    transform-origin: top left;
    pointer-events: none;
    will-change: transform, left, top;
}

/* The Anchors are where we Position the Elements (Center Point) */
.composited-element {
    position: absolute;
    transform-origin: center center;
    /* transition: all 0.5s ease-out; */
    /* removed for strict positioning */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.desk-img {
    width: auto;
    height: auto;
    max-width: none;
    /* Prevent constraint */
    display: block;
}

.student-video {
    width: auto;
    height: auto;
    max-width: none;
    display: block;
    /* Scaling handled by JS transform */
}

.student-label {
    position: absolute;
    top: -40px;
    background: rgba(255, 255, 255, 0.9);
    padding: 10px 22px;
    border-radius: 15px;
    font-size: 2rem;
    font-weight: 800;
    color: #e56ea5;
    pointer-events: auto;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1001;
    font-family: "Amarante", serif;
}

/* Chat Cloud Bubble */
.chat-cloud {
    position: absolute;
    bottom: calc(100% + 70px);
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 30px 60px;
    border-radius: 60px;
    box-shadow: 8px 8px 0px rgba(0, 0, 0, 0.6), 0 20px 50px rgba(0, 0, 0, 0.25);
    font-family: "Sour Gummy", sans-serif;
    font-size: 3.5rem;
    color: #ba9608;
    min-width: 350px;
    max-width: 650px;
    text-align: center;
    z-index: 3000;
    opacity: 0;
    animation: cloudPop 5s forwards;
    pointer-events: none;
    word-wrap: break-word;
    border: 5px solid #222;
    /* White border for cleaner edges */
}

.chat-cloud::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 10px;
    border-style: solid;
    border-color: white transparent transparent transparent;
}

@keyframes cloudPop {
    0% {
        opacity: 0;
        transform: translate(-50%, 20px) scale(0.8);
    }

    10% {
        opacity: 1;
        transform: translate(-50%, 0) scale(1.1);
    }

    15% {
        transform: translate(-50%, 0) scale(1);
    }

    90% {
        opacity: 1;
        transform: translate(-50%, 0) scale(1);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -20px) scale(0.9);
    }
}

/* Z-Index Layers */
.layer-bg {
    z-index: 1;
}

.layer-student-back {
    z-index: 10;
}

.layer-desk {
    z-index: 100;
    /* Table above all */
}

.layer-student-front {
    z-index: 30;
}

/* Hide original HTML specific styles */
.desk-surface,
.seat,
.avatar-display,
.level-badge {
    display: none;
}

/* Idle Animations */
@keyframes avatar-idle {

    0%,
    100% {
        transform: translateY(0) rotate(0);
    }

    50% {
        transform: translateY(-10px) rotate(1deg);
    }
}

.avatar-display.floating {
    animation: float 3s ease-in-out infinite;
}

.avatar-label {
    background: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-main);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Bottom Controls -> Left Sidebar */
.room-controls {
    position: fixed;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(15px);
    padding: 24px 12px;
    border-radius: 40px;
    display: flex;
    flex-direction: column;
    /* Vertical */
    gap: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    border: 2px solid white;
    z-index: 1000;
}

/* Tiny Centered Timer */
#tiny-timer {
    position: fixed;
    top: 100px;
    /* Below header */
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.9);
    padding: 8px 24px;
    border-radius: 20px;
    font-family: 'Fredoka One', cursive;
    font-size: 1.8rem;
    color: var(--primary-dark);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    border: 2px solid white;
    z-index: 900;
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0;
    transition: opacity 0.5s;
}

#tiny-timer.visible {
    opacity: 1;
}

/* Studying Prop (Laptop/Book) */
.studying-prop {
    position: absolute;
    bottom: -5px;
    /* Adjust to overlap bottom of avatar */
    left: 50%;
    transform: translateX(-50%);
    font-size: 40px;
    z-index: 5;
    /* In front of avatar(2) and desk(1) */
    filter: drop-shadow(0 4px 5px rgba(0, 0, 0, 0.15));
}

/* Specific Prop Positioning per Seat because of perspective */
.seat[data-index="0"] .studying-prop,
.seat[data-index="3"] .studying-prop {
    bottom: 10px;
}

.seat[data-index="1"] .studying-prop,
.seat[data-index="2"] .studying-prop {
    bottom: 20px;
    z-index: 5;
}

.control-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: white;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 0 #e0e0e0;
    transition: all 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-main);
}

.control-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 0 #e0e0e0;
    background: #fffdfd;
}

.control-btn:active {
    transform: translateY(2px);
    box-shadow: 0 0 0 #e0e0e0;
}

/* --- THEMES --- */

/* Cafe (Default) */
body.theme-cafe {
    background: linear-gradient(to top right, #fff1eb 0%, #ace0f9 100%);
    /* Soft Pastel Sky */
    --primary: #ff9a9e;
}

body.theme-cafe .desk-surface {
    background: rgba(255, 255, 255, 0.4);
    border-color: #fff;
}

/* Gamer */
body.theme-gamer {
    background: linear-gradient(to bottom, #2b1055 0%, #7597de 100%);
    color: white;
    --text-main: #333;
    /* For buttons inside */
}

body.theme-gamer .room-title {
    color: #2b1055;
    background: #fff;
}

body.theme-gamer .desk-surface {
    background: rgba(0, 0, 0, 0.4);
    border-color: #8a2be2;
    box-shadow: 0 0 30px rgba(138, 43, 226, 0.5);
}

body.theme-gamer .avatar-label {
    color: #2b1055;
}

/* Cloud */
body.theme-cloud {
    background: #c2e9fb;
    background-image: linear-gradient(120deg, #a1c4fd 0%, #c2e9fb 100%);
}

body.theme-cloud .desk-surface {
    background: rgba(255, 255, 255, 0.7);
    border-radius: 50% / 10%;
    /* Cloud shape attempt? No, let's keep it clean */
    border-radius: 40px;
    border: 8px solid white;
}

/* Utilities */
.input-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

input[type="text"] {
    width: 100%;
    padding: 1rem;
    border-radius: 15px;
    border: 2px solid #eee;
    font-size: 1rem;
    outline: none;
    font-family: 'Quicksand', sans-serif;
}

input[type="text"]:focus {
    border-color: var(--primary);
}

.avatar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 10px;
    padding: 10px;
    max-height: 250px;
    overflow-y: auto;
}

.avatar-option img {
    border-radius: 50%;
    width: 60px;
    height: 60px;
    transition: transform 0.2s;
}

.avatar-option.selected img {
    transform: scale(1.1);
    box-shadow: 0 0 0 3px var(--primary);
}

.avatar-option:hover img {
    transform: rotate(360deg);
}

.avatar-level-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: linear-gradient(135deg, #ffd700, #ffa500);
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    z-index: 10;
    border: 2px solid white;
}

/* Layout for Landing Page specifically */
/* Since Landing page uses .glass-panel directly in body */
/* Body is flex column centered */

/* --- OVERLAY STYLES --- */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    opacity: 1;
    transition: opacity 0.3s;
}

.overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-main);
    opacity: 0.6;
}

.close-btn:hover {
    opacity: 1;
}

/* --- TIMER STYLES --- */
.timer-digits {
    font-size: 5rem;
    font-weight: 700;
    font-family: 'Fredoka One', cursive;
    color: var(--primary-dark);
    margin: 1rem 0;
    text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.1);
}

.timer-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    margin-bottom: 2rem;
}

.timer-modes {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.mode-btn {
    background: transparent;
    border: 2px solid var(--primary);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-family: 'Quicksand', sans-serif;
    font-weight: 600;
    color: var(--text-main);
    transition: all 0.2s;
}

.mode-btn:hover {
    background: rgba(255, 255, 255, 0.5);
}

.mode-btn.active {
    background: var(--primary);
    color: white;
}

/* Duration Settings */
.duration-inputs {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 15px;
}

.duration-inputs.hidden {
    display: none;
}

.duration-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    gap: 10px;
}

.duration-row label {
    font-weight: 600;
    flex: 1;
    text-align: left;
}

.duration-row input[type="number"] {
    width: 60px;
    padding: 0.5rem;
    border-radius: 10px;
    border: 2px solid #eee;
    font-size: 1rem;
    text-align: center;
    font-family: 'Quicksand', sans-serif;
}

.duration-row input[type="number"]:focus {
    border-color: var(--primary);
    outline: none;
}

/* --- CHAT STYLES --- */
.chat-panel {
    max-width: 500px;
    width: 95%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    text-align: left;
}

.chat-messages {
    flex: 1;
    min-height: 200px;
    max-height: 300px;
    overflow-y: auto;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    margin-bottom: 1rem;
}

.chat-message {
    display: flex;
    align-items: flex-start;
}

.chat-message img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid white;
}

.chat-message-content {
    flex: 1;
}

.chat-message-header {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--primary-dark);
    margin-bottom: 2px;
}

.chat-message-text {
    background: white;
    padding: 0.5rem 1rem;
    border-radius: 15px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    display: inline-block;
    word-break: break-word;
}

.reaction-btn {
    background: white;
    border: none;
    font-size: 1.5rem;
    padding: 0.5rem;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.reaction-btn:hover {
    transform: scale(1.2);
}

.chat-input-area {
    display: flex;
    gap: 0.5rem;
}

.chat-input-area input {
    flex: 1;
}

/* Floating Reaction Animation */
.floating-reaction {
    position: fixed;
    font-size: 3rem;
    animation: floatUp 2s ease-out forwards;
    pointer-events: none;
    z-index: 200;
}

@keyframes floatUp {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    100% {
        opacity: 0;
        transform: translateY(-200px) scale(1.5);
    }
}

/* --- TASK STYLES --- */
.task-panel {
    max-width: 450px;
    width: 90%;
    min-height: 400px;
    display: flex;
    flex-direction: column;
}

.task-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
    flex: 1;
    overflow-y: auto;
    max-height: 300px;
    text-align: left;
}

.task-item {
    background: rgba(255, 255, 255, 0.6);
    margin-bottom: 0.5rem;
    padding: 0.8rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s;
    border-left: 4px solid var(--primary);
}

.task-item.completed {
    background: rgba(181, 224, 173, 0.4);
    border-left-color: #7bb376;
    text-decoration: line-through;
    opacity: 0.7;
}

.task-item:hover {
    transform: translateX(5px);
}

.task-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary);
}

.task-text-content {
    flex: 1;
}

.task-author {
    font-size: 0.7rem;
    color: var(--text-soft);
    display: block;
    margin-top: 2px;
}

.delete-task-btn {
    background: none;
    border: none;
    color: #e57373;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
}

.task-item:hover .delete-task-btn {
    opacity: 1;
}

.task-input-area {
    display: flex;
    gap: 0.5rem;
}

.task-input-area input {
    flex: 1;
}

/* Confetti Celebration */
.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    background-color: var(--primary);
    animation: fall 3s linear forwards;
    z-index: 999;
}

@keyframes fall {
    to {
        transform: translateY(100vh) rotate(720deg);
    }
}

/* --- GOD MODE STYLES --- */
/* --- CONTROL ICONS --- */
.control-btn i {
    font-size: 1.2rem;
    pointer-events: none;
}

.room-controls .control-btn i {
    font-size: 1.4rem;
}

/* --- QUIZ STYLES (Redesign) --- */
.quiz-panel {
    text-align: center;
    max-width: 600px;
    width: 95%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid white;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f0f0f0;
}

.quiz-badge {
    background: var(--primary);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.quiz-stats {
    display: flex;
    gap: 15px;
    font-weight: 600;
    color: var(--text);
    font-size: 0.95rem;
}

.quiz-stats span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.quiz-stats i {
    color: #ffd700;
}

#quiz-question {
    font-size: 1.4rem;
    color: var(--text);
    margin-bottom: 2rem;
    line-height: 1.4;
    font-weight: 700;
}

.quiz-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 2rem 0;
}

.quiz-option-btn {
    background: white;
    border: 2px solid #eee;
    padding: 1rem;
    border-radius: 15px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Quicksand', sans-serif;
    font-weight: 600;
}

.quiz-option-btn:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: white;
}

.quiz-option-btn.selected {
    background: var(--primary);
    color: white;
}

.quiz-option-btn.correct {
    background: #a5d6a7 !important;
    border-color: #66bb6a !important;
    color: white !important;
}

.quiz-option-btn.wrong {
    background: #ef9a9a !important;
    border-color: #ef5350 !important;
    color: white !important;
}

.quiz-timer-bar {
    width: 100%;
    height: 6px;
    background: #eee;
    border-radius: 3px;
    overflow: hidden;
}

#quiz-progress {
    width: 100%;
    height: 100%;
    background: var(--primary);
    animation: quizTimer 20s linear forwards;
}

@keyframes quizTimer {
    from {
        width: 100%;
    }

    to {
        width: 0%;
    }
}

.quiz-header {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
}

#quiz-leaderboard {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.8);
    padding: 10px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.leaderboard-item img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
}

.leaderboard-score {
    margin-left: auto;
    font-weight: bold;
    color: var(--primary);
}

/* --- MODAL & TOAST STYLES --- */
.modal-panel {
    max-width: 400px;
    width: 90%;
    padding: 1.5rem;
    text-align: left;
}

#toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    pointer-events: none;
    /* Let clicks pass through gaps */
}

.toast {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem 2rem;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    color: var(--text);
    font-weight: 500;
    pointer-events: auto;
    animation: slideDown 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ========================================
   NEW UI OVERHAUL - Split Header & Timer
   ======================================== */

/* Header Left Capsule - Room Name */
.header-left {
    position: fixed;
    top: 20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(15px);
    padding: 12px 25px;
    border-radius: 50px;
    font-size: 1.3rem;
    font-family: 'Agbalumo', system-ui;
    color: var(--primary-dark);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 2px solid white;
    z-index: 1000;
}

/* Header Right Capsule - Buttons */
.header-right {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(15px);
    padding: 8px 15px;
    border-radius: 50px;
    display: flex;
    gap: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 2px solid white;
    z-index: 1000;
}

/* Pomodoro Timer - Centered in Window Area */
.pomodoro-center {
    position: fixed;
    top: 22%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    padding: 20px 50px;
    border-radius: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border: 3px solid rgba(255, 255, 255, 0.9);
    z-index: 500;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.pomodoro-center.visible {
    opacity: 1;
    pointer-events: auto;
}

.pomodoro-center #tiny-timer {
    font-family: 'Agbalumo', system-ui;
    font-size: 3.5rem;
    color: #ff7e9d;
    text-shadow: 0 2px 8px rgba(255, 126, 157, 0.3);
}

/* ========================================
   GUI OS WINDOW SYSTEM
   ======================================== */

.os-window {
    position: absolute;
    background: white;
    border: 3px solid #222;
    border-radius: 12px;
    box-shadow: 8px 8px 0px rgba(0, 0, 0, 0.8);
    /* Cartoon Shadow */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 250px;
    z-index: 2000;
    transition: width 0.3s, height 0.3s, transform 0.2s;
}

.os-window.hidden {
    display: none !important;
}

.window-header {
    background: #ffb7b2;
    /* Primary pastel */
    border-bottom: 3px solid #222;
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: grab;
    user-select: none;
    touch-action: none;
}

.window-header:active {
    cursor: grabbing;
}

.window-title {
    font-family: 'Agbalumo', system-ui;
    font-size: 1.1rem;
    color: #222;
}

.window-controls {
    display: flex;
    gap: 6px;
}

.win-btn {
    width: 20px;
    height: 20px;
    border: 2px solid #222;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    transition: transform 0.1s;
}

.win-btn:active {
    transform: scale(0.9);
}

.btn-minimize {
    background: #ffe066;
}

/* Yellow */
.btn-close {
    background: #ff6b6b;
}

/* Red */

.window-content {
    background: #fff;
    padding: 15px;
    flex-grow: 1;
    overflow-y: auto;
}

/* --- SPECIFIC WINDOWS --- */

/* Pomodoro Window */
#window-pomodoro {
    top: 15%;
    left: 20%;
    /* Target red box area */
    width: 300px;
}

#window-pomodoro.minimized {
    height: auto !important;
    width: 200px !important;
}

#window-pomodoro.minimized .window-content {
    padding: 0;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffe3e3;
}

#window-pomodoro.minimized .full-timer-ui {
    display: none;
}

#window-pomodoro.minimized .mini-timer-ui {
    display: block !important;
    font-family: 'Agbalumo';
    font-size: 1.5rem;
    color: #d6336c;
}

.mini-timer-ui {
    display: none;
}

/* Chat Window */
#window-chat {
    bottom: 100px;
    right: 50px;
    width: 320px;
    height: 400px;
}

/* Tasks Window */
#window-tasks {
    top: 100px;
    right: 50px;
    width: 300px;
    height: 350px;
}

/* Quiz Window */
#window-quiz {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    /* Start centered */
    width: 400px;
    height: auto;
}

/* ========================================
   OS WINDOW - MINIMIZED STATE
   ======================================== */
.os-window.minimized {
    height: auto !important;
    width: auto !important;
    min-width: 150px !important;
}

.os-window.minimized .window-content {
    display: none;
}

.os-window.minimized .window-header {
    border-bottom: none;
}

/* Enhanced Cartoon Shadow */
.os-window {
    box-shadow: 8px 8px 0px rgba(0, 0, 0, 0.7),
        12px 12px 20px rgba(0, 0, 0, 0.2) !important;
}

/* Fancy Font Applications */
.window-title {
    font-family: 'Agbalumo', system-ui !important;
}

.chat-message-text,
.task-text-content span,
#quiz-question {
    font-family: 'Sour Gummy', sans-serif !important;
}

#timer-display,
#mini-timer-display {
    font-family: 'Agbalumo', system-ui !important;
}

.student-label {
    font-family: 'Amarante', serif !important;
}

/* ========================================
   MOBILE RESPONSIVENESS (UI Adjustment)
   ======================================== */
@media (max-width: 768px) {
    .header-left {
        top: 10px;
        left: 10px;
        padding: 8px 15px;
        font-size: 1rem;
    }

    .header-left img {
        width: 24px;
        height: 24px;
    }

    .header-right {
        top: 10px;
        right: 10px;
        padding: 5px 10px;
    }

    .header-right .control-btn {
        width: 34px;
        height: 34px;
        font-size: 1rem;
    }

    .room-controls {
        left: 50%;
        bottom: 20px;
        top: auto;
        transform: translateX(-50%);
        flex-direction: row;
        padding: 10px 20px;
        border-radius: 50px;
        width: auto;
        gap: 15px;
    }

    .room-controls .control-btn {
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
    }

    .os-window {
        width: 90%;
        left: 5%;
        top: 15%;
    }

    #window-chat,
    #window-tasks {
        bottom: auto;
        height: 60vh !important;
    }

    .student-label {
        font-size: 3rem;
        padding: 5px 12px;
        top: -50px;
    }

    .chat-cloud {
        padding: 15px 30px;
        font-size: 3.2rem;
        min-width: 200px;
        bottom: calc(100% + 40px);
    }

    .pomodoro-center #tiny-timer {
        font-size: 2.5rem;
    }
}