/* ================= ĐẤU TRƯỜNG OẲN TÙ TÌ ================= */
.c-violet { --c1: #d0a8ff; --c2: #7048e8; }
.dock-bar { grid-template-columns: repeat(13, 1fr); }
@media (max-width: 1300px) { .dock-bar { grid-template-columns: repeat(7, 1fr); } }

.rps-overlay {
  position: fixed; inset: 0; z-index: 90;
  display: flex; align-items: center; justify-content: center;
  padding: 18px;
  background: radial-gradient(circle at 50% 30%, rgba(76, 29, 149, 0.55), rgba(15, 10, 30, 0.82));
  backdrop-filter: blur(3px);
  animation: rps-fade .2s ease;
}
.rps-overlay.hidden { display: none; }
@keyframes rps-fade { from { opacity: 0; } to { opacity: 1; } }

.rps-card {
  width: min(980px, 100%);
  max-height: calc(100vh - 36px);
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, #fffaf0 0%, #fff3d6 100%);
  border: 3px solid var(--outline);
  border-radius: 22px;
  box-shadow: 0 8px 0 var(--outline), 0 24px 60px rgba(0,0,0,.45);
  overflow: hidden;
  animation: rps-pop .28s cubic-bezier(.2,1.4,.4,1);
}
@keyframes rps-pop { from { transform: scale(.9) translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }

.rps-head {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  background: linear-gradient(90deg, #7048e8, #c2255c 60%, #f76707);
  border-bottom: 3px solid var(--outline);
  color: #fff;
}
.rps-title { font-weight: 900; font-size: 19px; letter-spacing: .5px; text-shadow: 0 2px 0 rgba(0,0,0,.4); }
.rps-wallet { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.rps-wallet span {
  background: rgba(0,0,0,.28); border: 1.5px solid rgba(255,255,255,.35);
  border-radius: 999px; padding: 3px 10px; font-weight: 800; font-size: 13px;
}
.rps-head .modal-close { position: static; }
.rps-body { padding: 14px; overflow-y: auto; }

/* ---------- Sảnh ---------- */
.rps-lobby { display: flex; flex-direction: column; gap: 12px; }
.rps-opps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.rps-opp {
  --oc: #f76707;
  position: relative;
  font-family: inherit; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 6px 7px;
  background: #fff;
  border: 2.5px solid var(--outline); border-radius: 16px;
  box-shadow: 0 3px 0 var(--outline);
  transition: transform .12s, background .15s;
}
.rps-opp:hover { transform: translateY(-3px); }
.rps-opp.active { background: color-mix(in srgb, var(--oc) 22%, #fff); box-shadow: 0 3px 0 var(--outline), 0 0 0 3px var(--oc); }
.rps-opp.locked { filter: grayscale(.85); opacity: .7; }
.rps-opp.boss { background: linear-gradient(180deg, #fff5f5, #ffe3e3); }
.rps-opp.boss.active { background: linear-gradient(180deg, #ffc9c9, #ffa8a8); }
.rps-opp-face {
  width: 64px; height: 64px; border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, #fff, color-mix(in srgb, var(--oc) 35%, #fff));
  border: 2.5px solid var(--outline);
}
.rps-opp-name { font-weight: 800; font-size: 12.5px; text-align: center; line-height: 1.15; }
.rps-opp-meta { font-size: 11px; color: var(--muted); font-weight: 700; }
.rps-opp-medal {
  position: absolute; top: 4px; right: 4px;
  font-size: 11px; font-weight: 800;
  background: #ffe066; border: 1.5px solid var(--outline); border-radius: 999px; padding: 0 5px;
}

.rps-detail {
  --oc: #f76707;
  display: grid; grid-template-columns: 210px 1fr; gap: 14px; align-items: center;
  padding: 12px 16px;
  border: 2.5px solid var(--outline); border-radius: 18px;
  background:
    radial-gradient(circle at 12% 60%, color-mix(in srgb, var(--oc) 35%, transparent), transparent 55%),
    linear-gradient(180deg, #fff, #fff8e6);
  box-shadow: inset 0 -4px 0 rgba(0,0,0,.05);
}
.rps-detail-char { width: 210px; height: 210px; }
.rps-detail-info { display: flex; flex-direction: column; gap: 8px; }
.rps-detail-name { font-size: 24px; font-weight: 900; color: var(--outline); }
.rps-detail-hint { font-weight: 700; color: #495057; }
.rps-detail-rule { font-size: 14px; }
.rps-bets { display: flex; gap: 8px; flex-wrap: wrap; }
.rps-bet {
  font-family: inherit; cursor: pointer;
  font-weight: 800; font-size: 14px;
  padding: 7px 16px;
  background: #fff; border: 2.5px solid var(--outline); border-radius: 12px;
  box-shadow: 0 3px 0 var(--outline);
  transition: transform .1s;
}
.rps-bet:hover { transform: translateY(-2px); }
.rps-bet.active { background: linear-gradient(180deg, #ffe066, #fab005); }
.rps-streak-note {
  font-weight: 700; font-size: 13.5px;
  background: #fff4e6; border: 2px dashed #f76707; border-radius: 10px; padding: 5px 10px;
}
.rps-go { align-self: flex-start; min-width: 240px; }

.rps-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.rps-stats > div {
  display: flex; flex-direction: column; align-items: center;
  padding: 8px; background: #fff; border: 2px solid var(--outline); border-radius: 12px;
}
.rps-stats b { font-size: 20px; font-weight: 900; color: #7048e8; }
.rps-stats small { font-size: 11.5px; color: var(--muted); font-weight: 700; }
.rps-rules { text-align: center; font-size: 12.5px; color: #495057; font-weight: 600; }
.rps-rules kbd, .rps-choice kbd {
  font-family: inherit; font-weight: 800; font-size: 11px;
  background: #fff; border: 1.5px solid var(--outline); border-bottom-width: 3px; border-radius: 5px; padding: 0 5px;
}

/* ---------- Trận đấu ---------- */
.rps-match { --oc: #f76707; position: relative; display: flex; flex-direction: column; gap: 10px; }
.rps-score {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px;
  padding: 8px 14px;
  background: var(--outline); color: #fff; border-radius: 14px;
}
.rps-side { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.rps-side.them { justify-content: flex-end; }
.rps-side b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pips { display: flex; gap: 5px; }
.pips i {
  width: 16px; height: 16px; border-radius: 50%;
  background: rgba(255,255,255,.18); border: 2px solid rgba(255,255,255,.55);
  transition: background .2s, transform .2s;
}
.rps-side.me .pips i.on { background: #51cf66; transform: scale(1.15); box-shadow: 0 0 8px #51cf66; }
.rps-side.them .pips i.on { background: #ff6b6b; transform: scale(1.15); box-shadow: 0 0 8px #ff6b6b; }
.rps-round {
  font-weight: 900; padding: 3px 14px; border-radius: 999px;
  background: linear-gradient(180deg, #ffe066, #f59f00); color: var(--outline);
}

.rps-stage {
  position: relative;
  display: grid; grid-template-columns: 1fr 200px 1fr; align-items: end;
  min-height: 300px;
  border: 3px solid var(--outline); border-radius: 18px;
  overflow: hidden;
  background:
    linear-gradient(180deg, transparent 72%, #c08a52 72%, #a8743f 100%),
    radial-gradient(ellipse at 50% 120%, #ffd8a8 0, transparent 60%),
    linear-gradient(180deg, #4c2a85 0%, #7b3fa0 45%, #e8590c 100%);
}
.rps-stage::before { /* đèn lồng trang trí */
  content: '🏮      🏮      🏮      🏮      🏮';
  position: absolute; top: 4px; left: 0; right: 0;
  text-align: center; font-size: 20px; white-space: pre; opacity: .9;
  animation: rps-sway 3s ease-in-out infinite alternate;
}
@keyframes rps-sway { from { transform: translateX(-4px); } to { transform: translateX(4px); } }

.rps-fighter { position: relative; height: 300px; display: flex; justify-content: center; }
.rps-fighter canvas { width: 270px; height: 270px; align-self: flex-end; margin-bottom: 4px; }
.rps-hand {
  position: absolute; top: 56px; font-size: 56px; z-index: 2;
  filter: drop-shadow(0 3px 0 rgba(0,0,0,.35));
  transition: transform .2s;
}
.rps-hand.me { right: 4%; transform: scaleX(-1); }
.rps-hand.them { left: 4%; }
.rps-hand.shake { animation: rps-shake .42s ease-in-out infinite; }
.rps-hand.me.shake { animation-name: rps-shake-me; }
@keyframes rps-shake { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-26px) rotate(-12deg); } }
@keyframes rps-shake-me { 0%,100% { transform: scaleX(-1) translateY(0); } 50% { transform: scaleX(-1) translateY(-26px) rotate(-12deg); } }
.rps-hand.reveal { animation: rps-reveal .35s cubic-bezier(.2,1.6,.4,1); }
.rps-hand.me.reveal { animation-name: rps-reveal-me; }
@keyframes rps-reveal { from { transform: scale(.3); } to { transform: scale(1); } }
@keyframes rps-reveal-me { from { transform: scaleX(-1) scale(.3); } to { transform: scaleX(-1) scale(1); } }
.rps-hand.win { filter: drop-shadow(0 0 14px #ffe066) drop-shadow(0 3px 0 rgba(0,0,0,.35)); font-size: 68px; }
.rps-hand.lose { opacity: .55; filter: grayscale(.6); }

.rps-center { position: relative; align-self: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.rps-chant {
  color: #fff; font-weight: 900; font-size: 22px; text-align: center;
  text-shadow: 0 3px 0 var(--outline), 0 0 12px rgba(0,0,0,.4);
}
.rps-chant.pulse { animation: rps-pulse 1s ease-in-out infinite; }
@keyframes rps-pulse { 50% { transform: scale(1.08); } }
.rps-chant.pop.go { animation: rps-chant-pop .4s cubic-bezier(.2,1.6,.4,1); font-size: 34px; }
@keyframes rps-chant-pop { from { transform: scale(2); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.rps-verdict { font-weight: 900; font-size: 44px; letter-spacing: 2px; opacity: 0; }
.rps-verdict.win, .rps-verdict.lose, .rps-verdict.draw { opacity: 1; animation: rps-stamp .45s cubic-bezier(.2,1.6,.4,1); -webkit-text-stroke: 2px var(--outline); }
.rps-verdict.win { color: #69db7c; }
.rps-verdict.lose { color: #ff6b6b; }
.rps-verdict.draw { color: #ffe066; }
@keyframes rps-stamp { from { transform: scale(3) rotate(-10deg); opacity: 0; } to { transform: scale(1) rotate(-4deg); opacity: 1; } }

.rps-say {
  position: absolute; top: 8px; left: 50%; z-index: 3;
  transform: translateX(-50%) scale(.6); opacity: 0;
  max-width: 230px; padding: 6px 12px;
  background: #fff; border: 2.5px solid var(--outline); border-radius: 14px;
  font-weight: 800; font-size: 13px; text-align: center;
  transition: transform .2s cubic-bezier(.2,1.6,.4,1), opacity .2s;
  pointer-events: none;
}
.rps-say::after {
  content: ''; position: absolute; bottom: -9px; left: 50%; margin-left: -8px;
  border: 8px solid transparent; border-top-color: var(--outline); border-bottom: 0;
}
.rps-say.show { transform: translateX(-50%) scale(1); opacity: 1; }

.rps-timer { height: 10px; border: 2px solid var(--outline); border-radius: 999px; background: #fff; overflow: hidden; }
.rps-timer i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #51cf66, #94d82d); transition: background .3s; }
.rps-timer i.low { background: linear-gradient(90deg, #ff6b6b, #fa5252); }

.rps-choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.rps-choice {
  --c1: #ffd43b; --c2: #f59f00;
  position: relative;
  font-family: inherit; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 10px;
  color: #fff;
  background: linear-gradient(180deg, var(--c1), var(--c2));
  border: 3px solid var(--outline); border-radius: 16px;
  box-shadow: inset 0 3px 0 rgba(255,255,255,.45), 0 5px 0 var(--outline);
  transition: transform .1s, filter .15s;
}
.rps-choice.c-keo { --c1: #74c0fc; --c2: #1971c2; }
.rps-choice.c-bua { --c1: #ff8787; --c2: #c92a2a; }
.rps-choice.c-bao { --c1: #8ce99a; --c2: #2b8a3e; }
.rps-choice:not(:disabled):hover { transform: translateY(-3px); filter: brightness(1.08); }
.rps-choice:not(:disabled):active { transform: translateY(3px); box-shadow: inset 0 3px 0 rgba(255,255,255,.45), 0 2px 0 var(--outline); }
.rps-choice:disabled { cursor: default; filter: grayscale(.6) brightness(.9); }
.rps-choice.picked { filter: none; transform: translateY(-4px); box-shadow: inset 0 3px 0 rgba(255,255,255,.45), 0 5px 0 var(--outline), 0 0 0 4px #ffe066; }
.rc-icon { font-size: 38px; filter: drop-shadow(0 2px 0 rgba(0,0,0,.3)); }
.rc-name { font-size: 20px; font-weight: 900; text-shadow: 0 2px 0 rgba(0,0,0,.4); }
.rps-choice kbd { position: absolute; top: 6px; right: 8px; color: var(--outline); }
.rps-bet-info { text-align: center; font-size: 13.5px; color: #495057; }

/* ---------- Kết quả ---------- */
.rps-final {
  position: absolute; inset: 0; z-index: 10;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  border-radius: 18px; overflow: hidden;
  background: rgba(20, 12, 40, .78);
  color: #fff; text-align: center;
  animation: rps-fade .25s ease;
}
.rf-title { font-size: 46px; font-weight: 900; -webkit-text-stroke: 2px var(--outline); animation: rps-stamp .5s cubic-bezier(.2,1.6,.4,1); }
.rps-final.win .rf-title { color: #ffe066; }
.rps-final.lose .rf-title { color: #ff8787; }
.rf-score { font-size: 30px; font-weight: 900; }
.rf-msg { font-size: 16px; font-weight: 700; max-width: 80%; }
.rf-streak { font-weight: 800; color: #ffa94d; font-size: 17px; }
.rf-actions { display: flex; gap: 10px; margin-top: 8px; }
.rps-confetti { position: absolute; inset: 0; pointer-events: none; }
.rps-confetti i {
  position: absolute; top: -20px;
  left: calc(var(--i) * 4.2%);
  width: 9px; height: 14px; border-radius: 2px;
  background: hsl(calc(var(--i) * 47), 90%, 62%);
  animation: rps-confetti 2.4s linear infinite;
  animation-delay: calc(var(--i) * -0.11s);
}
@keyframes rps-confetti {
  to { transform: translateY(560px) rotate(720deg); }
}

/* ---------- Lối vào ở Quán Café ---------- */
.rps-launch {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; margin-bottom: 12px;
  border: 2.5px solid var(--outline); border-radius: 16px;
  background: linear-gradient(90deg, #7048e8, #c2255c);
  color: #fff;
  box-shadow: 0 4px 0 var(--outline);
}
.rps-launch-hands { font-size: 34px; white-space: nowrap; animation: rps-pulse 1.6s ease-in-out infinite; }
.rps-launch-hands span { display: inline-block; transform: translateY(-6px); }
.rps-launch-text { flex: 1; }
.rps-launch-text h3 { font-size: 18px; font-weight: 900; text-shadow: 0 2px 0 rgba(0,0,0,.35); }
.rps-launch-text p { font-size: 13px; opacity: .95; }

@media (max-width: 760px) {
  .rps-opps { grid-template-columns: repeat(3, 1fr); }
  .rps-detail { grid-template-columns: 1fr; justify-items: center; }
  .rps-stage { grid-template-columns: 1fr 110px 1fr; }
  .rps-fighter canvas { width: 150px; height: 150px; }
  .rps-hand { font-size: 40px; }
  .rps-stats { grid-template-columns: repeat(2, 1fr); }
  .rc-name { font-size: 15px; }
  .rps-launch { flex-direction: column; text-align: center; }
}
