:root {
  --bg: #bdbdbd;
  --panel: #cccccc;
  --tile: #d4d4d4;
  --tile-hi: #ffffff;
  --tile-lo: #969696;
  --frame: #969696;
  --ink: #111;
  --mute: #969696;
  --tile-hover: #e4e4e4;
  --red: #fe000d;
  --pen: #1450b4;
  --pixel: "Pixelify Sans", "DotGothic16", monospace;
  --digit: "Silkscreen", monospace;
  --kr: "Galmuri11", "DotGothic16", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
html { overflow-x: hidden; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--kr);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: center;          /* 창이 판보다 크면 위아래 여백을 같게 */
  -webkit-font-smoothing: none;
}
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; }

.sheet {
  /* --b = 판 한 변. 창 가로·세로 둘 다에 들어가는 가장 큰 값(최대 600px).
     세로 = 헤더(.26b) + 간격(.035b) + 판(b) + 바닥 고정 몫(약 120px)
     가로 = 왼쪽 줄(.4b) + 간격(.043b) + 판(b) + 양옆 여백 */
  --b: max(240px, min(600px, (100dvh - 134px) / 1.3, (100vw - 40px) / 1.443));
  --side: calc(var(--b) * .4);
  --gap: calc(var(--b) * .043);
  --play-w: calc(var(--side) + var(--gap) + var(--b));
  width: min(1080px, 100%);
  padding: 24px 16px;
  position: relative;
}

/* ---------- 헤더 ---------- */
.head { position: relative; margin: 0 auto calc(var(--b) * .035); max-width: var(--play-w); }
.head-in {
  position: relative;
  display: flex;
  align-items: center;
  gap: calc(var(--b) * .03);
  padding: calc(var(--b) * .023) calc(var(--b) * .037) calc(var(--b) * .023) calc(var(--b) * .027);
  background: var(--panel);
  border: clamp(6px, calc(var(--b) * .017), 10px) solid;
  border-color: var(--frame) var(--tile-hi) var(--tile-hi) var(--frame);
}
.logo { width: calc(var(--b) * .18); flex: none; padding: 0; background: none; border: 0; }
.logo:hover img { filter: brightness(1.04); }
.logo:active img { transform: translateY(2px) scale(.97); }
.logo:focus-visible { outline: 3px dashed var(--pen); outline-offset: 3px; }
.logo img { width: 100%; display: block; image-rendering: auto; }
.title { margin: 0; flex: 1; min-width: 0; line-height: 0; }
.title img { display: block; height: calc(var(--b) * .175); width: auto; max-width: 100%; object-fit: contain; object-position: left center; }
/* score 글자 위 = 로고 위, 점수 칸 아래 = 로고 아래 */
.hscore { flex: none; width: calc(var(--b) * .25); height: calc(var(--b) * .18); text-align: right; position: relative; display: flex; flex-direction: column; justify-content: space-between; }
.hscore-label { display: flex; justify-content: flex-end; line-height: 0; }
.hscore-label img { height: max(18px, calc(var(--b) * .058)); width: auto; }
.hscore-num {
  margin: 0; height: calc(var(--b) * .09); background: #fff;
  border: 3px solid var(--ink); transform: rotate(-2deg);
  display: grid; place-items: center;
  font-family: var(--digit); font-weight: 700; font-size: calc(var(--b) * .053);
}
.hscore-num.bump { animation: pop .5s ease-out; }
.hscore-sub { position: absolute; top: 100%; right: 0; margin-top: 3px; font-size: 11px; white-space: nowrap; }

.deco { position: absolute; z-index: 2; pointer-events: none; font-style: normal; }
.dot { width: 32px; height: 32px; background: url("assets/mine.svg") center/contain no-repeat; }
.d1 { left: -17px; top: -19px; }
.d2 { right: 120px; bottom: -14px; width: 24px; height: 24px; }
.d3 { right: -12px; top: 16px; width: 18px; height: 18px; }
.bar { height: 7px; background: var(--ink); }
.b1 { left: -28px; top: 40%; width: 22px; }
.b2 { right: -24px; top: 58%; width: 18px; height: 12px; }
.sq { width: 18px; height: 18px; background: var(--tile); border: 3px solid; border-color: var(--tile-hi) var(--tile-lo) var(--tile-lo) var(--tile-hi); }
.s1 { right: 140px; top: -14px; }
.spark { width: 12px; height: 20px; background: url("assets/sparkle.svg") center/contain no-repeat; }
.k1 { left: 46px; top: -12px; }
.k2 { right: 70px; top: -10px; }

/* ---------- 플레이 영역 ---------- */
.play {
  display: grid;
  grid-template-columns: var(--side) var(--b);
  justify-content: center;
  gap: var(--gap);
  align-items: start;
}

/* 아이템 3×4 */
.side { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: 1fr auto; gap: calc(var(--b) * .027); min-width: 0; min-height: var(--b); }
.items {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-self: end;
  gap: 3px;
  padding: 5px;
  background: var(--tile-hi);
  border: 1px solid var(--frame);
}
.item {
  position: relative;
  aspect-ratio: 1;
  border: clamp(2px, calc(var(--b) * .007), 4px) solid;
  border-color: var(--tile-hi) var(--tile-lo) var(--tile-lo) var(--tile-hi);
  background: var(--tile);
  display: grid; place-items: center;
  font-family: var(--pixel); font-weight: 700; font-size: clamp(11px, calc(var(--b) * .028), 17px);
  color: var(--ink);
  padding: 0;
}
.item .face { opacity: .3; transition: opacity .35s, transform .35s; display: grid; place-items: center; width: 100%; height: 100%; }
.item.have .face, .item.used .face { opacity: 1; }
.item.empty .face { color: var(--mute); text-shadow: 1px 1px 0 #fff; opacity: .6; }
.item.have { cursor: default; }
.item.have.ready { cursor: pointer; box-shadow: inset 0 0 0 2px var(--pen); }
.item.have.ready:hover { transform: translateY(-1px); filter: brightness(1.05); }
.item.used::after {
  content: ""; position: absolute; left: -6%; right: -6%; top: 50%;
  height: 3px; background: var(--pen); border-radius: 2px;
  transform: rotate(-45deg);
}
.item.fresh .face { animation: pop .6s ease-out; }
.item .face svg { width: 62%; height: 62%; }
.item .face svg[fill] { width: 54%; height: auto; }
@keyframes pop { 0% { transform: scale(.4); opacity: 0 } 60% { transform: scale(1.25) } 100% { transform: scale(1) } }

/* 5×5 판 */
.board-wrap {
  border: 3px solid var(--ink);
  background: var(--frame);
  padding: calc(var(--b) * .027);
  position: relative;
  width: var(--b);
}
.board-wrap::before { content: ""; position: absolute; left: -16px; bottom: 10%; width: 28px; height: 28px; background: url("assets/mine.svg") center/contain no-repeat; }
.board {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: calc(var(--b) * .007);
}
.cell {
  position: relative;
  aspect-ratio: 1;
  padding: 0;
  background: var(--tile);
  border: clamp(3px, calc(var(--b) * .01), 6px) solid;
  border-color: var(--tile-hi) var(--tile-lo) var(--tile-lo) var(--tile-hi);
  display: grid; place-items: center;
  font-family: var(--digit); font-weight: 700;
  font-size: calc(var(--b) * .067);
  transition: background .15s;
}
.cell.can:hover { background: var(--tile-hover); }
.cell.can:hover::before {
  content: attr(data-ghost); position: absolute; inset: 0; display: grid; place-items: center;
  color: rgba(0,0,0,.22);
}
.cell.can.ghost-flag:hover::before { content: ""; background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10' shape-rendering='crispEdges'><g opacity='.3'><rect x='4' y='1' width='1' height='7' fill='%23111'/><rect x='5' y='1' width='3' height='1' fill='%23fe000d'/><rect x='5' y='2' width='4' height='1' fill='%23fe000d'/><rect x='5' y='3' width='2' height='1' fill='%23fe000d'/><rect x='3' y='8' width='4' height='1' fill='%23111'/><rect x='2' y='9' width='6' height='1' fill='%23111'/></g></svg>") center/62% no-repeat; }
.cell.filled { cursor: default; }
.cell .flag { width: 66%; height: 66%; }
.cell .num { position: relative; z-index: 1; line-height: 1; }
.cell.placed { animation: stamp .28s ease-out; }
@keyframes stamp { 0% { transform: scale(1.18) } 100% { transform: scale(1) } }
.cell.near { background: #ececec; box-shadow: inset 0 0 0 2px rgba(20,80,180,.35); }
.cell .mark { position: absolute; inset: 6%; pointer-events: none; z-index: 2; }
.cell .mark path, .cell .mark circle { fill: none; stroke: var(--pen); stroke-width: 4; stroke-linecap: round; }
.cell .mark.draw path, .cell .mark.draw circle { stroke-dasharray: 260; stroke-dashoffset: 260; animation: draw .45s ease-out forwards; }
@keyframes draw { to { stroke-dashoffset: 0 } }
.board.locked .cell { cursor: default; }

/* ---------- 주사위 트레이 ---------- */
.tray {
  /* 주사위 | 값 줄·되돌리기, 그 아래 안내 글 */
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas: "die info" "hint hint";
  align-content: start;
  align-items: center;
  gap: 8px;
  container-type: inline-size;
  justify-items: stretch;
  padding: calc(var(--b) * .017) calc(var(--b) * .023);
  background: var(--panel);
  min-width: 0;
  border: clamp(4px, calc(var(--b) * .01), 6px) solid;
  border-color: var(--tile-lo) var(--tile-hi) var(--tile-hi) var(--tile-lo);
}
.die-btn {
  position: relative; width: calc(var(--b) * .17); height: calc(var(--b) * .17); padding: 0;
  background: none; border: 0; perspective: 500px;
  grid-area: die;
}
.die-btn:focus-visible { outline: 3px dashed var(--pen); outline-offset: 4px; }
.die-shadow {
  position: absolute; left: 22%; right: 22%; bottom: 4px; height: 12px;
  background: radial-gradient(closest-side, rgba(255,90,70,.55), rgba(170,0,20,.32) 55%, rgba(0,0,0,.12) 85%, transparent);
  border-radius: 50%; filter: blur(2px);
  transition: transform .2s;
}
.die { position: absolute; inset: 6px 10px 14px; transform-style: preserve-3d; }
.die svg { width: 100%; height: 100%; display: block; overflow: visible; filter: drop-shadow(0 3px 2px rgba(120,0,10,.3)); }
.die-btn.idle .die { animation: bob 1.6s ease-in-out infinite; }
.die-btn.idle:hover .die { animation-duration: .5s; }
@keyframes bob { 50% { transform: translateY(-5px) rotate(-3deg) } }
.die-btn.rolling .die { animation: tumble .95s cubic-bezier(.2,.7,.3,1) both; }
.die-btn.rolling .die-shadow { animation: shadow .95s ease-out both; }
@keyframes tumble {
  0%   { transform: translate(-90px,-80px) rotate(-200deg) rotateX(30deg) scale(.75); }
  28%  { transform: translate(-30px,0) rotate(-40deg) rotateY(35deg) scale(1.05,.92); }
  42%  { transform: translate(-6px,-30px) rotate(60deg) rotateX(-30deg) scale(1); }
  58%  { transform: translate(12px,0) rotate(150deg) rotateY(-30deg) scale(1.04,.94); }
  72%  { transform: translate(6px,-10px) rotate(260deg) rotateX(20deg); }
  86%  { transform: translate(0,0) rotate(352deg) scale(1.05,.93); }
  100% { transform: translate(0,0) rotate(360deg) scale(1); }
}
@keyframes shadow { 0% { transform: scale(.4); opacity: 0 } 30% { transform: scale(1); opacity: 1 } 45% { transform: scale(.8) } 62%,100% { transform: scale(1) } }

.tray-info { grid-area: info; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
@container (max-width: 170px) { .undo-txt { display: none; } }
.value-line { font-family: "Galmuri11", var(--kr); font-weight: 700; font-size: clamp(18px, calc(var(--b) * .042), 26px); min-height: 28px; min-width: 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.value-line .chip { display: inline-grid; place-items: center; min-width: 1.6em; height: 1.5em; padding: 0 5px; background: #fff; border: 3px solid var(--ink); line-height: 1; }
.value-line .chip.big { background: var(--ink); color: #fff; }
.value-line .arrow { color: var(--pen); font-family: var(--kr); font-size: 12px; }
.hint { grid-area: hint; margin: 0; font-family: "Galmuri11", var(--kr); font-size: 12px; line-height: 1.55; color: var(--ink); word-break: keep-all; }
@media (min-width: 900px) and (min-height: 720px) { .hint { font-family: "Galmuri14", var(--kr); font-size: 15px; } }
.actions { display: flex; flex-wrap: wrap; gap: 6px; }
.act {
  font-family: var(--pixel), var(--kr); font-weight: 700; font-size: clamp(11px, calc(var(--b) * .022), 14px);
  padding: .45em .7em; flex: none; white-space: nowrap;
  background: var(--tile);
  border: 3px solid;
  border-color: var(--tile-hi) var(--tile-lo) var(--tile-lo) var(--tile-hi);
  display: inline-flex; align-items: center; gap: 5px;
}
.act small { font-family: var(--kr); font-weight: 400; font-size: 12px; }
.act:not(:disabled):active { border-color: var(--tile-lo) var(--tile-hi) var(--tile-hi) var(--tile-lo); }
.act:disabled { opacity: .38; }
.act.ghost { background: transparent; }
.act .undo-ico { width: 1.15em; height: auto; flex: none; }
#btnUndo { font-family: "Galmuri11", var(--kr); font-size: 12px; gap: 6px; padding: 6px 9px; }
#btnUndo:not(:disabled) { color: var(--ink); }
.act .count { font-size: 11px; background: var(--ink); color: #fff; padding: 1px 4px; }
.ico.flag-ico { width: 16px; height: 16px; display: inline-block; background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10' shape-rendering='crispEdges'><rect x='4' y='1' width='1' height='7' fill='%23111'/><rect x='5' y='1' width='3' height='1' fill='%23fe000d'/><rect x='5' y='2' width='4' height='1' fill='%23fe000d'/><rect x='5' y='3' width='2' height='1' fill='%23fe000d'/><rect x='3' y='8' width='4' height='1' fill='%23111'/><rect x='2' y='9' width='6' height='1' fill='%23111'/></svg>") center/contain no-repeat; }

/* ---------- 바닥 ---------- */
.foot { margin-top: 12px; overflow: hidden; white-space: nowrap; }
.marquee { display: inline-flex; animation: slide 30s linear infinite; }
.marquee span { font-family: var(--pixel); font-weight: 700; font-size: 24px; line-height: 1.2; color: #d2d2d2; padding-right: .5em; }
@keyframes slide { to { transform: translateX(-50%) } }
.bottom-bar { display: flex; justify-content: center; gap: 18px; margin-top: 6px; }
.link { background: none; border: 0; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- 모달 ---------- */
.modal { position: fixed; inset: 0; background: rgba(40,40,40,.18); display: grid; place-items: center; padding: 16px; z-index: 50; }
.modal[hidden] { display: none; }
.modal-card {
  width: min(420px, 100%);
  max-height: calc(100vh - 32px); overflow: auto;
  background: var(--panel);
  border: 8px solid;
  border-color: var(--tile-hi) var(--tile-lo) var(--tile-lo) var(--tile-hi);
  outline: 3px solid var(--ink);
  padding: 20px;
  animation: pop .3s ease-out;
}
.modal-card { cursor: grab; touch-action: none; user-select: none; }
.modal-card.dragging { cursor: grabbing; animation: none; box-shadow: 0 10px 0 rgba(0,0,0,.18); }
.modal-card button { cursor: pointer; }
.grip { margin: -10px -10px 10px; padding: 2px 0 6px; text-align: center; font-size: 12px; letter-spacing: .5px; opacity: .45; border-bottom: 2px dashed var(--tile-lo); }
.modal-card h2 { font-family: var(--pixel); font-size: 24px; margin: 0 0 6px; }
.modal-card p { margin: 0 0 14px; line-height: 1.5; }
.choice-row { display: flex; gap: 10px; flex-wrap: wrap; }
.choice {
  flex: 1; min-width: 110px; padding: 14px 8px;
  background: var(--tile); border: 5px solid;
  border-color: var(--tile-hi) var(--tile-lo) var(--tile-lo) var(--tile-hi);
  font-family: var(--pixel); font-weight: 700; font-size: 24px;
  display: grid; gap: 4px; place-items: center;
}
.choice small { font-family: var(--kr); font-weight: 400; font-size: 13px; }
.choice:disabled { opacity: .35; }
.choice:not(:disabled):hover { background: var(--tile-hover); }
.num-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.num-grid .choice { font-family: var(--digit); min-width: 0; padding: 10px 0; font-size: 26px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.rules { font-size: 14px; line-height: 1.6; }
.rules h3 { font-family: var(--kr); font-size: 16px; margin: 14px 0 4px; }
.rules ul { margin: 0; padding-left: 18px; }
/* ---------- 룰북 ---------- */
.modal-card.wide { width: min(520px, 100%); }
.rb { text-align: center; }
.rb-count { font-family: "Galmuri11", var(--kr); font-size: 12px; color: #555; }
.rb h2 { margin: 2px 0 12px; }
.rb-demo {
  display: flex; align-items: center; justify-content: center; gap: 18px;
  min-height: 196px; padding: 14px;
  background: var(--bg);
  border: 4px solid; border-color: var(--tile-lo) var(--tile-hi) var(--tile-hi) var(--tile-lo);
}
.rb-demo[hidden], .rb-cap[hidden], .rb-die[hidden], .rb-side[hidden] { display: none; }
.rb-side { display: grid; justify-items: center; gap: 8px; min-width: 84px; }
.rb-die { width: 72px; height: 72px; transition: opacity .3s; }
.rb-die svg { width: 100%; height: 100%; display: block; overflow: visible; filter: drop-shadow(0 3px 2px rgba(120,0,10,.3)); }
.rb-die.dim { opacity: .35; }
.rb-die.roll svg { animation: rbroll .6s cubic-bezier(.2,.7,.3,1); }
@keyframes rbroll { 0% { transform: translate(-30px,-24px) rotate(-220deg) scale(.7) } 60% { transform: translate(3px,0) rotate(10deg) scale(1.05,.95) } 100% { transform: none } }
.rb-tag { min-height: 34px; display: flex; align-items: center; justify-content: center; gap: 4px; }
.rb-chip {
  display: inline-grid; place-items: center; min-width: 1.6em; height: 1.5em; padding: 0 4px;
  font-family: "Galmuri11", var(--kr); font-weight: 700; font-size: 18px; line-height: 1;
  background: #fff; border: 3px solid var(--ink);
}
.rb-chip.big { background: var(--ink); color: #fff; }
.rb-ar { color: var(--pen); font-family: "Galmuri11", var(--kr); font-size: 14px; }
.rb-item {
  width: 34px; height: 34px; display: grid; place-items: center;
  background: var(--tile); border: 3px solid; border-color: var(--tile-hi) var(--tile-lo) var(--tile-lo) var(--tile-hi);
  animation: pop .4s ease-out;
}
.rb-item.on { box-shadow: inset 0 0 0 2px var(--pen); }
.rb-item svg { width: 62%; height: auto; }
.rb-item svg.flag { height: 70%; }
.rb-plus { font-family: "Galmuri11", var(--kr); font-weight: 700; font-size: 14px; color: var(--pen); }
.rb-board {
  display: grid; grid-template-columns: repeat(3, 52px); gap: 3px; padding: 6px;
  background: var(--frame); border: 2px solid var(--ink);
}
.rb-cell {
  position: relative; aspect-ratio: 1; display: grid; place-items: center;
  background: var(--tile);
  border: 4px solid; border-color: var(--tile-hi) var(--tile-lo) var(--tile-lo) var(--tile-hi);
  font-family: "Galmuri11", var(--kr); font-weight: 700; font-size: 24px;
  transition: background .2s;
}
.rb-cell .flag { width: 66%; height: 66%; }
.rb-cell .num { position: relative; z-index: 1; line-height: 1; }
.rb-cell.hl { background: #ececec; box-shadow: inset 0 0 0 2px rgba(20,80,180,.4); }
.rb-cell.center { background: #fff; }
.rb-cell.placed { animation: stamp .28s ease-out; }
.rb-cell .mark { position: absolute; inset: 6%; pointer-events: none; z-index: 2; }
.rb-cell .mark path { fill: none; stroke: var(--pen); stroke-width: 6; stroke-linecap: round; }
.rb-cell .mark.draw path { stroke-dasharray: 260; stroke-dashoffset: 260; animation: draw .45s ease-out forwards; }
.rb-cap {
  min-height: 34px; margin: 10px 0 4px;
  display: flex; align-items: center; justify-content: center; gap: 4px; flex-wrap: wrap;
  font-family: "Galmuri14", var(--kr); font-size: 15px; color: var(--pen);
}
.rb-cap b { color: var(--ink); }
.rb-cap .rb-chip { font-size: 15px; }
.rb-text {
  min-height: 3.4em; margin: 4px 0 14px; text-align: left;
  font-family: "Galmuri14", var(--kr); font-size: 15px; line-height: 1.7; word-break: keep-all;
}
.rb-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.rb-list li { display: flex; align-items: center; gap: 12px; }
.rb-list img { width: 40px; flex: none; }
.rb-ico { width: 40px; height: 40px; flex: none; display: grid; place-items: center; background: var(--tile); border: 3px solid; border-color: var(--tile-hi) var(--tile-lo) var(--tile-lo) var(--tile-hi); font-size: 14px; }
.rb-ico svg { width: 60%; height: 60%; }
.rb-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rb-nav .act { min-width: 44px; justify-content: center; }
.rb-dots { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.rb-dot { width: 10px; height: 10px; padding: 0; background: var(--tile); border: 2px solid var(--ink); }
.rb-dot.on { background: var(--ink); }
@media (max-width: 420px) {
  .rb-demo { gap: 10px; padding: 10px; }
  .rb-board { grid-template-columns: repeat(3, 44px); }
  .rb-cell { font-size: 20px; border-width: 3px; }
  .rb-die { width: 58px; height: 58px; }
  .rb-side { min-width: 70px; }
}

.final-score { font-family: var(--digit); font-weight: 700; font-size: 64px; text-align: center; margin: 4px 0 6px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 30px);
  background: var(--ink); color: #fff; padding: 10px 16px; font-size: 14px;
  opacity: 0; transition: .25s; pointer-events: none; z-index: 60; max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 세로로 긴 창 (폰 등): 판 위, 주사위·아이템 아래 ---------- */
@media (max-aspect-ratio: 4/5) {
  .sheet {
    /* 세로 = 헤더(.26b) + 판(b) + 트레이(.2b) + 아이템 6×2(.36b) + 간격 + 바닥 */
    --b: max(240px, min(600px, 100vw - 32px, (100dvh - 174px) / 1.9));
    --play-w: var(--b);
  }
  .play { grid-template-columns: var(--b); }
  .side { order: 2; grid-template-rows: auto auto; }
  .side { min-height: 0; }
  .tray { grid-template-areas: "die info" "die hint"; column-gap: 12px; }
  .tray-info { flex-direction: row; align-items: center; justify-content: space-between; width: 100%; }
  .die-btn { width: calc(var(--b) * .2); height: calc(var(--b) * .2); }
  .items { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .hscore-sub { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
