/* ===== 基礎設定 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-color: #fef7f0;
    --primary-color: #ff9a9e;
    --secondary-color: #fad0c4;
    --accent-red: #ff6b6b;
    --accent-yellow: #ffd93d;
    --accent-blue: #6bcf7f;
    --accent-purple: #a29bfe;
    --text-color: #2d3436;
    --card-bg: #ffffff;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 8px 20px rgba(0, 0, 0, 0.15);
}

body {
    font-family: "Noto Sans TC", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: linear-gradient(135deg, #fef7f0 0%, #ffe8e8 100%);
    color: var(--text-color);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

/* ===== 主應用容器 ===== */
.app {
    max-width: 600px;
    margin: 0 auto;
    padding: 0 20px;
    min-height: 100vh;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

/* ===== 畫面切換控制 ===== */
.view {
    display: block;
}

.hidden {
    display: none !important;
}

/* ===== 遊戲大廳樣式 ===== */
#lobby-view {
    padding: 20px 0;
    min-height: 100vh;
}

.lobby-header {
    text-align: center;
    margin-bottom: 30px;
    padding-top: 20px;
}

/* ===== 年齡篩選列 ===== */
.age-filter {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
    padding: 0 10px;
}

.age-filter-btn {
    padding: 10px 18px;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-color);
    background: white;
    border: 2px solid #ddd;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.age-filter-btn:hover {
    background: #f5f5f5;
    border-color: var(--primary-color);
}

.age-filter-btn.active {
    background: linear-gradient(135deg, var(--primary-color), #ff8a95);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(255, 154, 158, 0.3);
}

/* ===== 遊戲列表 ===== */
.games-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-bottom: 40px;
}

.games-list .hidden {
    display: none !important;
}

.main-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.subtitle {
    font-size: 18px;
    color: #666;
    margin-top: 10px;
}

.game-cards {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-bottom: 40px;
}

.game-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 28px;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.game-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.card-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.color-icon {
    gap: 8px;
}

.icon-circle {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

.icon-red {
    background: var(--accent-red);
}

.icon-yellow {
    background: var(--accent-yellow);
}

.icon-blue {
    background: var(--accent-blue);
}

.shape-icon {
    gap: 12px;
    flex-wrap: wrap;
}

.shape-icon-circle {
    width: 24px;
    height: 24px;
    background: var(--accent-blue);
    border-radius: 50%;
}

.shape-icon-triangle {
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-bottom: 20px solid var(--accent-yellow);
}

.shape-icon-square {
    width: 20px;
    height: 20px;
    background: var(--accent-purple);
}

.balloons-icon {
    gap: 8px;
    align-items: flex-start;
}

.balloon-icon {
    width: 28px;
    height: 36px;
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    position: relative;
}

.balloon-icon::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 12px;
    background: var(--text-color);
}

.balloon-1 {
    background: var(--accent-red);
}

.balloon-2 {
    background: var(--accent-yellow);
}

.balloon-3 {
    background: var(--accent-blue);
}

/* ===== 大小比較農場 icon ===== */
.size-icon {
    gap: 8px;
    align-items: flex-end;
    justify-content: center;
}

.size-icon-big {
    width: 36px;
    height: 36px;
    background: var(--accent-red);
    border-radius: 50%;
}

.size-icon-medium {
    width: 26px;
    height: 26px;
    background: var(--accent-yellow);
    border-radius: 50%;
}

.size-icon-small {
    width: 18px;
    height: 18px;
    background: var(--accent-blue);
    border-radius: 50%;
}

/* ===== 表情心情小臉 icon ===== */
.emotion-icon {
    gap: 10px;
    align-items: center;
}

.emotion-icon-circle {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.emotion-icon-circle.emotion-1 {
    background: linear-gradient(135deg, #ffd93d, #ffe066);
}

.emotion-icon-circle.emotion-1::after {
    content: '😊';
    font-size: 18px;
    position: absolute;
}

.emotion-icon-circle.emotion-2 {
    background: linear-gradient(135deg, #6bcf7f, #87d99a);
}

.emotion-icon-circle.emotion-2::after {
    content: '😢';
    font-size: 18px;
    position: absolute;
}

.emotion-icon-circle.emotion-3 {
    background: linear-gradient(135deg, #ff6b6b, #ff8787);
}

.emotion-icon-circle.emotion-3::after {
    content: '😠';
    font-size: 18px;
    position: absolute;
}

/* ===== 數字小火車 icon ===== */
.train-icon {
    gap: 6px;
    align-items: center;
    justify-content: center;
}

.train-icon-car {
    width: 22px;
    height: 28px;
    background: linear-gradient(135deg, #ffd93d, #ffe066);
    border: 2px solid #ff9800;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: white;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.2);
}

.card-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 12px;
    text-align: center;
}

.card-description {
    font-size: 16px;
    color: #666;
    margin-bottom: 8px;
    text-align: center;
}

.card-age {
    font-size: 14px;
    color: #999;
    margin-bottom: 20px;
    text-align: center;
}

.card-button {
    width: 100%;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, var(--primary-color), #ff8a95);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-button:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(255, 154, 158, 0.4);
}

.card-button:active {
    transform: scale(0.98);
}

/* ===== 遊戲畫面框架 ===== */
.game-view {
    min-height: 100vh;
    padding: 20px 0;
}

.game-view.hidden {
    display: none !important;
}

.game-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 0 20px;
}

.game-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding: 12px 20px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.back-button {
    padding: 10px 16px;
    font-size: 16px;
    color: var(--text-color);
    background: white;
    border: 2px solid #ddd;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.back-button:hover {
    background: #f5f5f5;
    border-color: var(--primary-color);
}

.game-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--primary-color);
    flex: 1;
    text-align: center;
    margin: 0;
}

/* ===== 遊戲介紹 ===== */
.game-intro {
    margin: 16px 0 24px 0;
    padding: 16px 20px;
    background: linear-gradient(135deg, #fff9f0, #ffe8e8);
    border-radius: 12px;
    border-left: 4px solid var(--primary-color);
}

.intro-text {
    font-size: 16px;
    color: #555;
    line-height: 1.6;
    text-align: center;
    margin: 0;
}

/* ===== 遊戲區域 ===== */
.game-area {
    background: white;
    border-radius: 20px;
    padding: 24px;
    box-shadow: var(--shadow);
    min-height: 500px;
    max-width: 600px;
    margin: 0 auto;
}

/* ===== 顏色小怪獸遊戲 ===== */
.color-game-area {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.houses-container {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 20px;
    padding: 20px 0;
}

.color-house {
    width: 120px;
    height: 140px;
    position: relative;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    transition: transform 0.3s ease;
}

.color-house.highlight {
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.8);
}

.color-red {
    background: linear-gradient(135deg, #ff6b6b, #ff8787);
}

.color-yellow {
    background: linear-gradient(135deg, #ffd93d, #ffe066);
}

.color-blue {
    background: linear-gradient(135deg, #6bcf7f, #87d99a);
}

.house-roof {
    width: 0;
    height: 0;
    border-left: 40px solid transparent;
    border-right: 40px solid transparent;
    border-bottom: 30px solid rgba(0, 0, 0, 0.2);
    margin-bottom: -5px;
}

.house-body {
    width: 100%;
    height: 100px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 0 0 12px 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.house-door {
    width: 30px;
    height: 40px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px 4px 0 0;
}

.monsters-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    padding: 20px;
    min-height: 200px;
    position: relative;
}

.monster {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    position: absolute;
    cursor: grab;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.monster:active {
    cursor: grabbing;
}

.monster.dragging {
    transform: scale(1.2);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    opacity: 0.9;
}

.monster.placed {
    cursor: default;
    transform: scale(1);
}

.monster.error {
    animation: shake 0.5s;
}

.monster.correct {
    animation: celebrate 0.6s;
}

.monster-red {
    background: linear-gradient(135deg, #ff6b6b, #ff8787);
}

.monster-yellow {
    background: linear-gradient(135deg, #ffd93d, #ffe066);
}

.monster-blue {
    background: linear-gradient(135deg, #6bcf7f, #87d99a);
}

.monster-eye {
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    margin: 4px;
    position: relative;
}

.monster-eye::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    background: black;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.monster-mouth {
    width: 24px;
    height: 12px;
    border: 3px solid white;
    border-top: none;
    border-radius: 0 0 24px 24px;
    margin-top: 4px;
}

/* ===== 形狀配對屋遊戲 ===== */
.shape-game-area {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.shape-houses-container {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 20px;
    padding: 20px 0;
}

.shape-house {
    width: 140px;
    height: 160px;
    background: white;
    border: 4px solid #ddd;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.3s ease;
}

.shape-house.highlight {
    border-color: var(--accent-blue);
    background: #f0f9ff;
    transform: scale(1.05);
}

.shape-circle .shape-house-shape {
    width: 80px;
    height: 80px;
    background: #e3f2fd;
    border: 4px solid #2196f3;
    border-radius: 50%;
}

.shape-triangle .shape-house-shape {
    width: 0;
    height: 0;
    border-left: 40px solid transparent;
    border-right: 40px solid transparent;
    border-bottom: 70px solid #fff3e0;
    border-bottom-color: #ff9800;
}

.shape-square .shape-house-shape {
    width: 70px;
    height: 70px;
    background: #f3e5f5;
    border: 4px solid #9c27b0;
}

.shape-house-label {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
}

.shape-cards-container {
    position: relative;
    padding: 20px;
    min-height: 350px;
    width: 100%;
    background: #fafafa;
    border-radius: 12px;
    margin-top: 20px;
    overflow: visible;
    display: block !important;
    visibility: visible !important;
}

.shape-card {
    width: 90px;
    height: 90px;
    background: white;
    border: 3px solid #ddd;
    border-radius: 12px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    cursor: grab;
    position: absolute !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    z-index: 100;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

.shape-card:active {
    cursor: grabbing;
}

.shape-card.dragging {
    transform: scale(1.15);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    opacity: 0.9;
}

.shape-card.placed {
    cursor: default;
    transform: scale(1);
}

.shape-card.error {
    animation: shake 0.5s;
}

.shape-card.correct {
    animation: celebrate 0.6s;
}

.shape-card-circle {
    width: 50px;
    height: 50px;
    background: #ff6b6b;
    border-radius: 50%;
}

.shape-card-triangle {
    width: 0;
    height: 0;
    border-left: 25px solid transparent;
    border-right: 25px solid transparent;
    border-bottom: 45px solid #ffd93d;
}

.shape-card-square {
    width: 45px;
    height: 45px;
    background: #6bcf7f;
}

/* ===== 數數氣球遊戲 ===== */
.balloons-game-area {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.balloons-instruction {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, #ffe8e8, #fff4e8);
    border-radius: 12px;
}

.instruction-text {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 12px;
}

.instruction-text span {
    color: var(--primary-color);
    font-size: 28px;
}

.progress-text {
    font-size: 18px;
    color: #666;
}

.progress-text span {
    color: var(--accent-blue);
    font-weight: 600;
    font-size: 24px;
}

.balloons-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    padding: 20px;
    min-height: 300px;
    align-content: flex-start;
}

.balloon {
    width: 60px;
    height: 80px;
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    position: relative;
    cursor: pointer;
    transition: transform 0.2s ease;
    animation: float 3s ease-in-out infinite;
}

.balloon:nth-child(odd) {
    animation-delay: 0s;
}

.balloon:nth-child(even) {
    animation-delay: 1.5s;
}

.balloon:hover {
    transform: scale(1.1);
}

.balloon.clicked {
    animation: pop 0.5s ease-out forwards;
}

.balloon::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 20px;
    background: var(--text-color);
    opacity: 0.3;
}

/* ===== 完成彈窗 ===== */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.overlay.hidden {
    display: none !important;
}

.overlay-content {
    background: white;
    border-radius: 24px;
    padding: 40px 32px;
    text-align: center;
    max-width: 90%;
    width: 400px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: popIn 0.4s ease;
}

.success-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.success-popup {
    background: white;
    border-radius: 24px;
    padding: 40px 32px;
    text-align: center;
    max-width: 90%;
    width: 400px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: popIn 0.4s ease;
}

.success-icon {
    font-size: 64px;
    margin-bottom: 16px;
    animation: bounce 0.6s ease;
}

.success-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 12px;
}

.success-message {
    font-size: 20px;
    color: var(--text-color);
    margin-bottom: 8px;
}

.success-subtitle {
    font-size: 16px;
    color: #666;
    margin-bottom: 24px;
}

.success-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.success-button {
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.success-button.primary {
    background: linear-gradient(135deg, var(--primary-color), #ff8a95);
    color: white;
}

.success-button.secondary {
    background: white;
    color: var(--text-color);
    border: 2px solid #ddd;
}

.success-button:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.success-button:active {
    transform: scale(0.98);
}

/* ===== 動畫效果 ===== */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px) rotate(-5deg); }
    75% { transform: translateX(10px) rotate(5deg); }
}

@keyframes celebrate {
    0% { transform: scale(1); }
    50% { transform: scale(1.3) rotate(5deg); }
    100% { transform: scale(1); }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
}

@keyframes pop {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.5);
        opacity: 0.8;
    }
    100% {
        transform: scale(0);
        opacity: 0;
    }
}

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

@keyframes popIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

/* ===== 大小比較農場遊戲 ===== */
.size-farm-area {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.size-question {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, #ffe8e8, #fff4e8);
    border-radius: 12px;
}

.question-text {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 12px;
}

.question-progress {
    font-size: 16px;
    color: #666;
}

.size-items-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    padding: 20px;
    min-height: 200px;
}

.size-item {
    width: 120px;
    height: 140px;
    background: white;
    border: 3px solid #ddd;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.size-item:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.size-item.correct {
    border-color: var(--accent-blue);
    background: #e8f5e9;
    animation: celebrate 0.6s;
}

.size-item.error {
    border-color: var(--accent-red);
    animation: shake 0.5s;
}

.size-item.highlight {
    border-color: var(--accent-blue);
    background: #e3f2fd;
    transform: scale(1.1);
    box-shadow: 0 8px 16px rgba(33, 150, 243, 0.3);
}

.size-item-emoji {
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* 大項目：emoji 更大（120px） */
.size-emoji-big {
    font-size: 120px;
}

.size-item.size-item-big .size-item-emoji {
    font-size: 120px;
    min-height: 120px;
}

/* 小項目：emoji 更小（60px） */
.size-emoji-small {
    font-size: 60px;
}

.size-item.size-item-small .size-item-emoji {
    font-size: 60px;
    min-height: 60px;
}

.size-item-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
}

.size-feedback {
    text-align: center;
    padding: 16px;
    font-size: 20px;
    font-weight: 600;
    border-radius: 12px;
    display: none;
}

.size-feedback.correct {
    background: #e8f5e9;
    color: #2e7d32;
}

.size-feedback.error {
    background: #ffebee;
    color: #c62828;
}

/* ===== 表情心情小臉遊戲 ===== */
.emotion-game-area {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.emotion-question {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, #ffe8e8, #fff4e8);
    border-radius: 12px;
}

.emotion-face-display {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 30px;
    min-height: 200px;
}

.emotion-face-large {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 6px solid;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.emotion-face-emoji {
    font-size: 80px;
}

.emotion-options {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    padding: 20px;
}

.emotion-option {
    min-width: 100px;
    padding: 16px 24px;
    background: white;
    border: 3px solid #ddd;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.emotion-option:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.emotion-option.correct {
    border-color: var(--accent-blue);
    background: #e8f5e9;
    animation: celebrate 0.6s;
}

.emotion-option.error {
    border-color: var(--accent-red);
    animation: shake 0.5s;
}

.emotion-option.highlight {
    border-color: var(--accent-blue);
    background: #e3f2fd;
    transform: scale(1.1);
    box-shadow: 0 8px 16px rgba(33, 150, 243, 0.3);
}

.emotion-feedback {
    text-align: center;
    padding: 16px;
    font-size: 20px;
    font-weight: 600;
    border-radius: 12px;
    display: none;
}

.emotion-feedback.correct {
    background: #e8f5e9;
    color: #2e7d32;
}

.emotion-feedback.error {
    background: #ffebee;
    color: #c62828;
}

/* ===== 數字小火車遊戲 ===== */
.sequence-train-area {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.train-instruction {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, #ffe8e8, #fff4e8);
    border-radius: 12px;
}

.train-track {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 30px 20px;
    background: #f5f5f5;
    border-radius: 12px;
    min-height: 120px;
    flex-wrap: wrap;
}

.train-slot {
    width: 80px;
    height: 100px;
    background: white;
    border: 3px dashed #ddd;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.3s ease;
}

.train-slot:not(:last-child)::after {
    content: '→';
    position: absolute;
    right: -15px;
    font-size: 24px;
    color: #999;
}

.train-slot.highlight {
    border-color: var(--accent-blue);
    background: #e3f2fd;
    transform: scale(1.05);
}

.train-cars-container {
    position: relative;
    padding: 20px;
    min-height: 200px;
    width: 100%;
    background: #fafafa;
    border-radius: 12px;
}

.train-car {
    width: 60px;
    height: 80px;
    background: linear-gradient(135deg, #ffd93d, #ffe066);
    border: 3px solid #ff9800;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    position: absolute;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    z-index: 100;
}

.train-car:active {
    cursor: grabbing;
}

.train-car.dragging {
    transform: scale(1.2);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    opacity: 0.9;
}

.train-car.placed {
    cursor: grab !important;
    transform: scale(1);
    pointer-events: auto !important;
}

.train-car.error {
    animation: shake 0.5s;
}

.train-car.correct {
    animation: celebrate 0.6s;
}

.train-car-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.train-car-number {
    font-size: 32px;
    font-weight: 700;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* ===== 響應式設計 ===== */
@media (max-width: 768px) {
    .container {
        padding: 16px;
    }
    
    .main-title {
        font-size: 28px;
    }
    
    .subtitle {
        font-size: 16px;
    }
    
    .game-card {
        padding: 20px;
    }
    
    .card-title {
        font-size: 22px;
    }
    
    .houses-container {
        gap: 15px;
    }
    
    .color-house {
        width: 100px;
        height: 120px;
    }
    
    .shape-house {
        width: 120px;
        height: 140px;
    }
    
    .monster {
        width: 70px;
        height: 70px;
    }
    
    .shape-card {
        width: 80px;
        height: 80px;
    }
    
    .success-popup {
        padding: 32px 24px;
        width: 90%;
    }
    
    .game-header {
        flex-direction: column;
        gap: 12px;
    }
    
    .back-button {
        align-self: flex-start;
    }
}

@media (max-width: 480px) {
    .main-title {
        font-size: 24px;
    }
    
    .game-title {
        font-size: 20px;
    }
    
    .instruction-text {
        font-size: 18px;
    }
    
    .instruction-text span {
        font-size: 24px;
    }
}
