.arc-round {
  --arc-ink: #242321;
  --arc-paper: #fffcf2;
  --arc-accent: #b69df7;
  --arc-wash: #e9e2f7;
  --arc-strong: #674aa0;
  --arc-dot: #bab0cc;
  --arc-mono: "Space Mono", "Courier New", monospace;
  color: var(--arc-ink);
  background: var(--arc-paper);
  border: 2px solid var(--arc-ink);
  border-radius: 5px;
  overflow: hidden;
  width: 100%;
  text-align: left;
  container-type: inline-size;
}
.arc-round, .arc-round * { box-sizing: border-box; }
.arc-hands {
  --arc-accent: #ff9376;
  --arc-wash: #ffdfcb;
  --arc-strong: #872c17;
  --arc-dot: #d0a48b;
}
.arc-coin {
  --arc-accent: #efc046;
  --arc-wash: #f9ecc9;
  --arc-strong: #785108;
  --arc-dot: #c9b682;
}
.arc-stage {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 15px;
  min-height: 300px;
  padding: 22px clamp(14px, 4%, 38px);
  background-color: var(--arc-wash);
  background-image: radial-gradient(var(--arc-dot) 0.8px, transparent 1px);
  background-position: center;
  background-size: 10px 10px;
}
.arc-command {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  min-height: 91px;
  padding: 16px clamp(16px, 4%, 30px);
  border-top: 2px solid var(--arc-ink);
}
.arc-message { display: grid; gap: 4px; }
.arc-message strong {
  font-family: "Barlow Semi Condensed", "Arial Narrow", sans-serif;
  font-size: clamp(1.26rem, 4.2cqi, 1.65rem);
  line-height: 1.06;
  font-weight: 900;
  letter-spacing: -.018em;
}
.arc-message > span {
  color: #4d4943;
  font-size: .89rem;
  font-weight: 450;
  line-height: 1.45;
}
.arc-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.arc-actions:empty { display: none; }
.arc-round button {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  color: var(--arc-ink);
  cursor: pointer;
}
.arc-round button:focus-visible {
  outline: 3px solid var(--arc-ink);
  outline-offset: 3px;
  z-index: 1;
}
.arc-choice, .arc-replay {
  min-height: 44px;
  min-width: 64px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1.5px solid var(--arc-ink);
  border-radius: 4px;
  background: var(--arc-paper);
  font: 700 13px/1.1 var(--arc-mono);
  box-shadow: 2px 2px var(--arc-ink);
  transition: background-color .15s, transform .15s, box-shadow .15s;
}
.arc-choice .arc-hand-icon { width: 27px; height: 27px; object-fit: contain; }
.arc-choice.arc-picked, .arc-replay { background: var(--arc-accent); }
.arc-replay svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
@media (hover: hover) {
  .arc-choice:not([aria-disabled="true"]):hover, .arc-replay:hover {
    background: var(--arc-accent);
    transform: translate(-1px, -1px);
    box-shadow: 3px 3px var(--arc-ink);
  }
  .arc-square:not([aria-disabled="true"]):hover { background: #e7dbff; }
}
.arc-round button[aria-disabled="true"] { cursor: default; }
.arc-choice:not([aria-disabled="true"]):active, .arc-replay:active {
  transform: translate(2px, 2px);
  box-shadow: none;
}
.arc-players {
  display: flex;
  gap: 23px;
  font: 700 11px/1 var(--arc-mono);
  letter-spacing: .06em;
  text-transform: uppercase;
}
.arc-players span { display: inline-flex; gap: 5px; align-items: center; }
.arc-players svg { width: 16px; height: 16px; }
.arc-board {
  width: min(100%, 254px);
  aspect-ratio: 1;
  display: grid;
  grid-template: repeat(3, 1fr) / repeat(3, 1fr);
  position: relative;
  gap: 2px;
  border: 2px solid var(--arc-ink);
  border-radius: 4px;
  overflow: hidden;
  background: var(--arc-ink);
  box-shadow: 4px 4px var(--arc-ink);
}
.arc-square {
  display: grid;
  min-width: 0;
  min-height: 0;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 0;
  background: var(--arc-paper);
}
.arc-square:focus-visible { outline-offset: -4px !important; }
.arc-mark { fill: none; stroke: currentColor; stroke-width: 7.5; stroke-linecap: round; }
.arc-square .arc-mark { width: 74%; height: 74%; }
.arc-mark-x { color: #5c389c; }
.arc-mark-o { color: #252322; }
.arc-square .arc-mark > *, .arc-winning-line line {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: arc-draw .2s ease-out backwards;
}
.arc-square .arc-mark-x path + path { animation-delay: .085s; }
.arc-winning-cell { background: #dfd0fb; }
.arc-winning-line {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}
.arc-winning-line line {
  stroke: #8459c1;
  stroke-linecap: round;
  stroke-width: 5;
  animation-duration: .36s;
}
@keyframes arc-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
.arc-duel {
  width: min(100%, 550px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 3%, 20px);
}
.arc-hand-side { display: grid; justify-items: center; gap: 7px; }
.arc-side-label, .arc-choice-label, .arc-versus {
  font: 700 12px/1.2 var(--arc-mono);
  text-transform: uppercase;
  letter-spacing: .07em;
}
.arc-side-label {
  padding: 5px 10px;
  border-radius: 2px;
  background: var(--arc-ink);
  color: var(--arc-paper);
}
.arc-choice-label { color: var(--arc-strong); }
.arc-versus {
  width: 35px;
  height: 35px;
  display: grid;
  place-content: center;
  margin-top: 5px;
  border: 1.5px solid var(--arc-ink);
  border-radius: 50%;
  background: var(--arc-paper);
  font-size: 12px;
  letter-spacing: -.04em;
}
.arc-gesture {
  width: min(100%, 165px);
  transform-origin: 50% 82%;
}
.arc-gesture .arc-hand-icon { display: block; width: 100%; height: auto; }
.arc-hand-player .arc-gesture .arc-hand-icon { transform: rotate(13deg); }
.arc-hand-cpu .arc-gesture .arc-hand-icon { transform: scaleX(-1) rotate(13deg); }
.arc-shaking .arc-gesture { animation: arc-shake .25s ease-in-out 3; }
.arc-revealed .arc-gesture { animation: arc-hand-reveal .2s ease-out; }
@keyframes arc-shake {
  0%, 100% { transform: translateY(0); }
  48% { transform: translateY(-12px) rotate(-4deg); }
}
@keyframes arc-hand-reveal {
  from { transform: scale(.91); }
  70% { transform: scale(1.04); }
}
.arc-toss {
  display: grid;
  place-items: center;
  position: relative;
  width: min(100%, 340px);
  min-height: 238px;
  perspective: 740px;
}
.arc-token-lift {
  width: min(72%, 148px);
  aspect-ratio: 1;
  transform-style: preserve-3d;
}
.arc-token {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transform: rotateX(0deg);
}
.arc-coin-face {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.arc-coin-heads { transform: translateZ(3px); }
.arc-coin-tails { transform: rotateX(180deg) translateZ(3px); }
.arc-coin-caption { position: absolute; bottom: -5px; }
.arc-token::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: repeating-linear-gradient(90deg, #a46d23 0 3px, #f0bd54 3px 5px);
  transform: translateY(-50%) rotateX(90deg);
}
.arc-token-shadow {
  position: absolute;
  bottom: 20px;
  width: 89px;
  height: 10px;
  background: #68450c;
  border-radius: 50%;
  opacity: .18;
}
.arc-flipping .arc-token-lift { animation: arc-toss-height 1.05s both; }
.arc-flipping .arc-token { animation: arc-coin-turn 1.05s cubic-bezier(.2,.45,.63,1) both; }
.arc-flipping .arc-token-shadow { animation: arc-toss-shadow 1.05s both; }
.arc-land-tails { --arc-turn-end: 1260deg; }
.arc-landed.arc-land-tails .arc-token { transform: rotateX(180deg); }
@keyframes arc-coin-turn { from { transform: rotateX(0); } to { transform: rotateX(var(--arc-turn-end, 1080deg)); } }
@keyframes arc-toss-height {
  0%, 100% { transform: translateY(0); animation-timing-function: ease-out; }
  40% { transform: translateY(-37px); animation-timing-function: ease-in; }
  84% { transform: translateY(2px); animation-timing-function: ease-out; }
  93% { transform: translateY(-3px); }
}
@keyframes arc-toss-shadow {
  0%, 100% { transform: scale(1); opacity: .18; }
  40% { transform: scale(.64); opacity: .09; }
}
@container (max-width: 470px) {
  .arc-stage { min-height: 240px; padding: 18px 13px; }
  .arc-grid .arc-board { width: min(100%, 215px); }
  .arc-command { flex-direction: column; align-items: stretch; gap: 13px; }
  .arc-choice { flex: 1; min-width: 0; padding: 8px; }
  .arc-choice .arc-hand-icon { width: 20px; height: 20px; }
}
@container (max-width: 325px) {
  .arc-choice { gap: 3px; font-size: 12px; }
  .arc-choice .arc-hand-icon { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .arc-round *, .arc-round *::after { animation: none !important; transition: none !important; }
  .arc-choice, .arc-replay { transform: none !important; }
}

:root[data-theme="dark"] .arc-round {
  --arc-ink: #f8f4e8;
  --arc-paper: #29282d;
  --arc-accent: #c2a5f8;
  --arc-wash: #30283c;
  --arc-dot: #56475f;
  --arc-strong: #e0c7ff;
  border-color: #978e9e;
}
:root[data-theme="dark"] .arc-hands {
  --arc-accent: #ff9f84;
  --arc-wash: #392b29;
  --arc-dot: #674941;
  --arc-strong: #ffc6b0;
}
:root[data-theme="dark"] .arc-coin {
  --arc-accent: #f4cc65;
  --arc-wash: #343025;
  --arc-dot: #5c5037;
  --arc-strong: #f8d984;
}
:root[data-theme="dark"] .arc-command { border-color: #978e9e; }
:root[data-theme="dark"] .arc-message > span { color: var(--muted); }
:root[data-theme="dark"] .arc-mark-x { color: #d8baff; }
:root[data-theme="dark"] .arc-mark-o { color: #f8f4e8; }
:root[data-theme="dark"] .arc-winning-cell { background: #503c69; }
:root[data-theme="dark"] .arc-winning-line line { stroke: #ecbd75; }
:root[data-theme="dark"] .arc-board { background: #a397b3; border-color: #a397b3; box-shadow: 4px 4px #151318; }
:root[data-theme="dark"] .arc-choice,
:root[data-theme="dark"] .arc-replay { box-shadow: 2px 2px #0e0e0f; }
:root[data-theme="dark"] .arc-choice.arc-picked,
:root[data-theme="dark"] .arc-replay { color: #1d1920; border-color: var(--arc-accent); }
:root[data-theme="dark"] .arc-token-shadow { background: #100c08; opacity: .6; }
:root[data-theme="dark"] .arc-round button:focus-visible { outline-color: #ffd98d; }
@media (hover: hover) {
  :root[data-theme="dark"] .arc-choice:not([aria-disabled="true"]):hover,
  :root[data-theme="dark"] .arc-replay:hover { color: #1d1920; }
  :root[data-theme="dark"] .arc-square:not([aria-disabled="true"]):hover { background: #443752; }
}
