/* 리버시 */
/* ==AX== AAA 공통 꾸미기 — 보드 · 카드 게임 다섯 개가 같은 사본을 쓴다. 색은 각 게임이 .stage 의 --ax-* 로 정한다 */
/* 제목 화면 · 끝 화면 */
.overlay.ax-ov { padding: 14px; background: radial-gradient(120% 90% at 50% 0%, var(--ax-bg1) 0%, var(--ax-bg2) 72%); backdrop-filter: none; overflow: hidden; }
.overlay.ax-ov.ax-end-ov { background: radial-gradient(90% 80% at 50% 30%, color-mix(in srgb, var(--ax-bg1) 82%, transparent) 0%, color-mix(in srgb, var(--ax-bg2) 90%, transparent) 75%); backdrop-filter: blur(5px); }
.ax-scene { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.ax-scene::after { content: ''; position: absolute; inset: 0; background: radial-gradient(80% 70% at 50% 45%, transparent 40%, rgba(0, 0, 0, 0.5) 100%); }
.ax-ov .panel.ax-card { position: relative; z-index: 1; width: min(900px, 100%); max-height: 100%; overflow: auto; background: none; box-shadow: none; color: #fff; padding: 6px; border-radius: 0;
  display: grid; grid-template-columns: 1.05fr 1fr; gap: 10px 34px; align-items: center; text-align: center; scrollbar-width: none; animation: ax-in 0.5s cubic-bezier(.2, .9, .3, 1.15); }
.ax-ov .panel.ax-card::-webkit-scrollbar { display: none; }
@keyframes ax-in { from { opacity: 0; transform: translateY(24px) scale(0.96); } }
.ax-hero { display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; }
.ax-ov .ax-logo { position: relative; margin: 0; font-family: 'Black Han Sans', var(--title); font-weight: 400; font-size: clamp(44px, 6.4vw, 78px); line-height: 1.05; letter-spacing: -0.01em; word-break: keep-all;
  color: var(--ax-ink); -webkit-text-stroke: 6px var(--ax-ink); text-shadow: 0 4px 0 var(--ax-ink), 4px 0 0 var(--ax-ink), -4px 0 0 var(--ax-ink), 0 -4px 0 var(--ax-ink), 3px 3px 0 var(--ax-ink), -3px 3px 0 var(--ax-ink), 3px -3px 0 var(--ax-ink), -3px -3px 0 var(--ax-ink); filter: drop-shadow(0 6px 0 rgba(0, 0, 0, 0.35)) drop-shadow(0 14px 18px rgba(0, 0, 0, 0.4)); animation: ax-logo 3.6s ease-in-out infinite; }
.ax-ov .ax-logo::after { content: attr(data-t); position: absolute; inset: 0; -webkit-text-stroke: 0; text-shadow: none; color: transparent; background: linear-gradient(180deg, var(--ax-l1) 8%, var(--ax-l2) 52%, var(--ax-l3) 100%); -webkit-background-clip: text; background-clip: text; }
@keyframes ax-logo { 0%, 100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-5px) rotate(1deg); } }
.ax-ov .ax-tag { margin: 0; max-width: 30em; font-size: 15px; line-height: 1.45; color: rgba(255, 255, 255, 0.78); font-weight: 600; text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4); }
.ax-pic { position: relative; width: min(330px, 100%); height: 170px; margin: 2px 0; }
.ax-pic .ax-bot { position: absolute; left: 50%; bottom: 6px; width: 132px; transform: translateX(-50%); z-index: 2; }
.ax-badge { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 8px; border-radius: 999px; background: rgba(0, 0, 0, 0.32); border: 1px solid rgba(255, 255, 255, 0.14); font-size: 14px; font-weight: 700; color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1); }
.ax-badge:empty { display: none; }
.ax-badge i { font-style: normal; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: linear-gradient(180deg, #ffe58a, #ffb020); color: #6b3d00; font-size: 14px; box-shadow: 0 2px 0 #a46a00; }
.ax-opts { min-width: 0; padding: 16px 16px 14px; border-radius: 26px; text-align: left; background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04)); border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.16); backdrop-filter: blur(10px); }
.ax-ov p.ax-l { color: rgba(255, 255, 255, 0.62) !important; }
.ax-l { font-size: 12px; font-weight: 800; letter-spacing: 0.04em; color: rgba(255, 255, 255, 0.62); margin: 8px 4px 4px; text-align: left; }
.ax-l:first-child { margin-top: 0; }
.ax-ov .panel .seg { display: flex; gap: 6px; margin: 0 0 4px; }
.ax-ov .panel .seg button { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 4px; border-radius: 14px; border: 2px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.3); color: rgba(235, 238, 255, 0.86); font: inherit; font-size: 14px; font-weight: 800; cursor: pointer; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.3); transition: transform 0.12s, background 0.15s, border-color 0.15s; line-height: 1.15; -webkit-hyphens: auto; hyphens: auto; }
.ax-ov .panel .seg button:hover { border-color: rgba(255, 255, 255, 0.28); }
.ax-ov .panel .seg button:active { transform: scale(0.95); }
.ax-ov .panel .seg button.on { color: #fff; border-color: var(--ax-acc); background: linear-gradient(180deg, var(--ax-s1), var(--ax-s2)); box-shadow: 0 4px 16px var(--ax-glow), inset 0 1px 0 rgba(255, 255, 255, 0.3), inset 0 -3px 0 rgba(0, 0, 0, 0.2); text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35); }
.ax-ov .panel .seg button small { display: block; font-size: 10px; line-height: 1; letter-spacing: 1px; color: #ffd65e; }
.ax-ov .panel .seg button small:empty { display: none; }
.ax-ov .panel .seg button:has(small:not(:empty)) { flex-direction: column; gap: 2px; padding: 6px 4px; }
.ax-rec { margin: 4px 4px 0 !important; font-size: 12.5px; color: rgba(255, 255, 255, 0.6) !important; text-align: center; }
/* 큰 입체 PLAY 단추 */
.big-btn.ax-play { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; margin-top: 14px; padding: 15px 14px 17px; border: 0; border-radius: 20px; cursor: pointer;
  font-family: 'Black Han Sans', var(--title); font-size: 30px; line-height: 1.1; letter-spacing: 0.02em; color: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.3);
  background: linear-gradient(180deg, var(--ax-p1) 0%, var(--ax-p2) 100%); box-shadow: 0 7px 0 var(--ax-p3), 0 14px 26px rgba(0, 0, 0, 0.45), inset 0 2px 0 rgba(255, 255, 255, 0.5), inset 0 -4px 0 rgba(0, 0, 0, 0.12);
  animation: ax-breathe 2.2s ease-in-out infinite; transition: transform 0.08s, box-shadow 0.08s; }
.big-btn.ax-play::before { content: ''; flex: none; width: 0; height: 0; border-left: 20px solid #fff; border-top: 12px solid transparent; border-bottom: 12px solid transparent; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.25)); }
.big-btn.ax-play.ax-again::before { content: '\21BB'; width: auto; height: auto; border: 0; font-family: system-ui, sans-serif; font-size: 30px; line-height: 1; font-weight: 900; }
.big-btn.ax-play::after { content: ''; position: absolute; top: -10%; left: -50%; width: 34%; height: 120%; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.6), transparent); transform: skewX(-20deg); animation: ax-shine 3s ease-in-out infinite; }
.big-btn.ax-play:hover { filter: brightness(1.07); }
.big-btn.ax-play:active { transform: translateY(6px) scale(0.99); box-shadow: 0 1px 0 var(--ax-p3), 0 4px 10px rgba(0, 0, 0, 0.4), inset 0 2px 0 rgba(255, 255, 255, 0.5); animation: none; }
@keyframes ax-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.035); } }
@keyframes ax-shine { 0%, 55% { left: -50%; } 100% { left: 130%; } }
.ax-ov .sub-btn { display: block; width: 100%; margin-top: 8px; padding: 11px; border-radius: 14px; border: 1px solid rgba(255, 255, 255, 0.16); background: rgba(255, 255, 255, 0.08); color: #fff; font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; text-align: center; text-decoration: none; }
.ax-ov .sub-btn:hover { background: rgba(255, 255, 255, 0.15); }
.ax-ov .sub-btn[hidden] { display: none; }
.ax-ov details { margin-top: 10px; font-size: 14px; color: rgba(255, 255, 255, 0.78); text-align: left; }
.ax-ov details summary { cursor: pointer; text-align: center; font-weight: 800; color: rgba(255, 255, 255, 0.7); list-style: none; }
.ax-ov details summary::-webkit-details-marker { display: none; }
.ax-ov details summary::before { content: '?'; display: inline-grid; place-items: center; width: 20px; height: 20px; margin-right: 6px; border-radius: 50%; background: rgba(255, 255, 255, 0.16); font-size: 12px; }
.ax-ov details ul { margin: 8px 0 0; padding-left: 20px; color: rgba(255, 255, 255, 0.78); font-size: 13.5px; line-height: 1.5; }
/* 끝 화면 */
.ax-ov .panel.ax-card.ax-endc { display: flex; flex-direction: column; align-items: center; gap: 0; width: min(430px, 100%); padding: 0 22px 18px; margin-top: 30px; border-radius: 30px; overflow: visible;
  background: linear-gradient(180deg, rgba(36, 40, 92, 0.96), rgba(18, 20, 50, 0.97)); border: 2px solid rgba(255, 255, 255, 0.14); box-shadow: 0 30px 70px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.18); }
.ax-ribbon { position: relative; margin: -26px -34px 4px; padding: 12px 30px 14px; border-radius: 14px; background: linear-gradient(180deg, var(--ax-r1, #ffcf4a), var(--ax-r2, #f29a00)); box-shadow: 0 6px 0 var(--ax-r3, #a35d00), 0 14px 24px rgba(0, 0, 0, 0.4); }
.ax-ribbon::before, .ax-ribbon::after { content: ''; position: absolute; top: 14px; width: 26px; height: 100%; background: var(--ax-r3, #a35d00); z-index: -1; }
.ax-ribbon::before { left: -14px; transform: skewY(20deg); border-radius: 6px 0 0 6px; }
.ax-ribbon::after { right: -14px; transform: skewY(-20deg); border-radius: 0 6px 6px 0; }
.ax-ribbon h2 { margin: 0 !important; font-family: 'Black Han Sans', var(--title); font-weight: 400; font-size: 36px !important; line-height: 1.1; color: #fff; text-shadow: 0 3px 0 rgba(0, 0, 0, 0.28); white-space: nowrap; }
.ax-endc.lose .ax-ribbon { --ax-r1: #8a93c8; --ax-r2: #5a628f; --ax-r3: #353b62; }
.ax-endc.draw .ax-ribbon { --ax-r1: #6fd6c0; --ax-r2: #2aa58a; --ax-r3: #17604f; }
.ax-endico { margin-top: 6px; height: 104px; display: grid; place-items: center; font-size: 74px; line-height: 1; }
.ax-endico .ax-cup { width: 108px; height: 108px; filter: drop-shadow(0 8px 14px rgba(255, 190, 40, 0.45)); animation: ax-cup 0.7s cubic-bezier(.3, 1.7, .5, 1) both; }
@keyframes ax-cup { from { transform: scale(0.2) rotate(-25deg); opacity: 0; } }
.ax-endico .ax-bot { width: 116px; }
.ax-stars { display: flex; justify-content: center; align-items: flex-end; gap: 8px; height: 66px; margin: 2px 0 4px; }
.ax-stars:empty { display: none; }
.ax-star { width: 54px; height: 54px; background: rgba(0, 0, 0, 0.35); clip-path: polygon(50% 2%, 62% 36%, 98% 37%, 69% 59%, 80% 95%, 50% 74%, 20% 95%, 31% 59%, 2% 37%, 38% 36%); transform: scale(0.85); }
.ax-star.ax-star-mid { width: 66px; height: 66px; margin-bottom: 8px; }
.ax-star.on { background: radial-gradient(circle at 40% 30%, #fffbe0 0%, #ffe066 30%, #ffb800 70%, #e08a00 100%); animation: ax-star 0.5s cubic-bezier(.3, 1.9, .5, 1) both; }
.ax-star.off { background: rgba(255, 255, 255, 0.13); animation: ax-star-off 0.3s ease-out both; }
@keyframes ax-star { 0% { transform: scale(2.4) rotate(-40deg); opacity: 0; } 100% { transform: scale(1) rotate(0); opacity: 1; } }
@keyframes ax-star-off { from { transform: scale(0.5); } to { transform: scale(0.85); } }
.ax-msg { margin: 2px 0 6px !important; font-size: 15px; font-weight: 600; color: rgba(255, 255, 255, 0.82) !important; }
.ax-msg:empty { display: none; }
.ax-next { margin: 4px 0 8px !important; padding: 7px 14px; border-radius: 999px; background: rgba(255, 214, 94, 0.12); border: 1px dashed rgba(255, 214, 94, 0.55); color: #ffe08a !important; font-size: 13.5px; font-weight: 800; }
.ax-next:empty { display: none; }
.ax-pills { text-align: center; display: flex; justify-content: center; gap: 8px; margin: 6px 0 4px; width: 100%; }
.ax-pills > div { flex: 1; min-width: 0; padding: 7px 4px 6px; border-radius: 14px; background: rgba(0, 0, 0, 0.28); border: 1px solid rgba(255, 255, 255, 0.08); }
.ax-pills b { display: block; font-family: 'Black Han Sans', var(--title); font-weight: 400; font-size: 24px; line-height: 1.1; color: #fff; }
.ax-pills span { display: block; font-size: 11.5px; font-weight: 700; color: rgba(255, 255, 255, 0.6); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ax-best { margin: 6px 0 2px !important; font-size: 13.5px; font-weight: 700; color: rgba(255, 255, 255, 0.7) !important; }
.ax-best:empty { display: none; }
.ax-best.newbest { display: inline-block; padding: 6px 16px; border-radius: 10px; color: #3a2400 !important; background: linear-gradient(180deg, #fff1a6, #ffc83d); box-shadow: 0 4px 0 #b37a00, 0 0 24px rgba(255, 200, 61, 0.6); animation: ax-newbest 1s ease-in-out infinite alternate; }
@keyframes ax-newbest { from { transform: rotate(-2deg) scale(1); } to { transform: rotate(2deg) scale(1.05); } }
.ax-row { display: flex; gap: 6px; width: 100%; margin-top: 10px; }
.ax-row > * { flex: 1; min-width: 0; padding: 9px 4px !important; margin: 0 !important; font-size: 13px !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 게임 화면 단추 · 숫자 튐 */
.ax-btn { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 7px; padding: 10px 6px; border-radius: 14px; border: 1px solid rgba(255, 255, 255, 0.16); cursor: pointer;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.05)); color: #fff; font: inherit; font-weight: 800; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.22); transition: transform 0.08s, box-shadow 0.08s, background 0.15s; }
.ax-btn i { font-style: normal; flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--ax-acc); color: #1c1400; font-size: 14px; line-height: 1; box-shadow: 0 2px 0 rgba(0, 0, 0, 0.3); }
.ax-btn:hover { background: linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.08)); }
.ax-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.22); }
.ax-btn:disabled { opacity: 0.4; cursor: default; transform: none; box-shadow: 0 2px 0 rgba(0, 0, 0, 0.3); }
.ax-bump { animation: ax-bump 0.36s cubic-bezier(.3, 1.8, .5, 1); }
@keyframes ax-bump { 0% { transform: scale(1); } 35% { transform: scale(1.45); } 100% { transform: scale(1); } }
/* 샤봇 얼굴 · 표정 */
.ax-bot { position: relative; display: inline-block; width: 60px; flex: none; line-height: 0; }
.ax-bot svg { width: 100%; height: auto; overflow: visible; animation: ax-bob 2.6s ease-in-out infinite; transform-origin: 50% 90%; }
@keyframes ax-bob { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-4%) rotate(2deg); } }
.ax-bot .ax-m, .ax-bot .ax-brow, .ax-bot .ax-joy { display: none; }
.ax-bot[data-mood="idle"] .ax-m-idle, .ax-bot[data-mood="happy"] .ax-m-happy, .ax-bot[data-mood="sad"] .ax-m-sad, .ax-bot[data-mood="wow"] .ax-m-wow, .ax-bot[data-mood="think"] .ax-m-think { display: inline; }
.ax-bot[data-mood="sad"] .ax-brow-sad, .ax-bot[data-mood="think"] .ax-brow-think { display: inline; }
.ax-bot[data-mood="happy"] .ax-eyes { display: none; }
.ax-bot[data-mood="happy"] .ax-joy { display: inline; }
.ax-bot[data-mood="happy"] svg { animation: ax-hop 0.5s ease-in-out infinite; }
.ax-bot[data-mood="sad"] svg { animation: ax-sad 2.4s ease-in-out infinite; }
.ax-bot[data-mood="wow"] svg { animation: ax-wow 0.4s ease-out; }
.ax-bot[data-mood="sad"] .ax-eyes { transform: translateY(3px); }
.ax-bot .ax-eyes { transform-box: fill-box; transform-origin: center; animation: ax-blink 4.2s infinite; }
.ax-bot[data-mood="think"] .ax-eyes { animation: ax-look 1.6s ease-in-out infinite; }
@keyframes ax-blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(0.1); } }
@keyframes ax-look { 0%, 100% { transform: translate(-4px, -2px); } 50% { transform: translate(4px, -2px); } }
@keyframes ax-hop { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10%) rotate(3deg); } }
@keyframes ax-sad { 0%, 100% { transform: translateY(3%) rotate(-3deg); } 50% { transform: translateY(5%) rotate(-5deg); } }
@keyframes ax-wow { 0% { transform: scale(1); } 40% { transform: scale(1.15); } 100% { transform: scale(1); } }
.ax-bot .ax-ant { animation: ax-ant 1.8s ease-in-out infinite; }
.ax-bot[data-mood="think"] .ax-ant { fill: #ffd65e; animation: ax-antb 0.5s ease-in-out infinite alternate; }
@keyframes ax-ant { 0%, 100% { opacity: 1; } 50% { opacity: 0.75; } }
@keyframes ax-antb { from { fill: #ffd65e; } to { fill: #fff6cf; } }
.ax-bubble { position: absolute; right: -16%; top: -18%; display: none; gap: 3px; padding: 5px 7px; border-radius: 12px; background: #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35); line-height: 0; }
.ax-bubble b { width: 6px; height: 6px; border-radius: 50%; background: #4b55e0; animation: ax-dot 1s ease-in-out infinite; }
.ax-bubble b:nth-child(2) { animation-delay: 0.15s; }
.ax-bubble b:nth-child(3) { animation-delay: 0.3s; }
.ax-bot[data-mood="think"] .ax-bubble { display: flex; }
@keyframes ax-dot { 0%, 100% { transform: translateY(0); opacity: 0.4; } 40% { transform: translateY(-4px); opacity: 1; } }
/* 처음 하는 사람 안내 손가락 */
.ax-hand { position: absolute; left: 0; top: 0; z-index: 6000; width: 52px; pointer-events: none; transform: translate(var(--ax0), var(--ay0)); filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.45)); }
.ax-hand svg { display: block; width: 52px; margin: -2px 0 0 -21px; transform-origin: 40% 10%; }
.ax-hand.tap svg { animation: ax-tap 1.1s ease-in-out infinite; }
.ax-hand.drag { animation: ax-drag 2.2s cubic-bezier(.5, 0, .3, 1) infinite; }
.ax-hand.drag svg { animation: ax-press 2.2s ease-in-out infinite; }
.ax-hand-dot { position: absolute; left: -16px; top: -16px; width: 32px; height: 32px; border-radius: 50%; border: 3px solid #fff; opacity: 0; animation: ax-ripple 1.1s ease-out infinite; }
.ax-hand.drag .ax-hand-dot { animation-duration: 2.2s; }
@keyframes ax-tap { 0%, 100% { transform: translate(6px, 10px) scale(1); } 45% { transform: translate(0, 0) scale(0.9); } }
@keyframes ax-ripple { 0%, 40% { transform: scale(0.3); opacity: 0; } 45% { opacity: 0.9; } 100% { transform: scale(1.5); opacity: 0; } }
@keyframes ax-drag { 0%, 12% { transform: translate(var(--ax0), var(--ay0)); opacity: 0; } 18% { opacity: 1; } 30% { transform: translate(var(--ax0), var(--ay0)); } 75% { transform: translate(var(--ax1), var(--ay1)); opacity: 1; } 92%, 100% { transform: translate(var(--ax1), var(--ay1)); opacity: 0; } }
@keyframes ax-press { 0%, 20% { transform: translate(6px, 10px); } 30%, 75% { transform: scale(0.9); } 85%, 100% { transform: translate(6px, 10px); } }
@media (max-width: 760px) {
  .ax-ov .panel.ax-card { grid-template-columns: 1fr; gap: 10px; width: min(440px, 100%); align-content: start; }
  .ax-pic { height: 120px; }
  .ax-pic .ax-bot { width: 96px; }
  .ax-ov .ax-logo { font-size: clamp(40px, 12vw, 56px); }
  .ax-ov .ax-tag { font-size: 13.5px; }
  .big-btn.ax-play { font-size: 26px; padding: 13px 12px 15px; }
}
@media (max-height: 700px) and (min-width: 761px) { .ax-pic { height: 130px; } .ax-pic .ax-bot { width: 100px; } .ax-ov .ax-logo { font-size: 54px; } }
@media (prefers-reduced-motion: reduce) { .ax-logo, .big-btn.ax-play, .big-btn.ax-play::after, .ax-bot svg { animation: none !important; } }
/* ==/AX== */
/* ── 리버시: 초록 펠트 카지노 탁자 (놋쇠 테 · 등불) ── */
.stage { --ax-bg1: #1f8a57; --ax-bg2: #03140b; --ax-acc: #ffd65e; --ax-glow: rgba(120, 255, 190, 0.35); --ax-l1: #ffffff; --ax-l2: #d9ffe9; --ax-l3: #4fdc95; --ax-ink: #06301a;
  --ax-p1: #b48cff; --ax-p2: #6a3fe0; --ax-p3: #3b1f96; --ax-s1: #2aa36a; --ax-s2: #146b42;
  padding: 8px; overscroll-behavior: none;
  background: radial-gradient(70% 55% at 50% 10%, rgba(140, 255, 190, 0.22), transparent 70%), radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.025) 0 1px, transparent 1.5px) 0 0 / 5px 5px, linear-gradient(180deg, #146b41 0%, #0b4429 55%, #062a18 100%); }
.stage::before { content: ''; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(90% 80% at 50% 45%, transparent 45%, rgba(0, 0, 0, 0.6) 100%); }
.rv { position: relative; width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; user-select: none; -webkit-user-select: none; }
.rv-side { display: contents; }
.rv-info { order: 0; width: var(--bw, 360px); max-width: 100%; display: flex; flex-direction: column; gap: 6px; }
.rv-board { order: 1; line-height: 0; position: relative; }
.rv-ctrl { order: 2; width: var(--bw, 360px); max-width: 100%; display: flex; gap: 8px; }

.rv-board canvas { display: block; border-radius: 16px; touch-action: none; cursor: pointer; -webkit-touch-callout: none;
  box-shadow: 0 2px 0 #7a5a2a, 0 6px 0 #1d1206, 0 22px 40px rgba(0, 0, 0, 0.6), 0 0 60px rgba(120, 255, 180, 0.1); }
.rv-board canvas.rv-shake { animation: rv-shake 0.34s ease-out; }
@keyframes rv-shake { 0%, 100% { transform: translate(0, 0); } 20% { transform: translate(-5px, 2px); } 40% { transform: translate(5px, -2px); } 60% { transform: translate(-3px, -1px); } 80% { transform: translate(2px, 1px); } }

/* 알림 (잡기 의무) */
.rv-toast { position: absolute; left: 50%; top: 50%; z-index: 5; transform: translate(-50%, -50%); line-height: 1.3; text-align: center; pointer-events: none; min-width: 60%; max-width: 92%; padding: 12px 18px; border-radius: 18px; background: rgba(6, 30, 18, 0.94); border: 2px solid #ffc83d; box-shadow: 0 0 24px rgba(255, 200, 61, 0.4), 0 14px 30px rgba(0, 0, 0, 0.5); color: #fff; }
.rv-toast.warn { border-color: #ff6b5a; box-shadow: 0 0 24px rgba(255, 107, 90, 0.45), 0 14px 30px rgba(0, 0, 0, 0.5); }
.rv-toast[hidden] { display: none; }
.rv-toast b { display: block; font-family: 'Black Han Sans', var(--title); font-weight: 400; font-size: 28px; color: #ffd65e; letter-spacing: 0.02em; }
.rv-toast.warn b { color: #ff8a7c; }
.rv-toast span { display: block; font-size: 15px; font-weight: 700; color: #e6fff0; margin-top: 2px; }
.rv-toast.show { animation: rv-toast 1.7s ease-out forwards; }
@keyframes rv-toast { 0% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); } 12% { opacity: 1; transform: translate(-50%, -50%) scale(1.05); } 20% { transform: translate(-50%, -50%) scale(1); } 82% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -50%) scale(0.96); } }

/* 말 아이콘 */
.rv-st { flex: none; position: relative; display: inline-block; width: 26px; height: 26px; border-radius: 50%; box-shadow: 0 3px 0 rgba(0, 0, 0, 0.4), 0 5px 8px rgba(0, 0, 0, 0.35); vertical-align: middle; }
.rv-st::after { content: ''; position: absolute; inset: 22%; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.3); }
.rv-st.p { background: radial-gradient(circle at 34% 30%, #c9cdff 0%, #7d87ff 40%, #4450dc 82%, #2a3196 100%); box-shadow: 0 3px 0 #232a85, 0 5px 8px rgba(0, 0, 0, 0.4); }
.rv-st.y { background: radial-gradient(circle at 34% 30%, #fff6cf 0%, #ffd65e 40%, #f2b01e 82%, #b67d00 100%); box-shadow: 0 3px 0 #9a6400, 0 5px 8px rgba(0, 0, 0, 0.4); }
.rv-st.y::after { border-color: rgba(140, 85, 0, 0.35); }

/* 차례 · 말 수 (나무 명패) */
.rv-chips { display: flex; gap: 8px; }
.rv-chip { position: relative; flex: 1; min-width: 0; color: #fff; display: flex; align-items: center; gap: 9px; padding: 6px 10px 6px 8px; border-radius: 16px;
  background: linear-gradient(180deg, rgba(220, 255, 235, 0.14), rgba(0, 0, 0, 0.2)); border: 2px solid rgba(200, 255, 225, 0.12); box-shadow: 0 4px 0 rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.12); transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s; }
.rv-av { position: relative; flex: none; display: grid; place-items: center; }
.rv-av .ax-bot { display: none; width: 46px; }
.rv-chip.is-bot .rv-av .ax-bot { display: block; }
.rv-chip.is-bot .rv-av .rv-st { position: absolute; right: -5px; bottom: -3px; width: 19px; height: 19px; z-index: 2; }
.rv-chip span { min-width: 0; flex: 1; display: flex; flex-direction: column; line-height: 1.2; }
.rv-chip b { font-family: 'Black Han Sans', var(--title); font-weight: 400; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rv-chip small:empty { display: none; }
.rv-chip small { font-size: 11px; color: #bfe6cf; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rv-chip em { display: inline-block; font-style: normal; font-family: 'Black Han Sans', var(--title); font-size: 24px; line-height: 1; min-width: 1.7em; padding: 5px 8px 4px; border-radius: 999px; text-align: center; background: rgba(0, 0, 0, 0.35); box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4); }
.rv-chip-p em { color: #c3c8ff; }
.rv-chip-y em { color: #ffd65e; }
.rv-chip.on { border-color: #ffc83d; box-shadow: 0 4px 0 rgba(0, 0, 0, 0.3), 0 0 22px rgba(255, 200, 61, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.2); background: linear-gradient(180deg, rgba(255, 200, 61, 0.24), rgba(0, 60, 30, 0.25)); }
.rv-chip.on::after { content: ''; position: absolute; left: 50%; top: -9px; width: 12px; height: 12px; margin-left: -6px; background: #ffc83d; clip-path: polygon(0 0, 100% 0, 50% 100%); animation: rv-turn 0.8s ease-in-out infinite alternate; }
@keyframes rv-turn { to { transform: translateY(3px); } }
.rv-chip.won { border-color: #3ee0b5; background: rgba(62, 224, 181, 0.14); box-shadow: 0 0 22px rgba(62, 224, 181, 0.4); }
.rv-chip-y { flex-direction: row-reverse; text-align: right; }
.rv-chip-y span { align-items: flex-end; }

.rv-bar { display: flex; height: 10px; border-radius: 6px; overflow: hidden; background: rgba(0, 0, 0, 0.35); box-shadow: inset 0 2px 3px rgba(0, 0, 0, 0.45); }
.rv-bar i { display: block; height: 100%; transition: width 0.5s cubic-bezier(.3, 1.4, .5, 1); }
.rv-bar-p { background: linear-gradient(180deg, #9aa2ff, #4450dc); width: 50%; }
.rv-bar-y { background: linear-gradient(180deg, #ffe58a, #f2b01e); width: 50%; }

.rv-status { text-align: center; font-weight: 800; font-size: 15px; color: #eafff3; min-height: 21px; text-shadow: 0 2px 3px rgba(0, 0, 0, 0.5); }
.rv-status.must { color: #ffb0a4; animation: rv-must 0.7s ease-in-out infinite alternate; }
@keyframes rv-must { to { transform: scale(1.06); } }
.rv-status.think::after { content: ''; display: inline-block; width: 1.2em; text-align: left; animation: rv-dots 1s steps(4) infinite; }
@keyframes rv-dots { 0% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75% { content: '...'; } }

/* 넓은 화면: 판 오른쪽에 정보 · 단추 */
.rv.wide { flex-direction: row; gap: 26px; }
.rv.wide .rv-side { display: flex; order: 2; flex-direction: column; gap: 14px; width: 236px; }
.rv.wide .rv-info, .rv.wide .rv-ctrl { width: 100%; }
.rv.wide .rv-chips { flex-direction: column; gap: 14px; }
.rv.wide .rv-chip-y { flex-direction: row; text-align: left; }
.rv.wide .rv-chip-y span { align-items: flex-start; }
.rv.wide .rv-chip { padding: 9px 12px 9px 10px; }
.rv.wide .rv-chip b { font-size: 21px; }
.rv.wide .rv-chip em { font-size: 28px; }
.rv.wide .rv-chip .rv-st { width: 34px; height: 34px; }
.rv.wide .rv-chip.is-bot .rv-av .rv-st { width: 20px; height: 20px; }
.rv.wide .rv-av .ax-bot { width: 54px; }
.rv.wide .rv-chip.on::after { left: -10px; top: 50%; margin: -6px 0 0; clip-path: polygon(0 0, 100% 50%, 0 100%); }
.rv.wide .rv-status { font-size: 16px; padding: 9px 4px; border-radius: 14px; background: rgba(0, 0, 0, 0.28); box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.35); }
.rv.wide .rv-ctrl { flex-direction: column; }
.rv.wide .ax-btn { padding: 12px; font-size: 16px; justify-content: flex-start; padding-left: 14px; }

/* 넓지만 낮은 화면(폰 가로 · 미리보기): 작게 */
.rv.short { gap: 16px; }
.rv.short .rv-side { width: 214px; gap: 8px; }
.rv.short .rv-chips { gap: 8px; }
.rv.short .rv-chip { padding: 4px 10px 4px 8px; }
.rv.short .rv-chip b { font-size: 17px; }
.rv.short .rv-chip em { font-size: 22px; }
.rv.short .rv-chip .rv-st { width: 24px; height: 24px; }
.rv.short .rv-av .ax-bot { width: 40px; }
.rv.short .rv-status { font-size: 13px; padding: 4px; }
.rv.short .rv-ctrl { flex-direction: row; gap: 6px; }
.rv.short .ax-btn { flex-direction: column; gap: 2px; padding: 6px 2px; font-size: 12px; justify-content: center; }

/* 제목 화면 무대: 기울어진 펠트 판 · 뒤집히는 돌 */
.rv-scene::before { content: ''; position: absolute; left: 50%; top: -20%; width: 70vmax; height: 70vmax; margin-left: -35vmax; background: radial-gradient(circle, rgba(170, 255, 200, 0.28), transparent 60%); animation: rv-lamp 5s ease-in-out infinite alternate; }
@keyframes rv-lamp { to { opacity: 0.6; transform: scale(1.08); } }
.rv-table { position: absolute; left: 50%; bottom: -52%; width: 120vmin; height: 120vmin; margin-left: -60vmin; transform: perspective(900px) rotateX(64deg) rotateZ(20deg); animation: rv-spin 70s linear infinite; opacity: 0.6;
  background: linear-gradient(rgba(0, 0, 0, 0.45) 2px, transparent 2px) 0 0 / 12.5% 12.5%, linear-gradient(90deg, rgba(0, 0, 0, 0.45) 2px, transparent 2px) 0 0 / 12.5% 12.5%, radial-gradient(circle at 40% 30%, #22a564, #0e5a34);
  box-shadow: 0 0 0 3vmin #3a2410, 0 0 0 3.6vmin #d9a441, 0 0 80px rgba(0, 0, 0, 0.8); }
@keyframes rv-spin { to { transform: perspective(900px) rotateX(64deg) rotateZ(380deg); } }
.rv-fl, .rv-pic .rv-fd { position: absolute; transform-style: preserve-3d; animation: rv-flip var(--d, 4s) ease-in-out infinite; animation-delay: var(--dl, 0s); }
.rv-fl::before, .rv-fl::after, .rv-fd::before, .rv-fd::after { content: ''; position: absolute; inset: 0; border-radius: 50%; backface-visibility: hidden; box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.2), inset 0 -6px 10px rgba(0, 0, 0, 0.3); }
.rv-fl::before, .rv-fd::before { background: radial-gradient(circle at 34% 30%, #c3c8ff 0%, #7d87ff 40%, #4450dc 82%, #2a3196 100%); }
.rv-fl::after, .rv-fd::after { background: radial-gradient(circle at 34% 30%, #fff6cf 0%, #ffd65e 40%, #f2b01e 82%, #b67d00 100%); transform: rotateY(180deg); }
@keyframes rv-flip { 0%, 35% { transform: translateY(0) rotateY(0); } 50% { transform: translateY(-26px) rotateY(90deg); } 65%, 85% { transform: translateY(0) rotateY(180deg); } 100% { transform: translateY(0) rotateY(360deg); } }
.rv-fl { opacity: 0.85; filter: drop-shadow(0 14px 16px rgba(0, 0, 0, 0.45)); }
.rv-pic .rv-fd { width: 58px; height: 58px; bottom: 14px; filter: drop-shadow(0 8px 8px rgba(0, 0, 0, 0.45)); }
.rv-pic .ax-bot { left: 50%; bottom: 66px; width: 104px; }
.rv-pic::before { content: ''; position: absolute; left: 50%; bottom: 0; width: 300px; height: 90px; margin-left: -150px; border-radius: 50%; background: radial-gradient(ellipse, rgba(40, 200, 120, 0.45), transparent 70%); }

/* 시작 · 끝 화면 세부 */
.rv-two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 8px; }
.rv-ai[hidden] { display: none; }
.rv-panel .seg button .rv-st { width: 16px; height: 16px; box-shadow: 0 2px 2px rgba(0, 0, 0, 0.4); }
.rv-panel .seg button .rv-st::after { display: none; }
.rv-final { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 4px 0 0; }
.rv-final b { font-family: 'Black Han Sans', var(--title); font-weight: 400; font-size: 40px; line-height: 1; color: #fff; }
.rv-final span { font-size: 26px; color: rgba(255, 255, 255, 0.5); }
.rv-final .rv-st { width: 32px; height: 32px; }
.rv-panel .rv-left { font-size: 12px; color: rgba(255, 255, 255, 0.55); margin: 2px 0 4px; }

@media (max-width: 760px) {
  .rv-pic .ax-bot { width: 80px; bottom: 50px; }
  .rv-pic .rv-fd { width: 40px; height: 40px; }
}
@media (max-width: 380px) {
  .ax-btn { font-size: 13px; gap: 4px; }
  .rv-chip b { font-size: 16px; }
  .rv-chip em { font-size: 20px; }
  .rv-chip { gap: 6px; padding: 6px 8px; }
  .rv-panel .seg button { font-size: 13px; }
}
