.rings-game { width: min(100%, 370px); margin: 14px auto 0; min-width: 0; color: #294f48; }
.rings-hud { display: flex; justify-content: space-between; gap: 9px; margin: 0 0 9px; font-size: .88rem; font-weight: 850; }
.rings-hud span { display: flex; align-items: center; gap: 6px; }
.rings-hud b { padding: 3px 8px; border-radius: 30px; color: #24574c; background: #d8f2df; font-variant-numeric: tabular-nums; white-space: nowrap; }

.rings-table {
  position: relative;
  isolation: isolate;
  container-type: inline-size;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border: 2px solid #9b7551;
  border-radius: 25px;
  background: linear-gradient(155deg, #c7f3d6, transparent 58%), repeating-linear-gradient(35deg, #9fdac2 0 16px, #9bd5bc 16px 17px, #96d4bd 17px 34px);
  box-shadow: inset 0 0 0 5px #ffe9bb, inset 0 0 0 8px #e8bf87, inset 0 0 0 9px #a48659, 0 5px 0 #b88c61, 0 10px 16px #53392228;
}
.rings-table::before {
  position: absolute;
  inset: 0;
  content: '';
  background: radial-gradient(circle at center, #386b6461 0 1px, transparent 1.7px) 5% 5% / 18% 18%;
  mask-image: radial-gradient(ellipse at 50% 50%, #000 0 58%, transparent 77%);
}
.rings-table-art { position: absolute; inset: 0; pointer-events: none; }
.rings-peg, .rings-guide, .rings-flight { position: absolute; top: var(--ring-y); left: var(--ring-x); transform: translate(-50%, -50%); }

.rings-peg {
  --peg-top: #e2cbfd;
  --peg-fill: #b88ce9;
  --peg-base: #7852aa;
  z-index: 2;
  width: 10.5%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  padding-bottom: 2px;
  color: #35234c;
  border: 1px solid #f6edf5;
  border-radius: 49% 49% 48% 48%;
  background: radial-gradient(circle at 28% 20%, #fffcf07b 0 12%, transparent 13%), linear-gradient(140deg, var(--peg-top), var(--peg-fill) 69%);
  box-shadow: 0 3px 0 var(--peg-base), 0 5px 7px #47745f73;
  font-size: clamp(.72rem, 5cqw, 1.05rem);
  font-weight: 950;
  line-height: 1;
}
.rings-peg.value-2 { --peg-top: #ffc4ab; --peg-fill: #ef9b90; --peg-base: #bd6564; color: #61352d; }
.rings-peg.value-3 { --peg-top: #fff1aa; --peg-fill: #fbc766; --peg-base: #ba8139; color: #674517; }
.rings-peg.is-blocker {
  --peg-base: #4e5d67;
  width: 11%;
  color: #2c3b49;
  background: repeating-linear-gradient(135deg, #c2c4c7 0 4px, #e0e1e6 4px 8px);
  border-color: #f0e7e8;
}
.rings-peg.is-covered { outline: 2px solid #ffffe3; outline-offset: 2px; }
.rings-peg.is-caught { opacity: .29; box-shadow: none; }
.rings-guide, .rings-flight {
  z-index: 1;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 3px dashed #fff3b9;
  background: #fff0b32b;
  box-shadow: 0 0 0 1px #8e703e87, inset 0 0 0 1px #85663e46;
}
.rings-guide.is-blocked { border-color: #873f53; background: #c7737a36; box-shadow: none; }
.rings-flight {
  z-index: 3;
  border: 6px solid #f6b348;
  background: #ffeb9852;
  box-shadow: 0 3px 0 #a5692e, inset 0 0 0 1px #ffe4a8, 0 8px 7px #63442655;
  animation: rings-flight .29s cubic-bezier(.25,.86,.41,1) both;
}
@keyframes rings-flight {
  from { opacity: .6; transform: translate(-45%,-79%) scale(1.4); }
  75% { opacity: 1; transform: translate(-50%,-45%) scale(.97); }
  to { opacity: 1; transform: translate(-50%,-50%) scale(1); }
}

.rings-aim-grid { position: absolute; z-index: 4; inset: 5%; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); grid-template-rows: repeat(5, minmax(0, 1fr)); }
.rings-aim-grid button { position: relative; min-width: 0; min-height: 0; padding: 0; border: 0; border-radius: 14px; color: #265e55; background: transparent; }
.rings-aim-grid button:focus-visible { outline-offset: -5px; }
.rings-aim-grid button[aria-pressed='true']::after { position: absolute; inset: 50% auto auto 50%; width: 6px; height: 6px; content: ''; transform: translate(-50%, -50%); border: 1px solid #fff5d6; border-radius: 50%; background: #246e59; }

.rings-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 9px; margin-top: 15px; }
.rings-stock { display: flex; flex: 1 1 auto; gap: 6px; }
.rings-stock button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 0;
  min-height: 45px;
  padding: 5px 8px;
  border: 1px solid #bbdbce;
  border-radius: 10px;
  color: #355c50;
  background: #f1f9ef;
  font-size: .85rem;
  font-weight: 850;
  line-height: 1.2;
  text-align: center;
}
.rings-stock button[aria-pressed='true'] { border-color: #2c735e; color: #184a3a; background: #d5f3e0; box-shadow: inset 0 0 0 1px #2c735e; }
.rings-stock button[aria-disabled='true'] { opacity: .55; }
.rings-stock i { flex: 0 0 11px; height: 11px; border-radius: 50%; border: 2px solid #497d70; }
.rings-stock [data-rings-size='1'] i { flex-basis: 15px; height: 15px; }
.rings-toss { min-height: 45px; }
.rings-toss[aria-disabled='true'] { opacity: .65; cursor: wait; }
.rings-estimate { margin: 9px 0 0; font-size: .88rem; font-weight: 850; }
.rings-status { min-height: 1.5em; margin: 2px 0 0; color: #466b5c; font-size: .84rem; }

.rings-preview { width: min(100%, 122px, calc(var(--preview-height, 138px) - 14px)); margin-inline: auto; }
.rings-preview .rings-table { border-width: 1px; border-radius: 11px; box-shadow: inset 0 0 0 3px #ffe9bb, inset 0 0 0 4px #b38853, 0 3px 0 #bd9760; }
.rings-preview .rings-peg { border-width: .5px; padding: 0; font-size: clamp(.26rem, 6cqw, .47rem); box-shadow: 0 1px 0 var(--peg-base), 0 2px 4px #795c466b; }
.rings-preview .rings-peg.is-covered { outline-width: 1px; outline-offset: 1px; }
.rings-preview .rings-guide { border-width: 2px; }

@media (max-width: 360px) {
  .rings-stock { flex: 1 0 100%; }
  .rings-stock button { flex: 1 1 0; }
}
@media (prefers-reduced-motion: reduce) { .rings-flight { animation: none; } }
