@import url('https://fonts.googleapis.com/css2?family=M+PLUS+Rounded+1c:wght@500;700;800;900&display=swap');
:root{--ht-ink:#514751;--ht-muted:#817680;--ht-pink:#ef96b6;--ht-mint:#b8e2d2;--ht-paper:#fff9f1;--ht-line:#eadfdc;--ht-font:'M PLUS Rounded 1c','Hiragino Maru Gothic ProN','Yu Gothic','Noto Sans KR','Noto Sans SC',sans-serif}
*{box-sizing:border-box}html{background:var(--ht-paper);color:var(--ht-ink);scroll-behavior:smooth}body{margin:0;font-family:var(--ht-font);font-weight:500;line-height:1.7;background:radial-gradient(circle at 8% 25%,#fff0ef 0,transparent 32%),radial-gradient(circle at 92% 75%,#edf6ef 0,transparent 30%),var(--ht-paper);min-width:280px}button,input,select{font:inherit}button,a,input{-webkit-tap-highlight-color:transparent}button{color:inherit;cursor:pointer}a{color:inherit}button:focus-visible,a:focus-visible,input:focus-visible,summary:focus-visible,canvas:focus-visible{outline:3px solid #617a9c;outline-offset:4px}button[disabled]{opacity:.55;cursor:wait}[hidden]{display:none!important}.ht-shell{width:min(100% - 32px,560px);margin:0 auto;padding:20px 0 max(20px,env(safe-area-inset-bottom))}.ht-brand{display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:12px;font-weight:800;margin-bottom:25px}.ht-brand>a:first-child{display:flex;align-items:center;gap:8px;text-decoration:none;letter-spacing:.02em}.ht-brand-dot{display:grid;place-items:center;background:#efb3ca;border:3px solid white;color:white;border-radius:50%;width:33px;height:33px;box-shadow:0 2px 0 #e5bbc7;font-size:17px}.ht-small-link{font-size:12px;text-underline-offset:5px;line-height:1.6}.ht-eyebrow{color:#937482;font-size:10px;font-weight:800;letter-spacing:.16em;margin:0 0 7px}.ht-intro{text-align:center}.ht-intro h1{font-size:clamp(42px,12vw,62px);font-weight:900;letter-spacing:.11em;margin:0;line-height:1.25;color:#65505e;text-shadow:0 3px white}.ht-lead{font-size:15px;letter-spacing:.08em;line-height:1.7;font-weight:700;margin:16px 0 0}.ht-description{font-size:12px;line-height:1.9;margin:2px auto 22px}.ht-hero{height:188px;width:300px;max-width:100%;position:relative;margin:-2px auto 0}.hero-circle{display:grid;place-items:center;position:absolute;border-radius:50%;border:4px solid white;box-shadow:0 5px 0 #cdbfb225}.hero-circle img{width:85%;height:auto;max-height:90%;object-fit:contain;display:block}.hero-circle--blue{width:142px;height:142px;background:#d9f0f4;left:82px;bottom:7px;transform:rotate(4deg);z-index:2}.hero-circle--pink{width:115px;height:115px;background:#f8dbe7;left:3px;bottom:12px;transform:rotate(-13deg);z-index:1}.hero-circle--green{width:101px;height:101px;background:#e0f2e6;right:0;bottom:14px;transform:rotate(12deg);z-index:3}.hero-circle--egg{width:66px;height:66px;background:#fff2bd;left:109px;top:2px;transform:rotate(-8deg);z-index:3}.hero-dot{position:absolute;border-radius:50%}.hero-dot--one{width:13px;height:13px;background:#f6d496;top:44px;right:43px}.hero-dot--two{width:8px;height:8px;background:#bedad7;top:38px;left:40px}.ht-card{border:1px solid var(--ht-line);border-radius:27px;background:#fffdfa;box-shadow:0 7px 0 #eee5dd70}.ht-start-card{padding:24px}.ht-label{display:block;font-size:14px;font-weight:800;letter-spacing:.03em;margin:0 0 9px}.ht-start-card input{width:100%;height:52px;padding:10px 17px;border:1px solid #ded6d6;border-radius:14px;background:#fff;color:#514751;font-size:16px}.ht-start-card input::placeholder{color:#a49aa0}.ht-field-note{font-size:11px;color:var(--ht-muted);margin:6px 0 17px}.ht-button{display:flex;align-items:center;justify-content:center;text-align:center;min-height:52px;width:100%;padding:13px 18px;border-radius:999px;border:1px solid transparent;text-decoration:none;font-size:14px;font-weight:800;line-height:1.5;transition:transform .15s,box-shadow .15s;gap:7px}.ht-button:active{transform:translateY(2px)}.ht-button--pink{background:#efa0bb;color:#49313e;box-shadow:0 4px 0 #d986a3}.ht-button--mint{background:#c2e5d7;color:#36594c;box-shadow:0 4px 0 #a1cebd;margin-bottom:17px}.ht-button--light{background:white;border-color:#e5dcd8}.ht-start-card>a{margin-top:17px}.ht-howto{margin:24px 0 0;background:#fffaf4;border-bottom:1px solid #eaddd5;padding:10px 6px 17px}.ht-howto summary,.ht-play-guide summary{font-size:13px;font-weight:800;cursor:pointer;min-height:34px;line-height:2.5}.ht-howto ol:not(.ht-growth){padding-left:23px;margin:12px 0;font-size:13px}.ht-howto li{padding:5px 0}.ht-howto>p{font-size:12px;line-height:1.8}.ht-howto h2{font-size:13px;margin-top:22px}.ht-growth{display:flex;list-style:none;padding:6px 0 14px;margin:0;gap:9px;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:thin}.ht-growth li{position:relative;flex:0 0 62px;display:flex;align-items:center;flex-direction:column;gap:2px;padding:12px 2px 3px!important}.ht-growth img{background:var(--piece-soft);border:1px solid var(--piece);border-radius:50%;width:54px;height:54px;padding:5px;object-fit:contain}.ht-growth b{font-size:10px;position:absolute;left:1px;top:0;background:white;width:20px;height:20px;border-radius:50%;text-align:center;border:1px solid #e3dcd7}.ht-growth span{font-size:9px;text-align:center;white-space:normal;line-height:1.5}.ht-footer{text-align:center;padding:25px 0 0}.ht-sound{display:inline-flex;align-items:center;gap:10px;background:white;border:1px solid #e4d9d4;border-radius:99px;padding:7px 16px 7px 7px;min-height:48px;font-size:12px;font-weight:800}.ht-sound>span:first-child{width:32px;height:32px;border-radius:50%;background:#eee9e5;display:grid;place-items:center;font-size:20px;color:#84747e}.ht-sound[aria-checked=true]>span:first-child{background:#f9dbe5;color:#aa5376}.ht-sound b{font-size:11px;color:#867583}.ht-fineprint{font-size:11px;color:#857982;line-height:1.9}.ht-credit{font-size:10px;color:#a1949a;letter-spacing:.06em;margin-top:22px}.ht-storage-note{padding:12px;font-size:12px;line-height:1.7;background:#fff0df;color:#735936;border-radius:12px}.ht-play-shell{width:min(100% - 24px,480px);padding-top:10px}.ht-play-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px}.ht-play-header .ht-eyebrow{font-size:8px;margin:0}.ht-play-header h1{font-size:25px;margin:0;line-height:1.35;font-weight:900;letter-spacing:.06em}.ht-pause{border:1px solid #e5d8d2;border-radius:50%;width:43px;height:43px;background:#fff;display:grid;place-items:center;font-size:21px;font-weight:900}.ht-hud{display:flex;align-items:stretch;gap:12px}.ht-score{display:flex;align-items:center;justify-content:space-between;flex:1;border-radius:19px;background:#fff;border:1px solid #ebdfd8;padding:6px 18px;min-height:62px}.ht-score span,.ht-next>span{font-size:11px;font-weight:700;color:#8c7680}.ht-score strong{font-size:29px;font-weight:900;font-variant-numeric:tabular-nums;line-height:1.2;color:#6f5163}.ht-next{display:flex;align-items:center;gap:9px;background:#f5ebf0;border-radius:19px;padding:4px 12px}.ht-next img{display:block;object-fit:contain}.ht-play-instruction{text-align:center;font-size:11px;color:#8b7f84;margin:7px 0}.ht-board-wrap{position:relative;width:min(100%,calc((100svh - 240px)*.6666667));min-width:220px;max-width:380px;margin:auto;aspect-ratio:2/3;touch-action:none;user-select:none;border-radius:25px;box-shadow:0 7px 0 #e5d8cc70;background:#fffef9;overflow:hidden;border:1px solid #e7d9cc}#board{display:block;width:100%;height:100%;touch-action:none;-webkit-user-select:none;user-select:none}.ht-warning{position:absolute;left:15%;right:15%;top:19%;background:#9c5768ed;color:white;font-size:11px;border-radius:50px;padding:5px 9px;text-align:center;pointer-events:none;font-weight:800;box-shadow:0 2px 12px #5d2c3414}.ht-bottom-info{display:flex;justify-content:space-between;gap:10px;padding:9px 4px 0;font-size:10px;color:#907f86}.ht-bottom-info>span:first-child{max-width:55%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ht-play-guide{margin-top:2px}.ht-play-guide summary{font-size:11px;text-align:center;list-style-position:inside}.ht-overlay{position:absolute;inset:0;background:#fff9f0d9;backdrop-filter:blur(6px);display:flex;align-items:center;justify-content:center;padding:20px;z-index:5}.ht-overlay-card{text-align:center;width:100%;padding:25px 18px;border-radius:25px;border:1px solid #e7d9d7;background:#fffdfb;box-shadow:0 8px 30px #a97d8c14}.ht-dialog-dot{display:grid;place-items:center;background:#f7deea;color:#ad6685;width:52px;height:52px;border-radius:50%;margin:0 auto;font-size:27px;font-weight:900}.ht-overlay-card h2{font-size:24px;margin:15px 0 4px}.ht-overlay-card p{font-size:12px;margin:0 0 25px}.ht-overlay-card a{margin-top:16px}.ht-result-shell{max-width:470px}.ht-result-card{text-align:center;padding:28px 21px}.ht-result-card h1{font-size:25px;margin:6px 0 23px;line-height:1.4}.ht-result-piece{width:205px;height:205px;border:7px solid #fff;border-radius:50%;display:grid;place-items:center;margin:0 auto 14px;background:#fff1d3;box-shadow:0 0 0 1px #eedba7}.ht-result-piece img{width:90%;height:90%;object-fit:contain}.ht-result-name{font-size:17px;font-weight:800;margin:14px 0 0;overflow-wrap:anywhere}.ht-result-score{margin:0;line-height:1.3}.ht-result-score strong{display:block;font-size:clamp(45px,13vw,74px);font-weight:900;letter-spacing:-.03em;font-variant-numeric:tabular-nums;color:#9c5f7d}.ht-result-score>span{display:block;font-size:11px;letter-spacing:.12em;color:#a28292;margin-top:6px}.ht-rank-badge{display:inline-flex;align-items:center;justify-content:center;border-radius:50px;background:#f8eac0;font-size:12px;font-weight:800;padding:8px 18px;margin:20px 0 0}.ht-result-facts{display:grid;grid-template-columns:1fr 1fr;gap:12px;border-top:1px dashed #e4d9d3;padding-top:20px;margin-top:23px}.ht-result-facts span{display:block;font-size:10px;color:#93808b}.ht-result-facts strong{font-size:15px;display:block;margin-top:4px}.ht-result-actions{display:flex;align-items:center;flex-direction:column;gap:19px;margin-top:28px}.ht-result-actions .ht-small-link{margin-top:4px}.ht-ranking-shell{max-width:520px}.ht-ranking-intro{text-align:center;margin:35px 0 25px}.ht-ranking-intro h1{font-size:25px;line-height:1.5;margin:6px 0 10px}.ht-ranking-intro>p:last-child{font-size:12px;color:#82747c}.ht-ranking-list{list-style:none;display:flex;flex-direction:column;gap:13px;padding:0;margin:0 0 26px}.ht-ranking-row{display:flex;align-items:center;gap:12px;padding:15px 16px;border:1px solid #e8dcd6;border-radius:22px;background:#fffdfa}.ht-ranking-row:first-child{background:#fff6df;border-color:#eaddac}.ht-rank-number{display:grid;place-items:center;flex:0 0 28px;width:28px;height:28px;background:white;border-radius:50%;font-size:13px;font-weight:900;border:1px solid #eadcd8}.ht-ranking-row img{width:50px;height:50px;object-fit:contain;padding:5px;border-radius:50%;background:#f8ecef;border:2px solid white}.ht-ranking-body{flex:1;min-width:0}.ht-ranking-body strong{display:block;font-size:13px;overflow-wrap:anywhere}.ht-ranking-body time{display:block;font-size:9px;color:#95878e}.ht-ranking-points{font-size:21px;font-weight:900;white-space:nowrap;color:#8d6078}.ht-ranking-points small{display:block;font-size:9px;font-weight:500;text-align:right;color:#97848f}.ht-empty{text-align:center;padding:28px;margin:0 0 25px}.ht-empty img{object-fit:contain}.ht-empty p{font-size:13px;line-height:1.9}.ht-clear{display:block;margin:25px auto 15px;background:transparent;border:none;color:#93828b;text-decoration:underline;text-underline-offset:4px;min-height:44px;font-size:11px}.ht-ranking-shell>.ht-fineprint{text-align:center;padding:0 12px}.ht-score-pop{animation:score-pop .2s ease-out}@keyframes score-pop{50%{transform:scale(1.1)}}@media(min-width:700px){.ht-start{max-width:480px}.ht-intro{padding-top:15px}.ht-hero{margin:3px auto 0}.ht-play-shell{padding-top:16px}.ht-board-wrap{width:min(100%,calc((100svh - 250px)*.6666667));max-width:400px}}@media(max-height:650px){.ht-play-header .ht-eyebrow{display:none}.ht-play-shell{padding-top:5px}.ht-play-header h1{font-size:21px}.ht-hud{gap:8px}.ht-score{min-height:48px}.ht-next img{height:34px;width:45px}.ht-score strong{font-size:24px}.ht-board-wrap{width:min(100%,calc((100svh - 205px)*.6666667))}.ht-play-guide summary{min-height:25px;line-height:2}.ht-bottom-info{padding-top:6px}}@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;animation:none!important;transition:none!important}}

/* Result image download: one touch target and an optional mobile save preview. */
.ht-download-area{width:100%;min-width:0}.ht-download-area>.ht-button{margin-bottom:0}.ht-download-status{min-height:1.8em;margin:12px 4px 0;font-size:12px;line-height:1.8;text-align:center;color:#74636e;overflow-wrap:anywhere}.ht-download-preview{margin-top:14px;padding:12px 16px 16px;border:1px solid #e5dcd8;border-radius:23px;background:#fffdfa;min-width:0}.ht-download-preview summary{cursor:pointer;min-height:44px;display:list-item;list-style-position:inside;font-size:13px;font-weight:800;line-height:1.7;padding:10px 0;overflow-wrap:anywhere}.ht-download-preview p{font-size:11px;line-height:1.9;color:#817680;margin:2px 0 14px;overflow-wrap:anywhere}.ht-download-preview img{display:block;width:100%;max-width:100%;height:auto;border-radius:18px;border:1px solid #efe5de;-webkit-touch-callout:default;user-select:auto}.ht-download-preview a{margin-top:15px;font-size:13px;min-height:48px}.ht-result-facts>div{min-width:0}.ht-result-facts strong{overflow-wrap:anywhere}
.ht-pause-sound{margin-top:18px}.ht-pause-sound .ht-fineprint{margin:8px 0 0;font-size:10px}.ht-overlay{overflow-y:auto;align-items:flex-start}.ht-overlay-card{margin:auto;flex-shrink:0}
.ht-board-wrap{touch-action:auto}.ht-overlay{touch-action:pan-y;overscroll-behavior:contain}
@media(max-width:380px){.ht-overlay{padding:12px}.ht-overlay-card{padding:16px 14px}.ht-dialog-dot{width:40px;height:40px;font-size:23px}.ht-overlay-card h2{font-size:20px;line-height:1.5;margin:10px 0 4px}.ht-overlay-card p{margin-bottom:18px}.ht-overlay-card .ht-button{min-height:48px;padding:11px 14px}.ht-overlay-card a{margin-top:12px}.ht-pause-sound{margin-top:14px}.ht-pause-sound .ht-fineprint{margin:6px 0 0;line-height:1.7}}
/* Mobile play: keep the board and its controls together in the first viewport.
   The language control occupies the header row; credits remain below the game. */
.ht-play-page {
  --ht-play-width: 480px;
  --ht-viewport-height: 100vh;
  --ht-safe-top: max(8px, env(safe-area-inset-top, 0px));
  --ht-safe-bottom: max(8px, env(safe-area-inset-bottom, 0px));
  position: relative;
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
  min-width: 0;
}
@supports (height: 100svh) {
  .ht-play-page { --ht-viewport-height: 100svh; }
}
.ht-play-page .ht-play-shell {
  width: min(calc(100% - 24px), var(--ht-play-width));
  padding-top: var(--ht-safe-top);
  padding-bottom: var(--ht-safe-bottom);
}
.ht-play-page .site-language-bar {
  position: absolute;
  top: var(--ht-safe-top);
  left: env(safe-area-inset-left, 0px);
  right: env(safe-area-inset-right, 0px);
  width: min(calc(100% - 24px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)), var(--ht-play-width));
  margin: 0 auto;
  padding-right: 56px;
  z-index: 6;
  pointer-events: none;
}
.ht-play-page .site-language-control {
  padding: 2px;
  min-width: 0;
  width: 112px;
  min-height: 50px;
  pointer-events: auto;
}
.ht-play-page #site-language-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.ht-play-page .site-language-control select {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 6px 22px 6px 10px;
  font-size: 12px;
}
.ht-play-page .ht-play-header {
  min-height: 50px;
  margin-bottom: 6px;
  gap: 8px;
}
.ht-play-page .ht-play-header > div {
  min-width: 0;
  max-width: calc(100% - 168px);
}
.ht-play-page .ht-play-header h1 {
  font-size: clamp(19px, 5.6vw, 25px);
  line-height: 1.25;
  letter-spacing: .025em;
}
.ht-play-page .ht-pause {
  flex: 0 0 48px;
  width: 48px;
  min-width: 48px;
  height: 48px;
  min-height: 48px;
}
/* Draw the pause symbol without depending on a font's Roman numeral glyph. */
.ht-play-page #pause > span { display: block; width: 14px; height: 18px; font-size: 0; line-height: 0; }
.ht-play-page .ht-dialog-dot { font-size: 0; }
.ht-play-page #pause > span::before,
.ht-play-page .ht-dialog-dot::before {
  content: '';
  display: block;
  width: 14px;
  height: 18px;
  border-left: 4px solid currentColor;
  border-right: 4px solid currentColor;
  border-radius: 1px;
}
.ht-play-page .ht-hud { gap: 8px; }
.ht-play-page .ht-score {
  min-width: 0;
  min-height: 50px;
  padding: 5px 13px;
  gap: 7px;
}
.ht-play-page .ht-score strong {
  font-size: clamp(20px, 6vw, 27px);
  overflow-wrap: anywhere;
}
.ht-play-page .ht-next {
  flex-shrink: 0;
  gap: 6px;
  padding: 3px 10px;
}
.ht-play-page .ht-next > span {
  max-width: 4.5em;
  font-size: 10px;
  line-height: 1.4;
}
.ht-play-page .ht-next img { width: 52px; height: 39px; }
.ht-play-page .ht-play-instruction {
  margin: 5px 0;
  font-size: 11px;
  line-height: 1.6;
}
.ht-play-page .ht-board-wrap {
  width: min(100%, max(224px, calc((var(--ht-viewport-height) - 206px - var(--ht-safe-top) - var(--ht-safe-bottom)) * .7)));
  min-width: 0;
  max-width: 420px;
  aspect-ratio: 7 / 10;
  margin: 0 auto;
  border-radius: 23px;
  touch-action: auto;
}
.ht-play-page #board:focus-visible { outline-offset: -4px; }
.ht-shake-controls { width: min(100%, 420px); margin: 10px auto 0; }
.ht-shake {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 7px 20px;
  border: 1px solid #dfb2c1;
  border-radius: 999px;
  background: #f5b8ce;
  color: #5f3e50;
  box-shadow: 0 4px 0 #db9fb5;
  line-height: 1.3;
  touch-action: manipulation;
  transition: background .15s, box-shadow .15s, transform .15s;
}
.ht-shake.is-ready { background: #f7b4cd; }
.ht-shake:not(:disabled):active { transform: translateY(3px); box-shadow: 0 1px 0 #db9fb5; }
.ht-shake:disabled {
  opacity: 1;
  cursor: default;
  background: #f1e9e7;
  border-color: #e4d8d5;
  color: #796973;
  box-shadow: 0 3px 0 #e3d7d3;
}
.ht-shake-copy { min-width: 0; text-align: center; }
#shake-label { display: block; font-size: 17px; font-weight: 900; letter-spacing: .04em; }
#shake-status { display: block; margin-top: 2px; font-size: 10px; line-height: 1.4; font-weight: 700; }
.ht-shake-icon { position: relative; display: block; width: 34px; height: 34px; flex: 0 0 34px; border-radius: 50%; background: #fff7fa; }
.ht-shake-icon::before, .ht-shake-icon::after { content: ''; position: absolute; border-radius: 50%; border: 1px solid #d18aa4; background: #f4bdd1; }
.ht-shake-icon::before { width: 14px; height: 14px; left: 4px; bottom: 5px; }
.ht-shake-icon::after { width: 11px; height: 11px; right: 4px; top: 6px; background: #d4eee2; border-color: #a0c5b4; }
.ht-play-page .ht-bottom-info { padding-top: 12px; font-size: 10px; }
.ht-play-page .ht-play-guide summary { min-height: 36px; line-height: 2; padding: 6px 0; }
.ht-play-page > .site-credits { padding-top: 6px; }
.ht-play-page .ht-overlay {
  align-items: flex-start;
  justify-content: center;
  padding: 12px;
  overflow-y: auto;
  touch-action: pan-y;
  overscroll-behavior: contain;
}
.ht-play-page .ht-overlay-card {
  flex: 0 0 auto;
  width: 100%;
  min-width: 0;
  max-width: 350px;
  padding: 18px 14px;
  margin: auto 0;
}
.ht-play-page .ht-dialog-dot { width: 40px; height: 40px; font-size: 0; }
.ht-play-page .ht-overlay-card h2 { font-size: 20px; line-height: 1.5; margin: 8px 0 4px; }
.ht-play-page .ht-overlay-card p { margin-bottom: 12px; line-height: 1.7; }
.ht-play-page .ht-overlay-card .ht-button { min-height: 48px; padding: 11px 14px; }
.ht-play-page .ht-overlay-card a { margin-top: 10px; }
.ht-play-page .ht-pause-sound { margin-top: 14px; }
.ht-play-page .ht-pause-sound .ht-fineprint { margin: 6px 0 0; }
/* Wide, short screens keep the controls beside the board; very short screens
   can still scroll normally instead of clipping controls or credits. */
@media (orientation: landscape) and (max-height: 520px) and (min-width: 560px) {
  .ht-play-page { --ht-play-width: 760px; }
  .ht-play-page .ht-play-shell {
    display: grid;
    grid-template-columns: minmax(190px, 1fr) auto;
    grid-template-areas: 'header header' 'hud board' 'instruction board' 'shake board' 'info board' 'guide board' 'storage board';
    gap: 5px 16px;
    align-items: start;
  }
  .ht-play-page .ht-play-header { grid-area: header; margin: 0 0 3px; }
  .ht-play-page .ht-play-header > div { max-width: calc(100% - 168px); }
  .ht-play-page .ht-hud { grid-area: hud; }
  .ht-play-page .ht-play-instruction { grid-area: instruction; margin: 2px 0; }
  .ht-play-page .ht-board-wrap {
    grid-area: board;
    width: clamp(168px, calc((var(--ht-viewport-height) - 82px - var(--ht-safe-top) - var(--ht-safe-bottom)) * .7), 340px);
    max-width: 100%;
  }
  .ht-play-page .ht-shake-controls { grid-area: shake; margin: 4px auto 3px; }
  .ht-play-page .ht-bottom-info { grid-area: info; padding: 3px 4px 0; }
  .ht-play-page .ht-play-guide { grid-area: guide; margin: 0; min-width: 0; }
  .ht-play-page .ht-storage-note { grid-area: storage; margin: 0; }
  /* The board and shell have no transform/filter/contain, so this fixed dialog
     is viewport-relative and escapes the small board's overflow clipping. */
  .ht-play-page #pause-overlay {
    position: fixed;
    inset: 0;
    z-index: 30;
    align-items: center;
    padding: var(--ht-safe-top) max(12px, env(safe-area-inset-right, 0px)) var(--ht-safe-bottom) max(12px, env(safe-area-inset-left, 0px));
  }
  .ht-play-page #pause-overlay .ht-overlay-card {
    width: min(100%, 350px);
    max-height: calc(var(--ht-viewport-height) - var(--ht-safe-top) - var(--ht-safe-bottom));
    margin: auto 0;
    padding: 12px 16px;
    overflow-y: auto;
    touch-action: pan-y;
    overscroll-behavior: contain;
  }
  .ht-play-page #pause-overlay .ht-dialog-dot { width: 28px; height: 28px; }
  .ht-play-page #pause-overlay .ht-dialog-dot::before { width: 11px; height: 14px; border-width: 3px; }
  .ht-play-page #pause-overlay .ht-overlay-card h2 { margin: 6px 0 2px; font-size: 18px; line-height: 1.35; }
  .ht-play-page #pause-overlay .ht-overlay-card p { margin: 0 0 8px; font-size: 11px; line-height: 1.45; }
  .ht-play-page #pause-overlay .ht-button { min-height: 44px; padding: 8px 12px; }
  .ht-play-page #pause-overlay .ht-overlay-card a { margin-top: 8px; }
  .ht-play-page #pause-overlay .ht-pause-sound { margin-top: 10px; }
  .ht-play-page #pause-overlay .ht-sound { min-height: 44px; padding-top: 5px; padding-bottom: 5px; }
  .ht-play-page #pause-overlay .ht-pause-sound .ht-fineprint { margin: 4px 0 0; font-size: 10px; line-height: 1.5; }
}

/* Result celebrations stay inside their own card; play and physics layouts are unchanged. */
.ht-result-page {
  --ht-result-accent: #9c5f7d;
  --ht-result-edge: #eadfdc;
  --ht-result-soft: #fff2f6;
}
.ht-result-page[data-result-kind="black"] {
  --ht-result-accent: #775586;
  --ht-result-edge: #d8c7e4;
  --ht-result-soft: #f2e9f7;
  background: radial-gradient(circle at 7% 16%, #eadcf5 0, transparent 29%), radial-gradient(circle at 96% 54%, #f9dfe8 0, transparent 32%), #faf4fb;
}
.ht-result-page[data-result-kind="score"] {
  --ht-result-accent: #8d6422;
  --ht-result-edge: #ead195;
  --ht-result-soft: #fff2c8;
  background: radial-gradient(circle at 4% 17%, #fce9aa 0, transparent 30%), radial-gradient(circle at 95% 56%, #e6f3dd 0, transparent 32%), #fffaf0;
}
.ht-result-page[data-result-kind="both"] {
  --ht-result-accent: #a2587c;
  --ht-result-edge: #e8c0cb;
  --ht-result-soft: #ffe8ed;
  background: radial-gradient(circle at 4% 17%, #ffe4a9 0, transparent 29%), radial-gradient(circle at 97% 44%, #f7d7e8 0, transparent 32%), #fff5ef;
}
.ht-result-page .ht-result-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-color: var(--ht-result-edge);
}
.ht-result-page .ht-result-card h1 {
  overflow-wrap: anywhere;
  text-wrap: balance;
}
.ht-result-page:not([data-result-kind="none"]) .ht-result-card {
  padding: 28px 18px 24px;
  border-width: 2px;
  box-shadow: 0 7px 0 var(--ht-result-soft), 0 16px 40px #8e58700a;
}
.ht-result-page:not([data-result-kind="none"]) .ht-result-card::before,
.ht-result-page:not([data-result-kind="none"]) .ht-result-card::after {
  content: '';
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  background: var(--ht-result-soft);
  pointer-events: none;
}
.ht-result-page:not([data-result-kind="none"]) .ht-result-card::before { width: 122px; height: 122px; top: -49px; left: -52px; }
.ht-result-page:not([data-result-kind="none"]) .ht-result-card::after { width: 76px; height: 76px; top: 124px; right: -45px; }
.ht-result-page:not([data-result-kind="none"]) .ht-result-card h1 {
  font-size: clamp(23px, 6.8vw, 31px);
  margin: 6px 0 8px;
  line-height: 1.4;
  color: var(--ht-result-accent);
}
.ht-result-congrats {
  max-width: 30em;
  margin: 0 auto 20px;
  padding: 0 5px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.8;
  color: #947484;
  overflow-wrap: anywhere;
}
.ht-achievement-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  margin: 8px auto 0;
  padding: 5px 0;
}
.ht-black-pair { display: flex; align-items: center; justify-content: center; width: 100%; max-width: 288px; gap: 14px; }
.ht-black-frame {
  display: grid;
  place-items: center;
  flex: 0 1 132px;
  width: calc((100% - 14px) / 2);
  min-width: 0;
  aspect-ratio: 1;
  border: 6px solid white;
  border-radius: 50%;
  background: #efedf5;
  box-shadow: 0 0 0 2px #b7a8c4, 0 7px 0 #e7ddec;
}
.ht-black-frame img { display: block; width: 94%; height: 94%; object-fit: contain; }
.ht-black-frame:first-child img { transform: rotate(-6deg); }
.ht-black-frame:last-child img { transform: rotate(6deg); }
.ht-score-medal {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 218px;
  max-width: 100%;
  aspect-ratio: 1;
  padding: 24px 16px;
  border: 7px solid #f1d080;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 27%, #fffbea, #fff0ba);
  box-shadow: 0 0 0 2px white, 0 0 0 4px #e5c473, inset 0 0 0 2px #fffdf2, 0 9px 0 #f5e7c7;
  color: #876024;
  line-height: 1.35;
}
.ht-score-medal > span { font-size: 12px; font-weight: 800; max-width: 100%; overflow-wrap: anywhere; }
.ht-score-medal > strong { display: block; max-width: 100%; font-size: clamp(34px, 11vw, 44px); font-weight: 900; letter-spacing: -.06em; font-variant-numeric: tabular-nums; line-height: 1.2; margin: 8px 0 6px; }
.ht-score-medal > b { max-width: 100%; font-size: 20px; font-weight: 900; overflow-wrap: anywhere; }
.ht-result-page[data-result-kind="both"] .ht-achievement-hero { gap: 0; }
.ht-result-page[data-result-kind="both"] .ht-black-pair { max-width: 232px; gap: 20px; }
.ht-result-page[data-result-kind="both"] .ht-black-frame { flex-basis: 106px; width: calc((100% - 20px) / 2); border-width: 5px; }
.ht-result-page[data-result-kind="both"] .ht-score-medal { position: relative; width: 164px; margin-top: -7px; padding: 18px 12px; border-width: 6px; }
.ht-result-page[data-result-kind="both"] .ht-score-medal > span { font-size: 10px; }
.ht-result-page[data-result-kind="both"] .ht-score-medal > strong { font-size: 32px; margin: 4px 0; }
.ht-result-page[data-result-kind="both"] .ht-score-medal > b { font-size: 16px; }
.ht-result-awards { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 20px; }
.ht-result-award { display: flex; flex: 1 1 108px; min-width: 0; min-height: 66px; flex-direction: column; align-items: center; justify-content: center; padding: 10px 12px; border: 1px solid #ddd0e7; border-radius: 32px; background: #f1ebf6; color: #71597f; line-height: 1.6; overflow-wrap: anywhere; }
.ht-result-award > span { width: 100%; font-size: 11px; font-weight: 800; }
.ht-result-award > strong { width: 100%; font-size: 14px; font-weight: 900; margin-top: 1px; }
.ht-result-award--score { background: #fff1c7; border-color: #ead49b; color: #89652c; }
.ht-result-award--score > span { font-size: 13px; }
.ht-result-page .ht-result-name { overflow-wrap: anywhere; }
.ht-result-page .ht-result-score strong { max-width: 100%; color: var(--ht-result-accent); line-height: 1.18; }
.ht-result-page .ht-rank-badge { max-width: 100%; overflow-wrap: anywhere; }
.ht-result-page .ht-result-facts { align-items: center; }
.ht-biggest-thumbnail { display: block; width: 64px; height: 64px; object-fit: contain; border: 2px solid #e5d7df; border-radius: 50%; padding: 5px; margin: 7px auto 4px; }
@media (max-width: 350px) {
  /* Stack the short score label above its digits on small phones: 100,000 stays
     on one line without adding height to the play HUD or shrinking the board. */
  .ht-play-page .ht-score { display: grid; grid-template-columns: minmax(0, 1fr); align-content: center; gap: 1px; padding: 4px 10px; }
  .ht-play-page .ht-score > span { font-size: 9px; line-height: 1.2; white-space: nowrap; }
  .ht-play-page .ht-score strong { font-size: clamp(19px, 6.3vw, 22px); line-height: 1.2; white-space: nowrap; overflow-wrap: normal; }
  .ht-result-page .ht-result-shell { width: calc(100% - 24px); }
  .ht-result-page:not([data-result-kind="none"]) .ht-result-card { padding: 24px 14px 21px; }
  .ht-result-page .ht-result-congrats { font-size: 11px; padding: 0; }
  .ht-result-page .ht-result-award { padding: 9px; }
  .ht-result-page .ht-result-facts { gap: 8px; }
}
