@font-face {
  font-family: "UTM Avo";
  src: url('/UTM-Avo.ttf') format('truetype');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "UTM Avo";
  src: url('/UTM-Avo-Bold.ttf') format('truetype');
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Playfair Display";
  src: url('/Playfair-Display.ttf') format('truetype');
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
}
@font-face {
  font-family: "MJ Milestone";
  src: url('/MJ-Milestone-Script.ttf') format('truetype');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
:root{--pine:#20433b;--red:#ab3629;--paper:#fbf5e8;--ink:#29251f;--line:#e6d8c0;--gold:#d99c4c;--font-sans:"UTM Avo",system-ui,-apple-system,sans-serif;--font-serif:"Playfair Display",Georgia,'Times New Roman',serif;--font-script:"MJ Milestone",var(--font-serif);font-family:var(--font-sans);color:var(--ink);background:var(--paper);font-size:100%;line-height:1.6}*{box-sizing:border-box}body{margin:0}button,input,select{font:inherit}button,a{touch-action:manipulation}button{cursor:pointer}a{color:inherit}h1,h2,h3,p{margin:0}h1,h2,h3,.brand{font-family:var(--font-serif)}h2{font-size:clamp(2rem,5vw,3.15rem);line-height:1.08}h3{font-size:1.48rem}button,a,input,select{outline-offset:4px}button:disabled{cursor:wait;opacity:.65}.shell{width:min(1180px, calc(100% - 48px));margin-inline:auto}.top{background:#173d35;color:#fff5de}.topinner{min-height:72px;display:flex;align-items:center;justify-content:space-between;gap:20px}.brand{display:inline-flex;align-items:center;gap:10px;min-width:0;text-decoration:none;font-weight:bold;font-size:1.21rem;line-height:1.2}.brand-logo{display:block;flex:none;width:42px;height:auto}nav{display:flex;gap:24px}nav a{font-size:.9375rem;text-decoration:none}nav a:hover{text-decoration:underline}.footerinner button{border:1px solid #b3aa86;background:transparent;color:inherit;border-radius:99px;padding:7px 13px;white-space:nowrap}.hero{background:#f5e8ca;border-bottom:1px solid var(--line)}.herogrid{display:grid;grid-template-columns:1.04fr 1fr;gap:40px;align-items:center;min-height:480px;padding-block:39px}.herocopy{min-width:0}.date{display:inline-block;color:#7b3328;background:#f8efdb;border:1px solid #d8b79b;padding:5px 12px;border-radius:99px;font-size:.84rem;letter-spacing:.095em;font-weight:800}.herocopy h1{color:var(--pine);font-size:clamp(2.75rem,7.2vw,5.6rem);line-height:1;letter-spacing:normal;margin:21px 0 19px}.herocopy h1 em{font-family:var(--font-script);font-style:normal;font-weight:400;color:var(--red)}.herocopy p{max-width:435px;font-size:1.0625rem;line-height:1.6;color:#514333}.heroimage{width:100%;aspect-ratio:1.25;background:#daa25d url('/van-hoa-ba-mien.webp') center/cover;border-radius:48% 48% 5px 5px;border:5px solid #faedd1;box-shadow:0 0 0 1px #c39250,0 12px 0 #ccac7460}.buttons{display:flex;flex-wrap:wrap;align-items:center;gap:10px;margin-top:24px}.primary,.ghost,.play{display:inline-block;text-decoration:none;padding:10px 16px;border-radius:6px;border:1px solid #b49573;font-size:.9375rem;line-height:1.4;font-weight:700}.primary{color:#fff7ec;background:var(--red);border-color:var(--red)}.primary:hover{background:#84291e}.ghost{color:var(--pine);background:#fff9e7}.play{margin-top:auto;background:var(--pine);color:#fff7e6;border-color:var(--pine);width:100%}.play:hover{background:#2c574d}.journey,.tradition,.ranking{padding-block:52px}.heading{display:flex;gap:20px;justify-content:space-between;align-items:end;margin-bottom:23px}.heading p{color:#624e3b;text-align:right;font-size:.95rem}.kicker{color:#934534;font-weight:800;font-size:.84rem;letter-spacing:.13em;margin-bottom:8px}.cards,.trad-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:18px}.cards article,.trad-grid article{overflow:hidden;border:1px solid var(--line);border-radius:11px;background:#fffbf0;display:flex;flex-direction:column}.art{height:97px;display:grid;place-items:center;padding:15px;background-image:repeating-linear-gradient(45deg,transparent 0 19px,#fbd28a26 20px 22px)}.art.one{background-color:#a94434}.art.two{background-color:#346050}.art.three{background-color:#966128}.art span{font:bold 2.5rem var(--font-serif);color:#fff2d9;border:1px solid #f8dfaa96;border-radius:50%;background:#18221936;width:62px;height:62px;display:grid;place-items:center;line-height:1}.cardbody{display:flex;flex-direction:column;gap:10px;padding:16px;flex:1}.cardbody p{color:#5f503f;margin-bottom:8px}.ranking{background:#f0e4cd}.tablewrap{overflow:auto;background:#fffaf0;border:1px solid #dcc9a9;border-radius:9px}table{border-collapse:collapse;width:100%;text-align:left}th,td{padding:12px 16px;border-bottom:1px solid #eadfc9}th{font-size:.89rem;color:var(--pine);white-space:nowrap}tr:last-child td{border-bottom:0}.tradition>p{margin-top:13px;max-width:700px}.trad-grid{margin-top:20px;grid-template-columns:repeat(2,1fr)}.trad-grid article{padding:17px;gap:8px}footer{background:var(--pine);color:#fff5dc}.footerinner{min-height:75px;display:flex;gap:16px;align-items:center;flex-wrap:wrap}.footerinner span{margin-right:auto}.footerinner a{font-size:.91rem}dialog{border:1px solid #d3ad75;border-radius:13px;padding:0;width:min(720px,calc(100% - 24px));max-height:calc(100dvh - 24px);background:#fffaee;color:var(--ink)}dialog::backdrop{background:#1c2822b5}.dialogbar{display:flex;justify-content:space-between;align-items:center;background:var(--pine);color:#fff7e5;padding:10px 19px;position:sticky;top:0;z-index:2}.dialogbar button{border:0;background:transparent;color:white;font-size:1.8rem;line-height:1;padding:4px 7px}#panelbody{padding:21px}#panelbody p{margin-bottom:12px}form{display:grid;gap:12px}input,select{padding:9px;border:1px solid #ae9570;border-radius:5px;color:var(--ink);background:#fffdf4;max-width:100%}label{display:grid;gap:4px}fieldset{min-width:0;border:1px solid var(--line);border-radius:6px;margin:0 0 13px;padding:10px}legend{font-weight:700;padding:0 6px}fieldset label{display:flex;align-items:center;gap:9px;padding:6px 4px}.roundbar{display:flex;justify-content:space-between;align-items:center;position:sticky;top:54px;background:#fffaee;padding-block:5px;z-index:1}.clock{font:800 1.3rem var(--font-sans);color:var(--red);font-variant-numeric:tabular-nums}.beat{margin-block:12px;padding:25px;background:#e6efdd;border-radius:14px;text-align:center}.beat.hot{background:#f1c274}.pull{width:100%;min-height:72px;font-size:1.35rem}.trackline{display:flex;gap:9px;align-items:center;flex-wrap:wrap}.trackline label{flex:1}.adminitem{padding:12px 0;border-top:1px solid var(--line)}#toast{position:fixed;z-index:4;right:16px;bottom:16px;max-width:min(500px,calc(100% - 32px));background:#223d34;padding:11px 17px;border-radius:7px;color:white;box-shadow:0 5px 20px #0005}.ticket{position:relative;margin-top:25px;padding:18px;border:2px dashed #ab6941;border-radius:12px;background:#fff6d9}.ticket p{margin:6px 0 12px}.question-audio{margin:5px 0 8px}.fine{font-size:.9rem;color:#5b4a36}.error{color:#9c2119;font-weight:700}.tabbed{margin-top:14px}.statusline{margin:10px 0}.notice{background:#eadfbf;border-radius:6px;padding:10px 13px}.success{color:#1c6342}.review{margin-top:17px}summary{cursor:pointer;font-weight:700}
@media(max-width:760px){.shell{width:calc(100% - 30px)}.topinner{min-height:61px;gap:9px}.brand{gap:8px;font-size:clamp(.83rem,4vw,1.04rem)}.brand-logo{width:36px}nav{display:none}.herogrid{grid-template-columns:1fr;gap:22px;padding-block:24px 32px}.heroimage{aspect-ratio:1.55}.herocopy p{font-size:1rem}.herocopy h1{margin-block:15px}.hero h1 br{display:none}.hero h1 em{display:block;font-size:clamp(2.55rem,11.5vw,5.6rem)}.cards{grid-template-columns:1fr}.art{height:78px}.journey,.tradition,.ranking{padding-block:35px}.trad-grid{grid-template-columns:1fr}.heading{align-items:start}.heading p{font-size:.875rem}th,td{padding:8px}.footerinner{padding-block:9px}.footerinner span{flex-basis:100%}}
[hidden]{display:none!important}.phase{font-size:.92rem!important;color:#215345!important;font-weight:700;margin-bottom:7px}.art{height:170px;background-position:center;background-size:cover}.art.one{background-image:url('/wrestling-woodcut.webp'),url('/wrestling-arena.webp');background-size:auto 96%,cover;background-repeat:no-repeat;background-position:center bottom,center}.art.two{background-image:url('/poster-chu-cai.webp')}.art.three{background-image:url('/poster-nhac-cu.webp')}#logout{margin-bottom:10px}.admin-root{padding-block:34px 56px}.admin-root h1{font-size:clamp(2.2rem,6vw,4rem);color:var(--pine);margin-bottom:9px}.admin-root h2{font-size:clamp(1.6rem,4vw,2.4rem);margin-bottom:10px;color:var(--pine)}.admin-root .buttons{margin-bottom:20px}.admin-section{background:#fffbf0;border:1px solid var(--line);border-radius:12px;padding:clamp(14px,3vw,24px);margin:16px 0;scroll-margin-top:12px}.admin-section>p{margin-bottom:10px}.admin-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin-top:14px}.setting-box{padding:15px;border:1px solid var(--line);border-radius:8px}.setting-box h3{margin-bottom:5px}.setting-box form{margin-top:9px}.statusline:empty{display:none}.admin-root audio{max-width:min(100%,360px)}.footerinner a:last-child{border:1px solid #b3aa86;border-radius:99px;padding:7px 13px;text-decoration:none}.beat{background:#e6efdd url('/wrestling-cover.webp') center/cover;min-height:155px;display:grid;place-items:center;color:white;font-weight:900;font-size:1.6rem;text-shadow:0 2px 6px #24211b;background-blend-mode:multiply}.beat.hot{background-color:#ffbc57;color:#fff9dd}.beat:not(.hot){background-color:#7a8a7a}.admin-section .trackline>*{flex-shrink:1}@media(max-width:760px){.art{height:155px}.admin-grid{grid-template-columns:1fr}}
.game-panel{width:min(920px,calc(100% - 22px));max-height:calc(100dvh - 18px)}.game-panel #panelbody{padding:clamp(12px,3vw,22px)}.game-cover{height:160px;display:flex;align-items:flex-end;padding:13px;background:#785346 url('/stage-words.webp') center 42%/cover;border-radius:10px;overflow:hidden;color:#fff7de;margin-block:7px 14px}.game-cover.music{background-image:url('/stage-music.webp')}.game-cover.rope{background-image:url('/wrestling-arena.webp')}.game-cover.rope:not(.game-result){background-image:url('/wrestling-woodcut.webp'),url('/wrestling-arena.webp');background-size:auto 96%,cover;background-repeat:no-repeat;background-position:center bottom,center}.game-cover span{background:#173d35e8;padding:5px 9px;border-radius:4px;font-weight:750}.game-result{display:block;height:auto;min-height:151px;padding:24px;background-color:#413127aa;background-blend-mode:multiply}.game-result h2{line-height:1.05;margin-bottom:8px;text-shadow:0 2px 7px #20150e}.game-result p{display:inline-block;background:#342c22d9;padding:5px 9px;border-radius:4px}.game-actions{display:flex;gap:10px;flex-wrap:wrap;align-items:center;margin-top:12px}.rhythm-rail{position:relative;height:18px;background:#23433a;border:2px solid #886436;border-radius:999px;overflow:hidden}.rhythm-target{position:absolute;left:18%;right:18%;top:0;bottom:0;background:#d49b32}.rhythm-bead{height:100%;width:8px;position:absolute;background:#fff2d1;border-radius:12px;box-shadow:0 0 6px #141c18;transform:translateX(-50%)}.rhythm-cue{min-height:25px;color:#742b22;text-align:center;font-weight:850}.pull.armed{background:#eab444;color:#423013;border-color:#a76718;box-shadow:0 0 0 3px #f6db9a}.question-steps{display:flex;gap:5px;flex-wrap:wrap;margin:12px 0}.question-dot{height:33px;width:33px;border-radius:50%;border:1px solid #cdb190;background:#fff8e4;color:#3a5142;padding:0;font-size:.90rem}.question-dot.answered{background:#dce9d6;border-color:#87a786}.question-dot[aria-current=step]{background:#265044;color:#fff4dd;border-color:#265044}.question-content h3{font-size:clamp(1.18rem,3.4vw,1.58rem);line-height:1.22;margin:9px 0 13px}.game-choices{display:grid;grid-template-columns:1fr 1fr;gap:8px}.game-choice{background:#fff9eb;color:#2e362a;border:1px solid #cbb48d;border-radius:7px;padding:11px;text-align:left;line-height:1.45;min-height:45px}.game-choice:hover{border-color:#427052;background:#f1f5e8}.game-choice[aria-pressed=true]{border-color:#397e56;background:#e1efdd;font-weight:800;color:#24513a}.quiz-nav{justify-content:space-between}.quiz-nav .primary{margin-left:auto}.answer-feedback{margin:6px 0 0!important;height:auto;min-height:23px;color:#355638;font-size:.9rem}.instrument-console{display:flex;align-items:center;gap:14px;padding:8px 11px;background:#24493d;border:1px solid #927b4b;border-radius:7px;margin-bottom:12px}.instrument-console button{margin:0}.instrument-bars{display:flex;align-items:center;gap:4px;height:35px;flex:1;justify-content:center}.instrument-bars span{width:4px;height:calc(8px + mod(var(--i),5)*4px);min-height:6px;border-radius:6px;background:#efbe61}.instrument-bars span:nth-child(3n){height:20px}.instrument-bars span:nth-child(3n+1){height:13px}.instrument-bars.playing span{animation:playing .42s ease-in-out alternate infinite;animation-delay:calc(var(--i)*-74ms)}@keyframes playing{from{transform:scaleY(.45)}to{transform:scaleY(1.42);background:#fff0a5}}@media(max-width:600px){.game-cover{height:108px}.game-result{height:auto}.game-choices{grid-template-columns:1fr;gap:6px}.question-steps{gap:4px;margin-block:8px}.question-dot{width:29px;height:29px}.game-choice{min-height:42px}.pull{min-height:58px}.quiz-nav{gap:6px}.quiz-nav button{padding:8px 11px}}@media(prefers-reduced-motion:reduce){.rope-teams,.instrument-bars.playing span{animation:none}}
.contest-dates{display:grid;gap:12px;grid-template-columns:1fr 1fr}.contest-toggles{display:grid;gap:4px;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));margin:0}.inline-control{display:flex;align-items:center;gap:8px}.contest-hint{margin-top:12px;margin-bottom:0!important}#controls select{width:min(100%,340px)}@media(max-width:560px){.contest-dates{grid-template-columns:1fr}}
.tap-tally{display:flex;gap:11px;flex-wrap:wrap;align-items:center;color:#fff8df}.tap-tally span,.tap-tally strong{padding:5px 9px;background:#173d35e8;border-radius:4px}

.wrestling-arena {
  position: relative;
  height: clamp(210px, 44vw, 360px);
  margin: 7px 0 14px;
  overflow: hidden;
  isolation: isolate;
  border: 3px solid #efd4a4;
  border-radius: 11px;
  background: #aa6936 url('/wrestling-arena.webp') center 58% / cover;
}
.wrestling-arena.ready { border-color: #ffdc6e; }
.wrestling-pair {
  position: absolute;
  display: block;
  left: 50%;
  bottom: 12%;
  width: min(72%, 410px);
  height: 72%;
  object-fit: contain;
  object-position: center bottom;
  transform-origin: center 88%;
  transform: translateX(calc(-50% + var(--shift, 0%))) rotate(var(--tilt, 0deg)) scaleY(var(--stance, 1));
  transition: transform 100ms ease-out;
  filter: drop-shadow(0 6px 4px #542812a0);
  pointer-events: none;
}
.wrestling-lunge .wrestling-pair { --tilt: 9deg; --stance: .91; }
.wrestling-scores {
  position: absolute;
  inset: 10px 10px auto;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.wrestling-scores span {
  padding: 5px 12px;
  border: 1px solid #ffd398;
  border-radius: 999px;
  background: #263b69;
  color: #fff9e9;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}
.wrestling-scores span + span { background: #872f26; }
.wrestling-action {
  min-height: 64px;
  touch-action: manipulation;
  user-select: none;
}
.wrestling-feedback { margin-top: 8px; }
@media (prefers-reduced-motion: reduce) {
  .wrestling-pair { transform: translateX(-50%); transition: none; }
}

/* Hội làng entry screens */
.festival-loader[hidden] { display: none; }
.festival-loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #163c33;
  color: #fff3dd;
  text-align: center;
  transition: opacity .24s ease, visibility .24s ease;
}
.festival-loader--leaving { opacity: 0; visibility: hidden; pointer-events: none; }
.festival-loader__banner {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg,#163c33 4%,#163c33db 43%,#163c3366 100%), url('/festival.webp') center 44% / cover;
}
.festival-loader__content { position: relative; padding: 1.5rem; }
.entrance__seal {
  display: grid;
  place-items: center;
  width: 4.75rem;
  aspect-ratio: 1;
  border: 1px solid #fbca82;
  outline: 1px dashed #fbca82;
  outline-offset: 5px;
  border-radius: 50%;
  background: #a9362a;
  color: #ffe5ac;
  font-size: 2.5rem;
  box-shadow: 0 0 2rem #da854955;
}
.festival-loader__logo {
  display: block;
  width: clamp(7rem, 24vw, 11rem);
  height: auto;
  margin: 0 auto 1.45rem;
}
.festival-loader__title { font: 700 clamp(2.15rem,7vw,5rem)/1.12 var(--font-serif); margin-bottom: .85rem; }
.festival-loader__title em { color: #ffce83; font-family: var(--font-script); font-style: normal; font-weight: 400; }
.festival-loader__dots { animation: seal-breathe .85s ease-in-out infinite alternate; }
.festival-loader__line { position: relative; overflow: hidden; width: 8rem; height: 3px; margin: 1.15rem auto 0; border-radius: 1rem; background: #ffce8340; }
.festival-loader__line::after { content: ''; position: absolute; inset: 0; width: 45%; border-radius: inherit; background: #ffce83; animation: festival-sweep .85s ease-in-out infinite alternate; }
@keyframes seal-breathe { from { transform: scale(.95); opacity: .75; } to { transform: scale(1.05); opacity: 1; } }
@keyframes festival-sweep { from { transform: translateX(-30%); } to { transform: translateX(155%); } }

dialog.login-panel { width: min(760px,calc(100% - 1.5rem)); max-height: calc(100dvh - 1.5rem); padding: 0; }
.login-panel #panelbody { padding: 0; }
.entrance {
  display: grid;
  grid-template-columns: minmax(0,.88fr) minmax(0,1.12fr);
  overflow: hidden;
  background: #fff7e9;
  color: #20433b;
}
#admin-root > .entrance { max-width: 760px; margin-inline: auto; border: 1px solid var(--line); border-radius: .8rem; }
.entrance__scenery { position: relative; isolation: isolate; display: grid; place-items: end center; min-height: 15rem; padding: 2rem; background: #8e4630; overflow: hidden; }
.entrance__scenery::before { content: ''; position: absolute; z-index: -1; inset: 0; background: linear-gradient(0deg,#442618be,transparent 70%),url('/festival.webp') center / cover; animation: entrance-landscape 9s ease-out both; }
.entrance__seal { width: 3.75rem; font-size: 2rem; animation: seal-breathe 2.4s ease-in-out infinite alternate; }
.entrance__map {
  display: grid;
  align-content: center;
  justify-items: center;
  margin: 0;
  padding: .65rem;
  border-inline-end: 1px solid #dbc191;
  background: #edce98;
}
.entrance__map-art { position: relative; width: min(100%, 18rem); }
.entrance__map-image { display: block; width: 100%; height: auto; }
.entrance__map-logo {
  position: absolute;
  inset: 10% 8% auto auto;
  width: 26%;
  height: auto;
  opacity: .42;
}
.entrance__content { display: grid; align-content: center; gap: .75rem; min-width: 0; padding: clamp(1rem,4vw,2.5rem); }
.entrance__content h2 { font-size: clamp(1.9rem,4vw,2.6rem); }
.entrance__content form { display: grid; gap: .5rem; margin-top: .25rem; }
.entrance__content input { width: 100%; min-width: 0; min-height: 2.75rem; padding: .65rem .85rem; border: 1px solid #a79783; border-radius: .45rem; font-size: 1rem; color: var(--ink); background: #fffdfa; }
.entrance__content input:focus { outline: 2px solid #33674f; outline-offset: 2px; }
.entrance__content input[aria-invalid=true] { border-color: #a33629; }
.entrance__content .primary { justify-self: start; margin: 0; }
.entrance__status { color: #9b2c23; font-size: .9rem; }
.entrance__status:empty { display: none; }
@keyframes entrance-landscape { from { transform: scale(1.08); } to { transform: scale(1); } }
@media (max-width: 580px) {
  .entrance { grid-template-columns: 1fr; }
  .entrance__scenery { min-height: clamp(5.25rem,24vw,8rem); padding: .6rem; background-position: center 40%; }
  .entrance__seal { width: 2.65rem; font-size: 1.45rem; }
  .entrance__map { border-inline-end: 0; border-block-end: 1px solid #dbc191; }
  .entrance__map-art { width: min(100%, 14rem, 38dvh); }
}
@media (prefers-reduced-motion: reduce) {
  .festival-loader, .festival-loader *, .festival-loader *::after,
  .entrance__scenery::before, .entrance__seal { animation: none; transition: none; }
}

dialog.roster-panel { width: min(760px,calc(100% - 1.5rem)); max-height: calc(100dvh - 1.5rem); }
.roster-panel #panelbody { display: grid; gap: .85rem; }
#players > .primary { margin-block: .6rem; }
.roster-toolbar, .roster-row, .roster-row-actions { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; }
.roster-toolbar > input { flex: 1 1 13rem; min-width: 0; }
.roster-row { justify-content: space-between; padding: .65rem 0; border-bottom: 1px solid var(--line); }
.roster-identity { display: grid; min-width: 0; overflow-wrap: anywhere; }
.roster-identity span { color: #554d41; font-size: .9rem; }
.roster-danger { color: #902d23; }
.roster-form { display: grid; gap: .7rem; }
.roster-form input, .roster-toolbar input {
  width: 100%;
  min-height: 2.65rem;
  padding: .55rem .7rem;
  border: 1px solid #a79783;
  border-radius: .35rem;
  color: var(--ink);
  background: #fffcf5;
}
.roster-panel .statusline:empty { display: none; }

/* Tranh khắc gỗ trên sới vật Hội Lim */
.wrestling-arena::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 60%, transparent 40%, #52270c44 100%);
  pointer-events: none;
}
.wrestling-pair {
  transform: translate(calc(-50% + var(--shift, 0%)),var(--rise, 0px))
    rotate(var(--tilt, 0deg)) scaleY(var(--stance, 1));
}
.wrestling-dust {
  position: absolute;
  bottom: 12%;
  left: 50%;
  width: 42%;
  height: 14%;
  background: radial-gradient(ellipse, #ffe1a6a8 0%, #ffc98048 42%, transparent 72%);
  transform: translateX(calc(-50% + var(--dust-shift, 0px)));
  opacity: var(--dust, 0);
  pointer-events: none;
}
.wrestling-victory {
  display: grid;
  justify-items: center;
  align-items: end;
  background-position: center 62%;
}
.wrestling-victory::before {
  background: radial-gradient(ellipse at 50% 45%, #ffde8d70 0%, #6b2e1029 55%, #421e176e 100%);
}
.wrestling-victory__pose {
  position: relative;
  z-index: 1;
  margin-bottom: 3%;
  height: 89%;
  aspect-ratio: 1;
  background: url('/wrestling-victory.webp') right center / 200% 100% no-repeat;
  transform-origin: center bottom;
  filter: drop-shadow(0 .45rem .25rem #4928157d);
  background-position: left center;
}
.is-celebrating .wrestling-victory__pose { animation: victory-raise 1.15s ease-out both; }
@keyframes victory-raise {
  0% { background-position: left center; transform: scale(.9,.84); }
  32% { background-position: left center; transform: scale(1.06,.92); }
  33% { background-position: right center; transform: translateY(-6%) scale(.96,1.01); }
  52% { background-position: right center; transform: translateY(-10%) scale(1.035); }
  77% { background-position: right center; transform: scale(1.025,.96); }
  100% { background-position: right center; transform: none; }
}
.wrestling-victory__petals { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.wrestling-victory__petals i {
  position: absolute;
  left: calc(8% + var(--petal-index) * 9.25%);
  top: 9%;
  width: 9px;
  height: 13px;
  border-radius: 85% 0 85% 0;
  background: #ffd777;
  opacity: 0;
}
.is-celebrating .wrestling-victory__petals i { animation: victory-petal 1.4s ease-out calc(.34s + var(--petal-index) * .065s) both; }
.wrestling-victory__petals i:nth-child(3n+1) { background: #db4b2f; }
.wrestling-victory__petals i:nth-child(3n+2) { background: #ffe8b3; }
@keyframes victory-petal {
  0% { opacity: 0; transform: translateY(-8px) rotate(-45deg); }
  18% { opacity: 1; }
  100% { opacity: 0; transform: translate(calc((var(--petal-index) - 4) * 5px), 134px) rotate(160deg); }
}
.game-result.wrestling-win-result {
  height: auto;
  min-height: 0;
  margin-top: 0;
  background: #234d3e;
  border: 1px solid #d9ac69;
}
@media (prefers-reduced-motion: reduce) {
  .wrestling-pair { transform: translateX(-50%); }
  .wrestling-dust, .wrestling-victory__petals { display: none; }
  .is-celebrating .wrestling-victory__pose { animation: none; background-position: right center; }
}

.wrestling-duo {
  position: absolute;
  bottom: 7%;
  left: 50%;
  width: min(78%, 450px);
  aspect-ratio: 3 / 2;
  transform: translateX(-50%);
  pointer-events: none;
}
.wrestling-fighter {
  position: absolute;
  inset: 0 auto 0 0;
  width: 50%;
  background: url('/wrestling-woodcut.webp') left bottom / 200% 100% no-repeat;
  transform: translateX(var(--blue-advance, 0%)) rotate(var(--blue-tilt, 0deg));
  transform-origin: center 86%;
  filter: drop-shadow(0 3px 3px #54281280);
}
.wrestling-fighter--red {
  inset: 0 0 0 auto;
  background-position: right bottom;
  transform: translateX(var(--red-advance, 0%)) rotate(var(--red-tilt, 0deg));
}
@media (prefers-reduced-motion: reduce) {
  .wrestling-fighter { transform: none; }
}

.wrestling-grapple .wrestling-fighter { opacity: 0; transition: opacity .16s ease-out; }
.wrestling-grapple[data-pose="ready"] .wrestling-fighter { opacity: 1; }
.wrestling-hold {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  opacity: 0;
  transform: translateX(var(--grapple-shift,0px)) rotate(var(--grapple-tilt,0deg));
  transform-origin: center 87%;
  transition: opacity .18s ease;
  filter: drop-shadow(0 4px 3px #54281275);
}
.wrestling-grapple[data-pose="clinch"] .wrestling-hold--clinch,
.wrestling-grapple[data-pose="blue"] .wrestling-hold--blue,
.wrestling-grapple[data-pose="red"] .wrestling-hold--red {
  opacity: 1;
  animation: wrestling-turn .28s ease-out;
}
.wrestling-hold--blue { --reversal-angle: -13deg; }
.wrestling-hold--red { --reversal-angle: 13deg; }
@keyframes wrestling-turn {
  0% { translate: 0 -9px; rotate: var(--reversal-angle,0deg); scale: 1.035 .94; }
  65% { translate: 0 2px; rotate: 0deg; scale: .99 1.02; }
  100% { translate: 0 0; scale: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .wrestling-grapple .wrestling-fighter, .wrestling-grapple .wrestling-hold {
    transition: none;
    animation: none;
    transform: none;
  }
}

#progress, #ranking-status { font-weight: 700; }
#ranking-status[data-phase="open"] { color: var(--pine); }
@media (prefers-reduced-motion: no-preference) {
  #ranking-status[data-phase="open"] { animation: contest-pulse 2s ease-in-out infinite alternate; }
}
@keyframes contest-pulse {
  from { opacity: 1; }
  to { opacity: .65; }
}
#qr-dialog { width: min(22rem, calc(100% - 24px)); }
#qr-dialog img {
  display: block;
  width: min(calc(100% - 2rem), calc(100dvh - 7rem));
  height: auto;
  margin: 1rem auto;
}

.topinner .brand { flex: none; white-space: nowrap; }
.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(5px, 1.25vw, 16px);
}
.site-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding-inline: clamp(5px, 1vw, 12px);
  white-space: nowrap;
  border: 1px solid #294d42;
  border-radius: 6px;
  background: #294d42;
  font-weight: 700;
  line-height: 1.4;
}
.site-nav a:hover,
.site-nav a:active {
  background: #3b6657;
  text-decoration: none;
}
.site-nav a:focus-visible {
  outline: 2px solid #ffd68a;
  outline-offset: 2px;
  border-radius: 4px;
}
.site-home { gap: 6px; }
.home-icon {
  width: 17px;
  height: 17px;
  flex: none;
  background: currentColor;
  clip-path: polygon(50% 4%, 100% 46%, 87% 46%, 87% 94%, 60% 94%, 60% 66%, 40% 66%, 40% 94%, 13% 94%, 13% 46%, 0 46%);
}
@media (max-width: 670px) {
  .topinner { flex-direction: column; align-items: stretch; gap: 0; padding-bottom: 9px; }
  .topinner .brand { min-height: 47px; font-size: clamp(.875rem, 4vw, 1.07rem); }
  .site-nav { flex-wrap: wrap; gap: 7px 5px; }
}
@media (max-width: 420px) {
  .site-nav a { padding-inline: 3px; font-size: .875rem; }
  .site-home { min-width: 44px; }
  .home-label { display: none; }
}

.art.two {
  container-type: inline-size;
  background-color: #e6b56c;
  background-position: center;
}
.poster-alphabet {
  text-align: center;
  color: #682b21;
  font: 800 clamp(1.05rem, 7cqi, 2.15rem) / 1.12 var(--font-serif);
  letter-spacing: .045em;
  white-space: nowrap;
  text-shadow: 0 1px #ffe5ac;
}
.art.three {
  background-color: #214649;
  background-repeat: no-repeat;
}
@media (min-width: 540px) and (max-width: 760px) {
  .art.three {
    background-image: url('/poster-nhac-cu-ngang.webp');
    background-size: contain;
  }
}

.tradition-intro { max-width: 68ch; margin-block: .85rem 1.35rem; }
.tradition-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: .85rem;
}
.tradition-cards details {
  background: #f6e3bd url('/nen-giay-do.webp') center / cover;
  border: 1px solid #c59565;
  border-radius: 10px;
  box-shadow: inset 0 0 0 3px #fff5d88c;
}
.tradition-cards summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .65rem;
  padding: .9rem 1rem;
  list-style: none;
  color: #275044;
}
.tradition-cards summary::-webkit-details-marker { display: none; }
.tradition-cards summary::after {
  content: '';
  width: .6rem;
  height: .6rem;
  flex: none;
  border: solid #943a2e;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin: -.25rem .25rem 0 0;
}
.tradition-cards details[open] summary::after { transform: rotate(225deg); margin-top: .25rem; }
.tradition-cards summary strong { display: block; font: 700 1.18rem var(--font-serif); }
.tradition-cards summary small { display: block; margin-top: .25rem; font-size: .9rem; font-weight: 400; color: #514333; }
.tradition-cards summary:focus-visible { outline: 2px solid #943a2e; outline-offset: 2px; border-radius: 8px; }
.tradition-card-body { padding: .8rem 1rem 1rem; border-top: 1px solid #c5956580; }
.tradition-card-body p + p, .tradition-card-body blockquote + p { margin-top: .65rem; }
.tradition-card-body blockquote { margin: 0; padding-left: .75rem; border-left: 2px solid #943a2e; color: #782d22; font-weight: 700; }
.tradition-card-body strong { color: #782d22; margin-right: .35rem; }
.tradition-sources { display: flex; flex-wrap: wrap; gap: .35rem 1rem; margin-top: 1.15rem; color: #41554a; font-size: .9rem; }
.tradition-sources a { text-underline-offset: .15em; }
@media (max-width: 620px) { .tradition-cards { grid-template-columns: 1fr; } }

@media (min-width: 761px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1110px) { .cards { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.cards .food-card { background: #f9e8ce; border-color: #cc9b60; }
.food-card .cardbody { justify-content: center; }
.food-card .kicker { margin-bottom: 0; }
.food-card .play { background: var(--red); border-color: var(--red); }
.food-card .play:hover { background: #84291e; }
.food-panel-body { display: grid; gap: .8rem; padding: clamp(.75rem, 3vw, 1.4rem); }
.food-panel-body [hidden] { display: none; }
.food-status { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .75rem; color: #782d22; }
.food-rules { color: #5b5549; font-size: .9rem; }
.food-rules p { margin-top: .3rem; }
.food-clue {
  padding: .85rem 1rem;
  border: 1px solid #c59565;
  border-radius: 8px;
  background: #f4dfaf url('/nen-giay-do.webp') center / cover;
  color: #22483d;
  font: 700 clamp(1.1rem, 3vw, 1.35rem)/1.5 var(--font-serif);
}
.food-form { display: grid; gap: .55rem; }
.food-entry { position: relative; }
.food-entry input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  font-size: 16px;
}
.food-slots { display: flex; flex-wrap: wrap; gap: .35rem .55rem; }
.food-word { display: flex; gap: 3px; }
.food-letter {
  display: grid;
  place-items: center;
  width: clamp(1.15rem, 5vw, 1.95rem);
  height: clamp(1.55rem, 6vw, 2.35rem);
  border: 1px solid #ad8558;
  border-radius: 4px;
  background: #fffaf0;
  color: #22483d;
  font-weight: 700;
  line-height: 1;
}
.food-entry:focus-within .food-letter.is-current { outline: 2px solid #2b6554; outline-offset: 1px; background: #fff0c9; }
.food-form button, #food-next { justify-self: start; }
#food-feedback { color: #673e2e; min-height: 1.5em; }
.food-source { color: #5b5549; font-size: .85rem; }
.food-actions { flex-wrap: wrap; justify-content: flex-start; }
#food-clock { font-variant-numeric: tabular-nums; }
