/* 三回合剪刀石頭布（雙人） - YOW 專用樣式 */
:root {
  --bg: #0f172a; /* slate-900 */
  --panel: #111827; /* gray-900 */
  --muted: #94a3b8; /* slate-400 */
  --text: #e5e7eb; /* gray-200 */
  --accent: #38bdf8; /* sky-400 */
  --good: #22c55e; /* green-500 */
  --bad: #ef4444; /* red-500 */
  --draw: #64748b; /* slate-500 */
  --card: #1f2937; /* gray-800 */
  --card-front: #0b1222;
  --border: #334155;
  --focus: #f59e0b; /* amber-500 */
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Noto Sans, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  background: radial-gradient(1200px 700px at 50% -10%, #1e293b 0%, var(--bg) 60%);
  color: var(--text);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 1px, 1px);
  white-space: nowrap;
  border: 0;
}

.rps-app {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px;
}

.page-header {
  text-align: center;
  margin: 8px 0 16px;
}
.page-header h1 { margin: 8px 0; font-size: 24px; }
.page-header .subtitle { margin: 0; color: var(--muted); font-size: 14px; }

.arena {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.side {
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0));
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
}
.side-title { margin: 0 0 8px 0; font-size: 18px; }

.rounds {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.round-slot {
  display: grid;
  grid-template-rows: auto 20px;
  gap: 8px;
  align-items: center;
  justify-items: center;
}

.round-label {
  color: var(--muted);
  font-size: 12px;
}

.card {
  width: 96px;
  height: 96px;
  perspective: 900px;
}

.flip {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 560ms cubic-bezier(.2,.8,.2,1);
}

.face {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  border-radius: 10px;
  border: 1px solid var(--border);
  backface-visibility: hidden;
}

.face--front {
  background: radial-gradient(120px 80px at 50% 10%, rgba(255,255,255,0.06), var(--card-front));
  color: var(--muted);
  font-size: 32px;
}

.face--back {
  background: linear-gradient(180deg, rgba(56,189,248,.15), rgba(56,189,248,.04));
  color: var(--text);
  transform: rotateY(180deg);
  font-size: 28px;
}

.choice-symbol { font-size: 32px; }

/* Flip when revealed */
.round-slot.is-revealed .flip { transform: rotateY(180deg); }
/* While editing, show the chosen side so玩家可見目前選擇 */
.side.is-editing .round-slot .flip { transform: rotateY(180deg); }

/* Editing affordance */
.side.is-editing .face--back { outline: 2px dashed rgba(56,189,248,.35); outline-offset: -4px; }
.side.is-locked .face--back { outline: none; }

/* Result highlight */
.round-slot.result-win .face--back { box-shadow: 0 0 0 2px var(--good) inset, 0 0 18px rgba(34,197,94,.35); }
.round-slot.result-lose .face--back { box-shadow: 0 0 0 2px var(--bad) inset, 0 0 18px rgba(239,68,68,.35); }
.round-slot.result-draw .face--back { box-shadow: 0 0 0 2px var(--draw) inset; }

/* Win/Lose flash animation */
@keyframes flash-win { 0% { transform: scale(1); } 35% { transform: scale(1.06); } 100% { transform: scale(1); } }
.round-slot.result-win .flip { animation: flash-win 520ms ease-out; }

@keyframes flash-lose { 0% { filter: grayscale(0); } 50% { filter: grayscale(.6); } 100% { filter: grayscale(0); } }
.round-slot.result-lose .flip { animation: flash-lose 520ms ease-in-out; }

.side-controls { display: flex; gap: 8px; margin-top: 12px; }
.controls { display: flex; gap: 8px; justify-content: center; }

/* central start button removed in reverted layout */

.btn {
  appearance: none;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  color: var(--text);
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 14px;
}
.btn:hover { border-color: #3b82f6; box-shadow: 0 0 0 2px rgba(59,130,246,.2) inset; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn:focus { outline: 2px solid var(--focus); outline-offset: 2px; }
.btn-start.btn-pulse { animation: pulse 1s ease-in-out infinite; }

@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(56,189,248,.4); } 100% { box-shadow: 0 0 0 10px rgba(56,189,248,0); } }

.control-bar {
  margin-top: 16px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0));
}
.scoreboard { text-align: center; margin-bottom: 10px; }
.score { font-size: 28px; font-weight: 800; letter-spacing: 1px; }
.round-status { color: var(--muted); margin-top: 6px; font-size: 14px; }
.final-result { margin-top: 6px; font-size: 16px; font-weight: 700; }
.hint { margin-top: 8px; color: var(--muted); font-size: 12px; text-align: center; }

/* Responsive */
@media (max-width: 800px) {
  .arena { grid-template-columns: 1fr; }
  .rounds { justify-items: center; }
}
