/* ============================================
   CHATBOT BẬP BẸ — CSS STYLES
   ============================================ */

/* === RESET & BASE === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary: #6C63FF;
    --primary-dark: #5A52D5;
    --primary-light: #A5A0FF;
    --secondary: #00D2FF;
    --accent: #FF6B9D;
    --success: #00C853;
    --error: #FF5252;
    --warning: #FFD600;
    --bg-gradient: linear-gradient(135deg, #E8E4FF 0%, #D4F1FF 50%, #F0E6FF 100%);
    --card-bg: #fff;
    --text: #2D3436;
    --text-light: #636E72;
    --shadow: 0 4px 15px rgba(108,99,255,0.15);
    --shadow-hover: 0 8px 25px rgba(108,99,255,0.25);
    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 6px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-gradient);
    min-height: 100vh;
    color: var(--text);
    line-height: 1.5;
}

/* === HOME PAGE === */
.home-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 24px 16px 40px;
    position: relative;
    overflow: hidden;
}

/* Floating bubbles decoration */
.floating-bubbles {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    z-index: 0;
}
.float-bubble {
    position: absolute;
    font-size: 1.6rem;
    opacity: 0.15;
    animation: floatBubble 8s ease-in-out infinite;
}
.fb1 { top: 8%; left: 5%; animation-delay: 0s; }
.fb2 { top: 15%; right: 8%; animation-delay: 1.5s; font-size: 2rem; }
.fb3 { top: 40%; left: 3%; animation-delay: 3s; }
.fb4 { top: 60%; right: 5%; animation-delay: 4.5s; }
.fb5 { top: 80%; left: 10%; animation-delay: 6s; }

@keyframes floatBubble {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(10deg); }
}

/* Header */
.home-header {
    text-align: center;
    margin-bottom: 24px;
    position: relative;
    z-index: 1;
}

.logo-area {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 8px;
}

/* Bập Bẹ Logo (CSS-drawn robot) */
.bapbe-logo {
    position: relative;
    width: 56px;
    height: 68px;
}
.bapbe-head {
    width: 44px;
    height: 36px;
    background: var(--primary);
    border-radius: 12px 12px 8px 8px;
    position: absolute;
    top: 10px;
    left: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}
.bapbe-eye {
    width: 10px;
    height: 10px;
    background: #fff;
    border-radius: 50%;
    position: relative;
    animation: blink 3s ease-in-out infinite;
}
.bapbe-eye::after {
    content: '';
    width: 5px;
    height: 5px;
    background: #333;
    border-radius: 50%;
    position: absolute;
    top: 2.5px;
    left: 2.5px;
}
.bapbe-mouth {
    width: 16px;
    height: 6px;
    border-bottom: 2.5px solid #fff;
    border-radius: 0 0 8px 8px;
    position: absolute;
    bottom: 5px;
    left: 14px;
}
.bapbe-antenna {
    width: 3px;
    height: 12px;
    background: var(--primary);
    position: absolute;
    top: -2px;
    left: 20.5px;
    border-radius: 2px;
}
.bapbe-antenna::after {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--secondary);
    border-radius: 50%;
    position: absolute;
    top: -6px;
    left: -2.5px;
    animation: antennaPulse 2s ease-in-out infinite;
}
.bapbe-body {
    width: 36px;
    height: 22px;
    background: var(--primary);
    border-radius: 6px;
    position: absolute;
    bottom: 0;
    left: 10px;
}
.bapbe-body::before {
    content: '';
    width: 18px;
    height: 10px;
    background: var(--secondary);
    border-radius: 4px;
    position: absolute;
    top: 4px;
    left: 9px;
    opacity: 0.7;
}

@keyframes blink {
    0%, 45%, 55%, 100% { transform: scaleY(1); }
    50% { transform: scaleY(0.1); }
}
@keyframes antennaPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.6; }
}

.title-main {
    font-size: 2rem;
    color: var(--text);
    letter-spacing: 2px;
}
.title-main .highlight {
    color: var(--primary);
    text-shadow: 2px 2px 0 rgba(108,99,255,0.1);
}

.subtitle {
    color: var(--text-light);
    font-size: 1rem;
    margin-top: 4px;
}

/* Characters bar */
.characters-bar {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 28px;
    position: relative;
    z-index: 1;
}
.character {
    text-align: center;
    transition: transform 0.3s;
}
.character:hover { transform: translateY(-4px); }
.char-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 4px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}
.char-face { font-size: 1.6rem; }
.min-avatar { background: linear-gradient(135deg, #dfe6e9, #b2bec3); }
.phuc-avatar { background: linear-gradient(135deg, #a8e6cf, #55efc4); }
.mai-avatar { background: linear-gradient(135deg, #ffeaa7, #fdcb6e); }
.bo-avatar { background: linear-gradient(135deg, #fab1a0, #e17055); }
.char-name { font-size: 0.75rem; font-weight: 600; color: var(--text-light); }

/* === GAME GRID (cards) === */
.game-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 24px;
    position: relative;
    z-index: 1;
}

.game-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px 16px 16px;
    text-decoration: none;
    color: var(--text);
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.game-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}
.game-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
}
.card-1::before { background: var(--primary); }
.card-2::before { background: var(--secondary); }
.card-3::before { background: var(--accent); }
.card-4::before { background: var(--warning); }

.card-icon {
    margin-bottom: 12px;
    display: flex;
    justify-content: center;
}

/* Chat icon */
.chat-icon {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
    max-width: 180px;
}
.chat-bubble-icon {
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    max-width: 70%;
}
.chat-bubble-icon.left {
    background: #f0f0f0;
    color: var(--text);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}
.chat-bubble-icon.right {
    background: var(--primary);
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

/* Training icon */
.training-icon {
    font-size: 0.75rem;
    text-align: left;
    width: 100%;
}
.data-row {
    padding: 4px 8px;
    background: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 4px;
    color: var(--text-light);
}
.data-row.add {
    color: var(--secondary);
    font-style: italic;
    background: #e8fffe;
}

/* Word type icon */
.wordtype-icon {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: center;
}
.wt-tag {
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}
.wt-tag.pronoun { background: #E8DAFF; color: #6C63FF; }
.wt-tag.verb { background: #FFE0E0; color: #FF5252; }
.wt-tag.noun { background: #D4FFEA; color: #00C853; }
.wt-tag.adj { background: #FFF3D4; color: #FF9800; }

/* Sentiment icon */
.sentiment-icon {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.8rem;
}
.emoji-vs {
    font-size: 0.85rem;
    color: var(--text-light);
    font-weight: 600;
}

.card-content h2 {
    font-size: 1rem;
    margin-bottom: 4px;
    color: var(--text);
}
.card-content p {
    font-size: 0.8rem;
    color: var(--text-light);
    line-height: 1.4;
}

.card-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.card-1 .card-badge { background: #E8DAFF; color: var(--primary); }
.card-2 .card-badge { background: #D4F1FF; color: #0097B2; }
.card-3 .card-badge { background: #FFE0E8; color: var(--accent); }
.card-4 .card-badge { background: #FFF8D4; color: #F0A500; }

/* Concept box */
.concept-box {
    display: flex;
    gap: 14px;
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 18px 20px;
    box-shadow: var(--shadow);
    align-items: flex-start;
    position: relative;
    z-index: 1;
    border-left: 4px solid var(--primary);
}
.concept-icon { font-size: 1.8rem; flex-shrink: 0; }
.concept-text {
    font-size: 0.88rem;
    color: var(--text);
    line-height: 1.6;
}
.concept-text strong { color: var(--primary); }
.concept-text em {
    background: #E8DAFF;
    padding: 1px 6px;
    border-radius: 4px;
    font-style: normal;
    font-weight: 600;
    color: var(--primary-dark);
}

/* Footer */
.home-footer {
    text-align: center;
    margin-top: 24px;
    color: var(--text-light);
    font-size: 0.8rem;
    position: relative;
    z-index: 1;
}

/* ============================================
   GAME PAGE LAYOUT
   ============================================ */
.game-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 16px;
    min-height: 100vh;
}

.game-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.btn-back {
    background: var(--card-bg);
    color: var(--primary);
    text-decoration: none;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(108,99,255,0.15);
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-back:hover {
    background: var(--primary);
    color: #fff;
}

.game-title {
    font-size: 1.3rem;
    color: var(--primary);
    flex: 1;
}

/* Speech bubble */
.speech-bubble {
    display: flex;
    gap: 12px;
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 14px 18px;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
    align-items: flex-start;
}
.speech-char { font-size: 1.6rem; flex-shrink: 0; }
.speech-text {
    font-size: 0.88rem;
    line-height: 1.55;
    color: var(--text);
}
.speech-name {
    font-weight: 700;
    color: var(--primary);
}

/* Game panel */
.game-panel {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    position: relative;
}

/* Feedback */
.feedback {
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    margin-top: 12px;
    opacity: 0;
    transform: translateY(-8px);
    transition: all 0.3s;
    display: none;
}
.feedback.show {
    opacity: 1;
    transform: translateY(0);
    display: block;
}
.feedback.success {
    background: #E8F5E9;
    color: #2E7D32;
    border-left: 4px solid var(--success);
}
.feedback.error {
    background: #FFEBEE;
    color: #C62828;
    border-left: 4px solid var(--error);
}
.feedback.info {
    background: #E8DAFF;
    color: var(--primary-dark);
    border-left: 4px solid var(--primary);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 22px;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    text-decoration: none;
    text-align: center;
}
.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 3px 12px rgba(108,99,255,0.3);
}
.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}
.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}
.btn-outline:hover {
    background: var(--primary);
    color: #fff;
}
.btn-secondary {
    background: var(--secondary);
    color: #fff;
}
.btn-secondary:hover {
    background: #00B8E0;
}

/* Celebration */
.celebration {
    text-align: center;
    padding: 30px 20px;
    display: none;
}
.celebration.show { display: block; animation: popIn 0.5s ease; }
.celebration .stars { font-size: 2.2rem; margin-bottom: 12px; }
.celebration h2 {
    color: var(--primary);
    margin-bottom: 8px;
    font-size: 1.4rem;
}
.celebration p {
    color: var(--text-light);
    font-size: 0.92rem;
}

@keyframes popIn {
    0% { transform: scale(0.5); opacity: 0; }
    70% { transform: scale(1.05); }
    100% { transform: scale(1); opacity: 1; }
}

/* ============================================
   PAGE 1: CHAT WITH BẬP BẸ
   ============================================ */
.chat-layout {
    display: flex;
    gap: 16px;
    min-height: 500px;
}

.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #FAFAFE;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid #E8E4FF;
}

.chat-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 400px;
    min-height: 300px;
}

.message {
    display: flex;
    gap: 8px;
    max-width: 85%;
    animation: msgSlideIn 0.3s ease;
}
.message.bot { align-self: flex-start; }
.message.user { align-self: flex-end; flex-direction: row-reverse; }

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

.msg-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}
.message.bot .msg-avatar { background: #E8DAFF; }
.message.user .msg-avatar { background: #D4F1FF; }

.msg-bubble {
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 0.88rem;
    line-height: 1.5;
    position: relative;
}
.message.bot .msg-bubble {
    background: #fff;
    color: var(--text);
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.message.user .msg-bubble {
    background: var(--primary);
    color: #fff;
    border-bottom-right-radius: 4px;
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    align-items: center;
}
.typing-indicator .dot {
    width: 8px;
    height: 8px;
    background: var(--primary-light);
    border-radius: 50%;
    animation: typingBounce 1.2s ease-in-out infinite;
}
.typing-indicator .dot:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator .dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-6px); }
}

/* Quick replies */
.quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 16px;
    border-top: 1px solid #f0f0f0;
}
.quick-reply-btn {
    padding: 5px 12px;
    border-radius: 20px;
    border: 1.5px solid var(--primary-light);
    background: #fff;
    color: var(--primary);
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}
.quick-reply-btn:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* Chat input */
.chat-input-area {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid #E8E4FF;
    background: #fff;
}
.chat-input {
    flex: 1;
    padding: 10px 16px;
    border: 2px solid #E8E4FF;
    border-radius: 25px;
    font-size: 0.88rem;
    outline: none;
    transition: border-color 0.2s;
    font-family: inherit;
}
.chat-input:focus { border-color: var(--primary); }
.chat-input::placeholder { color: #B8B5D0; }

.chat-send-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all 0.2s;
    flex-shrink: 0;
}
.chat-send-btn:hover { background: var(--primary-dark); transform: scale(1.05); }

/* Chat sidebar: matched pattern display */
.chat-sidebar {
    width: 240px;
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid #E8E4FF;
    padding: 14px;
    overflow-y: auto;
    max-height: 500px;
}
.chat-sidebar h3 {
    font-size: 0.85rem;
    color: var(--primary);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.match-info {
    font-size: 0.78rem;
    color: var(--text-light);
    padding: 10px;
    background: #FAFAFE;
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    border-left: 3px solid var(--primary-light);
    animation: fadeIn 0.3s ease;
}
.match-info .match-label {
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 4px;
    display: block;
}
.match-info .match-pattern {
    background: #E8DAFF;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    display: inline-block;
    margin-top: 4px;
}
.no-match {
    text-align: center;
    color: #B8B5D0;
    font-size: 0.82rem;
    padding: 20px 0;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ============================================
   PAGE 2: TRAINING DATA
   ============================================ */
.training-layout {
    display: flex;
    gap: 16px;
    min-height: 460px;
}

.training-panel {
    flex: 1;
}

.category-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.cat-tab {
    padding: 6px 14px;
    border-radius: 20px;
    border: 2px solid #E8E4FF;
    background: #fff;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-light);
}
.cat-tab.active,
.cat-tab:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.training-data-list {
    max-height: 250px;
    overflow-y: auto;
    margin-bottom: 12px;
}
.training-entry {
    display: flex;
    gap: 8px;
    padding: 8px 12px;
    background: #FAFAFE;
    border-radius: var(--radius-xs);
    margin-bottom: 6px;
    font-size: 0.82rem;
    align-items: center;
    animation: fadeIn 0.3s ease;
}
.training-entry .entry-icon {
    font-size: 1rem;
    flex-shrink: 0;
}
.training-entry .entry-text { flex: 1; color: var(--text); }
.training-entry.custom {
    background: #E8FFFE;
    border-left: 3px solid var(--secondary);
}
.training-entry .entry-delete {
    background: none;
    border: none;
    color: #ccc;
    cursor: pointer;
    font-size: 1rem;
    padding: 0 4px;
    transition: color 0.2s;
}
.training-entry .entry-delete:hover { color: var(--error); }

.add-training-area {
    display: flex;
    gap: 8px;
}
.add-training-input {
    flex: 1;
    padding: 8px 14px;
    border: 2px solid #E8E4FF;
    border-radius: 20px;
    font-size: 0.85rem;
    outline: none;
    font-family: inherit;
}
.add-training-input:focus { border-color: var(--secondary); }
.add-training-btn {
    padding: 8px 18px;
    border-radius: 20px;
    background: var(--secondary);
    color: #fff;
    border: none;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.add-training-btn:hover { background: #00B8E0; }

/* Training test chat (mini chat on right) */
.training-test {
    width: 280px;
    display: flex;
    flex-direction: column;
    background: #FAFAFE;
    border-radius: var(--radius);
    border: 1px solid #E8E4FF;
    overflow: hidden;
}
.training-test-header {
    padding: 10px 14px;
    background: var(--primary);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
}
.training-test-messages {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 200px;
    max-height: 300px;
}
.training-test-input {
    display: flex;
    gap: 6px;
    padding: 10px;
    border-top: 1px solid #E8E4FF;
    background: #fff;
}
.training-test-input input {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid #E8E4FF;
    border-radius: 20px;
    font-size: 0.82rem;
    outline: none;
    font-family: inherit;
}
.training-test-input input:focus { border-color: var(--primary); }
.training-test-input button {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

/* Data counter */
.data-counter {
    text-align: center;
    margin-top: 12px;
    padding: 10px;
    background: #E8DAFF;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    color: var(--primary-dark);
}
.data-counter .count-number {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary);
    display: block;
}

/* ============================================
   PAGE 3: WORD TYPE GAME
   ============================================ */
.wordtype-game {
    text-align: center;
}

.wt-level-info {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 16px;
}

.wt-sentence-display {
    padding: 20px;
    background: #FAFAFE;
    border-radius: var(--radius);
    margin-bottom: 16px;
    min-height: 70px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    align-items: center;
}

.wt-word {
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: 2.5px solid #ddd;
    background: #fff;
    color: var(--text);
    user-select: none;
}
.wt-word:hover { transform: translateY(-2px); box-shadow: 0 3px 8px rgba(0,0,0,0.1); }
.wt-word.tagged-pronoun { background: #E8DAFF; border-color: #6C63FF; color: #6C63FF; }
.wt-word.tagged-verb { background: #FFE0E0; border-color: #FF5252; color: #FF5252; }
.wt-word.tagged-noun { background: #D4FFEA; border-color: #00C853; color: #00C853; }
.wt-word.tagged-adj { background: #FFF3D4; border-color: #FF9800; color: #FF9800; }

.wt-tools {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.wt-tool-btn {
    padding: 8px 18px;
    border-radius: 25px;
    border: 2.5px solid #ddd;
    background: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.wt-tool-btn.active { transform: scale(1.05); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
.wt-tool-btn[data-type="pronoun"] { color: #6C63FF; }
.wt-tool-btn[data-type="pronoun"].active { background: #E8DAFF; border-color: #6C63FF; }
.wt-tool-btn[data-type="verb"] { color: #FF5252; }
.wt-tool-btn[data-type="verb"].active { background: #FFE0E0; border-color: #FF5252; }
.wt-tool-btn[data-type="noun"] { color: #00C853; }
.wt-tool-btn[data-type="noun"].active { background: #D4FFEA; border-color: #00C853; }
.wt-tool-btn[data-type="adj"] { color: #FF9800; }
.wt-tool-btn[data-type="adj"].active { background: #FFF3D4; border-color: #FF9800; }
.wt-tool-btn[data-type="erase"] { color: #999; }
.wt-tool-btn[data-type="erase"].active { background: #f5f5f5; border-color: #999; }

.wt-pattern-display {
    padding: 12px 18px;
    background: #E8DAFF;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 12px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
}

.wt-check-btn {
    padding: 10px 28px;
    border-radius: 25px;
    background: var(--primary);
    color: #fff;
    border: none;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.wt-check-btn:hover { background: var(--primary-dark); transform: translateY(-2px); }

.wt-progress {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-bottom: 16px;
}
.wt-progress-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #E0E0E0;
    transition: all 0.3s;
}
.wt-progress-dot.current { background: var(--primary-light); transform: scale(1.3); }
.wt-progress-dot.done { background: var(--success); }

/* ============================================
   PAGE 4: SENTIMENT ANALYSIS
   ============================================ */
.sentiment-game {
    text-align: center;
}

.sentiment-phase-label {
    font-size: 0.82rem;
    color: var(--text-light);
    margin-bottom: 8px;
}

.sentiment-card {
    padding: 24px 20px;
    background: #FAFAFE;
    border-radius: var(--radius);
    margin-bottom: 16px;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.sentiment-card .sentence-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.6;
}

.sentiment-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.sentiment-btn {
    padding: 12px 28px;
    border-radius: 25px;
    border: 2.5px solid #ddd;
    background: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}
.sentiment-btn:hover { transform: translateY(-3px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.sentiment-btn.khen { color: var(--success); }
.sentiment-btn.khen:hover, .sentiment-btn.khen.selected { background: #D4FFEA; border-color: var(--success); }
.sentiment-btn.che { color: var(--error); }
.sentiment-btn.che:hover, .sentiment-btn.che.selected { background: #FFE0E0; border-color: var(--error); }
.sentiment-btn.trung-lap { color: #999; }
.sentiment-btn.trung-lap:hover, .sentiment-btn.trung-lap.selected { background: #f5f5f5; border-color: #999; }

.sentiment-btn.correct-pick {
    border-color: var(--success) !important;
    background: #D4FFEA !important;
    color: var(--success) !important;
}
.sentiment-btn.wrong-pick {
    border-color: var(--error) !important;
    background: #FFE0E0 !important;
    color: var(--error) !important;
}

.sentiment-progress {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-bottom: 16px;
}
.sp-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #E0E0E0;
    transition: all 0.3s;
}
.sp-dot.current { background: var(--primary-light); transform: scale(1.3); }
.sp-dot.done { background: var(--success); }
.sp-dot.wrong { background: var(--error); }

/* Stats display */
.sentiment-stats {
    padding: 20px;
    background: #FAFAFE;
    border-radius: var(--radius);
    margin-bottom: 16px;
}
.stats-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 12px;
}
.stat-bar-container {
    margin-bottom: 10px;
}
.stat-bar-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    margin-bottom: 4px;
    color: var(--text);
    font-weight: 600;
}
.stat-bar {
    height: 22px;
    background: #E0E0E0;
    border-radius: 11px;
    overflow: hidden;
}
.stat-bar-fill {
    height: 100%;
    border-radius: 11px;
    transition: width 1s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: #fff;
}
.stat-bar-fill.khen { background: var(--success); }
.stat-bar-fill.che { background: var(--error); }
.stat-bar-fill.trung-lap { background: #bbb; }

/* Quiz section in sentiment */
.sentiment-quiz {
    padding: 20px;
    background: #E8DAFF;
    border-radius: var(--radius);
    margin-top: 16px;
}
.sentiment-quiz .quiz-q {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 12px;
}
.sentiment-quiz .quiz-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.sq-option {
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    border: 2px solid #D0C4FF;
    background: #fff;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    font-family: inherit;
}
.sq-option:hover { border-color: var(--primary); background: #F5F2FF; }
.sq-option.correct-answer {
    border-color: var(--success);
    background: #D4FFEA;
    color: #2E7D32;
}
.sq-option.wrong-answer {
    border-color: var(--error);
    background: #FFE0E0;
    color: #C62828;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 700px) {
    .game-grid { grid-template-columns: 1fr; }
    .chat-layout { flex-direction: column; }
    .chat-sidebar { width: 100%; max-height: 200px; }
    .training-layout { flex-direction: column; }
    .training-test { width: 100%; }
    .title-main { font-size: 1.6rem; }
}

@media (max-width: 400px) {
    .home-container { padding: 16px 10px 30px; }
    .game-container { padding: 10px; }
    .title-main { font-size: 1.3rem; }
    .characters-bar { gap: 12px; }
    .char-avatar { width: 42px; height: 42px; }
}
