/* 语文闯关 · 清爽游戏风 */

:root {
  --ink: #1C2B36;
  --muted: #5E7383;
  --line: rgba(28, 43, 54, .08);
  --surface: #FFFFFF;
  --sky: #7EB8D4;
  --meadow: #8FBF9B;
  --deep: #1F5C6B;
  --deep-2: #2A7A8C;
  --gold: #E2A63A;
  --gold-soft: #FFF4DD;
  --ok: #3B9B6E;
  --lock: #D5DEE5;
  --soft: #F3F7F9;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', -apple-system, sans-serif;
}

* { box-sizing: border-box; }
button { font-family: inherit; }

body {
  margin: 0;
  background: #6FA3B8;
  font-family: var(--font);
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}

.yg5-app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  height: 100dvh;
  background:
    radial-gradient(ellipse 90% 50% at 80% -10%, rgba(255, 255, 255, .45), transparent 55%),
    linear-gradient(165deg, #9BC8DC 0%, #A8D0C4 42%, #B7D6B0 100%);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.yg5-screen { display: none !important; flex-direction: column; height: 100%; min-height: 0; overflow: hidden; }
.yg5-screen.on { display: flex !important; }
#scQuiz, #scResult { overflow-y: auto; }

/* HUD */
.yg5-hud {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px 10px;
  padding-top: calc(12px + env(safe-area-inset-top, 0px));
  background: rgba(255,255,255,.55);
  border-bottom: 1px solid rgba(255,255,255,.35);
  backdrop-filter: blur(12px);
  flex-shrink: 0;
}
.yg5-hud.compact {
  background: rgba(255,255,255,.82);
  border-bottom: 1px solid var(--line);
}
.yg5-hud.compact p {
  margin: 2px 0 0;
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
}
.yg5-avatar {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: linear-gradient(145deg, #FFE4B0, #F5C56B);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(214, 154, 48, .25);
}
.yg5-hud-mid { flex: 1; min-width: 0; }
.yg5-title-row {
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: .02em;
}
.yg5-energy {
  display: flex; align-items: center; gap: 8px;
  margin-top: 5px;
}
.yg5-energy-bar {
  flex: 1; height: 7px;
  background: rgba(31, 92, 107, .14);
  border-radius: 99px;
  overflow: hidden;
}
.yg5-energy-bar > i {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, #2A7A8C, #3B9B6E);
  border-radius: 99px;
  transition: width .35s ease;
}
.yg5-energy span {
  font-size: 11px;
  font-weight: 700;
  color: var(--deep);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.yg5-res { display: flex; gap: 6px; }
.yg5-coin {
  display: flex; align-items: center; gap: 3px;
  background: rgba(255,255,255,.85);
  border-radius: 999px;
  padding: 4px 8px 4px 6px;
  box-shadow: 0 2px 8px rgba(28, 43, 54, .06);
}
.yg5-coin span { font-size: 12px; }
.yg5-coin b { color: var(--ink); font-size: 12px; font-weight: 800; }
.yg5-coin.fire { background: #FFF0EC; }

/* Map */
.yg5-map {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 14px 12px;
  padding-bottom: calc(12px + var(--safe-b));
  scrollbar-width: none;
}
.yg5-map::-webkit-scrollbar { width: 0; height: 0; }
.yg5-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 14px 24px;
  padding-bottom: calc(24px + var(--safe-b));
}

.yg5-quest {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, #1F5C6B 0%, #2A7A8C 100%);
  border-radius: 18px;
  padding: 14px 14px 14px 16px;
  box-shadow: 0 10px 24px rgba(31, 92, 107, .28);
  margin-bottom: 10px;
  color: #fff;
}
.yg5-quest-copy { flex: 1; min-width: 0; }
.yg5-quest-copy em {
  display: block;
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
  color: rgba(255,255,255,.7);
  letter-spacing: .08em;
}
.yg5-quest-copy strong {
  display: block;
  font-size: 18px;
  font-weight: 800;
  margin: 3px 0 4px;
}
.yg5-status { font-size: 12px; font-weight: 700; }
.yg5-status.ok,
.yg5-status.wait,
.yg5-status.bad { color: rgba(255,255,255,.85); }

.yg5-play {
  width: 56px; height: 56px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: var(--deep);
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0,0,0,.12);
}
.yg5-play:active { transform: scale(.96); }

.yg5-continue {
  width: 100%;
  margin-bottom: 12px;
  border: 0;
  background: rgba(255,255,255,.55);
  color: var(--deep);
  font-weight: 700;
  font-size: 13px;
  padding: 10px;
  border-radius: 12px;
  cursor: pointer;
}
.yg5-continue:active { background: rgba(255,255,255,.8); }

/* World cards */
.yg5-world {
  background: #FFFFFF;
  border-radius: 16px;
  padding: 10px 10px 12px;
  margin-bottom: 10px;
  box-shadow: 0 8px 22px rgba(28, 43, 54, .1);
}
.yg5-world-flag {
  display: flex; align-items: center; gap: 8px;
  background: transparent;
  color: var(--ink);
  border-radius: 0;
  padding: 2px 4px 8px;
  border: 0;
  margin-bottom: 0;
}
.yg5-world-flag.boss { background: transparent; }
.yg5-world-no {
  font-size: 10px;
  font-weight: 800;
  background: rgba(31, 92, 107, .1);
  color: var(--deep);
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.yg5-world-flag.boss .yg5-world-no {
  background: rgba(226, 166, 58, .18);
  color: #A8761C;
}
.yg5-world-flag h3 { margin: 0; flex: 1; font-size: 13px; font-weight: 800; }
.yg5-world-flag b { font-size: 11px; color: var(--muted); font-weight: 700; }

.yg5-path {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.yg5-node-wrap { min-width: 0; }

.yg5-node {
  width: 100%;
  min-height: 52px;
  border: 1px solid #E6EEF2;
  border-radius: 14px;
  background: #F7FAFC;
  color: var(--ink);
  cursor: pointer;
  position: relative;
  margin: 0;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
  box-shadow: none;
}
.yg5-node.done {
  background: #EAF7F0;
  border-color: #C9E8D6;
}
.yg5-node.current {
  background: linear-gradient(135deg, #F6D28A, #E2A63A);
  border-color: transparent;
  box-shadow: 0 6px 14px rgba(226, 166, 58, .28);
}
.yg5-node.resume {
  border-color: #2A7A8C;
  box-shadow: 0 0 0 1px rgba(42, 122, 140, .25);
}
.yg5-node-resume {
  position: absolute;
  top: 4px;
  right: 6px;
  font-size: 10px;
  line-height: 1;
  padding: 3px 5px;
  border-radius: 6px;
  background: var(--deep);
  color: #fff;
  font-weight: 700;
}
.yg5-node.lock {
  background: #F1F4F7;
  border-color: #E2E8EE;
  cursor: not-allowed;
  opacity: 1;
}
.yg5-node:not(.lock):active { transform: scale(.98); }
.yg5-node-shine { display: none; }
.yg5-node-core {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--deep-2);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 28px;
  text-align: center;
  flex-shrink: 0;
}
.yg5-node.current .yg5-node-core { background: rgba(255,255,255,.35); color: #7A5200; }
.yg5-node.done .yg5-node-core { background: var(--ok); }
.yg5-node.lock .yg5-node-core {
  background: #E4EAF0;
  color: transparent;
  position: relative;
}
.yg5-node.lock .yg5-node-core::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 5px;
  width: 9px;
  height: 7px;
  margin-left: -4.5px;
  border: 2px solid #6B7C8A;
  border-bottom: 0;
  border-radius: 5px 5px 0 0;
  box-sizing: border-box;
}
.yg5-node.lock .yg5-node-core::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 11px;
  width: 12px;
  height: 9px;
  margin-left: -6px;
  background:
    radial-gradient(circle at 50% 32%, #E4EAF0 1.4px, transparent 1.5px),
    linear-gradient(#E4EAF0, #E4EAF0) 50% 62% / 1.5px 3px no-repeat,
    #6B7C8A;
  border-radius: 2.5px;
  box-shadow: 0 1px 0 rgba(28, 43, 54, .12);
}
.yg5-node-stars {
  margin: 0;
  font-size: 9px;
  color: var(--gold);
  font-weight: 700;
  letter-spacing: -1px;
  line-height: 1;
  min-height: 0;
}
.yg5-node.current .yg5-node-stars { color: #7A5200; }
.yg5-node-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.yg5-node.current .yg5-node-name { color: #5C3D00; }
.yg5-node.lock .yg5-node-name { color: var(--muted); }
.yg5-node-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* Dock — 随页面滚动，不固定底部 */
.yg5-dock {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
  padding: 0;
  background: transparent;
  border: 0;
  backdrop-filter: none;
}
.yg5-dock-btn {
  border: 0;
  background: #FFFFFF;
  border-radius: 14px;
  padding: 10px 6px 8px;
  cursor: pointer;
  color: var(--ink);
  box-shadow: 0 6px 16px rgba(28, 43, 54, .08);
}
.yg5-dock-btn i { display: block; font-style: normal; font-size: 18px; line-height: 1; }
.yg5-dock-btn b { display: block; font-size: 12px; color: var(--deep); font-weight: 800; margin-top: 2px; }
.yg5-dock-btn span { font-size: 11px; font-weight: 600; color: var(--muted); }
.yg5-dock-btn:active { background: #F3F7F9; }

.yg5-btn {
  border: 0;
  background: var(--deep);
  color: #fff;
  font-weight: 700;
  border-radius: 12px;
  padding: 13px 12px;
  cursor: pointer;
  font-size: 15px;
}
.yg5-btn.ghost {
  background: var(--surface);
  color: var(--deep);
  border: 1px solid var(--line);
}
.yg5-btn:active { opacity: .92; }
.yg5-btn:disabled { opacity: .4; cursor: not-allowed; }

.yg5-rules {
  font-size: 12px;
  color: rgba(28, 43, 54, .72);
  line-height: 1.65;
  padding: 10px 12px;
  background: rgba(255,255,255,.45);
  border-radius: 12px;
  font-weight: 500;
  margin: 4px 0 10px;
}
.yg5-rules b { color: var(--deep); }

.yg5-quiz-top {
  flex-shrink: 0;
  padding: 12px 14px;
  padding-top: calc(12px + env(safe-area-inset-top, 0px));
  background: rgba(255,255,255,.9);
  border-bottom: 1px solid var(--line);
}
.yg5-quiz-meta {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; color: var(--muted); font-weight: 600;
}
#quizTitle { color: var(--ink); font-size: 15px; font-weight: 800; }
#quizTimer {
  background: var(--gold-soft);
  color: #8A6418;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.yg5-progress {
  height: 6px;
  background: rgba(31, 92, 107, .12);
  border-radius: 99px;
  margin-top: 12px;
  overflow: hidden;
}
.yg5-progress > i {
  display: block; height: 100%;
  background: linear-gradient(90deg, #2A7A8C, #3B9B6E);
  width: 0;
  transition: width .25s ease;
}
.yg5-qbox { padding: 16px 16px 10px; }
.yg5-kp {
  display: inline-block;
  background: rgba(31, 92, 107, .1);
  color: var(--deep);
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 700;
  margin-bottom: 10px;
}
.yg5-q {
  font-size: 16px;
  line-height: 1.65;
  font-weight: 700;
  color: var(--ink);
  background: var(--surface);
  padding: 14px 16px;
  border-radius: 16px;
  box-shadow: 0 8px 20px rgba(28, 43, 54, .06);
}
.yg5-opts { padding: 0 16px; display: flex; flex-direction: column; gap: 8px; }
.yg5-opt {
  border: 0;
  background: var(--surface);
  border-radius: 14px;
  padding: 12px 14px;
  text-align: left;
  font-size: 15px;
  line-height: 1.5;
  cursor: pointer;
  color: var(--ink);
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(28, 43, 54, .05);
}
.yg5-opt:active:not(:disabled) { background: #E8F3F6; }
.yg5-opt.ok { background: #E7F6EE; color: var(--ok); }
.yg5-opt.no { background: #FDECEC; color: #C45C5C; }
.yg5-opt:disabled { cursor: default; }
.yg5-explain {
  margin: 12px 16px 0;
  padding: 12px 14px;
  background: var(--gold-soft);
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.7;
  color: #7A5A18;
  display: none;
  font-weight: 500;
}
.yg5-explain.on { display: block; }
.yg5-next-wrap { padding: 16px 16px calc(20px + var(--safe-b)); }
.yg5-combo {
  position: fixed; left: 50%; top: 24%;
  transform: translateX(-50%);
  opacity: 0; pointer-events: none;
  font-size: 28px; color: var(--deep);
  z-index: 20; font-weight: 800;
}
.yg5-combo.show { animation: comboPop .7s ease; }
@keyframes comboPop {
  0% { opacity: 0; transform: translateX(-50%) translateY(8px); }
  35% { opacity: 1; transform: translateX(-50%) translateY(0); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-16px); }
}

.yg5-result { text-align: center; padding: 36px 16px 8px; }
.yg5-trophy { font-size: 48px; }
.yg5-result .big {
  font-size: 24px;
  color: var(--ink);
  font-weight: 800;
  margin-top: 8px;
}
.yg5-result .stars { font-size: 24px; margin: 8px 0; }
.yg5-result p {
  color: var(--muted);
  line-height: 1.7;
  font-size: 13px;
  font-weight: 500;
  background: rgba(255,255,255,.85);
  display: inline-block;
  padding: 10px 14px;
  border-radius: 12px;
}
.yg5-award, .yg5-punish {
  margin: 10px 16px;
  padding: 12px 14px;
  border-radius: 12px;
  text-align: left;
  font-size: 13px;
  line-height: 1.7;
  font-weight: 600;
}
.yg5-award { background: #E7F6EE; color: var(--ok); }
.yg5-punish { background: #FDECEC; color: #C45C5C; }

.yg5-list { display: flex; flex-direction: column; gap: 8px; }
.yg5-card {
  background: var(--surface);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.7;
  box-shadow: 0 4px 12px rgba(28, 43, 54, .05);
  font-weight: 500;
}
.yg5-card .q { font-weight: 700; margin-bottom: 6px; }
.yg5-card .a { color: var(--ok); font-weight: 700; }

.yg5-back {
  border: 0;
  background: rgba(255,255,255,.7);
  color: var(--ink);
  font-size: 13px;
  cursor: pointer;
  padding: 8px 14px;
  font-weight: 700;
  border-radius: 999px;
}
.yg5-back:active { background: #fff; }

.yg5-shop-item {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  background: var(--surface);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 8px;
  box-shadow: 0 4px 12px rgba(28, 43, 54, .05);
}
.yg5-shop-item h4 { margin: 0; font-size: 14px; font-weight: 800; }
.yg5-shop-item p { margin: 4px 0 0; font-size: 12px; color: var(--muted); font-weight: 500; }
.yg5-shop-item .yg5-btn { padding: 8px 14px; font-size: 13px; white-space: nowrap; }

.yg5-toast {
  position: fixed; left: 50%; top: 16%; transform: translateX(-50%);
  background: rgba(28, 43, 54, .92);
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  z-index: 50;
  opacity: 0; pointer-events: none;
  transition: opacity .25s;
  font-size: 13px; max-width: 86vw; text-align: center;
  font-weight: 600;
}
.yg5-toast.show { opacity: 1; }

.yg5-hint {
  font-size: 12px;
  font-weight: 600;
  color: var(--deep);
  background: rgba(255,255,255,.75);
  border-radius: 10px;
  padding: 8px 12px;
  margin-bottom: 8px;
}
.yg5-fill {
  width: 100%;
  border: 0;
  background: var(--surface);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  font-family: var(--font);
  outline: none;
  box-shadow: 0 4px 12px rgba(28, 43, 54, .05);
}
.yg5-fill::placeholder {
  color: rgba(28, 43, 54, .35);
  font-weight: 500;
}
.yg5-fill:focus { box-shadow: 0 0 0 2px rgba(42, 122, 140, .35); }
.yg5-fill.ok { background: #E7F6EE; }
.yg5-fill.no { background: #FDECEC; }
.yg5-fill-ans {
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--gold-soft);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  color: #7A5A18;
}
.yg5-order-list { display: flex; flex-direction: column; gap: 8px; }
.yg5-order-item {
  border: 0;
  background: var(--surface);
  border-radius: 12px;
  padding: 12px 14px;
  text-align: left;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(28, 43, 54, .05);
}
.yg5-order-item.sel { background: #E8F3F6; color: var(--deep); }
.yg5-order-item.ok { background: #E7F6EE; }
.yg5-multi.picked { background: #E8F3F6 !important; color: var(--deep); }
