.tangyuan-game {
  --ty-ink:#452e49;
  --ty-muted:#664e65;
  --ty-brand:#663e72;
  --ty-line:#e5d4df;
  color:var(--ty-ink);
  background:radial-gradient(ellipse at 12% 8%,#ffead8,transparent 57%),
    radial-gradient(ellipse at 91% 18%,#f0dff6,transparent 52%),#fff7ee;
}
.ty-skip {
  position:absolute;
  width:1px;
  height:1px;
  overflow:hidden;
  clip-path:inset(50%);
}
.ty-skip:focus {
  width:auto;
  height:auto;
  padding:12px;
  background:white;
  clip-path:none;
  z-index:100;
}
.ty-layout {
  box-sizing:border-box;
  width:min(100%,510px);
  margin:0 auto;
  padding:12px clamp(10px,3vw,25px) 28px;
  font-family:var(--ui2-font-family);
}
.ty-heading { display:grid; justify-items:start; gap:4px; margin-bottom:10px; }
.ty-heading h1 { margin:0; font-size:clamp(30px,7vw,56px); letter-spacing:-.05em; line-height:1.08; }
.ty-heading p { margin:0; font-size:clamp(12px,3.2vw,16px); line-height:1.45; color:var(--ty-muted); }
.ty-back {
  display:inline-flex;
  align-items:center;
  min-height:24px;
  color:var(--ty-brand);
  font-size:13px;
  font-weight:750;
  text-decoration:none;
}
.ty-layout button {
  box-sizing:border-box;
  border:1px solid #d9c7d9;
  border-radius:12px;
  background:#fffdf7;
  color:var(--ty-ink);
  min-width:44px;
  min-height:44px;
  padding:0 11px;
  font:inherit;
  font-size:13px;
  font-weight:730;
  cursor:pointer;
  touch-action:manipulation;
  -webkit-tap-highlight-color:transparent;
}
.ty-layout button:hover:not(:disabled) { border-color:#875a91; }
.ty-layout button:disabled { background:#f1e8ec; color:#6d5c72; cursor:default; }
.ty-layout [hidden] { display:none; }
.ty-layout :focus-visible { outline:3px solid #8c6298; outline-offset:2px; }
.ty-layout button[aria-current],#ty-next { background:var(--ty-brand); border-color:var(--ty-brand); color:white; }
.ty-game { min-width:0; }
.ty-tray {
  padding:11px clamp(7px,2.6vw,16px) 12px;
  background:#fff7eb;
  border:1px solid #dcbfac;
  border-radius:21px;
  box-shadow:inset 0 3px 0 #fffdf6,0 5px 0 #c8978240,0 9px 24px #8a587120;
}
.ty-bar { display:flex; justify-content:space-between; align-items:center; gap:10px; }
.ty-bar strong { font-size:13px; color:var(--ty-brand); }
.ty-bar span {
  background:#fffdf7;
  border:1px solid #e4cdbf;
  border-radius:8px;
  padding:3px 7px;
  font-size:12px;
  font-weight:700;
  font-variant-numeric:tabular-nums;
}
.ty-status {
  margin:6px 0;
  min-height:47px;
  display:grid;
  align-content:center;
  justify-items:center;
  padding:3px 5px;
  text-align:center;
  background:#eee2f5;
  border:1px solid #d8c3e0;
  border-radius:12px;
}
.ty-status strong { font-size:clamp(15px,4vw,20px); line-height:1.1; }
.ty-status p { margin:3px 0 0; font-size:clamp(10px,2.8vw,13px); line-height:1.3; color:#57455e; }
.ty-game[data-turn="cherry"] .ty-status { background:#ffe8b8; border-color:#e8cb8c; }
.ty-game[data-winner="you"] .ty-status { background:#dceee2; border-color:#a9cbb4; }
.ty-bowls {
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  align-items:stretch;
  gap:5px;
  padding:6px 0 8px;
}
.ty-bowls .ty-bowl {
  --ty-rim:#e99eaa;
  --ty-plate:#ffd0d1;
  --ty-porcelain:#fff0e7;
  flex:0 0 calc((100% - 10px)/3);
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:3px;
  padding:5px 1px;
  background:#fffaf5;
  border-color:#e9d9cf;
  box-shadow:0 2px 0 #98707a18;
  min-width:0;
}
.ty-bowl:nth-child(2) { --ty-rim:#7cad97; --ty-plate:#c6ead7; --ty-porcelain:#effcf1; }
.ty-bowl:nth-child(3) { --ty-rim:#a682b8; --ty-plate:#dec2ee; --ty-porcelain:#f7ecfc; }
.ty-bowl:nth-child(4) { --ty-rim:#c89756; --ty-plate:#f9d993; --ty-porcelain:#fff1c8; }
.ty-bowl:nth-child(5) { --ty-rim:#739cb8; --ty-plate:#b9dff0; --ty-porcelain:#e8faff; }
.ty-bowls .ty-bowl[aria-pressed="true"] { border-color:#875a91; background:#f4e7f7; box-shadow:0 0 0 1px #875a91; }
.ty-bowls .ty-bowl[data-recent="true"] { border-color:#bf8a66; border-style:dashed; }
.ty-bowls .ty-bowl:disabled { color:var(--ty-ink); cursor:default; }
.ty-bowl-art {
  display:grid;
  place-items:center;
  width:min(94%,113px);
  aspect-ratio:1;
  border-radius:50%;
  background:radial-gradient(circle at 46% 40%,var(--ty-porcelain) 61%,var(--ty-plate) 64% 82%,var(--ty-rim) 83%);
  border:1px solid var(--ty-rim);
  box-shadow:inset 0 1px #fffaf4,0 2px 0 var(--ty-rim),0 4px 6px #8a5b5a32;
}
.ty-syrup {
  display:block;
  position:relative;
  width:76%;
  aspect-ratio:1;
  border-radius:50%;
  background:linear-gradient(145deg,#fff9dc,#f3cf8c 65%,#e9b975);
  box-shadow:inset 0 1px 5px #98663a44,0 0 0 1px var(--ty-rim);
}
.ty-bowl[data-left="0"] .ty-syrup { background:var(--ty-porcelain); }
.ty-syrup::after {
  content:"";
  position:absolute;
  inset:8% 12%;
  border-radius:50%;
  border-top:1px solid #ffffffa0;
  transform:rotate(-20deg);
}
.ty-syrup i {
  display:block;
  position:absolute;
  width:25%;
  aspect-ratio:1;
  left:50%;
  top:47%;
  transform:translate(-50%,-50%);
  border-radius:50%;
  background:radial-gradient(circle at 34% 28%,#fff,#fffbef 45%,#f1d4ba 97%);
  box-shadow:0 1px 2px #986e5270,inset 0 0 0 1px #bc8e7060;
}
.ty-syrup i:nth-child(3n) {
  background:radial-gradient(circle at 34% 28%,#fff5f8,#ffe1ed 50%,#edaec5 98%);
}
.ty-syrup i:nth-child(2) { left:67%; top:55%; }
.ty-syrup i:nth-child(3) { left:34%; top:66%; }
.ty-syrup i:nth-child(4) { left:30%; top:38%; }
.ty-syrup i:nth-child(5) { left:59%; top:29%; }
.ty-syrup i:nth-child(6) { left:54%; top:74%; }
.ty-syrup i:nth-child(7) { left:75%; top:34%; }
.ty-syrup i:nth-child(8) { left:20%; top:54%; }
.ty-syrup i:nth-child(9) { left:74%; top:72%; }
.ty-syrup i:nth-child(10) { left:38%; top:22%; }
.ty-bowl[data-left="2"] .ty-syrup i:first-child { left:37%; top:45%; }
.ty-bowl-name {
  display:flex;
  flex-wrap:wrap;
  gap:2px 4px;
  justify-content:center;
  align-items:center;
  color:#4f3a4c;
  line-height:1.1;
  font-size:clamp(10px,3vw,13px);
}
.ty-bowl-name > span {
  color:#654e60;
  background:#f0e3ed;
  border-radius:8px;
  padding:2px 4px;
  font-size:clamp(9px,2.8vw,11px);
  font-variant-numeric:tabular-nums;
}
.ty-spoon {
  display:inline-flex;
  gap:3px;
  justify-content:center;
  align-items:center;
  border-radius:7px;
  background:#f8ead1;
  color:#664c2d;
  padding:2px 3px;
  font-size:clamp(8px,2.35vw,10px);
  line-height:1.08;
}
.ty-spoon i {
  display:inline-block;
  width:6px;
  height:8px;
  border-radius:50%;
  background:#977451;
  position:relative;
  margin-right:2px;
  transform:rotate(-40deg);
}
.ty-spoon i::after { content:""; position:absolute; width:2px; height:5px; top:6px; left:2px; background:inherit; border-radius:2px; }
.ty-chooser {
  display:grid;
  grid-template-columns:minmax(50px,1fr) minmax(132px,1.7fr);
  gap:5px;
  align-items:center;
  padding:5px 6px;
  border:1px solid #eddbce;
  border-radius:12px;
  background:#fffcf7;
}
.ty-chooser p { margin:0; font-size:clamp(11px,3.1vw,14px); font-weight:760; }
.ty-amounts { display:grid; grid-template-columns:repeat(3,minmax(44px,1fr)); gap:3px; }
.ty-amounts button { display:grid; justify-items:center; align-content:center; gap:1px; line-height:1.1; padding:2px; }
.ty-amounts b { font-size:17px; }
.ty-amounts span { font-size:9px; }
.ty-amounts button:enabled { background:#f1e2f6; border-color:#a97abb; color:#563465; }
.ty-actions { display:flex; gap:6px; margin-top:6px; }
#ty-next { margin-left:auto; }
.ty-levels { display:flex; gap:6px; margin-top:10px; }
.ty-help {
  color:var(--ty-ink);
  border:1px solid var(--ty-line);
  background:#fffaf5;
  margin-top:12px;
  border-radius:17px;
  overflow:hidden;
}
.ty-help img { display:none; }
.ty-help > div { padding:13px 15px; }
.ty-help h2 { font-size:17px; margin:0; }
.ty-help ol { padding-left:19px; margin:6px 0 0; font-size:13px; line-height:1.55; }
.ty-help li+li { margin-top:4px; }
@media (max-width:370px) {
  .ty-layout { padding-top:7px; }
  .ty-heading { margin-bottom:7px; }
  .ty-tray { padding-block:8px 10px; }
  .ty-status { min-height:43px; }
  .ty-bowls { padding-block:5px 6px; gap:4px; }
  .ty-bowls .ty-bowl { flex-basis:calc((100% - 8px)/3); padding-block:4px; }
  .ty-bowls:is([data-size="4"],[data-size="5"]) .ty-bowl-art { width:min(85%,60px); }
  .ty-spoon { white-space:nowrap; }
}
@media (min-width:800px) {
  .ty-layout {
    display:grid;
    width:min(100%,1050px);
    grid-template-columns:minmax(330px,460px) minmax(280px,375px);
    grid-template-rows:auto auto 1fr;
    justify-content:center;
    gap:12px clamp(22px,5vw,60px);
    padding:28px 26px 36px;
  }
  .ty-game { grid-area:1 / 1 / span 3; }
  .ty-heading { grid-area:1 / 2; gap:5px; margin:0; }
  .ty-levels { grid-area:2 / 2; margin:0; }
  .ty-help { grid-area:3 / 2; align-self:start; margin:0; }
  .ty-help img { display:block; width:100%; height:auto; }
}
@media (prefers-reduced-motion:no-preference) {
  .ty-bowl { transition:background-color .12s,border-color .12s; }
  .ty-bowl:enabled:active .ty-bowl-art { transform:translateY(1px); }
  .ty-bowl[data-recent="true"] .ty-syrup { animation:ty-ripple .38s ease-out; }
  @keyframes ty-ripple {
    from { box-shadow:inset 0 0 0 5px #fff6cfbb,0 0 0 1px var(--ty-rim); }
    to { box-shadow:inset 0 1px 5px #98663a44,0 0 0 1px var(--ty-rim); }
  }
}
