/* Rock Paper Scissors – only what's specific to this game.
   Header, difficulty, status and buttons come from /css/style.css. */

/* ---------- Best-of-5 dots ---------- */

.rps-score {
  display: flex;
  align-items: center;
  gap: 28px;
}

.rps-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.rps-dots {
  display: flex;
  gap: 6px;
}

.rps-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
}

.rps-dot.is-filled.is-you {
  border-color: var(--accent);
  background: var(--accent);
}

.rps-dot.is-filled.is-ai {
  border-color: var(--text);
  background: var(--text);
}

/* ---------- The two hands ---------- */

.rps-arena {
  display: flex;
  align-items: center;
  gap: 20px;
}

.rps-hand {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 136px;
  height: 148px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  transition: border-color 150ms ease, background-color 150ms ease;
}

.rps-hand-icon {
  display: block;
  width: 64px;
  height: 64px;
}

.rps-hand-icon svg {
  width: 100%;
  height: 100%;
}

.rps-hand-label {
  font-size: 13px;
  color: var(--text-muted);
}

.rps-hand.is-empty {
  border-style: dashed;
  color: var(--text-faint);
}

.rps-hand.is-winner {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

/* Online: friend has picked (shown as a tick, not their move) */
.rps-hand.is-ready {
  border-color: var(--border-strong);
  color: var(--text-muted);
}

.rps-hand.is-thinking .rps-hand-icon {
  color: var(--text-faint);
  animation: think 0.5s ease-in-out infinite alternate;
}

.rps-vs {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text-faint);
}

@keyframes think {
  from { opacity: 0.35; }
  to   { opacity: 1; }
}

/* ---------- Choice buttons ---------- */

.rps-choices {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.rps-choice {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 56px;
  padding: 0 18px;
  border-radius: 14px;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.rps-choice svg {
  width: 26px;
  height: 26px;
}

.rps-choice:not(:disabled):hover {
  border-color: var(--accent);
}

.rps-choice:disabled {
  cursor: default;
  opacity: 0.5;
}

.rps-choice:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.rps-choice kbd {
  padding: 1px 6px;
  border-radius: 5px;
  border: 1px solid var(--border-strong);
  background: var(--inset);
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 11px;
}

/* On phones, keyboard hints are pointless and the buttons share the row */
@media (max-width: 560px) {
  .rps-hand {
    width: 120px;
    height: 132px;
  }
  .rps-choices {
    width: 100%;
    flex-wrap: nowrap;
  }
  .rps-choice {
    flex: 1 1 0;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    height: 76px;
    padding: 0 6px;
    font-size: 14px;
  }
  .rps-choice kbd {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rps-hand.is-thinking .rps-hand-icon { animation: none; }
}

/* Phone held sideways: fit the screen height (see css/style.css) */
@media (orientation: landscape) and (max-height: 540px) {
  .rps-arena { width: min(100%, var(--play-w)); align-self: center; }
}
@media (orientation: landscape) and (max-height: 540px) {
  .game-layout > .rps-arena { grid-row: 1; }
  .game-layout > .game-status { grid-column: 2; grid-row: 2; }
  .game-layout > .rps-choices { grid-column: 2; grid-row: 3; }
}
