.kakooma .hunt-game {
  margin-top:1.25rem;
  line-height:1.5;
}
#kakooma-rules {
  margin-top:.65rem;
  color:var(--muted);
}
.kakooma-score {
  margin-top:.75rem;
  font-variant-numeric:tabular-nums;
}
#kakooma-records {
  margin-top:1rem;
  padding-top:.75rem;
  border-top:1px solid var(--line);
}
#kakooma-records dl {
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(5rem, 1fr));
  gap:.5rem;
  margin:.5rem 0 0;
}
#kakooma-records dd {
  margin:0;
  font-weight:800;
  font-variant-numeric:tabular-nums;
  overflow-wrap:anywhere;
}
#kakooma-round {
  margin-top:1rem;
}
#kakooma-time {
  display:block;
  margin-top:.35rem;
}
#kakooma-feedback:not(:empty) {
  margin-top:.75rem;
  font-weight:700;
}
#kakooma-start {
  margin-top:1rem;
}
#kakooma-board {
  position:relative;
  width:min(100%, 22rem);
  aspect-ratio:1.05;
  margin:1rem auto 0;
  background:var(--ink);
  clip-path:polygon(50% 0%, 100% 38.2%, 80.9% 100%, 19.1% 100%, 0% 38.2%);
}
#kakooma-board button {
  position:absolute;
  inset:0;
  padding:0;
  border-radius:0;
  background:var(--white);
  color:var(--ink);
  clip-path:polygon(var(--triangle));
  touch-action:manipulation;
}
@media (hover: hover) {
  #kakooma-board button:hover span {
    color:var(--kakooma-gold, #8b5a00);
  }
}
[data-theme="dark"] #kakooma-board {
  --kakooma-gold:#ffd477;
}
#kakooma-board button:focus-visible span {
  outline:3px solid currentColor;
  outline-offset:.25rem;
  border-radius:.15rem;
}
#kakooma-board span {
  position:absolute;
  left:var(--x);
  top:var(--y);
  transform:translate(-50%, -50%);
  font-size:clamp(1.4rem, 7vw, 2.45rem);
  line-height:1;
}
#kakooma-board button:nth-child(1) {
  --triangle:50% .6%, 99.3% 38.1%, 50.4% 55%;
  --x:66.7%; --y:31.1%;
}
#kakooma-board button:nth-child(2) {
  --triangle:99.6% 38.9%, 80.8% 99.5%, 50.7% 55.8%;
  --x:77%; --y:64.6%;
}
#kakooma-board button:nth-child(3) {
  --triangle:80.3% 99.6%, 19.7% 99.6%, 50% 56.2%;
  --x:50%; --y:85.2%;
}
#kakooma-board button:nth-child(4) {
  --triangle:19.2% 99.5%, .4% 38.9%, 49.3% 55.8%;
  --x:23%; --y:64.6%;
}
#kakooma-board button:nth-child(5) {
  --triangle:.7% 38.1%, 50% .6%, 49.6% 55%;
  --x:33.3%; --y:31.1%;
}

#kakooma-board[data-shape="hexagon"] {
  aspect-ratio:1.155;
  clip-path:polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
}
#kakooma-board[data-shape="hexagon"] button:nth-child(1) {
  --triangle:25.5% .6%, 74.5% .6%, 50% 49.2%;
  --x:50%; --y:17%;
}
#kakooma-board[data-shape="hexagon"] button:nth-child(2) {
  --triangle:75.2% 1.2%, 99.3% 49.6%, 50.7% 49.6%;
  --x:75%; --y:33.3%;
}
#kakooma-board[data-shape="hexagon"] button:nth-child(3) {
  --triangle:99.3% 50.4%, 75.2% 98.8%, 50.7% 50.4%;
  --x:75%; --y:66.7%;
}
#kakooma-board[data-shape="hexagon"] button:nth-child(4) {
  --triangle:74.5% 99.4%, 25.5% 99.4%, 50% 50.8%;
  --x:50%; --y:83%;
}
#kakooma-board[data-shape="hexagon"] button:nth-child(5) {
  --triangle:24.8% 98.8%, .7% 50.4%, 49.3% 50.4%;
  --x:25%; --y:66.7%;
}
#kakooma-board[data-shape="hexagon"] button:nth-child(6) {
  --triangle:.7% 49.6%, 24.8% 1.2%, 49.3% 49.6%;
  --x:25%; --y:33.3%;
}
#kakooma-board[data-shape="grid"] {
  display:grid;
  grid-template:repeat(3, minmax(0, 1fr)) / repeat(3, minmax(0, 1fr));
  --grid-line:3px;
  color:var(--ink);
  background:none;
  aspect-ratio:1;
  clip-path:none;
}
#kakooma-board[data-shape="grid"] button {
  position:relative;
  min-width:0;
  background:transparent;
  clip-path:none;
}
#kakooma-board[data-shape="grid"] span {
  position:static;
  transform:none;
  font-size:clamp(.85rem, 5vw, 1.8rem);
  overflow-wrap:anywhere;
}

.kakooma-choice {
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:.5rem;
  margin-bottom:.75rem;
  font-weight:700;
}
.kakooma-choice select {
  font:inherit;
  color:var(--ink);
  background:var(--paper);
  border:1px solid var(--line);
  border-radius:.5rem;
  padding:.3rem .6rem;
}

.kakooma-shapes {
  min-inline-size:0;
  margin:0 0 .85rem;
  padding:0;
  border:0;
}
.kakooma-shapes legend {
  margin-bottom:.35rem;
  padding:0;
  font-weight:700;
}
.kakooma-shape-options {
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:.35rem;
}
.kakooma-shape-card {
  display:grid;
  justify-items:center;
  gap:.35rem;
  padding:.55rem .15rem;
  border:2px solid var(--line);
  border-radius:.6rem;
  background:var(--white);
  color:var(--ink);
  text-align:center;
  font-size:clamp(.65rem, 3.2vw, .9rem);
  font-weight:700;
  cursor:pointer;
}
.kakooma-shape-options input:checked + .kakooma-shape-card {
  border-color:currentColor;
  background:var(--lilac);
  color:#172e28;
}
.kakooma-shape-options input:focus-visible + .kakooma-shape-card {
  outline:3px solid #8a56ea;
  outline-offset:2px;
}
.kakooma-shapes:disabled .kakooma-shape-card {
  cursor:default;
}
.kakooma-shape-icon {
  width:clamp(2rem, 9vw, 2.85rem);
  aspect-ratio:1;
  background:currentColor;
}
.kakooma-shape-pentagon {
  clip-path:polygon(50% 0%, 100% 38.2%, 80.9% 100%, 19.1% 100%, 0% 38.2%);
}
.kakooma-shape-hexagon {
  clip-path:polygon(25% 7%, 75% 7%, 100% 50%, 75% 93%, 25% 93%, 0% 50%);
}
.kakooma-shape-grid {
  position:relative;
  --grid-line:2px;
  background:none;
}
:is(#kakooma-board[data-shape="grid"], .kakooma-shape-grid)::before,
:is(#kakooma-board[data-shape="grid"], .kakooma-shape-grid)::after {
  content:"";
  position:absolute;
  inset:0;
  z-index:1;
  pointer-events:none;
}
:is(#kakooma-board[data-shape="grid"], .kakooma-shape-grid)::before {
  background:
    linear-gradient(currentColor, currentColor) 33.333% 48% / var(--grid-line) 95% no-repeat,
    linear-gradient(currentColor, currentColor) 66.667% 58% / var(--grid-line) 98% no-repeat;
  transform:rotate(1deg);
}
:is(#kakooma-board[data-shape="grid"], .kakooma-shape-grid)::after {
  background:
    linear-gradient(currentColor, currentColor) 48% 33.333% / 96% var(--grid-line) no-repeat,
    linear-gradient(currentColor, currentColor) 55% 66.667% / 99% var(--grid-line) no-repeat;
  transform:rotate(-1deg);
}
