:root {
  --bg-top: #7bd9ec;
  --bg-bottom: #eefaf8;
  --card: rgba(255, 255, 255, 0.86);
  --card-strong: #ffffff;
  --text: #123052;
  --muted: #5c7698;
  --line: rgba(18, 48, 82, 0.12);
  --shadow: 0 24px 60px rgba(27, 82, 130, 0.18);
  --blue: #3d7cff;
  --blue-soft: #dce9ff;
  --yellow: #ffc940;
  --yellow-soft: #fff4c8;
  --coral: #ff736a;
  --coral-soft: #ffe0dd;
  --mint: #64d8c4;
  --mint-soft: #dffff8;
  --win: #1eaa69;
  --win-soft: #ddf8eb;
  --lose: #ef5d57;
  --lose-soft: #ffe1df;
  --draw: #d19a1a;
  --draw-soft: #fff0c8;
  --radius-xl: 34px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 14px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    linear-gradient(180deg, rgba(123, 217, 236, 0.55), rgba(238, 250, 248, 0.92)),
    url("assets/rps-hero-bg.png") center top / cover no-repeat fixed,
    linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
}

button {
  font: inherit;
}

.page-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 18px;
}

.game-card {
  width: min(1040px, 100%);
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(255, 255, 255, 0.9));
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.hero-banner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: end;
  min-height: 240px;
  padding: 24px 28px;
  border-radius: 28px;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.34)),
    url("assets/rps-hero-bg.png") center / cover no-repeat;
  overflow: hidden;
}

.eyebrow,
.fighter-label,
.result-tag {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero-copy h1 {
  margin: 8px 0 0;
  font-family: "Baloo 2", "Noto Sans SC", sans-serif;
  font-size: clamp(2.6rem, 7vw, 5.1rem);
  line-height: 0.96;
}

.subtitle {
  max-width: 520px;
  margin: 12px 0 0;
  color: #33557f;
  font-size: 1.03rem;
}

.hero-rules {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 18px 20px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 14px 32px rgba(45, 117, 172, 0.12);
  font-family: "Baloo 2", "Noto Sans SC", sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
}

.arena-panel,
.status-grid {
  margin-top: 18px;
}

.arena-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}

.fighter-card,
.result-panel,
.score-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card);
}

.fighter-card {
  padding: 22px;
  text-align: center;
  min-height: 240px;
  display: grid;
  place-items: center;
  gap: 8px;
}

.player-side {
  box-shadow: inset 0 0 0 1px rgba(61, 124, 255, 0.04);
}

.cpu-side {
  box-shadow: inset 0 0 0 1px rgba(255, 115, 106, 0.04);
}

.gesture-badge {
  width: min(160px, 30vw);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 34px;
  font-family: "Baloo 2", "Noto Sans SC", sans-serif;
  font-size: clamp(3rem, 7vw, 5rem);
  color: var(--text);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(238, 247, 255, 0.92));
  box-shadow: inset 0 -12px 24px rgba(61, 124, 255, 0.08), 0 18px 36px rgba(37, 97, 156, 0.12);
}

.player-side .gesture-badge {
  border: 2px solid rgba(61, 124, 255, 0.16);
}

.cpu-side .gesture-badge {
  border: 2px solid rgba(255, 115, 106, 0.16);
}

.gesture-name {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 700;
}

.vs-pulse {
  display: grid;
  place-items: center;
}

.vs-pulse span {
  width: 92px;
  height: 92px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(180deg, #183e65, #2860a5);
  color: #fff;
  font-family: "Baloo 2", "Noto Sans SC", sans-serif;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  box-shadow: 0 16px 36px rgba(24, 62, 101, 0.24);
  animation: pulse 2s ease-in-out infinite;
}

.controls-panel {
  margin-top: 18px;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.choice-btn {
  position: relative;
  min-height: 170px;
  padding: 18px;
  border: 1px solid transparent;
  border-radius: 28px;
  text-align: center;
  display: grid;
  place-items: center;
  gap: 8px;
  background: var(--card-strong);
  box-shadow: 0 18px 36px rgba(58, 112, 163, 0.12);
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.choice-btn::after {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 22px;
  opacity: 0;
  transition: opacity 160ms ease;
}

.choice-btn:hover,
.choice-btn:focus-visible {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 22px 40px rgba(58, 112, 163, 0.18);
  outline: none;
}

.choice-btn:hover::after,
.choice-btn:focus-visible::after {
  opacity: 1;
}

.choice-btn:active {
  transform: translateY(0) scale(0.985);
}

.rock {
  background: linear-gradient(180deg, #edf4ff, #dbe8ff);
  border-color: rgba(61, 124, 255, 0.16);
}

.rock::after {
  border: 1px solid rgba(61, 124, 255, 0.28);
}

.scissors {
  background: linear-gradient(180deg, #fff1ef, #ffe1dd);
  border-color: rgba(255, 115, 106, 0.16);
}

.scissors::after {
  border: 1px solid rgba(255, 115, 106, 0.28);
}

.paper {
  background: linear-gradient(180deg, #fff8dd, #ffefbf);
  border-color: rgba(255, 201, 64, 0.2);
}

.paper::after {
  border: 1px solid rgba(209, 154, 26, 0.24);
}

.choice-emoji {
  font-size: clamp(2.7rem, 6vw, 4rem);
}

.choice-label {
  font-family: "Baloo 2", "Noto Sans SC", sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
}

.status-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(300px, 0.7fr);
  gap: 16px;
}

.result-panel {
  min-height: 212px;
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3);
}

.result-panel h2 {
  margin: 0;
  font-family: "Baloo 2", "Noto Sans SC", sans-serif;
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  line-height: 1;
}

.result-panel p:last-child {
  margin: 0;
  color: var(--muted);
}

.result-panel.idle {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(242, 251, 255, 0.88));
}

.result-panel.win {
  background: linear-gradient(180deg, var(--win-soft), #f3fff8);
  border-color: rgba(30, 170, 105, 0.22);
}

.result-panel.lose {
  background: linear-gradient(180deg, var(--lose-soft), #fff8f8);
  border-color: rgba(239, 93, 87, 0.22);
}

.result-panel.draw {
  background: linear-gradient(180deg, var(--draw-soft), #fffaf0);
  border-color: rgba(209, 154, 26, 0.24);
}

.score-panel {
  padding: 20px;
}

.score-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.score-head h2 {
  margin: 0;
  font-family: "Baloo 2", "Noto Sans SC", sans-serif;
  font-size: 1.7rem;
}

.reset-btn {
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  padding: 0 18px;
  background: #183e65;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 14px 28px rgba(24, 62, 101, 0.18);
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.reset-btn:hover,
.reset-btn:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 18px 30px rgba(24, 62, 101, 0.24);
  outline: none;
}

.reset-btn:active {
  transform: translateY(0);
}

.score-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.score-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-radius: 18px;
  font-weight: 700;
}

.score-item strong {
  font-family: "Baloo 2", "Noto Sans SC", sans-serif;
  font-size: 2rem;
  line-height: 1;
}

.player-score {
  background: var(--blue-soft);
  color: #19498d;
}

.cpu-score {
  background: var(--coral-soft);
  color: #b7463e;
}

.draw-score {
  background: var(--yellow-soft);
  color: #a56d0f;
}

.announce-flash {
  animation: resultFlash 420ms ease;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.06);
  }
}

@keyframes resultFlash {
  0% {
    transform: scale(0.98);
    box-shadow: 0 0 0 rgba(255, 255, 255, 0);
  }
  60% {
    transform: scale(1.012);
    box-shadow: 0 0 0 10px rgba(255, 255, 255, 0.18);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(255, 255, 255, 0);
  }
}

@media (max-width: 920px) {
  .hero-banner,
  .status-grid,
  .arena-panel {
    grid-template-columns: 1fr;
  }

  .hero-rules {
    justify-self: start;
    align-items: flex-start;
  }

  .arena-panel {
    gap: 12px;
  }

  .fighter-card {
    min-height: 204px;
  }

  .vs-pulse {
    order: -1;
    margin: 4px 0;
  }

  .status-grid {
    gap: 14px;
  }
}

@media (max-width: 720px) {
  .game-card {
    padding: 14px;
    border-radius: 24px;
  }

  .hero-banner {
    min-height: 0;
    padding: 18px;
    border-radius: 22px;
  }

  .choice-grid {
    grid-template-columns: 1fr;
  }

  .choice-btn {
    min-height: 132px;
    grid-template-columns: 72px 1fr;
    text-align: left;
    justify-items: start;
    align-items: center;
    padding: 16px 20px;
  }

  .choice-btn .choice-label {
    font-size: 1.28rem;
  }

  .fighter-card {
    padding: 18px 14px;
  }

  .gesture-badge {
    width: min(132px, 44vw);
    border-radius: 28px;
  }

  .score-head {
    flex-direction: column;
    align-items: stretch;
  }

  .reset-btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
