/*---------------------------------------------------------------------------
  Version : 2026.10.02
  Purpose : 小遊戲專區「茶葉的一生」— 系列表 games.php、介紹頁 game.php
            站上 Tailwind 為裁剪版，這裡全部用自有 class（tgg- 前綴）
            不用 <figure>（common.css 的 TinyMCE 規則會把它弄壞）
---------------------------------------------------------------------------*/
.tgg {
	--ink: #282828;
	--ink-2: #5b554d;
	--paper: #ebe9e3;
	--paper-2: #f7f4ee;
	--line: #e4dfd5;
	--ember: #d9642b;
	--amber: #c49a3a;
	--leaf: #5f7a45;
	--seal: #C0664E;
	--wood: #8b7d6b;
	--serif: 'Noto Serif TC', 'Songti TC', 'PMingLiU', serif;
	color: var(--ink);
	font-family: 'LINESeedTW', 'Noto Sans TC', 'Microsoft JhengHei', sans-serif;
	-webkit-font-smoothing: antialiased;
}
.tgg *, .tgg *::before, .tgg *::after { box-sizing: border-box; }
.tgg a { color: inherit; text-decoration: none; }
.tgg img { display: block; max-width: 100%; }
.tgg-wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.tgg-section { padding: calc(var(--marquee-height, 40px) + var(--header-height, 80px) + 24px) 0 80px; }

/* ---------- 系列表 Hero ---------- */
.tgg-hero { position: relative; border-radius: 22px; overflow: hidden; min-height: 340px; display: flex; align-items: flex-end; background: #3b3a2c; isolation: isolate; }
.tgg-hero__bg { position: absolute; inset: 0; z-index: -2; background-size: cover; background-position: center 40%; transform: scale(1.06); animation: tggPan 22s ease-in-out infinite alternate; }
.tgg-hero::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(20, 16, 10, .05) 20%, rgba(20, 16, 10, .72) 100%); }
.tgg-hero__txt { padding: 28px 24px; color: #fff8ec; max-width: 680px; }
.tgg-eyebrow { font-family: var(--serif); font-size: 12px; letter-spacing: .32em; text-transform: uppercase; color: var(--amber); margin: 0 0 10px; }
.tgg-hero h1 { font-family: var(--serif); font-weight: 900; font-size: clamp(30px, 6vw, 52px); line-height: 1.15; letter-spacing: .08em; margin: 0 0 12px; }
.tgg-hero p { margin: 0; line-height: 1.85; font-size: 15px; color: rgba(255, 248, 236, .88); }
.tgg-hero__seal { display: inline-grid; place-items: center; width: 46px; height: 46px; background: var(--seal); color: #fff; font-family: var(--serif); font-weight: 900; font-size: 15px; line-height: 1.05; border-radius: 4px; margin-bottom: 14px; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .25); }
@keyframes tggPan { from { transform: scale(1.06) translateX(-1.5%); } to { transform: scale(1.12) translateX(1.5%); } }

/* ---------- 工序進度條（10 道工序一覽） ---------- */
.tgg-path { display: flex; gap: 6px; overflow-x: auto; padding: 18px 2px 6px; margin: 0 -2px; scrollbar-width: none; }
.tgg-path::-webkit-scrollbar { display: none; }
.tgg-path a { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; padding: 7px 12px 7px 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper-2); font-size: 13px; color: var(--ink-2); transition: background .2s, color .2s, border-color .2s; }
.tgg-path a b { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; background: var(--paper); color: var(--wood); font-variant-numeric: tabular-nums; }
.tgg-path a.done b { background: var(--leaf); color: #fff; }
.tgg-path a:hover { border-color: var(--wood); color: var(--ink); }

/* ---------- 章節 ---------- */
.tgg-chapter { margin-top: 48px; }
.tgg-chapter__head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 18px; border-bottom: 1px solid var(--line); padding-bottom: 14px; }
.tgg-chapter__no { font-family: var(--serif); font-size: 44px; line-height: 1; font-weight: 900; color: var(--seal); }
.tgg-chapter__head h2 { font-family: var(--serif); font-size: 24px; letter-spacing: .12em; margin: 0 0 4px; font-weight: 900; }
.tgg-chapter__head h2 small { font-size: 12px; letter-spacing: .24em; color: var(--wood); font-weight: 400; margin-left: 8px; text-transform: uppercase; }
.tgg-chapter__head p { margin: 0; font-size: 14px; color: var(--ink-2); line-height: 1.7; }

.tgg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.tgg-card { position: relative; display: flex; flex-direction: column; background: #fffdf8; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; transition: transform .35s cubic-bezier(.2, .8, .2, 1), box-shadow .35s; box-shadow: 0 1px 2px rgba(40, 32, 20, .05); }
.tgg-card:hover { transform: translateY(-4px); box-shadow: 0 14px 34px rgba(40, 32, 20, .14); }
.tgg-card__img { position: relative; aspect-ratio: 1 / 1; overflow: hidden; background: var(--paper); }
.tgg-card__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s cubic-bezier(.2, .8, .2, 1); }
.tgg-card:hover .tgg-card__img img { transform: scale(1.06); }
.tgg-card__no { position: absolute; left: 12px; top: 12px; font-family: var(--serif); font-weight: 900; font-size: 13px; letter-spacing: .1em; color: #fff; background: rgba(40, 40, 40, .62); backdrop-filter: blur(4px); padding: 4px 10px; border-radius: 999px; }
.tgg-card__best { position: absolute; right: 12px; top: 12px; font-size: 12px; color: #fff; background: var(--leaf); padding: 4px 10px; border-radius: 999px; }
.tgg-card__body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.tgg-card__body h3 { font-family: var(--serif); font-weight: 900; font-size: 20px; letter-spacing: .06em; margin: 0; }
.tgg-card__body h3 small { display: block; font-family: 'Cormorant Garamond', var(--serif); font-weight: 600; font-size: 12px; letter-spacing: .2em; color: var(--wood); text-transform: uppercase; margin-top: 2px; }
.tgg-card__body p { margin: 0; font-size: 13.5px; line-height: 1.7; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tgg-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 8px; }
.tgg-meta span { font-size: 12px; padding: 3px 9px; border-radius: 999px; background: var(--paper); color: var(--ink-2); }
.tgg-level { letter-spacing: 2px; color: var(--amber) !important; }

/* ---------- 介紹頁 ---------- */
.tgg-crumb { font-size: 13px; color: var(--ink-2); margin-bottom: 16px; display: flex; gap: 8px; flex-wrap: wrap; }
.tgg-crumb a:hover { color: var(--seal); }
.tgg-intro { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 36px; align-items: start; }
.tgg-intro__art { position: sticky; top: calc(var(--marquee-height, 40px) + var(--header-height, 80px) + 16px); border-radius: 22px; overflow: hidden; aspect-ratio: 1 / 1; background: var(--paper); box-shadow: 0 18px 50px rgba(40, 32, 20, .16); }
.tgg-intro__art img { width: 100%; height: 100%; object-fit: cover; animation: tggBreath 9s ease-in-out infinite alternate; }
@keyframes tggBreath { from { transform: scale(1); } to { transform: scale(1.05); } }
.tgg-intro__chapter { font-family: var(--serif); color: var(--seal); letter-spacing: .2em; font-size: 13px; margin: 0 0 8px; }
.tgg-intro h1 { font-family: var(--serif); font-weight: 900; font-size: clamp(30px, 5vw, 44px); letter-spacing: .08em; margin: 0; line-height: 1.2; }
.tgg-intro h1 small { display: block; font-family: 'Cormorant Garamond', var(--serif); font-size: 15px; font-weight: 600; color: var(--wood); letter-spacing: .28em; text-transform: uppercase; margin-top: 6px; }
.tgg-lead { font-size: 16px; line-height: 1.95; color: var(--ink); margin: 18px 0; }
.tgg-facts { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 26px; }
.tgg-facts span { font-size: 13px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper-2); }
.tgg-box { background: #fffdf8; border: 1px solid var(--line); border-radius: 18px; padding: 20px; margin-bottom: 16px; }
.tgg-box h2 { font-family: var(--serif); font-size: 17px; letter-spacing: .14em; margin: 0 0 12px; font-weight: 900; display: flex; align-items: center; gap: 8px; }
.tgg-box h2::before { content: ''; width: 8px; height: 8px; background: var(--seal); transform: rotate(45deg); }
.tgg-how { list-style: none; margin: 0; padding: 0; counter-reset: s; }
.tgg-how li { position: relative; padding: 8px 0 8px 36px; line-height: 1.7; font-size: 15px; border-top: 1px dashed var(--line); }
.tgg-how li:first-child { border-top: 0; }
.tgg-how li::before { counter-increment: s; content: counter(s); position: absolute; left: 0; top: 9px; width: 24px; height: 24px; border-radius: 50%; background: var(--ink); color: var(--paper); font-size: 12px; display: grid; place-items: center; }
.tgg-know { background: linear-gradient(135deg, #f6ecd2, #f1e6d3); border-color: #e8d7b2; }
.tgg-know p { margin: 0; line-height: 1.9; font-size: 15px; }
.tgg-reco-mini { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tgg-reco-mini a { display: block; font-size: 12.5px; line-height: 1.45; color: var(--ink-2); }
.tgg-reco-mini a span { display: block; aspect-ratio: 1 / 1; border-radius: 12px; overflow: hidden; background: var(--paper); margin-bottom: 6px; }
.tgg-reco-mini a img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.tgg-reco-mini a:hover img { transform: scale(1.06); }
.tgg-play { display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 17px 22px; border-radius: 999px; background: var(--ink); color: var(--paper) !important; font-family: var(--serif); font-weight: 900; font-size: 19px; letter-spacing: .3em; transition: transform .2s, background .2s; box-shadow: 0 10px 26px rgba(40, 40, 40, .28); }
.tgg-play:hover { background: var(--seal); transform: translateY(-2px); }
.tgg-play svg { width: 20px; height: 20px; fill: currentColor; }
.tgg-best { text-align: center; font-size: 13px; color: var(--ink-2); margin: 10px 0 0; }
.tgg-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 30px; }
.tgg-nav a { display: block; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper-2); font-size: 13px; color: var(--ink-2); transition: border-color .2s; }
.tgg-nav a b { display: block; font-family: var(--serif); font-size: 16px; color: var(--ink); margin-top: 4px; }
.tgg-nav a:last-child { text-align: right; }
.tgg-nav a:hover { border-color: var(--wood); }
.tgg-sticky { display: none; }

@media (max-width: 860px) {
	.tgg-intro { grid-template-columns: 1fr; gap: 22px; }
	.tgg-intro__art { position: relative; top: 0; aspect-ratio: 4 / 3; }
	.tgg-sticky { display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(180deg, rgba(239, 233, 221, 0), rgba(239, 233, 221, .96) 35%); }
	.tgg-play-top { display: none; }
	.tgg-section { padding-bottom: 110px; }
}
@media (max-width: 560px) {
	.tgg-hero { min-height: 300px; border-radius: 18px; }
	.tgg-hero__txt { padding: 22px 18px; }
	.tgg-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
	.tgg-card__body { padding: 10px 11px 12px; }
	.tgg-card__body h3 { font-size: 16px; }
	.tgg-card__body p { display: none; }
	.tgg-meta span:not(.tgg-level) { display: none; }
	.tgg-chapter { margin-top: 36px; }
	.tgg-chapter__no { font-size: 36px; }
	.tgg-chapter__head h2 small { display: none; }
}
@media (prefers-reduced-motion: reduce) {
	.tgg-hero__bg, .tgg-intro__art img { animation: none; }
}
/* 手機底部固定「開始遊戲」時，把官網的回到頂端鈕往上移 */
@media (max-width: 860px) { body:has(.tgg-sticky) #scroll-to-top { bottom: 96px; } }
/* 介紹頁：開始遊戲＋看示範 */
.tgg-btns { display: flex; gap: 10px; }
.tgg-btns .tgg-play { flex: 1.4; }
.tgg-demo { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 15px 16px; border-radius: 999px; border: 1.5px solid var(--ink); background: #fffdf8; color: var(--ink) !important; font-family: var(--serif); font-weight: 900; font-size: 16px; letter-spacing: .12em; transition: background .2s, color .2s; white-space: nowrap; }
.tgg-demo:hover { background: var(--ink); color: var(--paper) !important; }
.tgg-demo svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 860px) { .tgg-sticky .tgg-demo { flex: 0 0 auto; font-size: 15px; padding: 15px 18px; } }
/* 分享 */
.tgg-hubshare { margin: 18px 0 4px; }
.tgg-sharebox .tg-share { justify-content: flex-start; }
/* 人次／全站最高分 */
.tgg-statline { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.tgg-statline > span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.tgg-statline i { color: var(--seal); font-size: 11px; }
.tgg-statbox { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: -10px 0 24px; }
.tgg-statbox > div { background: #fffdf8; border: 1px solid var(--line); border-radius: 14px; padding: 12px 8px; text-align: center; }
.tgg-statbox i { color: var(--seal); font-size: 15px; }
.tgg-statbox b { display: block; font-family: var(--serif); font-size: 22px; font-weight: 900; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.tgg-statbox small { font-size: 12px; color: var(--ink-2); letter-spacing: .08em; }
@media (max-width: 560px) { .tgg-statline { font-size: 11.5px; gap: 2px 8px; } .tgg-statbox b { font-size: 19px; } }
