@font-face {
  font-family: "Janken Logo";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("./assets/fonts/dela-gothic-one-kana.woff2") format("woff2");
  unicode-range: U+3041-3093, U+3099-309A, U+30A1-30E1, U+30E3-30ED, U+30EF-30F0, U+30F2-30F4, U+30FB-30FE, U+FF65-FF9F;
}

:root {
  color-scheme: light;
  --ink: #111111;
  --paper: #fffef7;
  --yellow: #ffe600;
  --yellow-soft: #fff8a8;
  --blue: #1f65ff;
  --blue-soft: #dbe8ff;
  --pink: #ff4f8b;
  --pink-soft: #ffe0eb;
  --green: #00a879;
  --line: #171717;
  --muted: #686868;
  --shadow: 6px 7px 0 #111111;
  --small-shadow: 3px 4px 0 #111111;
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--yellow);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 1px 1px, rgba(17, 17, 17, 0.12) 1.2px, transparent 1.3px) 0 0 / 22px 22px,
    var(--yellow);
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

button:focus-visible,
a:focus-visible {
  outline: 4px solid var(--blue);
  outline-offset: 3px;
}

.site-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header {
  min-height: 82px;
  padding: 13px clamp(16px, 4vw, 52px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: var(--yellow);
  border-bottom: 4px solid var(--ink);
  position: relative;
  z-index: 5;
}

.brand {
  color: var(--ink);
  text-decoration: none;
  display: inline-block;
}

.brand-logo {
  display: block;
  width: clamp(132px, 14vw, 154px);
  height: auto;
  pointer-events: none;
}

.header-button,
.icon-button {
  border: 3px solid var(--ink);
  color: var(--ink);
  background: var(--paper);
  font-weight: 900;
  cursor: pointer;
}

.header-button {
  min-height: 46px;
  padding: 8px 16px;
  border-radius: 999px;
  box-shadow: var(--small-shadow);
}

.header-button:hover {
  transform: translate(-1px, -1px);
  box-shadow: 4px 5px 0 var(--ink);
}

.header-button:active {
  transform: translate(3px, 3px);
  box-shadow: none;
}

.header-button span {
  display: inline-grid;
  width: 22px;
  height: 22px;
  place-items: center;
  color: var(--yellow);
  background: var(--ink);
  border-radius: 50%;
  margin-right: 3px;
}

#app {
  width: 100%;
  max-width: 1220px;
  margin: 0 auto;
  padding: clamp(18px, 4vw, 44px) clamp(14px, 3vw, 34px) 48px;
  flex: 1;
}

.site-footer {
  min-height: 52px;
  padding: 12px clamp(16px, 4vw, 52px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  border-top: 3px solid var(--ink);
  font-size: 0.82rem;
  font-weight: 800;
  background: var(--paper);
}

.site-footer a,
.text-link {
  color: var(--ink);
  text-underline-offset: 4px;
  font-weight: 900;
}

.footer-credit b {
  font-weight: 1000;
}

.footer-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px 18px;
}

.site-footer .footer-purchase {
  padding: 5px 10px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--yellow);
  text-decoration: none;
}

.site-footer .footer-purchase:hover {
  background: var(--yellow-soft);
}

.panel {
  background: var(--paper);
  border: 4px solid var(--ink);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.start-screen {
  min-height: min(680px, calc(100vh - 190px));
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(340px, 0.95fr);
  align-items: stretch;
  overflow: hidden;
}

.start-copy {
  padding: clamp(28px, 6vw, 74px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.eyebrow {
  display: inline-block;
  width: fit-content;
  margin-bottom: 14px;
  font-size: 0.78rem;
  font-weight: 1000;
  letter-spacing: 0.14em;
}

.start-copy h1 {
  max-width: 680px;
  margin: 0;
  font-size: clamp(2.25rem, 5.2vw, 4.2rem);
  line-height: 0.98;
  letter-spacing: -0.07em;
  font-weight: 1000;
}

.start-copy h1 .headline-line {
  display: block;
  width: fit-content;
  white-space: nowrap;
}

.start-copy h1 .marker {
  background: linear-gradient(transparent 62%, var(--yellow) 62%);
}

.start-lead {
  max-width: 610px;
  margin: 26px 0 0;
  font-size: clamp(1rem, 2vw, 1.25rem);
  line-height: 1.8;
  font-weight: 750;
}

.start-lead strong {
  font-weight: 1000;
}

.start-actions {
  margin-top: 32px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px 22px;
}

.primary-button,
.secondary-button,
.play-button {
  border: 3px solid var(--ink);
  border-radius: 14px;
  font-weight: 1000;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.purchase-button {
  min-height: 60px;
  padding: 13px 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--ink);
  background: var(--yellow);
  border: 3px solid var(--ink);
  border-radius: 14px;
  box-shadow: 5px 6px 0 var(--pink);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 1000;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.purchase-button:hover {
  transform: translate(-2px, -2px);
  background: var(--yellow-soft);
  box-shadow: 7px 8px 0 var(--pink);
}

.purchase-button:active {
  transform: translate(4px, 4px);
  box-shadow: 1px 1px 0 var(--pink);
}

.primary-button,
.play-button {
  color: var(--yellow);
  background: var(--ink);
  box-shadow: 5px 6px 0 var(--blue);
}

.primary-button {
  min-height: 60px;
  padding: 13px 25px;
  font-size: 1.08rem;
}

.primary-button:hover,
.play-button:not(:disabled):hover {
  transform: translate(-2px, -2px);
  box-shadow: 7px 8px 0 var(--blue);
}

.primary-button:active,
.play-button:not(:disabled):active {
  transform: translate(4px, 4px);
  box-shadow: 1px 1px 0 var(--blue);
}

.secondary-button {
  min-height: 50px;
  padding: 10px 18px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: var(--small-shadow);
}

.secondary-button:hover {
  background: var(--yellow-soft);
}

.mini-rule {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
  color: var(--muted);
  font-weight: 800;
}

.mini-rule b {
  padding: 4px 7px;
  color: var(--yellow);
  background: var(--ink);
  border-radius: 999px;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  font-weight: 1000;
}

.start-visual {
  min-height: 510px;
  padding: clamp(28px, 5vw, 58px);
  display: grid;
  align-content: center;
  justify-content: center;
  background: var(--ink);
  position: relative;
  overflow: hidden;
}

.start-visual::before {
  content: "NO BORDER";
  position: absolute;
  right: -12px;
  bottom: 4px;
  color: rgba(255, 230, 0, 0.13);
  font-size: clamp(3.7rem, 8vw, 7.5rem);
  line-height: 0.75;
  font-weight: 1000;
  writing-mode: vertical-rl;
  letter-spacing: -0.08em;
}

.card-fan {
  width: min(390px, 70vw);
  height: 340px;
  position: relative;
}

.hero-card {
  width: 154px;
  aspect-ratio: 0.68;
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  place-items: center;
  border-radius: 16px;
  border: 4px solid var(--ink);
  background: var(--paper);
  box-shadow: 8px 10px 0 rgba(0, 0, 0, 0.42);
  font-size: 5.4rem;
  line-height: 1;
  font-weight: 1000;
}

.hero-card::before,
.number-card::before,
.reveal-number::before,
.boundary-number::before {
  content: "";
  position: absolute;
  inset: 7px;
  border: 2px solid currentColor;
  border-radius: inherit;
  opacity: 0.2;
  pointer-events: none;
}

.hero-card:nth-child(1) {
  color: var(--blue);
  transform: translate(-96%, -48%) rotate(-16deg);
}

.hero-card:nth-child(2) {
  color: var(--pink);
  transform: translate(-50%, -58%) rotate(0deg);
  z-index: 2;
}

.hero-card:nth-child(3) {
  color: var(--green);
  transform: translate(-4%, -48%) rotate(16deg);
}

.hero-card small {
  position: absolute;
  left: 16px;
  top: 14px;
  font-size: 0.66rem;
  letter-spacing: 0.08em;
}

.visual-caption {
  position: relative;
  z-index: 2;
  margin: 18px auto 0;
  padding: 8px 13px;
  color: var(--ink);
  background: var(--yellow);
  border-radius: 5px;
  font-size: 0.92rem;
  font-weight: 1000;
  transform: rotate(-2deg);
}

.game-screen {
  display: grid;
  gap: 18px;
}

.game-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.round-label {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.round-label span {
  font-size: 0.74rem;
  font-weight: 1000;
  letter-spacing: 0.13em;
}

.round-label strong {
  font-size: clamp(1.65rem, 5vw, 2.5rem);
  line-height: 1;
  letter-spacing: -0.05em;
}

.round-dots {
  display: flex;
  gap: 7px;
}

.round-dot {
  width: 34px;
  height: 9px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
}

.round-dot.done {
  background: var(--ink);
}

.round-dot.current {
  background: var(--blue);
}

.quit-button {
  border: 0;
  padding: 8px;
  background: transparent;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 4px;
  font-weight: 900;
  cursor: pointer;
}

.tabletop {
  display: grid;
  grid-template-columns: minmax(240px, 0.78fr) minmax(290px, 1.22fr) minmax(240px, 0.78fr);
  gap: 16px;
  align-items: stretch;
}

.player-zone,
.reveal-zone {
  min-height: 265px;
  border: 4px solid var(--ink);
  border-radius: 22px;
  padding: 20px;
}

.player-zone {
  background: var(--paper);
  position: relative;
  overflow: hidden;
}

.player-zone.cpu {
  box-shadow: inset 0 9px 0 var(--pink);
}

.player-zone.you {
  box-shadow: inset 0 9px 0 var(--blue);
}

.player-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-top: 6px;
}

.player-head h2 {
  margin: 0;
  font-size: 1.35rem;
  letter-spacing: -0.04em;
}

.player-tag {
  padding: 5px 9px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 1000;
  background: var(--yellow);
}

.hand-count {
  margin: 14px 0 12px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.card-backs {
  height: 72px;
  display: flex;
  align-items: center;
  padding-left: 7px;
}

.you-tip {
  min-height: 72px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border: 2px dashed var(--blue);
  border-radius: 10px;
  background: var(--blue-soft);
}

.you-tip strong {
  font-size: 0.92rem;
  font-weight: 1000;
}

.you-tip span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
}

.card-back {
  width: 45px;
  height: 64px;
  margin-left: -7px;
  border: 3px solid var(--ink);
  border-radius: 7px;
  background: repeating-linear-gradient(135deg, var(--yellow) 0 8px, var(--ink) 8px 13px);
  box-shadow: 2px 2px 0 var(--paper);
}

.history-title {
  margin: 20px 0 8px;
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  font-weight: 1000;
}

.played-row {
  min-height: 48px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.played-chip {
  width: 42px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 7px;
  background: var(--paper);
  font-size: 1.1rem;
  font-weight: 1000;
}

.played-empty {
  color: #8c8c8c;
  align-self: center;
  font-size: 0.82rem;
  font-weight: 800;
}

.reveal-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--paper);
  background: var(--ink);
  position: relative;
  overflow: hidden;
}

.reveal-zone::after {
  content: "VS";
  position: absolute;
  right: -4px;
  bottom: -24px;
  color: rgba(255, 255, 255, 0.07);
  font-size: 9rem;
  line-height: 1;
  font-weight: 1000;
}

.reveal-kicker {
  position: relative;
  z-index: 1;
  color: var(--yellow);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  font-weight: 1000;
}

.reveal-zone h2 {
  position: relative;
  z-index: 1;
  margin: 10px 0 6px;
  font-size: clamp(1.35rem, 3vw, 2rem);
  letter-spacing: -0.04em;
}

.reveal-zone p {
  position: relative;
  z-index: 1;
  margin: 0;
  color: #cfcfcf;
  font-size: 0.87rem;
  line-height: 1.6;
  font-weight: 750;
}

.versus-cards {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 12px 0;
}

.reveal-number,
.boundary-number {
  position: relative;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 11px;
  font-weight: 1000;
}

.reveal-number {
  width: 84px;
  height: 118px;
  font-size: 2.6rem;
}

.reveal-number.you-card {
  box-shadow: 0 0 0 5px var(--blue);
}

.reveal-number.cpu-card {
  box-shadow: 0 0 0 5px var(--pink);
}

.vs-mark {
  color: var(--yellow);
  font-size: 1.1rem;
  font-weight: 1000;
}

.next-button {
  position: relative;
  z-index: 1;
  min-height: 44px;
  margin-top: 8px;
  padding: 8px 16px;
  border: 2px solid var(--paper);
  border-radius: 10px;
  color: var(--ink);
  background: var(--yellow);
  font-weight: 1000;
  cursor: pointer;
}

.hand-panel {
  padding: clamp(18px, 3vw, 28px);
}

.hand-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.hand-heading h2 {
  margin: 0;
  font-size: 1.25rem;
}

.hand-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.hand-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 22px;
  align-items: center;
}

.hand-cards {
  display: flex;
  gap: clamp(7px, 1.4vw, 13px);
  align-items: flex-end;
  overflow-x: auto;
  padding: 8px 5px 14px;
  scrollbar-width: thin;
}

.number-card {
  min-width: clamp(66px, 8.2vw, 92px);
  height: clamp(96px, 12vw, 132px);
  position: relative;
  border: 3px solid var(--ink);
  border-radius: 12px;
  color: var(--blue);
  background: var(--paper);
  box-shadow: 3px 4px 0 var(--ink);
  font-size: clamp(1.8rem, 4vw, 2.75rem);
  font-weight: 1000;
  cursor: pointer;
  flex: 0 0 auto;
  transition: transform 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.number-card:hover {
  transform: translateY(-5px) rotate(-1deg);
}

.number-card.selected {
  color: var(--ink);
  background: var(--yellow);
  transform: translateY(-10px);
  box-shadow: 0 0 0 4px var(--blue), 4px 7px 0 var(--ink);
}

.number-card:disabled {
  cursor: default;
  opacity: 0.62;
}

.play-button {
  min-width: 170px;
  min-height: 58px;
  padding: 12px 20px;
}

.play-button:disabled {
  color: #777;
  background: #d9d9d9;
  box-shadow: 4px 5px 0 #777;
  cursor: not-allowed;
}

.selection-hint {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  text-align: center;
  font-size: 0.76rem;
  font-weight: 800;
}

.result-screen {
  display: grid;
  gap: 20px;
}

.result-hero {
  padding: clamp(26px, 5vw, 54px);
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 24px;
  background: var(--ink);
  color: var(--paper);
  position: relative;
  overflow: hidden;
}

.result-hero::after {
  content: attr(data-stamp);
  position: absolute;
  right: -20px;
  bottom: -34px;
  color: rgba(255, 230, 0, 0.12);
  font-size: clamp(5rem, 15vw, 11rem);
  line-height: 1;
  font-weight: 1000;
  transform: rotate(-8deg);
}

.result-copy,
.score-box {
  position: relative;
  z-index: 1;
}

.result-copy .eyebrow {
  color: var(--yellow);
}

.result-copy h1 {
  margin: 0;
  font-size: clamp(2.4rem, 7vw, 5.3rem);
  line-height: 1;
  letter-spacing: -0.08em;
}

.result-copy p {
  max-width: 620px;
  margin: 16px 0 0;
  color: #d5d5d5;
  line-height: 1.7;
  font-weight: 750;
}

.score-box {
  min-width: 225px;
  padding: 18px 20px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  background: var(--yellow);
  border: 3px solid var(--paper);
  border-radius: 16px;
  text-align: center;
}

.score-side span {
  display: block;
  font-size: 0.74rem;
  font-weight: 900;
}

.score-side strong {
  display: block;
  font-size: 2.5rem;
  line-height: 1.05;
}

.score-colon {
  font-weight: 1000;
}

.result-section {
  padding: clamp(20px, 4vw, 34px);
}

.section-head {
  margin-bottom: 20px;
}

.section-head .eyebrow {
  margin-bottom: 6px;
}

.section-head h2 {
  margin: 0;
  font-size: clamp(1.45rem, 4vw, 2.1rem);
  letter-spacing: -0.05em;
}

.boundary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.boundary-player {
  padding: 19px;
  border: 3px solid var(--ink);
  border-radius: 16px;
  background: #fff;
}

.boundary-player.you {
  box-shadow: inset 0 7px 0 var(--blue);
}

.boundary-player.cpu {
  box-shadow: inset 0 7px 0 var(--pink);
}

.boundary-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin: 4px 0 16px;
}

.boundary-title h3 {
  margin: 0;
  font-size: 1.08rem;
}

.boundary-pair {
  display: flex;
  gap: 7px;
}

.boundary-number {
  width: 42px;
  height: 54px;
  border-width: 2px;
  border-radius: 7px;
  font-size: 1.2rem;
}

.range-map {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 2px solid var(--ink);
  border-radius: 10px;
  overflow: hidden;
}

.range-piece {
  min-height: 78px;
  padding: 10px 6px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  text-align: center;
}

.range-piece + .range-piece {
  border-left: 2px solid var(--ink);
}

.range-piece.rock {
  background: var(--blue-soft);
}

.range-piece.scissors {
  background: var(--yellow-soft);
}

.range-piece.paper {
  background: var(--pink-soft);
}

.gesture-code {
  font-family: "Arial Black", "Helvetica Neue", Arial, sans-serif;
  font-style: normal;
  font-weight: 900;
  letter-spacing: 0.06em;
  line-height: 1;
}

.range-piece strong,
.tiebreak-hand strong,
.boundary-demo .range strong,
.gesture-chip b,
.morph-guide span {
  font-family: "Janken Logo", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  font-style: normal;
  font-weight: 400;
  font-synthesis: none;
  letter-spacing: 0.01em;
  line-height: 1.08;
}

.range-piece .gesture-code {
  padding-bottom: 3px;
  border-bottom: 2px solid currentColor;
  font-size: 0.62rem;
}

.range-piece strong {
  font-size: 0.92rem;
}

.range-piece small {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
}

.round-results {
  display: grid;
  gap: 9px;
}

.round-result {
  display: grid;
  grid-template-columns: 74px 1fr 58px 1fr 110px;
  align-items: center;
  gap: 10px;
  min-height: 70px;
  padding: 9px 13px;
  border: 2px solid var(--ink);
  border-radius: 12px;
  background: #fff;
}

.round-name {
  font-size: 0.78rem;
  font-weight: 1000;
}

.round-hand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 900;
}

.round-hand .mini-number {
  width: 36px;
  height: 45px;
  display: grid;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 6px;
  background: var(--paper);
  font-size: 1rem;
}

.round-hand.you .mini-number {
  box-shadow: inset 0 -5px 0 var(--blue);
}

.round-hand.cpu .mini-number {
  box-shadow: inset 0 -5px 0 var(--pink);
}

.round-vs {
  text-align: center;
  font-size: 0.74rem;
  font-weight: 1000;
}

.round-verdict {
  justify-self: end;
  min-width: 96px;
  padding: 6px 8px;
  border-radius: 999px;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 1000;
  background: #ececec;
}

.round-verdict.win {
  background: var(--yellow);
}

.round-verdict.lose {
  color: #fff;
  background: var(--ink);
}

.result-actions {
  display: flex;
  align-items: stretch;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  padding: 4px 0 10px;
}

.result-actions .secondary-button {
  min-height: 60px;
}

.tiebreak-screen {
  min-height: min(650px, calc(100vh - 190px));
  padding: clamp(26px, 6vw, 70px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  background: var(--ink);
  color: var(--paper);
}

.tiebreak-screen .eyebrow {
  color: var(--yellow);
}

.tiebreak-screen h1 {
  margin: 0;
  font-size: clamp(2.2rem, 7vw, 4.7rem);
  letter-spacing: -0.07em;
}

.tiebreak-screen > p {
  max-width: 560px;
  margin: 18px 0 28px;
  color: #d2d2d2;
  line-height: 1.7;
  font-weight: 750;
}

.tiebreak-hands {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 160px));
  gap: 14px;
}

.tiebreak-hand {
  min-height: 146px;
  padding: 12px;
  border: 3px solid var(--paper);
  border-radius: 16px;
  color: var(--ink);
  background: var(--yellow);
  box-shadow: 5px 6px 0 var(--blue);
  cursor: pointer;
}

.tiebreak-hand.rock {
  background: var(--blue-soft);
}

.tiebreak-hand.scissors {
  background: var(--yellow);
}

.tiebreak-hand.paper {
  background: var(--pink-soft);
}

.tiebreak-hand:hover {
  transform: translateY(-5px);
}

.tiebreak-hand .gesture-code {
  display: block;
  font-size: clamp(0.78rem, 2vw, 1.05rem);
  letter-spacing: 0.08em;
}

.tiebreak-hand.scissors .gesture-code {
  font-size: clamp(0.68rem, 1.5vw, 0.86rem);
  letter-spacing: 0.04em;
}

.tiebreak-hand strong {
  display: block;
  margin-top: 12px;
  font-size: 1.55rem;
  font-weight: 400;
}

.tiebreak-last {
  min-height: 28px;
  margin-top: 24px;
  color: var(--yellow);
  font-weight: 900;
}

.rules-dialog {
  width: min(760px, calc(100vw - 28px));
  max-height: min(86vh, 820px);
  padding: 0;
  border: 4px solid var(--ink);
  border-radius: 22px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 10px 12px 0 var(--ink);
}

.rules-dialog::backdrop {
  background: rgba(17, 17, 17, 0.72);
  backdrop-filter: blur(4px);
}

.dialog-head {
  padding: 20px 22px 17px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  border-bottom: 3px solid var(--ink);
  background: var(--yellow);
}

.dialog-head .eyebrow {
  margin: 0 0 4px;
}

.dialog-head h2 {
  margin: 0;
  font-size: 1.75rem;
  letter-spacing: -0.05em;
}

.icon-button {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.6rem;
  line-height: 1;
}

.rules-body {
  padding: 24px;
  overflow-y: auto;
}

.rule-lead {
  padding: 17px 18px;
  border-left: 8px solid var(--blue);
  background: var(--blue-soft);
}

.rule-lead strong {
  font-size: 1.05rem;
  font-weight: 1000;
}

.rule-lead p,
.rule-steps p,
.rule-note {
  margin: 7px 0 0;
  line-height: 1.65;
  font-size: 0.92rem;
  font-weight: 700;
}

.rule-steps {
  margin: 22px 0;
  padding: 0;
  display: grid;
  gap: 13px;
  list-style: none;
}

.rule-steps li {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 13px;
  align-items: start;
}

.rule-steps li > span {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--yellow);
  font-weight: 1000;
}

.rule-steps strong {
  font-weight: 1000;
}

.rule-steps p {
  margin-top: 3px;
}

.boundary-example {
  margin: 0;
}

.boundary-example figcaption {
  width: fit-content;
  margin: 0 auto 8px;
  padding: 4px 11px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--yellow);
  font-size: 0.88rem;
  font-weight: 1000;
  line-height: 1.35;
}

.boundary-demo {
  display: grid;
  grid-template-columns: 1fr 48px 1fr 48px 1fr;
  align-items: stretch;
  border: 3px solid var(--ink);
  border-radius: 12px;
  overflow: hidden;
}

.boundary-demo .range {
  min-height: 85px;
  padding: 9px 5px;
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
}

.boundary-demo .range .gesture-code {
  padding-bottom: 3px;
  border-bottom: 2px solid currentColor;
  font-size: 0.58rem;
}

.boundary-demo .range.scissors .gesture-code {
  font-size: 0.5rem;
  letter-spacing: 0.02em;
}

.boundary-demo .range strong {
  font-size: 0.86rem;
}

.boundary-demo .range b {
  font-size: 0.8rem;
}

.boundary-demo .rock {
  background: var(--blue-soft);
}

.boundary-demo .scissors {
  background: var(--yellow-soft);
}

.boundary-demo .paper {
  background: var(--pink-soft);
}

.boundary-card {
  display: grid;
  place-items: center;
  color: var(--paper);
  background: var(--ink);
  font-size: 1.25rem;
  font-weight: 1000;
}

.rule-note {
  margin: 18px 0;
  color: var(--muted);
}

.toast-region {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 20;
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  min-width: min(420px, calc(100vw - 28px));
  padding: 12px 16px;
  border: 3px solid var(--ink);
  border-radius: 10px;
  background: var(--paper);
  box-shadow: var(--small-shadow);
  text-align: center;
  font-weight: 900;
}

@media (max-width: 900px) {
  .start-screen {
    grid-template-columns: 1fr;
  }

  .start-visual {
    min-height: 420px;
  }

  .tabletop {
    grid-template-columns: 1fr 1fr;
  }

  .reveal-zone {
    grid-column: 1 / -1;
    grid-row: 2;
    min-height: 245px;
  }

  .hand-layout {
    grid-template-columns: 1fr;
  }

  .play-area {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 13px;
  }

  .selection-hint {
    margin: 0;
    max-width: 160px;
    text-align: left;
  }
}

@media (max-width: 680px) {
  .site-header {
    min-height: 70px;
    padding: 10px 14px;
  }

  .brand-logo {
    width: 124px;
  }

  .header-button {
    min-height: 40px;
    padding: 6px 11px;
    font-size: 0.85rem;
  }

  #app {
    padding: 14px 10px 34px;
  }

  .panel {
    border-width: 3px;
    border-radius: 18px;
    box-shadow: 4px 5px 0 var(--ink);
  }

  .start-screen {
    min-height: auto;
  }

  .start-copy {
    padding: 32px 22px 38px;
  }

  .start-copy h1 {
    font-size: clamp(2.2rem, 11.2vw, 3rem);
  }

  .start-lead {
    font-size: 0.96rem;
  }

  .start-visual {
    min-height: 350px;
    order: -1;
  }

  .card-fan {
    height: 270px;
  }

  .hero-card {
    width: 126px;
    font-size: 4.1rem;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .game-toolbar {
    align-items: flex-start;
  }

  .round-dots {
    margin-top: 7px;
    gap: 4px;
  }

  .round-dot {
    width: 22px;
  }

  .tabletop {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .player-zone,
  .reveal-zone {
    border-width: 3px;
    border-radius: 15px;
  }

  .player-zone {
    min-height: 206px;
    padding: 14px 11px;
  }

  .player-head {
    display: block;
  }

  .player-head h2 {
    font-size: 1.05rem;
  }

  .player-tag {
    display: inline-block;
    margin-top: 6px;
  }

  .card-backs {
    overflow: hidden;
  }

  .card-back {
    width: 33px;
    height: 50px;
  }

  .history-title {
    margin-top: 12px;
  }

  .played-chip {
    width: 32px;
    height: 38px;
    font-size: 0.9rem;
  }

  .reveal-zone {
    min-height: 234px;
    padding: 16px 12px;
  }

  .reveal-number {
    width: 67px;
    height: 94px;
    font-size: 2rem;
  }

  .hand-panel {
    padding: 16px 12px;
  }

  .hand-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .number-card {
    min-width: 67px;
    height: 100px;
  }

  .play-area {
    position: sticky;
    bottom: 8px;
    z-index: 3;
    padding: 8px;
    border: 2px solid var(--ink);
    border-radius: 13px;
    background: var(--paper);
    box-shadow: var(--small-shadow);
  }

  .play-button {
    min-width: 148px;
  }

  .result-hero {
    grid-template-columns: 1fr;
  }

  .score-box {
    width: 100%;
  }

  .boundary-grid {
    grid-template-columns: 1fr;
  }

  .round-result {
    grid-template-columns: 52px 1fr 38px 1fr;
    gap: 6px;
  }

  .round-verdict {
    grid-column: 1 / -1;
    justify-self: stretch;
  }

  .round-hand {
    gap: 5px;
    font-size: 0.83rem;
  }

  .tiebreak-hands {
    width: 100%;
    grid-template-columns: repeat(3, 1fr);
    gap: 7px;
  }

  .tiebreak-hand {
    min-width: 0;
    min-height: 120px;
    padding: 8px 3px;
  }

  .tiebreak-hand .gesture-code {
    font-size: 0.62rem;
    letter-spacing: 0.02em;
  }

  .tiebreak-hand strong {
    margin-top: 9px;
    font-size: 1.22rem;
  }

  .boundary-demo {
    grid-template-columns: 1fr 36px 1fr 36px 1fr;
  }

  .rules-body {
    padding: 18px 15px 22px;
  }
}

/* Physical card table */
.playing-card {
  --owner-color: var(--blue);
  width: min(100%, 106px);
  aspect-ratio: 489 / 667;
  position: relative;
  display: grid;
  place-items: center;
  overflow: visible;
  background: #fff;
  border: 3px solid #202020;
  border-radius: 10px;
  box-shadow: 2px 3px 0 rgba(0, 0, 0, 0.45);
  user-select: none;
}

.playing-card.cpu {
  --owner-color: var(--pink);
}

.playing-card.you {
  --owner-color: var(--blue);
}

.playing-card::after {
  content: "";
  position: absolute;
  left: -3px;
  right: -3px;
  bottom: -3px;
  height: 7px;
  border: 3px solid #202020;
  border-top: 0;
  border-radius: 0 0 8px 8px;
  background: var(--owner-color);
}

.card-art {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 6px;
  pointer-events: none;
}

.playing-card.compact {
  width: 66px;
  border-width: 2px;
  border-radius: 8px;
}

.playing-card.compact::after {
  left: -2px;
  right: -2px;
  bottom: -2px;
  height: 5px;
  border-width: 2px;
}


.gesture-chip {
  --gesture-accent: var(--yellow);
  min-width: 72%;
  position: absolute;
  left: 50%;
  bottom: 6px;
  z-index: 4;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 2px 5px 3px;
  color: var(--yellow);
  background: var(--ink);
  border-radius: 999px;
  font-size: 0.7rem;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 0 0 2px var(--gesture-accent);
}

.gesture-chip.rock {
  --gesture-accent: #72a6ff;
}

.gesture-chip.scissors {
  --gesture-accent: var(--yellow);
}

.gesture-chip.paper {
  --gesture-accent: #ff83ad;
}

.gesture-chip .gesture-code {
  padding-right: 4px;
  border-right: 1px solid currentColor;
  font-size: 0.55rem;
  letter-spacing: 0.04em;
}

.gesture-chip b {
  font-size: 0.6rem;
  font-weight: 400;
}

.win-stamp {
  width: 38px;
  height: 38px;
  position: absolute;
  right: -12px;
  top: -13px;
  z-index: 8;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: var(--yellow);
  border: 3px solid var(--ink);
  border-radius: 50%;
  box-shadow: 2px 2px 0 var(--owner-color);
  font-size: 1rem;
  font-weight: 1000;
  transform: rotate(9deg);
}

.morph-cards {
  min-height: 310px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 30px;
  position: relative;
  z-index: 1;
}

.morph-card {
  width: 112px;
  margin-left: -18px;
  transform-origin: bottom center;
}

.morph-card:first-child {
  margin-left: 0;
  transform: rotate(-9deg) translateY(14px);
}

.morph-card:nth-child(2) {
  transform: rotate(-3deg) translateY(-5px);
}

.morph-card:nth-child(3) {
  transform: rotate(4deg) translateY(-5px);
}

.morph-card:nth-child(4) {
  transform: rotate(10deg) translateY(14px);
}

.morph-card .playing-card {
  width: 100%;
  box-shadow: 7px 9px 0 rgba(0, 0, 0, 0.42);
}

.morph-guide {
  width: min(390px, 86%);
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  margin: 12px auto 0;
  color: var(--yellow);
  font-size: 0.82rem;
  font-weight: 1000;
}

.morph-guide i {
  height: 3px;
  position: relative;
  background: var(--yellow);
}

.morph-guide i::after {
  content: "";
  position: absolute;
  right: -1px;
  top: -5px;
  border-left: 10px solid var(--yellow);
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
}

.tabletop-game {
  gap: 16px;
}

.auto-note {
  margin: 0 auto;
  padding: 7px 12px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  font-size: 0.82rem;
  font-weight: 900;
}

.remaining-card-map {
  padding: 11px 14px 13px;
  border-width: 3px;
  border-radius: 16px;
  box-shadow: 3px 4px 0 var(--ink);
}

.remaining-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.remaining-card-title,
.remaining-card-legend {
  display: flex;
  align-items: center;
}

.remaining-card-title {
  gap: 8px;
}

.remaining-card-title > span {
  padding: 3px 7px;
  color: var(--yellow);
  background: var(--ink);
  border-radius: 999px;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  font-weight: 1000;
}

.remaining-card-title h2 {
  margin: 0;
  font-size: 0.9rem;
  letter-spacing: -0.02em;
}

.remaining-card-title strong {
  padding: 2px 7px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--yellow);
  font-size: 0.72rem;
  white-space: nowrap;
}

.remaining-card-legend {
  gap: 10px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
}

.remaining-card-legend span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.remaining-card-legend i {
  width: 10px;
  height: 10px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
}

.remaining-card-legend i.you {
  background: var(--blue);
}

.remaining-card-legend i.cpu {
  background: var(--pink);
}

.remaining-numbers {
  display: grid;
  grid-template-columns: repeat(16, minmax(28px, 40px));
  justify-content: center;
  gap: clamp(3px, 0.65vw, 7px);
}

.remaining-number {
  width: 100%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  position: relative;
  border: 2px solid var(--ink);
  border-radius: 7px;
  background: var(--paper);
  font-family: Arial, sans-serif;
  font-size: clamp(0.72rem, 1.2vw, 0.88rem);
  font-weight: 900;
}

.remaining-number.is-played {
  color: rgba(17, 17, 17, 0.58);
  text-decoration: line-through 2px;
  transform: scale(0.88);
}

.remaining-number.is-played.you {
  background: var(--blue-soft);
  box-shadow: inset 0 -5px 0 var(--blue);
}

.remaining-number.is-played.cpu {
  background: var(--pink-soft);
  box-shadow: inset 0 -5px 0 var(--pink);
}

.battle-board {
  padding: 14px clamp(10px, 2vw, 22px) 18px;
  color: var(--paper);
  background:
    radial-gradient(circle at 50% 0, rgba(255, 255, 255, 0.1), transparent 48%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 8px),
    #143f31;
  overflow: hidden;
}

.board-side {
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 7px;
}

.board-side strong {
  font-size: 1rem;
  font-weight: 1000;
}

.cpu-rank {
  padding: 2px 7px;
  color: var(--ink);
  background: var(--yellow);
  border-radius: 999px;
  font-size: 0.66rem;
  letter-spacing: 0.05em;
  font-weight: 1000;
}

.board-side small {
  margin-left: auto;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.74rem;
  font-weight: 800;
}

.far-side {
  border-bottom: 1px solid rgba(255, 255, 255, 0.22);
}

.near-side {
  border-top: 1px solid rgba(255, 255, 255, 0.22);
}

.battle-lanes {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: clamp(5px, 1.2vw, 14px);
  padding: 14px 0;
  perspective: 900px;
}

.battle-lane {
  min-width: 0;
  display: grid;
  grid-template-rows: 20px minmax(96px, 1fr) 34px minmax(104px, 1fr);
  align-items: center;
  justify-items: center;
  gap: 7px;
  padding: 7px clamp(2px, 0.7vw, 8px) 10px;
  border-left: 1px dashed rgba(255, 255, 255, 0.17);
  border-right: 1px dashed rgba(255, 255, 255, 0.17);
  border-radius: 13px;
  transition: background 180ms ease, box-shadow 180ms ease;
}

.battle-lane.is-current {
  background: rgba(255, 230, 0, 0.08);
  box-shadow: inset 0 0 0 2px var(--yellow);
}

.lane-number {
  color: rgba(255, 255, 255, 0.66);
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  font-weight: 1000;
}

.lane-card {
  width: 100%;
  min-width: 0;
  display: grid;
  place-items: center;
}

.cpu-position {
  transform: scale(0.92) translateY(2px);
  transform-origin: bottom center;
}

.you-position {
  transform-origin: top center;
}

.card-slot {
  width: min(100%, 106px);
  aspect-ratio: 0.69;
  display: grid;
  place-items: center;
  border: 2px dashed rgba(255, 255, 255, 0.28);
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.5);
  background: rgba(0, 0, 0, 0.08);
  font-size: 0.72rem;
  font-weight: 900;
}

.card-slot.is-current {
  border-color: rgba(255, 230, 0, 0.75);
  color: var(--yellow);
}

.lane-verdict {
  min-width: min(96%, 105px);
  min-height: 27px;
  display: grid;
  place-items: center;
  padding: 3px 6px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.64);
  font-size: 0.67rem;
  font-weight: 1000;
  text-align: center;
}

.result-board .lane-verdict.you {
  color: var(--ink);
  background: var(--blue-soft);
  border-color: var(--blue);
}

.result-board .lane-verdict.cpu {
  color: var(--ink);
  background: var(--pink-soft);
  border-color: var(--pink);
}

.result-board .lane-verdict.draw {
  color: var(--ink);
  background: #ececec;
  border-color: #999;
}

.just-played .cpu-position .playing-card {
  animation: dealFromFar 420ms cubic-bezier(0.2, 0.75, 0.25, 1.15) both;
}

.just-played .you-position .playing-card {
  animation: dealFromNear 420ms cubic-bezier(0.2, 0.75, 0.25, 1.15) both;
}

.center-reveal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(7, 18, 14, 0.8);
  backdrop-filter: blur(5px);
  pointer-events: none;
  animation: centerRevealBackdrop 180ms ease-out both;
}

.center-reveal-stage {
  width: min(620px, 100%);
  position: relative;
  display: grid;
  justify-items: center;
  gap: 16px;
  padding: clamp(24px, 5vw, 44px);
  overflow: hidden;
  border: 3px solid rgba(255, 255, 255, 0.52);
  border-radius: 28px;
  background: radial-gradient(circle at 50% 52%, rgba(255, 230, 0, 0.24), transparent 56%);
  box-shadow: 0 18px 70px rgba(0, 0, 0, 0.52);
  isolation: isolate;
}

.center-reveal-stage::before {
  content: "";
  width: 390px;
  aspect-ratio: 1;
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: -1;
  background: repeating-conic-gradient(from 5deg, rgba(255, 230, 0, 0.3) 0deg 6deg, transparent 6deg 16deg);
  border-radius: 50%;
  animation: centerRevealBurst 720ms cubic-bezier(0.16, 0.82, 0.24, 1) both;
}

.center-reveal-round {
  padding: 6px 14px;
  color: var(--ink);
  background: var(--yellow);
  border: 2px solid var(--ink);
  border-radius: 999px;
  box-shadow: 3px 4px 0 rgba(0, 0, 0, 0.48);
  font-size: 0.76rem;
  letter-spacing: 0.1em;
  font-weight: 1000;
}

.center-reveal-cards {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: clamp(12px, 3vw, 28px);
}

.center-reveal-player {
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 10px;
}

.center-reveal-player.cpu {
  animation: centerRevealCpu 480ms cubic-bezier(0.16, 0.82, 0.24, 1.18) both;
}

.center-reveal-player.you {
  animation: centerRevealYou 480ms cubic-bezier(0.16, 0.82, 0.24, 1.18) both;
}

.center-reveal-player .playing-card {
  width: clamp(132px, 20vw, 172px);
  max-width: none;
  border-width: 4px;
  border-radius: 15px;
  box-shadow: 8px 11px 0 rgba(0, 0, 0, 0.55);
}

.center-reveal-player .playing-card::after {
  left: -4px;
  right: -4px;
  bottom: -4px;
  height: 10px;
  border-width: 4px;
  border-top: 0;
}

.center-reveal-label {
  min-width: 86px;
  padding: 5px 13px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  color: var(--ink);
  background: var(--pink);
  text-align: center;
  font-size: 0.84rem;
  font-weight: 1000;
}

.center-reveal-player.you .center-reveal-label {
  color: #fff;
  background: var(--blue);
}

.center-reveal-vs {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  z-index: 2;
  color: var(--ink);
  background: var(--yellow);
  border: 3px solid var(--ink);
  border-radius: 50%;
  box-shadow: 4px 5px 0 rgba(0, 0, 0, 0.48);
  font-size: 1rem;
  font-weight: 1000;
  animation: centerRevealVs 340ms 160ms cubic-bezier(0.16, 0.82, 0.24, 1.35) both;
}

.real-hand-panel {
  padding: clamp(17px, 3vw, 26px);
  overflow: hidden;
}

.real-hand-panel .hand-heading {
  align-items: center;
  margin-bottom: 10px;
}

.real-hand-panel .hand-heading .eyebrow {
  margin: 0 0 3px;
}

.real-hand-panel .hand-heading h2 {
  margin: 0;
}

.real-hand-cards {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: clamp(7px, 1.2vw, 13px);
  padding: 16px 7px 12px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
}

.hand-card {
  width: clamp(76px, 9.4vw, 108px);
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  transition: transform 140ms ease, filter 140ms ease;
}

.hand-card .playing-card {
  width: 100%;
}

.hand-card:not(:disabled):hover {
  transform: translateY(-9px) rotate(-1deg);
  filter: brightness(1.03);
}

.hand-card:not(:disabled):active {
  transform: translateY(-3px) scale(0.97);
}

.hand-card:disabled {
  cursor: wait;
  opacity: 0.62;
}

.battle-result-screen {
  display: grid;
  gap: 18px;
}

.compact-result-head {
  padding: clamp(22px, 4vw, 38px);
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 24px;
  color: var(--paper);
  background: var(--ink);
  overflow: hidden;
}

.compact-result-head .result-copy h1 {
  margin: 0;
  font-size: clamp(2.1rem, 6vw, 4.2rem);
  line-height: 1;
  letter-spacing: -0.07em;
}

.compact-result-head .result-copy p {
  margin-top: 10px;
}

.result-board .battle-lane {
  animation: resolveLane 360ms cubic-bezier(0.2, 0.75, 0.25, 1.15) both;
  animation-delay: calc(var(--lane) * 150ms);
}

.result-board .win-stamp {
  animation: stampWin 330ms cubic-bezier(0.18, 0.85, 0.25, 1.35) both;
  animation-delay: calc(380ms + var(--lane) * 150ms);
}

.boundary-reveal {
  padding: clamp(20px, 4vw, 34px);
}

.boundary-pair .playing-card {
  width: 58px;
}

@keyframes dealFromFar {
  from { opacity: 0; transform: translateY(-35px) scale(0.86) rotate(-4deg); }
  to { opacity: 1; transform: translateY(0) scale(1) rotate(0); }
}

@keyframes dealFromNear {
  from { opacity: 0; transform: translateY(38px) scale(0.86) rotate(4deg); }
  to { opacity: 1; transform: translateY(0) scale(1) rotate(0); }
}

@keyframes centerRevealBackdrop {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes centerRevealBurst {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.25) rotate(-24deg); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1.25) rotate(8deg); }
}

@keyframes centerRevealCpu {
  from { opacity: 0; transform: translate(-68px, -48px) scale(0.72) rotate(-11deg); }
  to { opacity: 1; transform: translate(0, 0) scale(1) rotate(-2deg); }
}

@keyframes centerRevealYou {
  from { opacity: 0; transform: translate(68px, 48px) scale(0.72) rotate(11deg); }
  to { opacity: 1; transform: translate(0, 0) scale(1) rotate(2deg); }
}

@keyframes centerRevealVs {
  from { opacity: 0; transform: scale(2.3) rotate(-18deg); }
  to { opacity: 1; transform: scale(1) rotate(-4deg); }
}

@keyframes resolveLane {
  from { opacity: 0.35; transform: scale(0.93); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes stampWin {
  from { opacity: 0; transform: rotate(22deg) scale(1.8); }
  to { opacity: 1; transform: rotate(9deg) scale(1); }
}

@media (max-width: 900px) {
  .auto-note {
    order: 3;
    width: 100%;
    text-align: center;
  }

  .game-toolbar {
    flex-wrap: wrap;
  }

  .compact-result-head {
    grid-template-columns: 1fr;
  }

  .compact-result-head .score-box {
    width: 100%;
  }
}

@media (max-width: 680px) {
  .morph-cards {
    min-height: 230px;
    padding-inline: 0;
  }

  .morph-card {
    width: 78px;
    margin-left: -11px;
  }

  .battle-board {
    padding: 9px 6px 12px;
  }

  .board-side {
    min-height: 30px;
    padding-inline: 3px;
  }

  .board-side strong {
    font-size: 0.88rem;
  }

  .cpu-rank {
    padding: 2px 5px;
    font-size: 0.56rem;
  }

  .board-side small {
    font-size: 0.62rem;
  }

  .battle-lanes {
    gap: 3px;
    padding-block: 9px;
  }

  .battle-lane {
    grid-template-rows: 16px minmax(74px, 1fr) 27px minmax(80px, 1fr);
    gap: 4px;
    padding: 4px 1px 7px;
    border-radius: 8px;
  }

  .lane-number {
    font-size: 0.5rem;
    letter-spacing: 0;
  }

  .battle-lane .playing-card,
  .battle-lane .card-slot {
    width: min(100%, 54px);
    border-width: 2px;
    border-radius: 7px;
  }

  .battle-lane .playing-card::after {
    left: -2px;
    right: -2px;
    bottom: -2px;
    height: 4px;
    border-width: 2px;
  }

  .remaining-card-map {
    padding: 10px 8px 11px;
  }

  .remaining-card-head {
    align-items: flex-start;
    flex-wrap: wrap;
    margin-bottom: 7px;
  }

  .remaining-card-title {
    flex-wrap: wrap;
    gap: 5px 7px;
  }

  .remaining-card-title h2 {
    font-size: 0.8rem;
  }

  .remaining-card-legend {
    width: 100%;
    justify-content: flex-end;
    font-size: 0.66rem;
  }

  .remaining-numbers {
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 5px;
  }

  .remaining-number {
    font-size: 0.74rem;
  }

  .center-reveal {
    padding: 12px;
  }

  .center-reveal-stage {
    gap: 12px;
    padding: 22px 10px 25px;
    border-radius: 21px;
  }

  .center-reveal-stage::before {
    width: 300px;
  }

  .center-reveal-cards {
    gap: 8px;
  }

  .center-reveal-player {
    gap: 7px;
  }

  .center-reveal-player .playing-card {
    width: clamp(98px, 31vw, 118px);
    border-width: 3px;
    border-radius: 11px;
  }

  .center-reveal-player .playing-card::after {
    left: -3px;
    right: -3px;
    bottom: -3px;
    height: 7px;
    border-width: 3px;
    border-top: 0;
  }

  .center-reveal-label {
    min-width: 70px;
    padding: 4px 9px;
    font-size: 0.74rem;
  }

  .center-reveal-vs {
    width: 43px;
    height: 43px;
    border-width: 2px;
    font-size: 0.78rem;
  }

  .lane-verdict {
    min-width: 96%;
    min-height: 22px;
    padding: 2px;
    font-size: 0.52rem;
  }

  .gesture-chip {
    min-width: 82%;
    bottom: 3px;
    gap: 2px;
    padding: 1px 2px 2px;
    font-size: 0.52rem;
  }

  .gesture-chip .gesture-code {
    padding-right: 2px;
    font-size: 0.42rem;
  }

  .gesture-chip b {
    font-size: 0.46rem;
  }

  .win-stamp {
    width: 27px;
    height: 27px;
    right: -8px;
    top: -9px;
    border-width: 2px;
    font-size: 0.72rem;
  }

  .real-hand-panel {
    padding: 14px 9px;
  }

  .real-hand-panel .hand-heading {
    align-items: flex-start;
  }

  .real-hand-cards {
    justify-content: flex-start;
    gap: 8px;
    padding: 13px 6px 12px;
  }

  .hand-card {
    width: 78px;
  }

  .compact-result-head {
    padding: 22px 18px;
  }

  .boundary-pair .playing-card {
    width: 50px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}


/* The score table borrows the printed game's strong ink and yellow palette. */
.header-actions { display:flex; align-items:center; gap:12px; }
.ranking-menu-button { background:var(--ink); color:var(--yellow); }
.header-button.ranking-menu-button span { background:transparent; }
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
.streak-start-note { flex-basis:100%; margin:0; color:var(--muted); font-size:.78rem; line-height:1.7; font-weight:700; }
.home-ranking { margin-top:44px; padding:clamp(22px,4vw,42px); background:var(--ink); color:var(--paper); border:4px solid var(--ink); }
.ranking-heading { display:flex; align-items:center; justify-content:space-between; gap:20px; border-bottom:2px solid var(--yellow); padding-bottom:20px; }
.ranking-heading .eyebrow { margin-bottom:6px; color:var(--yellow); }
.ranking-heading h2 { margin:0; font-size:clamp(1.5rem,3vw,2.1rem); letter-spacing:-.04em; }
.ranking-top { font:900 clamp(1.15rem,3vw,2rem)/1.2 ui-monospace,Consolas,monospace; color:var(--yellow); white-space:nowrap; }
.ranking-intro { margin:20px 0 0; font-weight:700; line-height:1.7; }
.ranking-table { width:100%; border-collapse:collapse; table-layout:fixed; margin-top:18px; }
.ranking-table th,.ranking-table td { padding:15px 12px; border-bottom:1px solid #545454; text-align:left; }
.ranking-table thead th { padding-block:12px; font-size:.75rem; font-weight:700; letter-spacing:.06em; color:#c6c6c6; }
.ranking-table th:first-child,.ranking-table td:first-child { width:24%; padding-left:0; }
.ranking-table th:last-child,.ranking-table td:last-child { width:24%; text-align:right; padding-right:0; }
.ranking-table tbody th { font-size:clamp(.92rem,2vw,1.1rem); font-weight:800; overflow-wrap:anywhere; }
.ranking-table td>b,.ranking-table td>strong { font:900 clamp(1.5rem,3vw,2rem)/1.1 ui-monospace,Consolas,monospace; font-variant-numeric:tabular-nums; }
.ranking-table .top-rank { color:var(--yellow); }
.rank-unit { margin-left:6px; font-size:.72rem; font-weight:700; white-space:nowrap; }
.rank-unit small { display:inline-block; margin-left:4px; font-size:.62rem; border:1px solid currentColor; padding:2px 4px; line-height:1.2; }
.ranking-policy { margin:22px 0 0; font-size:.75rem; line-height:1.8; color:#c6c6c6; }
.ranking-empty { margin:0; padding:30px 0 18px; line-height:1.8; }
.ranking-empty strong { display:block; color:var(--yellow); font-size:1.2rem; }
.ranking-empty p { margin:8px 0 0; font-size:.9rem; }
.ranking-dialog { width:min(680px,calc(100vw - 28px)); max-height:88dvh; padding:0; border:4px solid var(--ink); border-radius:10px; color:var(--paper); background:var(--ink); }
.ranking-dialog .dialog-head { color:var(--ink); }
.ranking-dialog-body { padding:4px clamp(18px,4vw,30px) 26px; }
.ranking-dialog::backdrop,.entry-dialog::backdrop { background:rgba(0,0,0,.76); }
.streak-badge { display:flex; align-items:center; gap:9px; margin:0; padding:8px 13px; color:var(--yellow); background:var(--ink); border:3px solid var(--ink); }
.streak-badge span { font-size:.8rem; font-weight:900; }
.streak-badge strong { font:900 1.8rem/1 ui-monospace,Consolas,monospace; font-variant-numeric:tabular-nums; }
.streak-result { display:grid; grid-template-columns:auto 1fr; align-items:center; gap:clamp(24px,5vw,64px); padding:22px clamp(22px,4vw,38px); border:4px solid var(--ink); background:var(--paper); }
.streak-result.is-win { background:var(--yellow); }
.streak-result .eyebrow { margin-bottom:4px; }
.streak-result>div:last-child { border-left:2px solid var(--ink); padding-left:clamp(24px,5vw,54px); }
.streak-result>div:last-child>p { margin:0 0 13px; font-weight:800; line-height:1.7; }
.streak-result .secondary-button { min-height:42px; padding:8px 15px; font-size:.82rem; }
.streak-result .primary-button { min-height:48px; font-size:.95rem; }
.streak-number { margin:0; display:flex; align-items:baseline; gap:9px; }
.streak-number strong { font:900 clamp(3.4rem,7vw,5.5rem)/1.15 ui-monospace,Consolas,monospace; font-variant-numeric:tabular-nums; }
.streak-number span { font-size:1.05rem; font-weight:900; white-space:nowrap; }
.tiebreak-streak { color:var(--yellow)!important; margin:0 0 16px!important; }
.ranking-rules { margin:26px 0; border-top:2px solid var(--ink); padding-top:18px; }
.ranking-rules h3 { margin:0 0 10px; font-size:1.15rem; }
.ranking-rules p { margin:9px 0; font-size:.9rem; line-height:1.8; }
.entry-dialog { width:min(540px,calc(100vw - 28px)); max-height:90dvh; padding:0; border:4px solid var(--ink); border-radius:10px; color:var(--ink); background:var(--paper); }
.entry-intro { padding:26px 24px 21px; color:var(--yellow); background:var(--ink); text-align:center; }
.entry-intro .eyebrow { margin-bottom:9px; font:900 .8rem/1.2 ui-monospace,Consolas,monospace; letter-spacing:.14em; }
.entry-intro h2 { margin:0; font-size:clamp(1.6rem,5vw,2rem); }
.entry-record { display:flex; align-items:baseline; justify-content:center; gap:8px; margin:10px 0 3px; }
.entry-record strong { font:900 5rem/1 ui-monospace,Consolas,monospace; font-variant-numeric:tabular-nums; }
.entry-record span { font-weight:900; font-size:1.1rem; }
#entry-rank { margin:12px 0 0; font-weight:800; font-size:.9rem; }
.entry-form { padding:22px clamp(20px,5vw,30px) 25px; }
.entry-form>p:first-child { margin:0 0 20px; font-size:.9rem; line-height:1.6; }
.entry-label { display:flex; align-items:baseline; justify-content:space-between; flex-wrap:wrap; gap:5px 12px; margin-bottom:8px; }
.entry-label label { font-size:.88rem; font-weight:900; }
#name-count { color:var(--muted); font-size:.73rem; font-variant-numeric:tabular-nums; }
.entry-form input { display:block; width:100%; min-height:56px; padding:12px 14px; border:3px solid var(--ink); border-radius:0; color:var(--ink); background:white; font-family:inherit; font-size:1.15rem; font-weight:800; line-height:1.3; }
.entry-form input:focus-visible { outline:3px solid var(--blue); outline-offset:3px; }
.entry-help { margin:8px 0 0; color:var(--muted); font-size:.74rem; line-height:1.7; }
.entry-error { margin:12px 0; color:#a31b15; font-size:.85rem; line-height:1.6; font-weight:800; }
.entry-error:empty { display:none; }
.entry-form .primary-button { display:block; width:100%; margin-top:20px; min-height:56px; font-size:1rem; }
.entry-skip { display:block; min-height:44px; margin:14px auto 0; padding:8px 12px; border:0; background:transparent; color:var(--muted); font-family:inherit; font-size:.85rem; font-weight:700; line-height:1.5; text-decoration:underline; text-underline-offset:4px; cursor:pointer; }
.entry-footnote { margin-top:12px; }
button:disabled { cursor:wait; }
.primary-button:disabled,.secondary-button:disabled,.tiebreak-hand:disabled { opacity:.65; transform:none; }
.loading-game { padding:clamp(30px,8vw,75px); }
.loading-game h1 { font-size:clamp(1.4rem,4vw,2rem); }
.loading-game p { line-height:1.7; }
.connection-notice { display:flex; align-items:center; gap:18px; margin-bottom:20px; padding:14px 18px; border:3px solid var(--ink); background:var(--paper); }
.connection-notice p { flex:1; margin:0; line-height:1.7; font-size:.88rem; font-weight:700; }
.connection-notice .secondary-button { min-height:44px; font-size:.82rem; white-space:nowrap; }
.notice-close { min-width:38px; min-height:38px; border:0; background:transparent; color:var(--ink); font-size:1.4rem; cursor:pointer; }
.connection-status:not(:empty) { position:fixed; right:18px; bottom:18px; z-index:110; padding:8px 14px; color:var(--yellow); background:var(--ink); border:2px solid var(--yellow); font-size:.78rem; font-weight:800; }
@media(max-width:680px) {
  .site-header { gap:12px; padding-inline:14px; }
  .brand-logo { width:112px; }
  .header-actions { gap:8px; }
  .header-button { padding:8px 10px; min-height:42px; font-size:.74rem; border-width:2px; }
  .header-button span { width:17px; height:17px; font-size:.7rem; margin-right:1px; }
  .home-ranking { margin-top:26px; padding:24px 18px; }
  .ranking-table th,.ranking-table td { padding:13px 7px; }
  .ranking-table th:first-child,.ranking-table td:first-child { width:26%; }
  .ranking-table th:last-child,.ranking-table td:last-child { width:28%; }
  .rank-unit { margin-left:3px; font-size:.63rem; }
  .rank-unit small { display:block; width:fit-content; margin:4px 0 0; }
  .ranking-table td:first-child { vertical-align:middle; }
  .ranking-table td:first-child>b { display:inline; }
  .ranking-table td:first-child .rank-unit { display:inline-block; vertical-align:baseline; }
  .ranking-table td:first-child .rank-unit small { display:inline-block; margin:0 0 0 4px; }
  .ranking-dialog .dialog-head { padding:17px 18px; gap:10px; }
  .ranking-dialog .dialog-head h2 { font-size:1.4rem; }
  .ranking-dialog .dialog-head .eyebrow { font-size:.66rem; }
  .streak-result { grid-template-columns:1fr; gap:15px; padding:20px; }
  .streak-result>div:first-child { display:flex; align-items:center; justify-content:space-between; gap:16px; }
  .streak-result>div:last-child { border-left:0; border-top:2px solid var(--ink); padding:14px 0 0; }
  .streak-result .eyebrow { font-size:.7rem; }
  .streak-number strong { font-size:3.4rem; }
  .streak-number span { font-size:.86rem; }
  .streak-badge { padding:7px 10px; gap:7px; }
  .streak-badge strong { font-size:1.5rem; }
  .streak-badge span { font-size:.72rem; }
  .game-toolbar { gap:14px; }
  .connection-notice { align-items:flex-start; flex-wrap:wrap; gap:10px; }
  .connection-notice p { flex-basis:calc(100% - 48px); }
  .entry-intro { padding:22px 20px 18px; }
  .entry-record strong { font-size:4rem; }
  .entry-form { padding:20px; }
}
@media(max-width:370px) {
  .brand-logo { width:94px; }
  .header-actions { gap:6px; }
  .header-button { padding-inline:8px; }
  .header-button span { display:none; }
  .ranking-table th:first-child,.ranking-table td:first-child { width:28%; }
  .rank-unit small { font-size:.55rem; padding-inline:2px; }
}
