:root { --game: #06b6d4; }
.rc-stage { margin: 4px auto 16px; padding: 2px 0 8px; }
.rv-shell {
  max-width: 580px;
  margin: auto;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 0 28px #06b6d424;
}
.rv-shell h1 { margin: 0 2px; font-size: 1.35rem; }
.rv-sub, .rv-help {
  margin: 1px 2px 5px;
  color: var(--text-dim);
  font-size: .78rem;
}
.rv-hud, .rv-scores, .rv-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}
.rv-hud { justify-content: space-between; font-size: .78rem; color: var(--text-dim); }
.rv-scores { justify-content: space-between; padding: 3px 2px; }
.rv-scores span {
  min-width: 0;
  padding: 3px 6px;
  border-radius: 8px;
  color: var(--text-dim);
  font-size: .88rem;
}
.rv-scores .active { color: var(--text); background: #06b6d426; }
.rv-mini {
  display: inline-block;
  width: .75em;
  height: .75em;
  border-radius: 50%;
  vertical-align: -.05em;
}
.rv-mini.dark { border: 1.5px solid #a9b3bc; background: #080a0e; }
.rv-mini.light { border: 1.5px solid #fff; background: var(--text); }
#message { min-height: 1.25em; margin: 2px 3px 5px; font-size: .82rem; }
.rv-board {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  width: 100%;
  max-width: 560px;
  margin: auto;
  border: 2px solid var(--game);
  border-radius: 5px;
  overflow: hidden;
  box-shadow: 0 0 15px #06b6d43b;
}
.rv-square {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 0;
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.rv-square.star::before {
  content: '';
  position: absolute;
  top: -3px;
  left: -3px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #7b8d96;
}
.rv-square.legal::after {
  content: '';
  position: absolute;
  width: 21%;
  height: 21%;
  border-radius: 3px;
  transform: rotate(45deg);
  background: var(--game);
  opacity: .82;
}
.rv-square.last { box-shadow: inset 0 0 0 2px var(--game); }
.rv-square.hint { box-shadow: inset 0 0 0 3px #facc15; }
.rv-disc {
  display: none;
  width: 78%;
  height: 78%;
  border-radius: 50%;
  z-index: 1;
}
.rv-disc.dark {
  display: block;
  border: 2px solid #a9b3bc;
  background: radial-gradient(circle at 35% 27%, #343b44, #080a0e 72%);
  box-shadow: 0 2px 4px #0009;
}
.rv-disc.light {
  display: block;
  border: 2px solid #fff;
  background: radial-gradient(circle at 35% 25%, #fff, var(--text) 75%);
  box-shadow: 0 2px 5px #0009;
}
.rv-coord {
  position: absolute;
  z-index: 2;
  color: #a5c5ce;
  font-size: .57rem;
  line-height: 1;
  pointer-events: none;
}
.rv-column { right: 3px; top: 2px; }
.rv-row { left: 3px; top: 2px; }
.rv-square.pop .rv-disc { animation: rv-pop .24s ease-out; }
.rv-square.flip .rv-disc { animation: rv-flip .22s ease-in-out; }
.rv-square.flash { background: #06b6d45c; }
.rv-square.pulse { animation: rv-pulse .8s ease-in-out 2; }
.rv-square.shake { animation: rv-shake .22s ease-in-out; }
.rv-controls { flex-wrap: wrap; margin: 7px 1px 2px; }
.rv-controls label { font-size: .8rem; color: var(--text-dim); }
.rv-controls select, .rv-controls button {
  min-height: 40px;
  padding: 5px 9px;
  border: 1px solid #494951;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  font-size: .82rem;
}
.rv-controls button.off { opacity: .42; }
.rv-controls .rv-show {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-right: auto;
}
.rv-controls input { accent-color: var(--game); width: 18px; height: 18px; }
.rv-square:focus-visible, .rv-controls :focus-visible {
  outline: 2px solid var(--game);
  outline-offset: -3px;
}
@keyframes rv-pop { from { transform: scale(.15); } }
@keyframes rv-flip { 50% { transform: scaleX(.06); } }
@keyframes rv-pulse { 50% { filter: brightness(1.8); } }
@keyframes rv-shake { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
@media (max-width: 390px) {
  .rc-stage { padding: 0; }
  .rv-shell { padding: 1px; border: 0; }
  .rv-sub, .rv-help { display: none; }
  .rv-controls { gap: 3px; }
  .rv-controls select, .rv-controls button { padding: 4px 6px; }
  .rv-controls > label:first-child { display: none; }
  .rv-board { border-width: 1px; }
  .rv-coord { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .rv-square.pop .rv-disc, .rv-square.flip .rv-disc,
  .rv-square.pulse, .rv-square.shake { animation: none; }
}
