/* 第 10、11 堂(收成)的站:接在 py.css 後面。明亮兒童風(白 / 奶油底,黃藍綠橘),字大、按鈕大。 */

/* ---------- 換一堂課:十一堂 ---------- */
@media (max-width: 900px), (max-width: 1100px) and (orientation: portrait) {
  /* 十一顆圓鈕排兩排(六 + 五),整塊留在搖桿右邊 */
  .tmi-lessons { grid-template-columns: repeat(6, 32px); }
  .tmi-lessons a { width: 32px; height: 32px; font-size: 14px; }
  /* 換堂鈕兩排變高了:「重看旅程」放在它上面,不要疊在第一排上 */
  .tmi-trip-again { bottom: calc(132px + var(--safe-b, 0px)); right: 10px; }
}
@media (max-width: 370px) {
  .tmi-lessons { grid-template-columns: repeat(6, 29px); }
  .tmi-lessons a { width: 29px; height: 29px; font-size: 13px; }
}
/* 電腦:十一堂的堂名一排放不下,中等寬度只留「第 N 堂」 */
@media (max-width: 1680px) { .tmi-lessons a small { display: none; } }

/* ---------- 9 國護照(地圖右上) ---------- */
.tmi-pp9 #xp-stamps { gap: 4px; }
.tmi-pp9 #xp-stamps button { position: relative; width: 50px; }
.tmi-pp9 .round .xp-st { width: 40px; height: 40px; font-size: 21px; background: color-mix(in srgb, var(--c) 14%, #fff); border: 2px dashed color-mix(in srgb, var(--c) 55%, #fff); }
.tmi-pp9 #xp-stamps .done .xp-st { background: var(--c); border: 2px solid var(--c); filter: saturate(1.1); }
.tmi-pp9 .xp-st-lab { font-size: 11px; max-width: 50px; overflow: hidden; text-overflow: ellipsis; }
.tmi-pp-n { position: absolute; top: -4px; right: -2px; min-width: 22px; padding: 1px 4px; border-radius: 999px; background: #fff; color: #2d4a78; font: 900 10px/1.3 var(--font); font-style: normal;
  box-shadow: 0 1px 4px rgba(45, 74, 120, .25); pointer-events: none; }
.tmi-pp9 .done .tmi-pp-n { background: #ffd24a; color: var(--ink); }
.tmi-pp9 #xp-stamps .locked { opacity: .5; }
body.xp-quest .tmi-pp9 #xp-stamps button { width: 42px; }
body.xp-quest .tmi-pp9 .round .xp-st { width: 32px; height: 32px; font-size: 16px; }
body.xp-quest .tmi-pp9 .xp-st-lab { display: none; }

/* 護照的一頁(點護照上的一國) */
.tmi-ppg { text-align: center; }
.tmi-ppg-k { margin: 0; font-size: 13px; font-weight: 900; letter-spacing: .12em; color: color-mix(in srgb, var(--c) 75%, var(--ink)); }
.tmi-ppg-icon { display: grid; place-items: center; width: 84px; height: 84px; margin: 8px auto 6px; border-radius: 50%; font-size: 46px; background: color-mix(in srgb, var(--c) 16%, #fff);
  box-shadow: inset 0 0 0 4px var(--c); }
.tmi-ppg-list { display: grid; gap: 6px; margin: 12px 0; padding: 0; list-style: none; text-align: left; max-height: 40vh; overflow: auto; }
.tmi-ppg-list li { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 14px; background: #fff; box-shadow: inset 0 0 0 2px var(--line); font-weight: 800; }
.tmi-ppg-list li.done { background: #f2fbf5; }
.tmi-ppg-list li.done b { color: #23805a; }
.tmi-ppg-list li.locked { opacity: .55; }
.tmi-ppg-list b { font-size: 13px; color: var(--soft); white-space: nowrap; }
.tmi-ppg-tag { display: inline-grid; place-items: center; min-width: 40px; height: 28px; padding: 0 6px; border-radius: 10px; background: color-mix(in srgb, var(--c, #4a97dd) 18%, #fff);
  color: #2d4a78; font-size: 13px; font-weight: 900; }

/* ---------- 視窗大小 ---------- */
body.xv .xq-props > .xq-hv-map { width: min(880px, 100%); }
body.xv .xq-props > .xq-hv-todo, body.xv .xq-props > .xq-hv-legs, body.xv .xq-props > .xq-hv-portfolio, body.xv .xq-props > .xq-hv-preview { width: min(520px, 100%); }
body.xv .xq-props > .xq-hv-gallery, body.xv .xq-props > .xq-hv-idea, body.xv .xq-props > .xq-hv-tally { width: min(720px, 100%); }
body.xv .xq-props > .xq-hv-podium, body.xv .xq-props > .xq-hv-cert { width: min(940px, 100%); }
body.xv .xq-props > .xq-hv-book { width: min(640px, 100%); }
body.xv .xq-props > .xq-hv-stagework { width: min(900px, 100%); height: 100%; }
.xq-hv-map, .xq-hv-book, .xq-hv-tally { --k: #4a97dd; }
.xq-hv-idea, .xq-hv-gallery, .xq-hv-portfolio { --k: #3fae7a; }
.xq-hv-podium, .xq-hv-card, .xq-hv-preview, .xq-hv-pick, .xq-hv-cert { --k: #f4b63f; }
.xq-hv-stagework .xq-card-body { display: flex; flex-direction: column; }
.xq-hv-stagework .tmi-screen-wrap, .xq-hv-stagework .tmi-screen { flex: 1; min-height: 320px; }

/* ---------- 世界地圖 ---------- */
.tmi-wmap { position: relative; width: 100%; aspect-ratio: 16 / 10; flex: none; border-radius: 22px; overflow: hidden;
  background: radial-gradient(circle at 30% 30%, #e8f7ff 0, #c9ebfb 55%, #b2e0f6 100%); box-shadow: inset 0 0 0 3px #9fd3ef; }
.tmi-wmap::before { content: ""; position: absolute; inset: 8% 6%; border-radius: 48%; background: rgba(255, 255, 255, .35); }
.tmi-wmap-route { position: absolute; inset: 0; width: 100%; height: 100%; }
.tmi-wmap-route polyline { fill: none; stroke: #f0a83a; stroke-width: 3; stroke-dasharray: 7 7; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.tmi-pin { position: absolute; z-index: 2; transform: translate(-50%, -50%); display: grid; justify-items: center; gap: 1px; padding: 4px 8px 5px; border-radius: 16px; background: rgba(255, 255, 255, .95);
  color: var(--ink); text-decoration: none; text-align: center; box-shadow: 0 4px 12px rgba(45, 74, 120, .18), inset 0 0 0 2px color-mix(in srgb, var(--c) 45%, #fff); min-width: 74px; }
a.tmi-pin:hover { transform: translate(-50%, -54%); box-shadow: 0 8px 18px rgba(45, 74, 120, .25), inset 0 0 0 3px var(--c); }
.tmi-pin-ic { display: grid; place-items: center; width: 38px; height: 38px; margin-top: -18px; border-radius: 50%; background: #fff; font-size: 22px; box-shadow: inset 0 0 0 3px var(--c), 0 3px 8px rgba(45, 74, 120, .2); }
.tmi-pin b { font-size: 14px; font-weight: 900; line-height: 1.2; white-space: nowrap; }
.tmi-pin small { font-size: 11.5px; font-weight: 800; color: var(--soft); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tmi-pin.full { background: #fff8db; box-shadow: 0 4px 12px rgba(45, 74, 120, .18), inset 0 0 0 3px #f2c84b; }
.tmi-pin.full .tmi-pin-ic::after { content: "✓"; position: absolute; transform: translate(15px, -13px); display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: #3fae7a; color: #fff; font-size: 11px; font-weight: 900; }
.tmi-pin.todo { animation: tmi-blink 1.4s ease-in-out infinite; }
.tmi-pin.todo .tmi-pin-ic { box-shadow: inset 0 0 0 3px var(--c), 0 0 0 0 color-mix(in srgb, var(--c) 60%, transparent); animation: tmi-ring 1.4s ease-out infinite; }
.tmi-pin.locked { opacity: .55; }
.tmi-wmap.tour .tmi-pin { opacity: .7; filter: saturate(.55); }
.tmi-wmap.tour .tmi-pin.lit { opacity: 1; filter: none; animation: tmi-lit .9s cubic-bezier(.2, 1.5, .4, 1) backwards; background: #fff8db; box-shadow: 0 0 0 4px rgba(255, 210, 74, .5), 0 6px 16px rgba(45, 74, 120, .2); }
.tmi-wmap.tour .tmi-pin.lit:nth-of-type(2) { animation-delay: .1s; } .tmi-wmap.tour .tmi-pin.lit:nth-of-type(3) { animation-delay: .2s; } .tmi-wmap.tour .tmi-pin.lit:nth-of-type(4) { animation-delay: .3s; }
.tmi-wmap.tour .tmi-pin.lit:nth-of-type(5) { animation-delay: .4s; } .tmi-wmap.tour .tmi-pin.lit:nth-of-type(6) { animation-delay: .5s; } .tmi-wmap.tour .tmi-pin.lit:nth-of-type(7) { animation-delay: .6s; }
.tmi-wmap.tour .tmi-pin.lit:nth-of-type(8) { animation-delay: .7s; } .tmi-wmap.tour .tmi-pin.lit:nth-of-type(9) { animation-delay: .8s; } .tmi-wmap.tour .tmi-pin.lit:nth-of-type(10) { animation-delay: .9s; }
.tmi-leg { position: absolute; z-index: 3; transform: translate(-50%, -50%); width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: #fff; cursor: pointer;
  box-shadow: 0 0 0 3px #f0a83a, 0 4px 10px rgba(45, 74, 120, .25); display: grid; place-items: center; font-size: 20px; overflow: hidden; }
.tmi-leg img { width: 100%; height: 100%; object-fit: cover; }
.tmi-leg:hover, .tmi-leg:focus-visible { transform: translate(-50%, -50%) scale(1.15); }
.tmi-leg:disabled { opacity: .5; cursor: default; }
.tmi-wmap-legend { display: flex; flex-wrap: wrap; gap: 6px 12px; margin: 4px 0 0; font-size: 13px; font-weight: 800; color: var(--soft); }
.tmi-wmap-legend .lg.full { color: #a87a00; } .tmi-wmap-legend .lg.todo { color: #c2410c; }
@keyframes tmi-blink { 0%, 100% { transform: translate(-50%, -50%) scale(1); } 50% { transform: translate(-50%, -50%) scale(1.07); } }
@keyframes tmi-ring { 0% { box-shadow: inset 0 0 0 3px var(--c), 0 0 0 0 color-mix(in srgb, var(--c) 55%, transparent); } 100% { box-shadow: inset 0 0 0 3px var(--c), 0 0 0 14px transparent; } }
@keyframes tmi-lit { from { transform: translate(-50%, -50%) scale(.6); opacity: 0; } }

/* 補課站:還差哪幾課 */
.tmi-mk-list { display: grid; gap: 10px; }
.tmi-mk-sum { margin: 0; padding: 8px 12px; border-radius: 14px; background: #fff6dc; font-weight: 900; color: #5d4a12; text-align: center; }
.tmi-mk-row { display: grid; gap: 6px; padding: 10px 12px; border-radius: 16px; background: #fff; box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--c) 35%, #fff); }
.tmi-mk-h { display: flex; align-items: center; gap: 8px; margin: 0; }
.tmi-mk-h span { font-size: 22px; } .tmi-mk-h b { font-size: 16px; } .tmi-mk-h small { margin-left: auto; font-weight: 900; color: #c2410c; }
.tmi-mk-row ul { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; font-size: 14px; font-weight: 700; }
.tmi-mk-row li { display: flex; align-items: center; gap: 8px; }
.tmi-mk-row .xq-btn { justify-self: start; text-decoration: none; }

/* ---------- 自由創作工坊 ---------- */
.tmi-free-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tmi-free-tabs .xq-tab { flex: 1; min-width: 150px; height: 44px; border: 0; border-radius: 14px; background: #eef4fb; color: #2d4a78; font: 900 15px/1 var(--font); cursor: pointer; }
.tmi-free-tabs .xq-tab.on { background: #ffd24a; color: var(--ink); box-shadow: inset 0 -3px 0 #e8a522; }
.tmi-free-play { display: flex; flex-direction: column; gap: 8px; min-height: 0; flex: 1; }
.tmi-free-play .tmi-screen-wrap { flex: 1; min-height: 260px; }
.tmi-free-play .tmi-ed { min-height: 160px; max-height: 300px; }
.tmi-free-note { margin: 0; padding: 8px 12px; border-radius: 14px; background: #eef7ff; color: #2d4a78; font-weight: 800; font-size: 14.5px; }

/* ---------- 作品展覽館 ---------- */
.tmi-wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.tmi-work-tile { display: grid; gap: 4px; align-content: start; justify-items: start; padding: 12px; border-radius: 18px; background: #fff;
  box-shadow: inset 0 0 0 3px #f1e3bd, 0 4px 10px rgba(45, 74, 120, .08); }
.tmi-work-tile.lang-python { box-shadow: inset 0 0 0 3px #cfe4f6, 0 4px 10px rgba(45, 74, 120, .08); }
.tmi-work-tile.lang-game { box-shadow: inset 0 0 0 3px #cdeedd, 0 4px 10px rgba(45, 74, 120, .08); }
.tmi-work-ic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: #fff6dc; font-size: 24px; }
.tmi-work-tile b { font-size: 15.5px; line-height: 1.35; color: var(--ink); word-break: break-word; }
.tmi-work-tile small { font-size: 12.5px; font-weight: 800; color: var(--soft); }
.tmi-work-tile .xq-btn { text-decoration: none; margin-top: 2px; }
.tmi-portfolio { display: grid; gap: 10px; }
.tmi-portfolio > .xq-btn { text-decoration: none; justify-self: start; }
.tmi-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tmi-chip { padding: 4px 12px; border-radius: 999px; background: #e9f8ef; color: #23805a; font-size: 13.5px; font-weight: 900; }
.tmi-share-box { display: grid; gap: 6px; padding: 12px; border-radius: 16px; background: #fffdf6; box-shadow: inset 0 0 0 2px #f1e3bd; }
.tmi-share-box .xq-b { margin: 0; }
.xq .tmi-share-url { width: 100%; padding: 8px 10px; border: 2px solid #dfe9f3; border-radius: 12px; background: #fff; color: #2d4a78; font: 700 14px/1.3 Consolas, "Cascadia Mono", monospace; }
.tmi-hold-share { padding: 8px 12px; border-radius: 12px; background: #fff8e6; color: #5d4a12 !important; }

/* ---------- 發表小卡 ---------- */
.tmi-card-edit { display: grid; gap: 10px; }
.tmi-card-line { display: grid; gap: 4px; }
.tmi-card-line b { font-size: 15px; color: #2d4a78; }
.xq .tmi-card-in { width: 100%; padding: 8px 12px; border: 2px solid #f1e3bd; border-radius: 14px; background: #fffdf6; font: 700 16px/1.5 var(--font); color: var(--ink); resize: vertical; }
.xq .tmi-card-in:focus { outline: none; border-color: #f4b63f; box-shadow: 0 0 0 3px rgba(244, 182, 63, .25); }
.tmi-pick-list { display: grid; gap: 8px; }
.tmi-pick-work { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 14px; border: 0; border-radius: 16px; background: #fff; box-shadow: inset 0 0 0 2px var(--line);
  font: 800 15.5px/1.35 var(--font); color: var(--ink); text-align: left; cursor: pointer; }
.tmi-pick-work span { font-size: 22px; }
.tmi-pick-work:hover { box-shadow: inset 0 0 0 2px #f4b63f; }
.tmi-pick-work.on { background: #fff6dc; box-shadow: inset 0 0 0 3px #f4b63f; }
.tmi-pick-work.on::after { content: "⭐ 就是它"; margin-left: auto; font-size: 13px; font-weight: 900; color: #a87a00; white-space: nowrap; }

/* 小卡(預演台的鏡子、發表舞台) */
.tmi-podium { display: grid; gap: 8px; padding: 18px 20px; border-radius: 22px; background: linear-gradient(160deg, #fffdf2, #fff3cf); box-shadow: inset 0 0 0 3px #f2c84b; }
.tmi-podium-who { margin: 0; font-size: 14px; font-weight: 900; color: #a87a00; letter-spacing: .06em; }
.tmi-podium h2 { margin: 0; font-size: 22px; font-weight: 900; color: var(--ink); line-height: 1.35; }
.tmi-podium ol { display: grid; gap: 8px; margin: 4px 0 0; padding: 0; list-style: none; counter-reset: tl; }
.tmi-podium li { display: grid; gap: 2px; padding: 8px 12px 8px 44px; border-radius: 14px; background: rgba(255, 255, 255, .8); position: relative; counter-increment: tl; }
.tmi-podium li::before { content: counter(tl); position: absolute; left: 10px; top: 9px; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #ffd24a; font-weight: 900; color: var(--ink); }
.tmi-podium li small { font-size: 12.5px; font-weight: 900; color: var(--soft); }
.tmi-podium li span { font-size: 17px; font-weight: 800; line-height: 1.5; color: #34433f; }
.tmi-podium.big h2 { font-size: 28px; }
.tmi-podium.big li span { font-size: 21px; }
.tmi-podium-acts { flex-wrap: wrap; }
.tmi-podium-acts a.xq-btn { text-decoration: none; }
.xq-card.xq-max .tmi-podium-acts { justify-content: center; margin-top: 12px; }
/* 全螢幕上台:字放到教室後排也看得到 */
.xq-card.xq-max .tmi-podium { max-width: 1200px; margin: auto; padding: clamp(20px, 4vw, 56px); }
.xq-card.xq-max .tmi-podium-who { font-size: clamp(16px, 2vw, 26px); }
.xq-card.xq-max .tmi-podium h2 { font-size: clamp(30px, 4.6vw, 64px); }
.xq-card.xq-max .tmi-podium li { padding: 14px 18px 14px 72px; }
.xq-card.xq-max .tmi-podium li::before { width: 44px; height: 44px; top: 16px; left: 14px; font-size: 22px; }
.xq-card.xq-max .tmi-podium li small { font-size: clamp(14px, 1.5vw, 20px); }
.xq-card.xq-max .tmi-podium li span { font-size: clamp(22px, 3vw, 42px); }

/* ---------- 重看旅程 ---------- */
.tmi-legs ol { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.tmi-leg-row { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 50px; padding: 6px 12px 6px 6px; border: 0; border-radius: 16px; background: #fff; box-shadow: inset 0 0 0 2px var(--line);
  font: 800 15px/1.3 var(--font); color: var(--ink); text-align: left; cursor: pointer; }
.tmi-leg-row:hover { box-shadow: inset 0 0 0 2px #f0a83a; background: #fffaf0; }
.tmi-leg-row:disabled { opacity: .55; cursor: default; }
.tmi-leg-row img, .tmi-leg-dice { flex: none; width: 40px; height: 40px; border-radius: 12px; object-fit: cover; display: grid; place-items: center; font-size: 22px; background: #fff6dc; }
.tmi-leg-row span { display: grid; gap: 1px; }
.tmi-leg-row small { font-size: 12.5px; font-weight: 800; color: var(--soft); }

/* ---------- 授勳台:蓋章結算 ---------- */
.tmi-tally { width: 100%; border-collapse: separate; border-spacing: 0 4px; font-size: 15px; }
.tmi-tally th { padding: 4px 10px; text-align: left; font-size: 13px; color: var(--soft); }
.tmi-tally td { padding: 8px 10px; background: #fff; font-weight: 800; color: #34433f; }
.tmi-tally td:first-child { border-radius: 12px 0 0 12px; white-space: nowrap; font-weight: 900; }
.tmi-tally td:last-child { border-radius: 0 12px 12px 0; white-space: nowrap; color: #c2410c; }
.tmi-tally tr.full td { background: #fff8db; } .tmi-tally tr.full td:last-child { color: #23805a; }
.tmi-tally tr.locked td { opacity: .55; }
.tmi-tally .num { font-variant-numeric: tabular-nums; text-align: center; font-weight: 900; }
.tmi-tally tfoot td { background: #2d4a78; color: #fff !important; font-weight: 900; }

/* ---------- 授勳台:9 國護照 ---------- */
.tmi-book { padding: 12px; border-radius: 20px; background: linear-gradient(135deg, #2f5d9a, #3a6fb3); box-shadow: inset 0 0 0 3px #f2c84b; }
.tmi-book-page { min-height: 320px; border-radius: 14px; background: #fffdf6; box-shadow: inset 0 0 0 2px #f1e3bd; overflow: hidden; }
.tmi-bp { position: relative; display: grid; justify-items: center; gap: 6px; padding: 18px 16px 20px; text-align: center; animation: tmi-flip .45s ease-out; }
.tmi-bp-k { margin: 0; font-size: 13px; font-weight: 900; color: color-mix(in srgb, var(--c, #4a97dd) 75%, var(--ink)); letter-spacing: .08em; }
.tmi-bp-icon { display: grid; place-items: center; width: 74px; height: 74px; border-radius: 50%; font-size: 40px; background: color-mix(in srgb, var(--c) 16%, #fff); box-shadow: inset 0 0 0 4px var(--c); }
.tmi-bp h3 { margin: 0; font-size: 22px; font-weight: 900; color: var(--ink); }
.tmi-bp-stamps { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 6px 0 0; padding: 0; list-style: none; }
.tmi-bp-stamps li { display: grid; place-items: center; width: 50px; height: 50px; border-radius: 50%; border: 2.5px dashed #d8cfb8; color: #b3a890; font-size: 13px; font-weight: 900; }
.tmi-bp-stamps li.on { border: 3px solid var(--c); background: color-mix(in srgb, var(--c) 18%, #fff); color: color-mix(in srgb, var(--c) 70%, var(--ink)); transform: rotate(-8deg);
  animation: tmi-stamp .5s cubic-bezier(.2, 1.6, .4, 1) var(--d, 0s) backwards; }
.tmi-bp-n { margin: 2px 0 0; font-weight: 900; color: var(--soft); }
.tmi-bp-seal { position: absolute; right: 14px; top: 14px; display: grid; place-items: center; width: 86px; height: 86px; border-radius: 50%; border: 4px double #e0533d; color: #e0533d;
  transform: rotate(14deg); background: rgba(255, 255, 255, .6); animation: tmi-seal .6s cubic-bezier(.2, 1.6, .4, 1) .5s backwards; }
.tmi-bp-seal b { font-size: 22px; line-height: 1; } .tmi-bp-seal small { font-size: 11px; font-weight: 900; }
.tmi-bp.last { padding-top: 22px; }
.tmi-bp-nine { display: grid; grid-template-columns: repeat(9, 1fr); gap: 4px; width: 100%; margin: 0; padding: 0; list-style: none; }
.tmi-bp-nine li { display: grid; place-items: center; aspect-ratio: 1; border-radius: 50%; font-size: 18px; background: #f3efe4; filter: grayscale(1); opacity: .5; }
.tmi-bp-nine li.on { background: color-mix(in srgb, var(--c) 22%, #fff); box-shadow: inset 0 0 0 2px var(--c); filter: none; opacity: 1; }
.tmi-world-seal { display: grid; place-items: center; align-content: center; width: 190px; height: 190px; margin: 12px auto 0; border-radius: 50%; border: 7px double #e0533d; color: #e0533d;
  background: radial-gradient(circle, #fff 0, #fff4f0 70%); transform: rotate(-10deg); animation: tmi-seal .8s cubic-bezier(.2, 1.6, .4, 1) .3s backwards; }
.tmi-world-seal b { font-size: 34px; line-height: 1.1; letter-spacing: .1em; }
.tmi-world-seal small { font-size: 13px; font-weight: 900; }
.tmi-world-seal.small { width: 96px; height: 96px; border-width: 4px; animation: none; }
.tmi-world-seal.small b { font-size: 17px; }
.tmi-bp-left { display: grid; gap: 6px; justify-items: center; margin-top: 16px; padding: 14px 18px; border-radius: 18px; background: #fff6dc; }
.tmi-bp-left b { font-size: 20px; } .tmi-bp-left p { margin: 0; font-weight: 800; color: #5d4a12; }
.tmi-bp-left .xq-btn { text-decoration: none; }
.tmi-book-dots { display: flex; justify-content: center; gap: 6px; margin: 2px 0; }
.tmi-book-dots i { width: 9px; height: 9px; border-radius: 50%; background: #d8e2ee; }
.tmi-book-dots i.on { background: #f4b63f; transform: scale(1.3); }
.tmi-book-nav { justify-content: center; }
@keyframes tmi-flip { from { opacity: 0; transform: perspective(800px) rotateY(-24deg) translateX(30px); } }
@keyframes tmi-stamp { from { transform: rotate(-8deg) scale(2.2); opacity: 0; } }
@keyframes tmi-seal { from { transform: rotate(-30deg) scale(2.6); opacity: 0; } }

/* ---------- 授勳台:護照樣式的結業證書 ---------- */
.tmi-cert-wrap { overflow-x: auto; }
.tmi-cert { display: grid; grid-template-columns: minmax(170px, .7fr) 1.6fr; min-width: 620px; border-radius: 18px; overflow: hidden; box-shadow: 0 8px 22px rgba(45, 74, 120, .18);
  -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.tmi-cert-cover { display: grid; align-content: center; justify-items: center; gap: 8px; padding: 22px 14px; background: linear-gradient(160deg, #2f5d9a, #3a6fb3); color: #fff; text-align: center; }
.tmi-cert-logo { width: 72px; height: 72px; border-radius: 18px; background: #fff; padding: 6px; }
.tmi-cert-brand { margin: 0; font-size: 22px; font-weight: 900; letter-spacing: .12em; color: #ffd24a; }
.tmi-cert-pp { margin: 0; font-size: 18px; font-weight: 900; letter-spacing: .3em; }
.tmi-cert-sub { margin: 0; font-size: 13px; font-weight: 800; opacity: .9; }
.tmi-cert-page { position: relative; display: grid; gap: 6px; align-content: start; padding: 22px 26px 20px; background: #fffdf6;
  background-image: repeating-linear-gradient(0deg, transparent 0 31px, rgba(74, 151, 221, .06) 31px 32px); }
.tmi-cert-k { margin: 0; font-size: 15px; font-weight: 900; letter-spacing: .4em; color: #a87a00; }
.tmi-cert-name { margin: 2px 0; font-size: 38px; font-weight: 900; color: var(--ink, #23302d); line-height: 1.2; }
.tmi-cert-text { margin: 0; font-size: 15.5px; font-weight: 700; line-height: 1.7; color: #34433f; max-width: 34em; }
.tmi-cert-courses { margin: 2px 0; font-size: 14px; font-weight: 900; color: #2d4a78; }
.tmi-cert-stamps { display: grid; grid-template-columns: repeat(9, 1fr); gap: 4px; margin: 4px 0; padding: 0; list-style: none; max-width: 520px; }
.tmi-cert-stamps li { display: grid; justify-items: center; gap: 1px; padding: 4px 0; border-radius: 12px; border: 2px dashed #d8cfb8; opacity: .55; }
.tmi-cert-stamps li.on { border: 2px solid var(--c); background: color-mix(in srgb, var(--c) 14%, #fff); opacity: 1; }
.tmi-cert-stamps span { font-size: 20px; } .tmi-cert-stamps small { font-size: 9.5px; font-weight: 900; color: #5b6b67; white-space: nowrap; }
.tmi-cert-count { margin: 0; font-weight: 900; color: #2d4a78; }
.tmi-cert-date { margin: 0; font-weight: 800; color: var(--soft, #6b7a76); }
.tmi-cert-page .tmi-world-seal.small { position: absolute; right: 22px; top: 16px; margin: 0; }

/* 列印:只印證書(在學習島頁面外面另外放一份 #tmi-print) */
#tmi-print { display: none; }
@media print {
  @page { size: A4 landscape; margin: 12mm; }
  body.tmi-printing > *:not(#tmi-print) { display: none !important; }
  body.tmi-printing { background: #fff !important; overflow: visible !important; }
  body.tmi-printing #tmi-print { display: block; }
  #tmi-print .tmi-cert { min-width: 0; box-shadow: none; border: 2px solid #2f5d9a; }
  #tmi-print .tmi-world-seal { animation: none; }
}

/* ---------- 手機、直立平板 ---------- */
@media (max-width: 900px), (max-width: 1100px) and (orientation: portrait) {
  .tmi-pp9 #xp-stamps li { flex: 1; min-width: 0; display: flex; }
  body.xp-map .tmi-pp9 #xp-stamps button, body.xp-quest .tmi-pp9 #xp-stamps button { width: auto; min-width: 0; flex: 1; }
  body.xp-map .tmi-pp9 .round .xp-st, body.xp-quest .tmi-pp9 .round .xp-st { width: 28px; height: 28px; font-size: 15px; border-width: 1.5px; }
  .tmi-pp-n { font-size: 8.5px; min-width: 0; padding: 0 3px; top: -5px; right: -4px; }
  .tmi-wmap { aspect-ratio: 4 / 3; }
  .tmi-pin-n { display: none; }   /* 手機:地點擠,只留「幾課 / 幾課」 */
  .tmi-pin { min-width: 0; padding: 3px 5px 4px; border-radius: 12px; }
  .tmi-pin-ic { width: 30px; height: 30px; font-size: 17px; margin-top: -14px; }
  .tmi-pin b { font-size: 11.5px; }
  .tmi-pin small { font-size: 10px; }
  .tmi-leg { width: 32px; height: 32px; }
  .tmi-wall { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .tmi-podium { padding: 14px; }
  .tmi-podium h2 { font-size: 19px; }
  .tmi-podium.big li span { font-size: 17px; }
  .tmi-book-page { min-height: 0; }
  .tmi-bp-stamps li { width: 42px; height: 42px; font-size: 12px; }
  .tmi-bp-seal { width: 64px; height: 64px; right: 8px; top: 8px; } .tmi-bp-seal b { font-size: 16px; }
  .tmi-world-seal { width: 150px; height: 150px; } .tmi-world-seal b { font-size: 26px; }
  .tmi-tally { font-size: 13px; } .tmi-tally td { padding: 6px; } .tmi-tally td:nth-child(2), .tmi-tally th:nth-child(2) { display: none; }
  .tmi-cert { min-width: 0; grid-template-columns: 1fr; }
  .tmi-cert-cover { grid-auto-flow: column; padding: 10px; justify-content: center; }
  .tmi-cert-logo { width: 44px; height: 44px; }
  .tmi-cert-sub { display: none; }
  .tmi-cert-page { padding: 16px; }
  .tmi-cert-name { font-size: 28px; }
  .tmi-cert-stamps small { display: none; }
  .tmi-cert-page .tmi-world-seal.small { position: static; justify-self: end; }
  .xq .tmi-card-in { font-size: 16px; }   /* iPhone 點進小於 16px 的框會自動放大 */
}
@media (prefers-reduced-motion: reduce) {
  .tmi-pin.todo, .tmi-pin.todo .tmi-pin-ic, .tmi-wmap.tour .tmi-pin.lit, .tmi-bp, .tmi-bp-stamps li.on, .tmi-bp-seal, .tmi-world-seal { animation: none; }
}
