:root {
  --yolk: #ffc01f;
  --pine: #0d3a32;
  --comb: #d3200f;
  --husk: #ffe9a8;
  --display: "Dela Gothic One", "Arial Black", sans-serif;
  --gutter: clamp(1.25rem, 5vw, 5rem);
  --out: cubic-bezier(.16, 1, .3, 1);
  --play: running;
  --sky: var(--yolk);
  --sky-ink: var(--pine);
}
:root:has(#rest:checked) { --play: paused; }
:root:has(#night:checked) { --sky: #14264a; --sky-ink: #fff; --dawn: #14264a; }

* { box-sizing: border-box; margin: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 5rem; }
body { font: 400 1.125rem/1.6 "Be Vietnam Pro", system-ui, sans-serif; color: var(--pine); background: var(--sky); }
body, .top, .contact, .grow { transition: background-color .8s; }
svg { display: block; overflow: visible; }
a { color: inherit; }
ul, ol { list-style: none; padding: 0; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.22; text-wrap: balance; }
h2 { font-size: clamp(2rem, 4.6vw, 3.75rem); }
h3 { font-size: clamp(1.5rem, 2.4vw, 2rem); }
p { text-wrap: pretty; }
section { position: relative; padding: clamp(4.5rem, 9vw, 8rem) var(--gutter); overflow: clip; }
:focus-visible { outline: 3px solid currentColor; outline-offset: 4px; border-radius: 6px; }

/* ---------- Thanh trên cùng ---------- */
.top {
  position: sticky; top: 0; z-index: 10; height: 4.5rem; margin-bottom: -4.5rem;
  display: flex; align-items: center; gap: 2rem; padding: 0 var(--gutter);
  background: var(--sky); color: var(--sky-ink); white-space: nowrap;
}
.brand { font-family: var(--display); text-decoration: none; margin-right: auto; }
.top nav { display: flex; gap: 1.75rem; }
.top nav a { font-size: 1rem; font-weight: 600; text-decoration: none; padding: .5rem 0; background: linear-gradient(currentColor, currentColor) 0 85% / 0 2px no-repeat; transition: background-size .35s var(--out); }
.top nav a:hover { background-size: 100% 2px; }
.rest { display: flex; align-items: center; gap: .5rem; min-height: 44px; font-size: .95rem; cursor: pointer; }
.rest input { width: 1.1rem; height: 1.1rem; accent-color: var(--pine); }

/* ---------- Nút ---------- */
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 2rem; }
.btn {
  background: var(--comb); color: #fff; font-weight: 700; text-decoration: none; white-space: nowrap;
  padding: 1rem 1.75rem; border-radius: 999px; transition: translate .3s var(--out), background-color .2s;
}
.btn:hover { translate: 0 -4px; background: #ad1609; }
.btn:active { translate: 0 1px; }
.link { font-weight: 600; text-underline-offset: 5px; text-decoration-thickness: 2px; padding: .6rem 0; }
.link:hover { text-decoration-thickness: 4px; }

/* ---------- Mở đầu ---------- */
.hero {
  min-height: min(100svh, 60rem); padding-top: 6.5rem; padding-bottom: 7rem;
  display: grid; grid-template-columns: 1.15fr 1fr; align-items: center; gap: 2rem;
}
.hero-text { position: relative; z-index: 2; }
h1 { font-size: clamp(3rem, 7.2vw, 7rem); line-height: 1.32; }
h1 span { display: block; overflow: clip; overflow-clip-margin: .12em; }
h1 b { display: block; font-weight: 400; animation: rise .9s var(--out) backwards; }
h1 span:nth-child(2) b { animation-delay: .1s; }
h1 span:nth-child(3) b { animation-delay: .2s; }
.hero-text p { max-width: 30rem; margin: 1.25rem 0 2rem; font-size: 1.25rem; }
.star { position: relative; z-index: 2; align-self: end; width: min(100%, 36rem, 66svh); justify-self: center; animation: land 1s .25s var(--out) backwards; }
.hero { color: var(--sky-ink); }
.hero-text, .star, .hill { pointer-events: none; }
.hero-text p, .hero-text a, .sun { pointer-events: auto; }
.sun { position: absolute; inset: 4% 2% auto; aspect-ratio: 1; border-radius: 50%; background: #fff3cc; cursor: pointer; transition: box-shadow .4s; }
.sun:hover { box-shadow: 0 0 0 14px #fff3cc55; }
.sun:has(:focus-visible) { outline: 4px solid var(--sky-ink); outline-offset: 4px; }
.sun input { position: absolute; inset: 0; opacity: 0; }
.hint { position: absolute; top: calc(100% + 1rem); left: 0; right: 0; text-align: center; font-size: .9rem; line-height: 1.4; color: #fff; }

/* ---------- Ban đêm ---------- */
.by-night, .zzz { display: none; }
:root:has(#night:checked) :is(.by-day, .crow) { display: none; }
:root:has(#night:checked) .by-night { display: inline; }
:root:has(#night:checked) .zzz { display: block; }
:root:has(#night:checked) .star > svg { --head: doze; --jaw: none; --rwing: none; --lid: 1; }
:root:has(#night:checked) .flyer, :root:has(#night:checked) .feather { opacity: 0; visibility: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0; opacity: 0; transition: opacity .8s;
  background: radial-gradient(circle, #fff 1.5px, transparent 2px) 0 0 / 170px 130px, radial-gradient(circle, #ffe9a8 2px, transparent 2.5px) 60px 40px / 290px 210px;
}
:root:has(#night:checked) .hero::before { opacity: .8; }
.zzz i { position: absolute; z-index: 1; left: 4%; top: 22%; font: 400 2.5rem/1 var(--display); color: #fff; opacity: 0; animation: snore 3.6s linear infinite; animation-play-state: var(--play); }
.zzz i:nth-child(2) { animation-delay: 1.2s; }
.zzz i:nth-child(3) { animation-delay: 2.4s; }
.eyelid { opacity: var(--lid, 0); }
@keyframes snore { 0% { opacity: 0; transform: scale(.4); } 20%, 70% { opacity: 1; } 100% { opacity: 0; transform: translate(-60px, -130px) scale(1.2) rotate(-16deg); } }
@keyframes doze { 0%, 100% { transform: rotate(10deg); } 50% { transform: rotate(17deg); } }
.star > svg { position: relative; scale: -1 1; }
.hill { position: absolute; inset: auto 0 -1px; width: 100%; height: 10rem; z-index: 1; fill: var(--pine); }

.crow i {
  position: absolute; z-index: 1; font: 400 clamp(1.5rem, 3vw, 2.75rem)/1.2 var(--display); color: var(--comb);
  opacity: 0; animation: crow 8s infinite; animation-play-state: var(--play);
}
.crow i:nth-child(1) { left: 2%; top: 13%; }
.crow i:nth-child(2) { left: -5%; top: 6%; animation-delay: .12s; }
.crow i:nth-child(3) { left: -10%; top: -2%; animation-delay: .24s; }
.crow i:nth-child(4) { left: -13%; top: -10%; animation-delay: .36s; }

/* ---------- Các bộ phận cử động của gà ---------- */
.wing, .tail, .head, .rwing, .jaw { transform-box: fill-box; animation: 1s ease-in-out infinite; animation-play-state: var(--play); }
.wing { transform-origin: 85% 94%; animation-name: flap; animation-duration: var(--flap, .42s); animation-direction: alternate; }
.tail { transform-origin: 95% 85%; animation-name: sway; animation-duration: 2.4s; animation-direction: alternate; }
.head { transform-origin: 35% 90%; animation-name: var(--head, call); animation-duration: 8s; }
.jaw { transform-origin: 0 0; animation-name: var(--jaw, jaw); animation-duration: 8s; }
.rwing { transform-origin: 90% 20%; animation-name: var(--rwing, rwing); animation-duration: 8s; }

@keyframes flap { from { transform: scaleY(1) rotate(4deg); } to { transform: scaleY(-.55) rotate(-8deg); } }
@keyframes sway { from { transform: rotate(-2deg); } to { transform: rotate(4deg); } }
@keyframes call { 0%, 20%, 48%, 100% { transform: none; } 23% { transform: rotate(7deg); } 27%, 43% { transform: rotate(-13deg); } 70%, 76% { transform: rotate(6deg); } 73% { transform: rotate(-2deg); } }
@keyframes jaw { 0%, 25%, 45%, 100% { transform: none; } 28%, 42% { transform: rotate(24deg); } }
@keyframes rwing { 0%, 22%, 48%, 100% { transform: none; } 26%, 32%, 38% { transform: rotate(24deg); } 29%, 35%, 41% { transform: rotate(4deg); } }
@keyframes crow { 0%, 26% { opacity: 0; transform: translate(50px, 40px) scale(.3); } 30%, 40% { opacity: 1; transform: none; } 47%, 100% { opacity: 0; transform: translate(-14px, -24px); } }
@keyframes rise { from { transform: translateY(110%); } }
@keyframes land { from { transform: translateY(-110vh) rotate(-14deg); } 70% { transform: translateY(0) scale(1.04, .95); } }

/* ---------- Đàn gà bay ---------- */
.sky { position: absolute; inset: 0; pointer-events: none; overflow: clip; }
.flyer { position: absolute; left: 0; top: var(--y); width: var(--w); translate: var(--still) 0; animation: fly var(--t) linear var(--d) infinite; animation-play-state: var(--play); }
.flyer svg { animation: bob 1.7s ease-in-out infinite alternate; animation-play-state: var(--play); }
/* Bấm vào gà: giật mình, rụng lông, rơi trứng */
.flyer { pointer-events: auto; cursor: pointer; transition: opacity .6s, visibility .6s, scale .5s var(--out), rotate .5s var(--out); }
.flyer:active { scale: 1.3; rotate: -18deg; transition-duration: 0s; }
.flyer input { display: none; }
.loot { animation: arm .01s 2.5s backwards; }
.drop { position: absolute; left: 42%; top: 72%; width: 20px; height: 27px; background: #fff; border-radius: 50% / 58% 58% 42% 42%; opacity: 0; animation: lay 1.5s cubic-bezier(.5, 0, 1, .7); }
.fluff, .fluff::before, .fluff::after { position: absolute; width: 9px; height: 24px; background: #fff; border-radius: 100% 0; }
.fluff { left: 50%; top: 45%; opacity: 0; animation: shed 1.6s ease-out; }
.fluff::before { content: ""; left: -34px; top: 10px; rotate: 60deg; }
.fluff::after { content: ""; left: 30px; top: 16px; rotate: -50deg; }
.flyer :checked ~ .loot .drop { animation-name: lay2; }
.flyer :checked ~ .loot .fluff { animation-name: shed2; }
@keyframes arm { from, to { visibility: hidden; } }
@keyframes lay { from, 95% { opacity: 1; } to { opacity: 0; transform: translateY(85vh) rotate(220deg); } }
@keyframes lay2 { from, 95% { opacity: 1; } to { opacity: 0; transform: translateY(85vh) rotate(220deg); } }
@keyframes shed { from { opacity: 1; transform: scale(.3); } to { opacity: 0; transform: translateY(90px) scale(1.5) rotate(50deg); } }
@keyframes shed2 { from { opacity: 1; transform: scale(.3); } to { opacity: 0; transform: translateY(90px) scale(1.5) rotate(50deg); } }

.f1 { --y: 12%; --w: 9rem; --t: 15s; --d: -3s; --still: 46vw; }
.f2 { --y: 83%; --w: 7rem; --t: 19s; --d: -12s; --still: 36vw; --body: #96281a; --wing: #f58a1c; --wing2: #6f1a10; --tail: #0d3a32; }
.f3 { --y: 20%; --w: 5rem; --t: 24s; --d: -17s; --still: 80vw; }
.f4 { --y: 42%; --w: 6rem; --t: 21s; --d: -8s; --still: 48vw; }
.f5 { --y: 8%; --w: 4rem; --t: 28s; --d: -23s; --still: 25vw; }
@keyframes fly { from { translate: -12rem 0; } to { translate: calc(100vw + 3rem) 0; } }
@keyframes bob { from { transform: translateY(-16px) rotate(-7deg); } to { transform: translateY(16px) rotate(5deg); } }

.feather { position: absolute; top: -3rem; left: var(--x); width: 12px; height: 34px; background: #fff; border-radius: 100% 0 100% 0; animation: drift var(--t) linear var(--d) infinite; animation-play-state: var(--play); }
.p1 { --x: 8%; --t: 13s; --d: -2s; } .p2 { --x: 27%; --t: 17s; --d: -9s; } .p3 { --x: 46%; --t: 12s; --d: -6s; }
.p4 { --x: 61%; --t: 16s; --d: -13s; } .p5 { --x: 78%; --t: 14s; --d: -4s; } .p6 { --x: 93%; --t: 18s; --d: -11s; }
@keyframes drift {
  0% { transform: none; } 25% { transform: translate(50px, 28vh) rotate(80deg); } 50% { transform: translate(-30px, 55vh) rotate(10deg); }
  75% { transform: translate(45px, 82vh) rotate(95deg); } 100% { transform: translate(-20px, 112vh) rotate(20deg); }
}

/* ---------- Các loại gà ---------- */
.kinds { background: var(--pine); color: #fff; }
.pens { display: grid; grid-template-columns: 1.1fr 1fr; gap: 1.25rem; margin-top: 3rem; }
.pen { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 17rem; padding: clamp(1.5rem, 3vw, 2.5rem); border-radius: 28px; color: var(--pine); overflow: clip; }
.pen p { margin-top: .5rem; max-width: 24rem; }
.pen svg { flex: none; transition: transform .7s var(--out); }
.pen-big { grid-row: span 2; flex-direction: column; align-items: start; background: var(--yolk); }
.pen-big svg { width: min(88%, 25rem); align-self: end; margin-bottom: -3.5rem; }
.pen-hen { background: #fff3cc; --body: #a8482a; --wing: #d97a3a; --wing2: #6f2a17; --tail: #6f2a17; }
.pen-young { background: #1a6e59; color: #fff; }
.pen-hen svg, .pen-young svg { width: 44%; --flap: .9s; }
.pen-vet { grid-column: 1 / -1; min-height: 0; background: #fff; }
.pen-vet p { max-width: 36rem; }
.pen-vet svg { width: 8rem; margin-block: -1rem; }
.pen:hover svg { transform: translateY(-14px) rotate(-5deg); }

/* ---------- Gà lớn dần ---------- */
.grow { background: var(--dawn, #fff3cc); color: var(--sky-ink); text-align: center; --flap: .7s; }
.stages { display: grid; grid-template-columns: repeat(4, 1fr); align-items: end; gap: 1.5rem; margin-top: 3rem; }
.stages svg { width: var(--s); max-width: 100%; margin: 0 auto 1rem; }
.stages li:nth-child(1) { --s: 6rem; } .stages li:nth-child(2) { --s: 8rem; }
.stages li:nth-child(3) { --s: 13rem; --body: #a8482a; --wing: #f58a1c; --wing2: #6f2a17; --tail: #6f2a17; } .stages li:nth-child(4) { --s: 18rem; }

/* ---------- Đoán cân ---------- */
.weigh { background: #a3190c; color: #fff; }
.weigh form { display: grid; grid-template-columns: minmax(0, 25rem) minmax(0, 36rem); justify-content: center; align-items: center; gap: clamp(2rem, 6vw, 5rem); }
.scale { position: relative; overflow: clip; border-radius: 24px; }
.scale img { display: block; width: 100%; height: auto; }
.dial { position: absolute; left: 58.4%; top: 73.5%; width: 46%; translate: -50% -50%; }
.dial text { font: 700 15px "Be Vietnam Pro", sans-serif; text-anchor: middle; fill: var(--pine); }
.needle { fill: var(--comb); transform-origin: 100px 100px; }
.weigh fieldset { border: 0; padding: 0; margin: 1rem 0 1.5rem; display: flex; flex-wrap: wrap; gap: .75rem; }
.weigh legend { padding: 0 0 1.25rem; }
.weigh label, .weigh button { font: 700 1.125rem/1 "Be Vietnam Pro", sans-serif; padding: 1.1rem 1.5rem; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.weigh label { background: var(--yolk); color: var(--pine); transition: translate .3s var(--out); }
.weigh label:hover { translate: 0 -4px; }
.weigh label:has(:checked) { background: #fff; }
.weigh label:has(:focus-visible) { outline: 3px solid #fff; outline-offset: 3px; }
.weigh input { position: absolute; opacity: 0; }
.weigh button { background: none; color: #fff; border: 2px solid #fff; visibility: hidden; }
.answer { font-size: 1.375rem; font-weight: 700; min-height: 2.2em; }
.answer span { display: none; }
.weigh form:has([value="3.5"]:checked) .right, .weigh form:has(:checked:not([value="3.5"])) .wrong { display: inline; animation: tell .3s 1.5s backwards; }
.weigh form:has(:checked) button { visibility: visible; }
.weigh form:has(:checked) .needle { transform: rotate(84deg); transition: transform 1.4s cubic-bezier(.3, 1.7, .5, 1); }
.weigh form:has(:checked) .dial { opacity: 0; transition: opacity .6s 2.4s; }
@keyframes tell { from { opacity: 0; } }

/* ---------- Hỏi giá ---------- */
.ask { background: #1a6e59; color: #fff; }
.ask > p { margin-top: .75rem; }
.on-phone { display: none; }
.ask ul { margin-top: 2.5rem; }
.ask li a { align-items: center; justify-content: space-between; gap: 1rem; padding: 1.4rem 0; border-top: 1px solid #ffffff55; text-decoration: none; transition: padding .4s var(--out), background-color .3s; }
.ask li a.on-desktop { display: flex; }
.ask li a:hover { padding-inline: 1.5rem; background: #14594b; }
.ask strong { font: 400 clamp(1.25rem, 2.6vw, 2rem)/1.3 var(--display); }
.ask li span { flex: none; font-weight: 700; background: var(--yolk); color: var(--pine); padding: .6rem 1.1rem; border-radius: 999px; line-height: 1.3; }

/* ---------- Chủ cửa hàng ---------- */
.owner { background: #fff; display: grid; grid-template-columns: minmax(0, 24rem) minmax(0, 36rem); justify-content: center; align-items: center; gap: clamp(2.5rem, 7vw, 6rem); }
.owner p { margin: 1.25rem 0 1rem; font-size: 1.25rem; }
.portrait { position: relative; }
.portrait img { display: block; width: 100%; height: auto; aspect-ratio: 5 / 6; object-fit: cover; object-position: 35% 50%; border-radius: 50% / 58% 58% 42% 42%; }
.portrait svg { position: absolute; right: -2.5rem; bottom: -1rem; width: 9.5rem; --body: #f58a1c; --wing: #ffc01f; --wing2: #96281a; --tail: #96281a; animation: bob 1.7s ease-in-out infinite alternate; animation-play-state: var(--play); }

/* ---------- Ảnh gà thực tế ---------- */
.photos { background: var(--pine); color: #fff; }
.gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2rem 1.25rem; margin-top: 3rem; }
.gallery .wide { grid-column: span 2; }
.gallery a { display: block; overflow: clip; border-radius: 20px; }
.gallery img { display: block; width: 100%; height: auto; transition: transform .8s var(--out); }
.gallery a:hover img { transform: scale(1.06) rotate(-1deg); }
.gallery figcaption { margin-top: .6rem; font-weight: 600; line-height: 1.4; }

/* ---------- Trứng nở ---------- */
.hatch { background: var(--husk); text-align: center; }
.hatch > p { margin-top: .75rem; }
.eggs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1rem; max-width: 68rem; margin: 2rem auto 0; }
.egg { display: block; cursor: pointer; border-radius: 20px; padding-bottom: .5rem; }
.egg input { position: absolute; opacity: 0; }
.egg:has(:focus-visible) { outline: 3px solid var(--pine); }
.egg-stage { display: block; position: relative; width: min(100%, 10rem); aspect-ratio: 120 / 170; margin: auto; transform-origin: 50% 97%; }
.egg-stage svg { position: absolute; inset: 0; }
.egg :checked + .egg-stage svg { transition: transform .6s cubic-bezier(.3, 1.5, .5, 1), opacity .4s .25s; }
/* Khi trứng còn đóng, 3 con thay phiên nhau bên trong. Bấm trứng thì dừng lại ở con đang tới lượt. */
.egg-stage .chick { --a: 1; --b: 0; --c: 0; opacity: 0; animation: shuffle .5s step-end infinite; }
.chick use:nth-child(1) { opacity: var(--a); }
.chick use:nth-child(2) { opacity: var(--b); }
.chick use:nth-child(3) { opacity: var(--c); }
.egg:hover :not(:checked) + .egg-stage, .egg:hover input:not(:checked) + .egg-stage { animation: wobble .5s ease-in-out infinite; }
.egg :checked + .egg-stage .lid { transform: translate(45%, -60%) rotate(75deg); opacity: 0; }
.egg :checked + .egg-stage .chick { transform: translateY(-23%); opacity: 1; transition: transform .6s cubic-bezier(.3, 1.5, .5, 1); animation-play-state: paused; }
.dish { display: block; font-weight: 700; line-height: 1.4; margin-top: .5rem; text-wrap: balance; }
@keyframes shuffle {
  0% { --a: 1; --b: 0; --c: 0; }
  33% { --a: 0; --b: 1; --c: 0; }
  66%, 100% { --a: 0; --b: 0; --c: 1; }
}
@keyframes wobble { 25% { transform: rotate(-7deg); } 75% { transform: rotate(7deg); } }

/* ---------- Cách đặt ---------- */
.steps { background: #fff; }
.route { position: relative; height: 8rem; margin-top: 1rem; border-bottom: 4px dotted var(--yolk); }
.route svg { position: absolute; bottom: .75rem; left: 0; width: 8rem; --wing: #ffc01f; --body: #f58a1c; --tail: #96281a; --wing2: #96281a; }
.steps ol { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.5rem; margin-top: 2rem; counter-reset: s; }
.steps li { counter-increment: s; }
.steps h3::before { content: counter(s) ". "; color: var(--comb); }
.steps li p { margin-top: .4rem; max-width: 22rem; }

/* ---------- Cẩm nang nuôi gà ---------- */
.guide { background: var(--husk); display: grid; grid-template-columns: 1fr 1.4fr; gap: 2rem 4rem; align-items: start; }
.guide details { border-bottom: 2px solid var(--pine); }
.guide summary { display: flex; justify-content: space-between; gap: 1rem; padding: 1.2rem 0; font-weight: 700; font-size: 1.25rem; line-height: 1.4; cursor: pointer; list-style: none; }
.guide summary::-webkit-details-marker { display: none; }
.guide summary::after { content: ""; flex: none; width: 18px; height: 24px; margin-top: .15rem; background: #fff; border-radius: 50% / 58% 58% 42% 42%; transition: rotate .5s var(--out), background-color .3s; }
.guide [open] summary::after { rotate: 180deg; background: var(--comb); }
.guide details p { padding-bottom: 1.4rem; max-width: 40rem; }

/* ---------- Quy định ---------- */
.rules { background: var(--pine); color: #fff; }
.rules dl { margin-top: 2.5rem; }
.rules dl div { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem 3rem; padding: 1.5rem 0; border-top: 1px solid #ffffff40; }
.rules dt { font-weight: 700; font-size: 1.25rem; line-height: 1.4; color: var(--yolk); }
.rules dd { max-width: 34rem; }

/* ---------- Rút quẻ gà ---------- */
.omen { background: #a3190c; color: #fff; text-align: center; }
.omen-card { display: block; width: min(100%, 24rem); height: 15rem; margin: 2.5rem auto 1.5rem; perspective: 60rem; cursor: pointer; border-radius: 24px; }
.omen-card:has(:focus-visible) { outline: 3px solid #fff; outline-offset: 6px; }
.omen-card input { position: absolute; opacity: 0; }
.omen-flip { display: block; position: relative; height: 100%; transform-style: preserve-3d; }
.omen-card :checked + .omen-flip { transform: rotateY(180deg); transition: transform .9s var(--out); }
.omen-front, .omen-back { position: absolute; inset: 0; border-radius: 24px; overflow: clip; backface-visibility: hidden; color: var(--pine); }
.omen-front { background: var(--yolk); display: grid; place-content: center; justify-items: center; gap: .75rem; font-weight: 700; --flap: .6s; }
.omen-front svg { width: 9rem; }
.omen-back { background: #fff; transform: rotateY(180deg); }
/* Sáu quẻ chạy vòng khi thẻ còn úp, bấm vào thì dừng ở một quẻ */
.omen-list { display: block; animation: omen .72s steps(6) infinite; }
.omen-card :checked + .omen-flip .omen-list { animation-play-state: paused; }
.omen-list > span { height: 15rem; display: grid; place-content: center; gap: .5rem; padding: 1.5rem; font-size: 1.25rem; text-wrap: balance; }
.omen-list b { font: 400 1.75rem/1.3 var(--display); color: var(--comb); }
@keyframes omen { to { transform: translateY(-100%); } }

/* ---------- Giao diện Tết (bật bằng class="tet" ở thẻ html) ---------- */
.tet-hat { opacity: var(--tet, 0); }
.tet-wish { display: none; }
.tet { --tet: 1; }
.tet .hero-text .tet-wish { display: block; margin: 0; font: 400 1.5rem/1.4 var(--display); color: var(--comb); }
.tet:has(#night:checked) .hero-text .tet-wish { color: var(--yolk); }
.tet .feather { width: 18px; height: 18px; background: #f0568c; border-radius: 80% 10% 80% 40%; }

/* ---------- Liên hệ ---------- */
.contact { background: var(--sky); color: var(--sky-ink); min-height: 36rem; display: grid; align-content: center; justify-items: center; text-align: center; gap: 1.25rem; }
.contact > :not(.sky) { position: relative; }
.contact h2 { font-size: clamp(2.4rem, 6.4vw, 5.5rem); }
.contact .actions { justify-content: center; margin-top: .75rem; }

.phone { font: 400 clamp(1.75rem, 3.6vw, 2.75rem)/1.2 var(--display); text-decoration: none; white-space: nowrap; }
.phone:hover { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 6px; }
footer { color: var(--sky-ink); padding: .75rem var(--gutter); text-align: center; font-size: .6875rem; }

/* ---------- Chuyển động theo cuộn trang ---------- */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .pen, .gallery figure { animation: pop linear backwards; animation-timeline: view(); animation-range: entry 0% entry 75%; }
    .grow { height: 320vh; padding: 0; view-timeline: --grow; }
    .grow-pin { position: sticky; top: 0; height: 100svh; padding: 7rem var(--gutter) 5rem; display: grid; grid-template-rows: auto 1fr; }
    .stages { grid-template-columns: 1fr; margin: 0; }
    .stages li { grid-area: 1 / 1; transform-origin: 50% 100%; animation: stage linear both; animation-timeline: --grow; }
    .stages svg { width: min(var(--s) * 1.5, 48svh); }
    .stages li:nth-child(1) { animation-name: stage-first; animation-range: contain 0% contain 27%; }
    .stages li:nth-child(1) svg { transform-origin: 50% 95%; animation: crack linear; animation-timeline: --grow; animation-range: contain 0% contain 27%; }
    .stages li:nth-child(2) { animation-range: contain 24% contain 53%; }
    .stages li:nth-child(3) { animation-range: contain 50% contain 79%; }
    .stages li:nth-child(4) { animation-name: stage-last; animation-range: contain 76% contain 86%; }
    .route svg { animation: cross linear both; animation-timeline: view(); animation-range: entry 60% exit 0%; }
  }
}
@keyframes stage { 0% { opacity: 0; transform: scale(.5); } 15% { opacity: 1; transform: none; } 88% { opacity: 1; transform: scale(1.12); } 100% { opacity: 0; transform: scale(1.2); } }
@keyframes stage-first { 85% { opacity: 1; } 100% { opacity: 0; } }
@keyframes crack { 20%, 50%, 75% { transform: rotate(-9deg); } 40%, 65%, 85% { transform: rotate(9deg); } }
@keyframes stage-last { from { opacity: 0; transform: scale(.5); } }
@keyframes pop { from { transform: translateY(90px) rotate(3deg); } }
@keyframes cross { from { left: 0; } to { left: calc(100% - 8rem); } }

/* ---------- Nút liên hệ cố định trên điện thoại ---------- */
.dock { display: none; }

@media (max-width: 1100px) { .top nav { display: none; } }

/* ---------- Màn hình nhỏ ---------- */
@media (max-width: 820px) {
  .top nav { display: none; }
  .top { gap: .75rem; }
  .brand { font-size: clamp(.8rem, 4vw, 1.125rem); }
  .rest { font-size: .85rem; }
  .hero { grid-template-columns: 1fr; gap: 3rem; padding-bottom: 6rem; }
  h1 { font-size: clamp(3rem, 15vw, 6rem); }
  .star { width: min(82%, 24rem); }
  .owner, .weigh form, .guide { grid-template-columns: 1fr; }
  p.on-phone { display: block; }
  .ask li a.on-phone { display: flex; }
  .on-desktop, .ask li a.on-desktop { display: none; }
  body { padding-bottom: 4.5rem; }
  .grow .grow-pin { padding-bottom: 7rem; }
  .dock { position: fixed; inset: auto 0 0; z-index: 10; display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; padding: .5rem .75rem calc(.5rem + env(safe-area-inset-bottom)); background: var(--pine); }
  .dock a { padding: .9rem; border-radius: 999px; text-align: center; font-weight: 700; line-height: 1.4; text-decoration: none; background: var(--comb); color: #fff; }
  .dock a + a { background: #fff; color: var(--pine); }
  .gallery { grid-template-columns: 1fr 1fr; gap: 1.5rem .75rem; }
  .portrait { width: min(75%, 20rem); margin: auto; }
  .hill { height: 10rem; width: 200%; left: -100%; }
  .hint { top: calc(100% + .5rem); font-size: .85rem; text-wrap: balance; }
  .weigh { padding-block: 3rem; }
  .weigh form { gap: 1rem; }
  .scale { order: 1; width: 62%; margin: auto; }
  .weigh fieldset { margin: .5rem 0 1rem; gap: .5rem; }
  .weigh legend { padding-bottom: .75rem; }
  .weigh label, .weigh button { padding: .9rem 1.1rem; font-size: 1rem; }
  .answer { font-size: 1.125rem; min-height: 1.6em; }
  .f1 { --w: 6rem; --y: 9%; }
  .f3 { --y: 14%; }
  .f4 { display: none; }
  .pens, .steps ol, .rules dl div { grid-template-columns: 1fr; }
  .pen-big { grid-row: auto; }
  .eggs { display: flex; flex-wrap: wrap; justify-content: center; }
  .eggs li { width: calc(33% - 1rem); min-width: 6rem; }
}

/* Người dùng đã tắt chuyển động trong máy */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .feather, .rest { display: none; }
  /* Giữ phần chọn ngẫu nhiên, vì nó chạy ngầm chứ không chuyển động trên màn hình */
  .egg-stage .chick { animation: shuffle .5s step-end infinite !important; }
  .omen-list { animation: omen .72s steps(6) infinite !important; }
  .egg :checked + .egg-stage .chick, .omen-card :checked + .omen-flip .omen-list { animation-play-state: paused !important; }
}
