/* ===== 预习小游戏：英语岛探险（触屏优先，平板/学习机） ===== */
#yuxi-game-panel { -webkit-tap-highlight-color: transparent; }

.yg-btn {
    border: none; border-radius: 14px; padding: 14px 24px;
    font-size: 17px; font-family: inherit; font-weight: bold;
    cursor: pointer; transition: transform 0.1s, box-shadow 0.2s, filter 0.2s;
    touch-action: manipulation; user-select: none; -webkit-user-select: none;
}
.yg-btn:active { transform: scale(0.94); }
.yg-btn-primary { background: linear-gradient(135deg, #4A90E2, #7AB8FF); color: #fff; box-shadow: 0 4px 0 #357ABD; }
.yg-btn-success { background: linear-gradient(135deg, #52C41A, #95DE64); color: #fff; box-shadow: 0 4px 0 #389E0D; }
.yg-btn-ghost { background: #fff; color: #4A90E2; border: 2px solid #BBD7F5; }
.yg-btn-big { width: 100%; padding: 18px; font-size: 19px; border-radius: 18px; margin-top: 10px; }

/* ===== 开始页 ===== */
.yg-intro { text-align: center; padding: 10px 0; }
.yg-intro h2 { color: #4A90E2; font-size: 24px; margin-bottom: 6px; }
.yg-intro .yg-sub { color: #8C8C8C; margin-bottom: 20px; }
.yg-game-lineup { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-bottom: 22px; }
/* 选游戏测试网格 */
.yg-picker-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 540px; margin: 0 auto 22px; }
.yg-picker-card {
    background: #F0F8FF; border: 2px solid #BBD7F5; border-radius: 16px;
    padding: 18px 10px; cursor: pointer; font-family: inherit;
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    transition: transform 0.12s, box-shadow 0.2s; touch-action: manipulation;
}
.yg-picker-card:active { transform: scale(0.95); }
.yg-picker-card:hover { box-shadow: 0 4px 12px rgba(74,144,226,0.25); }
.yg-picker-card .yg-chip-icon { font-size: 34px; }
.yg-picker-card .yg-chip-name { font-size: 13px; font-weight: bold; color: #262626; line-height: 1.3; text-align: center; }
@media (max-width: 600px) {
    .yg-picker-grid { grid-template-columns: repeat(2, 1fr); }
}
.yg-game-chip {
    background: #F0F8FF; border: 2px solid #BBD7F5; border-radius: 16px;
    padding: 16px 14px; width: 30%; min-width: 120px;
}
.yg-game-chip .yg-chip-icon { font-size: 34px; display: block; margin-bottom: 6px; }
.yg-game-chip .yg-chip-name { font-size: 14px; font-weight: bold; color: #262626; }
.yg-fox-intro { font-size: 54px; animation: yg-float 2.2s ease-in-out infinite; }

/* ===== 顶部 HUD ===== */
#yg-hud { margin-bottom: 12px; }
.yg-hud-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.yg-game-tag { font-weight: bold; color: #4A90E2; font-size: 16px; }
.yg-progress-text { color: #8C8C8C; font-size: 14px; }
.yg-combo {
    font-weight: bold; font-size: 16px; color: #FA8C16;
    opacity: 0; transform: scale(0.6); transition: all 0.2s;
}
.yg-combo.show { opacity: 1; transform: scale(1); animation: yg-pop 0.3s; }
.yg-energy-track {
    height: 12px; background: #E8F2FD; border-radius: 8px; overflow: hidden;
}
.yg-energy-fill {
    height: 100%; width: 0%;
    background: linear-gradient(90deg, #FFD666, #FF9C2E);
    border-radius: 8px; transition: width 0.35s ease;
}

/* ===== 狐狸伙伴 ===== */
.yg-fox-row { display: flex; align-items: center; gap: 10px; min-height: 52px; margin-bottom: 14px; }
.yg-fox { font-size: 40px; line-height: 1; transition: transform 0.2s; }
.yg-fox.happy { animation: yg-jump 0.5s; }
.yg-fox.sad { animation: yg-shake 0.4s; }
.yg-bubble {
    background: #fff; border: 2px solid #BBD7F5; border-radius: 14px;
    padding: 8px 14px; font-size: 15px; color: #262626; position: relative;
}
.yg-bubble::before {
    content: ''; position: absolute; left: -8px; top: 16px;
    border: 6px solid transparent; border-right-color: #BBD7F5;
}

/* ===== 题目区通用 ===== */
#yg-stage { min-height: 260px; }
.yg-question-text {
    text-align: center; font-size: 19px; line-height: 1.7; color: #262626;
    margin: 10px 0 18px;
}
.yg-speak-big {
    display: block; margin: 0 auto 16px;
    width: 86px; height: 86px; border-radius: 50%; border: none;
    background: linear-gradient(135deg, #4A90E2, #7AB8FF);
    font-size: 38px; cursor: pointer; color: #fff;
    box-shadow: 0 5px 0 #357ABD; transition: transform 0.1s;
}
.yg-speak-big:active { transform: scale(0.92); }
.yg-speak-small {
    border: none; background: #E6F3FF; border-radius: 10px;
    padding: 6px 12px; font-size: 16px; cursor: pointer; margin-bottom: 10px;
}

.yg-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.yg-opt {
    min-height: 64px; padding: 12px 16px; border-radius: 16px;
    border: 2.5px solid #D6E8FB; background: #fff;
    font-size: 18px; font-family: inherit; color: #262626;
    cursor: pointer; line-height: 1.4; transition: all 0.15s;
    display: flex; align-items: center; justify-content: center; text-align: center;
}
.yg-opt:active { transform: scale(0.96); }
.yg-opt.correct { background: #F6FFED; border-color: #52C41A; color: #389E0D; font-weight: bold; animation: yg-pop 0.3s; }
.yg-opt.wrong { background: #FFF1F0; border-color: #FF4D4F; color: #CF1322; animation: yg-shake 0.4s; }
.yg-opt.locked { pointer-events: none; opacity: 0.75; }
.yg-blank {
    display: inline-block; min-width: 90px;
    border-bottom: 3px solid #4A90E2; text-align: center;
    color: #4A90E2; font-weight: bold; padding: 0 8px;
}

/* ===== 句子排序 ===== */
.yg-chip-zone {
    display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
    min-height: 58px; padding: 12px; border-radius: 14px; margin-bottom: 10px;
}
.yg-answer-zone { background: #EAF4FF; border: 2px dashed #7AB8FF; }
.yg-word-bank { background: #FAFAFA; border: 2px solid #EEEEEE; }
.yg-word {
    border: none; border-radius: 12px; padding: 10px 16px;
    font-size: 17px; font-family: inherit; cursor: pointer;
    background: #fff; color: #262626; box-shadow: 0 2px 6px rgba(0,0,0,0.12);
    transition: transform 0.1s;
}
.yg-word:active { transform: scale(0.93); }
.yg-word.used { visibility: hidden; }
.yg-word.in-answer { background: #4A90E2; color: #fff; visibility: visible; }
.yg-answer-zone .yg-word.bad { background: #FF4D4F; }
.yg-answer-zone .yg-word.good { background: #52C41A; }
.yg-check-row { display: flex; gap: 10px; justify-content: center; margin-top: 6px; }
.yg-check-row .yg-btn { padding: 10px 22px; font-size: 16px; }

/* ===== 连连看 ===== */
.yg-match-board { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.yg-match-col { display: flex; flex-direction: column; gap: 10px; }
.yg-match-btn {
    min-height: 56px; border-radius: 14px; border: 2.5px solid #D6E8FB;
    background: #fff; padding: 10px 12px; font-size: 17px; font-family: inherit;
    cursor: pointer; color: #262626; transition: all 0.15s;
}
.yg-match-btn.en { font-weight: bold; color: #4A90E2; }
.yg-match-btn.selected { border-color: #FA8C16; background: #FFF7E6; transform: scale(1.03); }
.yg-match-btn.paired { background: #F6FFED; border-color: #52C41A; color: #389E0D; pointer-events: none; animation: yg-pop 0.3s; }
.yg-match-btn.shake { animation: yg-shake 0.4s; border-color: #FF4D4F; }

/* ===== 关卡过渡 / 结算 ===== */
.yg-mid, .yg-result { text-align: center; padding: 20px 0; }
.yg-mid-icon, .yg-result-icon { font-size: 64px; animation: yg-jump 0.6s; }
.yg-mid h2, .yg-result h2 { color: #4A90E2; margin: 10px 0; }
.yg-stars { font-size: 46px; letter-spacing: 8px; margin: 14px 0; }
.yg-stars .star { display: inline-block; opacity: 0.25; transform: scale(0.7); }
.yg-stars .star.on { opacity: 1; transform: scale(1); animation: yg-star-in 0.5s backwards; }
.yg-stars .star.on:nth-child(1) { animation-delay: 0.15s; }
.yg-stars .star.on:nth-child(2) { animation-delay: 0.45s; }
.yg-stars .star.on:nth-child(3) { animation-delay: 0.75s; }
.yg-breakdown { color: #595959; font-size: 15px; line-height: 2; margin-bottom: 16px; }

/* 撒花 */
.yg-confetti { position: absolute; width: 10px; height: 14px; top: -20px; border-radius: 2px;
    animation: yg-fall linear forwards; pointer-events: none; }
#yg-result { position: relative; overflow: hidden; }

/* ===== 动画 ===== */
@keyframes yg-pop { 0% { transform: scale(0.8); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes yg-shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-7px); } 75% { transform: translateX(7px); } }
@keyframes yg-jump { 0%,100% { transform: translateY(0); } 40% { transform: translateY(-18px) scale(1.05); } }
@keyframes yg-float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes yg-star-in { 0% { transform: scale(0) rotate(-40deg); opacity: 0; } 70% { transform: scale(1.35) rotate(10deg); } 100% { transform: scale(1); opacity: 1; } }
@keyframes yg-fall {
    0% { transform: translateY(0) rotate(0); opacity: 1; }
    100% { transform: translateY(520px) rotate(720deg); opacity: 0.9; }
}

@media (max-width: 600px) {
    .yg-opts { grid-template-columns: 1fr; }
    .yg-game-chip { width: 100%; }
    .yg-question-text { font-size: 17px; }
    .yg-match-btn, .yg-opt { min-height: 54px; font-size: 16px; }
}

/* ===== 🎈 气球射手 ===== */
.yg-balloon-field { position: relative; height: 360px; overflow: hidden; background: linear-gradient(180deg, #E6F3FF 0%, #F0F8FF 100%); border-radius: 14px; }
.yg-balloon { position: absolute; bottom: -120px; animation: yg-rise linear forwards; cursor: pointer; user-select: none; -webkit-user-select: none; }
.yg-balloon-body {
    width: 96px; height: 116px; border-radius: 50% 50% 50% 50% / 55% 55% 45% 45%;
    display: flex; align-items: center; justify-content: center;
    box-shadow: inset -8px -8px 0 rgba(0,0,0,0.12);
    padding: 4px; box-sizing: border-box;
}
.yg-balloon-word {
    color: #fff; font-weight: bold; font-size: 15px;
    text-align: center; padding: 0 2px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.4);
    line-height: 1.15; word-break: break-word; overflow-wrap: anywhere;
}
.yg-balloon-string { width: 2px; height: 28px; background: rgba(0,0,0,0.35); margin: 0 auto; }
.yg-balloon-pop .yg-balloon-body { animation: yg-pop 0.4s; }
.yg-balloon-pop { animation: yg-fade-out 0.5s forwards; }
.yg-balloon-miss .yg-balloon-body { animation: yg-shake 0.4s; }
@keyframes yg-rise { from { transform: translateY(0); } to { transform: translateY(-500px); } }
@keyframes yg-fade-out { to { opacity: 0; transform: scale(1.4); } }

/* ===== 🏃 单词跑酷 ===== */
.yg-parkour-track { position: relative; height: 280px; overflow: hidden; background: linear-gradient(180deg, #B5EAD7 0%, #B5EAD7 65%, #7FC8A9 65%, #7FC8A9 100%); border-radius: 12px; }
.yg-parkour-scenery {
    position: absolute; top: 6%; left: 0; right: 0; height: 8px;
    background: repeating-linear-gradient(90deg, transparent 0, transparent 60px, #fff 60px, #fff 64px);
    animation: yg-scroll-bg 0.6s linear infinite;
}
@keyframes yg-scroll-bg { from { background-position: 0 0; } to { background-position: -60px 0; } }
.yg-parkour-lanes { position: absolute; bottom: 0; left: 0; right: 0; height: 35%; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 2px; }
.yg-parkour-lane {
    background: rgba(255,255,255,0.9); border: 2px solid #7AB8FF; border-bottom: none;
    display: flex; align-items: center; justify-content: center; cursor: pointer;
    font-family: inherit; transition: transform 0.1s;
}
.yg-parkour-lane:active { transform: scale(0.96); }
.yg-parkour-sign { font-weight: bold; color: #4A90E2; font-size: 15px; padding: 4px; }
.yg-parkour-runner {
    position: absolute; bottom: 36%; left: 16%; font-size: 36px;
    transition: left 0.5s ease; animation: yg-bob 0.3s ease-in-out infinite alternate;
}
@keyframes yg-bob { from { transform: translateY(0); } to { transform: translateY(-4px); } }
.yg-runner-jump { animation: yg-jump 0.5s; }
.yg-runner-bump { animation: yg-shake 0.4s; }
.yg-parkour-timer { position: absolute; top: 8px; right: 12px; background: rgba(0,0,0,0.6); color: #fff; padding: 4px 10px; border-radius: 10px; font-size: 14px; font-weight: bold; }

/* ===== 🗺️ 单词迷宫 ===== */
.yg-maze-board { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; width: 260px; height: 260px; margin: 0 auto 16px; background: #FAFAFA; border: 3px solid #595959; }
.yg-maze-cell {
    border: 0 solid #595959; background: #FAFAFA; font-size: 22px;
    display: flex; align-items: center; justify-content: center;
}
.yg-maze-cell.yg-wall-e { border-right-width: 3px; }
.yg-maze-cell.yg-wall-s { border-bottom-width: 3px; }
.yg-maze-cell.yg-wall-n { border-top-width: 3px; }
.yg-maze-cell.yg-wall-w { border-left-width: 3px; }
.yg-maze-ctrls { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.yg-maze-row { display: flex; gap: 6px; }
.yg-maze-btn { width: 56px; height: 56px; border-radius: 12px; border: 2px solid #BBD7F5; background: #fff; font-size: 22px; cursor: pointer; transition: transform 0.1s; touch-action: manipulation; }
.yg-maze-btn:active { transform: scale(0.92); }

/* ===== 🏰 塔防单词 ===== */
.yg-tower-field { position: relative; height: 300px; background: linear-gradient(180deg, #FFE5B4 0%, #FFE5B4 75%, #C7F464 75%, #C7F464 100%); border-radius: 14px; padding: 10px; overflow: hidden; }
.yg-tower-path { position: absolute; top: 60px; left: 6%; right: 6%; height: 4px; background: #8B5A2B; border-radius: 2px; }
.yg-tower-castle { position: absolute; right: 4%; top: 36px; font-size: 28px; }
.yg-tower-monster {
    position: absolute; top: 24px; left: 4%;
    display: flex; flex-direction: column; align-items: center;
    transition: transform 5s linear;
}
.yg-monster-emoji { font-size: 30px; }
.yg-monster-word { background: #fff; padding: 2px 8px; border-radius: 6px; font-size: 13px; color: #CF1322; font-weight: bold; margin-bottom: 2px; box-shadow: 0 2px 4px rgba(0,0,0,0.15); }
.yg-monster-hit { animation: yg-pop 0.5s; opacity: 0; transition: opacity 0.5s, transform 0.5s; }
.yg-monster-escape { opacity: 0.5; }
.yg-tower-row { position: absolute; bottom: 8px; left: 0; right: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 0 10px; }
.yg-tower {
    background: #fff; border: 2px solid #BBD7F5; border-radius: 10px; padding: 6px 4px;
    display: flex; flex-direction: column; align-items: center; cursor: pointer;
    font-family: inherit; transition: transform 0.1s;
}
.yg-tower:active { transform: scale(0.93); }
.yg-tower-emoji { font-size: 22px; }
.yg-tower-zh { font-size: 11px; color: #262626; margin-top: 2px; line-height: 1.2; text-align: center; }
.yg-tower-correct { background: #F6FFED; border-color: #52C41A; animation: yg-pop 0.3s; }
.yg-tower-miss { background: #FFF1F0; border-color: #FF4D4F; animation: yg-shake 0.4s; }
.yg-tower-timer { position: absolute; top: 8px; right: 12px; background: rgba(0,0,0,0.6); color: #fff; padding: 4px 10px; border-radius: 10px; font-size: 14px; font-weight: bold; }

/* ===== 🧩 词义三消 ===== */
.yg-match3-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; max-width: 340px; margin: 0 auto; background: #F0F0F0; padding: 6px; border-radius: 10px; }
.yg-m3-tile {
    aspect-ratio: 1; border: none; border-radius: 8px;
    font-size: 12px; font-family: inherit; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: transform 0.15s; padding: 2px; text-align: center;
    line-height: 1.1; word-break: break-word;
}
.yg-m3-tile:active { transform: scale(0.93); }
.yg-m3-en { background: #E6F3FF; color: #4A90E2; font-weight: bold; }
.yg-m3-zh { background: #FFF7E6; color: #FA8C16; font-weight: 500; }
.yg-m3-empty { background: rgba(0,0,0,0.05); }
.yg-m3-sel { outline: 3px solid #FA8C16; transform: scale(1.05); }
