:root {
    --bg-color: #f4f7f6;
    --card-bg: #ffffff;
    --text-color: #1e293b;
    --text-light: #64748b;
    --primary: #4f46e5;      /* Indigo */
    --primary-hover: #4338ca;
    --secondary: #0ea5e9;    /* Sky */
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --muted: #94a3b8;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: 'Noto Sans SC', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 2rem;
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-icon {
    font-size: 2rem;
    color: var(--primary);
}

.logo-text h1 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
    color: var(--text-color);
}

.logo-text p {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}
.btn-block { width: 100%; }
.btn-primary { background: var(--primary); color: white; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-outline { background: white; border: 1px solid var(--border-color); color: var(--text-color); }
.btn-outline:hover { background: #f8fafc; border-color: #cbd5e1; }
.btn-demo { background: #e0e7ff; color: #4338ca; font-size: 0.8rem; padding: 0.4rem 0.8rem; border-radius: 2rem;}
.btn-demo:hover { background: #c7d2fe; }
.btn-play-hero { background: var(--secondary); color: white; padding: 0.75rem 1.5rem; border-radius: 2rem; font-weight: 600; box-shadow: var(--shadow-md);}
.btn-play-hero:hover { background: #0284c7; transform: scale(1.05); }

/* Main Container */
.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Hub Section */
.hub-header {
    text-align: center;
    margin-bottom: 2.5rem;
}
.hub-header h2 { font-size: 2.5rem; font-weight: 900; color: var(--text-color); margin-bottom: 0.5rem; letter-spacing: -0.02em;}
.hub-header p { color: var(--text-light); font-size: 1.1rem;}

/* Featured Games Banners */
.featured-games {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 3rem;
}

@media (max-width: 900px) {
    .featured-games { grid-template-columns: 1fr; }
}

.feature-card {
    background: var(--card-bg);
    border-radius: 1.25rem;
    padding: 2rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
}
.feature-card.c-blue::before { background: var(--secondary); }
.feature-card.c-purple::before { background: var(--primary); }
.feature-card.c-orange::before { background: var(--warning); }

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: #cbd5e1;
}

.fc-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    background: #f1f5f9;
    width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
}
.c-blue .fc-icon { color: var(--secondary); background: #e0f2fe; }
.c-purple .fc-icon { color: var(--primary); background: #e0e7ff; }
.c-orange .fc-icon { color: var(--warning); background: #fef3c7; }

.fc-title { font-size: 1.25rem; font-weight: 700; margin-bottom: 0.5rem; }
.fc-desc { font-size: 0.9rem; color: var(--text-light); margin-bottom: 1.5rem; flex-grow: 1; }

/* Curriculum List */
.curriculum-section h3 { font-size: 1.5rem; margin-bottom: 1.5rem; padding-bottom: 0.5rem; border-bottom: 2px solid var(--border-color); }
.curriculum-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}
@media (max-width: 1024px) { .curriculum-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px) { .curriculum-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .curriculum-grid { grid-template-columns: 1fr; } }

.curr-item {
    background: var(--card-bg);
    padding: 1rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
    font-size: 0.85rem;
    display: flex; flex-direction: column;
}
.curr-week { color: var(--primary); font-weight: bold; margin-bottom: 0.25rem; font-size: 0.75rem; }
.curr-title { font-weight: 600; margin-bottom: 0.5rem; color: var(--text-color); }
.curr-tag { margin-top: auto; align-self: flex-start; background: #f1f5f9; color: var(--text-light); padding: 0.15rem 0.5rem; border-radius: 0.25rem; font-size: 0.7rem; }


/* Games Container */
.game-view {
    background: var(--card-bg);
    border-radius: 1.5rem;
    border: 1px solid var(--border-color);
    padding: 2.5rem;
    min-height: 600px;
    box-shadow: var(--shadow-lg);
    animation: fadeIn 0.3s ease-out;
}

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

.game-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    text-align: center;
}

.game-header h2 { font-size: 2rem; font-weight: 800; margin-bottom: 0.5rem; color: var(--primary);}
.game-header p { color: var(--text-light); font-size: 1.1rem; }

/* --- Game 1: Draw --- */
.game-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}

@media (max-width: 900px) {
    .game-layout { grid-template-columns: 1fr; gap: 2rem; }
}

.form-group { margin-bottom: 1.5rem; }
.form-group label { display: block; margin-bottom: 0.5rem; font-weight: 600; color: var(--text-color); font-size: 1rem;}
.form-control {
    width: 100%;
    padding: 1rem;
    background: #f8fafc;
    border: 2px solid var(--border-color);
    color: var(--text-color);
    border-radius: 0.75rem;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
}
.form-control:focus { outline: none; border-color: var(--primary); background: #ffffff; }

.demo-buttons { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }

.image-result-box {
    background: #f1f5f9;
    border-radius: 1rem;
    height: 100%;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    border: 2px dashed #cbd5e1;
}
.image-result-box img { width: 100%; height: 100%; object-fit: cover; border-radius: 1rem; box-shadow: var(--shadow-md); }

.loading-overlay {
    position: absolute; inset: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    z-index: 10;
    border-radius: 1rem;
}
.spinner {
    width: 40px; height: 40px;
    border: 4px solid #e2e8f0;
    border-left-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Game 2: Spotter --- */
.spotter-game-container {
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
}
.spotter-status {
    display: flex; justify-content: center; gap: 1rem; margin-bottom: 1.5rem;
}
.spotter-status span {
    background: var(--primary); color: white; padding: 0.4rem 1.2rem; border-radius: 2rem; font-weight: bold; box-shadow: var(--shadow-sm);
}
.spotter-game-container h3 { font-size: 1.5rem; margin-bottom: 2rem;}

.image-comparison {
    display: flex; gap: 2rem; justify-content: center; margin: 2rem 0;
}
@media (max-width: 768px) { .image-comparison { flex-direction: column; } }

.img-choice {
    position: relative;
    border-radius: 1rem; overflow: hidden;
    cursor: pointer;
    border: 4px solid transparent;
    transition: all 0.2s;
    box-shadow: var(--shadow-md);
}
.img-choice img { display: block; max-width: 100%; height: auto; border-radius: 0.5rem; }
.overlay-label {
    position: absolute; top: 1rem; left: 1rem;
    background: rgba(255,255,255,0.9); width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%; font-weight: 900; font-size: 1.2rem; color: var(--primary);
    box-shadow: var(--shadow-sm);
}
.img-choice:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.img-choice.selected { opacity: 0.5; }
.img-choice.correct { border-color: var(--success); opacity: 1; transform: scale(1.02); z-index: 10; box-shadow: 0 0 0 8px rgba(16,185,129,0.2);}
.img-choice.wrong { border-color: var(--danger); opacity: 0.5; }

.spotter-feedback {
    background: #f0fdf4; border: 1px solid #bbf7d0; padding: 2rem; border-radius: 1rem;
}

/* --- Game 3: Chat --- */
.chat-game-layout {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 2rem;
    height: 600px;
}
@media (max-width: 900px) {
    .chat-game-layout { grid-template-columns: 1fr; height: auto; display: flex; flex-direction: column;}
}

.chat-sidebar {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 1rem;
    border: 1px solid var(--border-color);
    display: flex; flex-direction: column; gap: 1.5rem;
    overflow-y: auto;
}
.creator-section h3 { font-size: 1.1rem; margin-bottom: 0.5rem; color: var(--text-color); display: flex; align-items: center; gap: 0.5rem;}
.creator-section textarea { font-size: 0.85rem; height: 120px; }

.chat-main {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-radius: 1rem;
    border: 1px solid var(--border-color);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.chat-messages {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    background: #f1f5f9;
}
.message {
    display: flex;
    gap: 1rem;
    max-width: 85%;
}
.message .avatar {
    width: 44px; height: 44px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}
.npc-message { align-self: flex-start; }
.npc-message .avatar { background: white; color: var(--primary); border: 1px solid var(--border-color); }
.npc-message .bubble { background: white; border: 1px solid var(--border-color); border-radius: 0 1rem 1rem 1rem; color: var(--text-color); box-shadow: var(--shadow-sm);}

.user-message { align-self: flex-end; flex-direction: row-reverse;}
.user-message .avatar { background: var(--primary); color: white; }
.user-message .bubble { background: var(--primary); color: white; border-radius: 1rem 0 1rem 1rem; box-shadow: var(--shadow-sm);}

.bubble {
    padding: 0.875rem 1.25rem;
    line-height: 1.6;
    font-size: 0.95rem;
}

.chat-input-area {
    display: flex;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: white;
    border-top: 1px solid var(--border-color);
}
.chat-input-area textarea {
    flex: 1;
    resize: none;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 0.875rem;
    border-radius: 0.75rem;
    font-family: inherit;
    font-size: 0.95rem;
}
.chat-input-area textarea:focus { outline: none; border-color: var(--primary); background: white; }
.btn-send { height: 100%; padding: 0 1.5rem; font-size: 1.2rem; border-radius: 0.75rem; }

.typing-indicator span {
    display: inline-block;
    width: 6px; height: 6px;
    background: currentColor;
    border-radius: 50%;
    margin: 0 2px;
    animation: bounce 1.4s infinite ease-in-out both;
}
.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

/* Toast */
.toast-notification {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--text-color);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 2rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
}
.toast-notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.app-footer { text-align: center; padding: 2rem; color: var(--text-light); font-size: 0.85rem;}
