/* 사목 */
/* ==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: #3a6bff; --ax-bg2: #0c1446; --ax-acc: #7cf0ff; --ax-glow: rgba(90, 220, 255, 0.45); --ax-l1: #ffffff; --ax-l2: #bff4ff; --ax-l3: #4cc8ff; --ax-ink: #0d1a6b;
  --ax-p1: #8ff05a; --ax-p2: #2fbf3a; --ax-p3: #17752a; --ax-s1: #4f7bff; --ax-s2: #2d40c4;
  padding: 8px; overscroll-behavior: none;
  background: radial-gradient(80% 60% at 50% 0%, rgba(110, 170, 255, 0.45), transparent 70%), linear-gradient(180deg, #2a3fa8 0%, #182366 55%, #0e1440 100%); }
.stage::before { content: ''; position: absolute; inset: -60px; pointer-events: none; opacity: 0.5;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.09) 0 22px, transparent 23px) 0 0 / 120px 120px, radial-gradient(circle, rgba(255, 210, 63, 0.08) 0 12px, transparent 13px) 60px 60px / 120px 120px;
  animation: c4-dots-move 30s linear infinite; }
@keyframes c4-dots-move { to { transform: translate(120px, 120px); } }
.c4 { position: relative; width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; }
.c4-side { display: contents; }
.c4-info { order: 0; width: var(--bw, 340px); max-width: 100%; display: flex; flex-direction: column; gap: 6px; }
.c4-board { order: 1; line-height: 0; position: relative; }
.c4-ctrl { order: 2; width: var(--bw, 340px); max-width: 100%; display: flex; gap: 8px; }
.c4-board canvas { display: block; touch-action: none; cursor: pointer; filter: drop-shadow(0 18px 24px rgba(0, 0, 20, 0.55)); }

/* 차례 표시 */
.c4-chips { display: flex; gap: 8px; }
.c4-chip { position: relative; flex: 1; min-width: 0; color: #fff; display: flex; align-items: center; gap: 9px; padding: 6px 10px 6px 8px; border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.04)); border: 2px solid rgba(255, 255, 255, 0.12); box-shadow: 0 4px 0 rgba(0, 0, 30, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.2); transition: border-color 0.2s, box-shadow 0.2s; }
.c4-av { position: relative; flex: none; display: grid; place-items: center; }
.c4-av .ax-bot { display: none; width: 46px; }
.c4-chip.is-bot .c4-av .ax-bot { display: block; }
.c4-chip.is-bot .c4-av .c4-st { position: absolute; right: -5px; bottom: -3px; width: 19px; height: 19px; z-index: 2; }
.c4-chip span { min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.c4-chip b { font-family: 'Black Han Sans', var(--title); font-weight: 400; font-size: 19px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c4-chip small { font-size: 11px; color: #b9c8ff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c4-chip.on { border-color: #7cf0ff; background: linear-gradient(180deg, rgba(124, 240, 255, 0.24), rgba(40, 80, 200, 0.2)); box-shadow: 0 4px 0 rgba(0, 0, 30, 0.35), 0 0 22px rgba(124, 240, 255, 0.45); }
.c4-chip.on::after { content: ''; position: absolute; left: 50%; top: -9px; width: 12px; height: 12px; margin-left: -6px; background: #7cf0ff; clip-path: polygon(0 0, 100% 0, 50% 100%); animation: c4-turn 0.8s ease-in-out infinite alternate; }
@keyframes c4-turn { to { transform: translateY(3px); } }
.c4-chip.won { border-color: #ffd23f; background: rgba(255, 210, 63, 0.18); box-shadow: 0 0 24px rgba(255, 210, 63, 0.5); }
.c4-chip-2 { flex-direction: row-reverse; text-align: right; }
.c4-chip-2 span { align-items: flex-end; }
.c4-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.3), 0 4px 8px rgba(0, 0, 0, 0.35), inset 0 0 0 3px rgba(255, 255, 255, 0.2); }
.c4-st.p1 { background: radial-gradient(circle at 34% 30%, #d8d2ff 0%, #8064ff 45%, #4a2fc4 100%); }
.c4-st.p2 { background: radial-gradient(circle at 34% 30%, #fff8d8 0%, #ffc83d 48%, #d68a0c 100%); }
.c4-status { text-align: center; font-weight: 800; font-size: 15px; color: #eaf0ff; min-height: 21px; text-shadow: 0 2px 3px rgba(0, 0, 0, 0.5); }
.c4-status.think::after { content: ''; display: inline-block; width: 1.2em; text-align: left; animation: c4-dots 1s steps(4) infinite; }
@keyframes c4-dots { 0% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75% { content: '...'; } }

/* 넓은 화면: 판 오른쪽에 정보 · 단추 */
.c4.wide { flex-direction: row; gap: 26px; }
.c4.wide .c4-side { display: flex; order: 2; flex-direction: column; gap: 16px; width: 236px; }
.c4.wide .c4-info, .c4.wide .c4-ctrl { width: 100%; }
.c4.wide .c4-chips { flex-direction: column; gap: 14px; }
.c4.wide .c4-chip-2 { flex-direction: row; text-align: left; }
.c4.wide .c4-chip-2 span { align-items: flex-start; }
.c4.wide .c4-chip { padding: 10px 12px 10px 10px; }
.c4.wide .c4-chip b { font-size: 22px; }
.c4.wide .c4-st { width: 34px; height: 34px; }
.c4.wide .c4-chip.is-bot .c4-av .c4-st { width: 20px; height: 20px; }
.c4.wide .c4-av .ax-bot { width: 54px; }
.c4.wide .c4-chip.on::after { left: -10px; top: 50%; margin: -6px 0 0; clip-path: polygon(0 0, 100% 50%, 0 100%); }
.c4.wide .c4-status { font-size: 17px; padding: 9px 4px; border-radius: 14px; background: rgba(0, 0, 30, 0.3); box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.35); }
.c4.wide .c4-ctrl { flex-direction: column; }
.c4.wide .ax-btn { padding: 12px; font-size: 16px; justify-content: flex-start; padding-left: 14px; }

/* 넓지만 낮은 화면(폰 가로) */
.c4.short { gap: 16px; }
.c4.short .c4-side { width: 214px; gap: 8px; }
.c4.short .c4-chips { gap: 8px; }
.c4.short .c4-chip { padding: 4px 10px 4px 8px; }
.c4.short .c4-chip b { font-size: 17px; }
.c4.short .c4-st { width: 24px; height: 24px; }
.c4.short .c4-av .ax-bot { width: 40px; }
.c4.short .c4-status { font-size: 14px; padding: 4px; }
.c4.short .c4-ctrl { flex-direction: row; gap: 6px; }
.c4.short .ax-btn { flex-direction: column; gap: 2px; padding: 6px 2px; font-size: 12px; justify-content: center; }

/* 제목 화면: 떨어지는 돌 비 · 작은 사목 판 */
.c4-scene::before { content: ''; position: absolute; inset: 0; background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0 26px, transparent 27px) 0 0 / 140px 140px; opacity: 0.6; animation: c4-dots-move 26s linear infinite; }
.c4-rain { position: absolute; top: -90px; border-radius: 50%; animation: c4-rain var(--d, 6s) linear infinite; animation-delay: var(--dl, 0s); opacity: 0.85; }
.c4-rain.p1 { background: radial-gradient(circle at 34% 30%, #d8d2ff 0%, #8064ff 45%, #4a2fc4 100%); box-shadow: inset 0 0 0 5px rgba(255, 255, 255, 0.18), 0 10px 20px rgba(0, 0, 0, 0.35); }
.c4-rain.p2 { background: radial-gradient(circle at 34% 30%, #fff8d8 0%, #ffc83d 48%, #d68a0c 100%); box-shadow: inset 0 0 0 5px rgba(255, 255, 255, 0.22), 0 10px 20px rgba(0, 0, 0, 0.35); }
@keyframes c4-rain { from { transform: translateY(0) rotate(0); } to { transform: translateY(calc(100vh + 200px)) rotate(240deg); } }
.c4-pic .c4-mb { position: absolute; bottom: 4px; left: 50%; width: 192px; height: 140px; margin-left: -96px; border-radius: 22px; z-index: 1;
  background: radial-gradient(circle, #121a52 0 15px, rgba(255, 255, 255, 0.25) 16px 17px, transparent 18px) 8px 6px / 46px 44px, linear-gradient(180deg, #5c86ff, #2d40c4);
  box-shadow: 0 8px 0 #1d2a8e, 0 18px 30px rgba(0, 0, 0, 0.45), inset 0 3px 0 rgba(255, 255, 255, 0.35); }
.c4-mb i { position: absolute; width: 30px; height: 30px; border-radius: 50%; }
.c4-mb i.p1 { background: radial-gradient(circle at 34% 30%, #d8d2ff 0%, #8064ff 45%, #4a2fc4 100%); }
.c4-mb i.p2 { background: radial-gradient(circle at 34% 30%, #fff8d8 0%, #ffc83d 48%, #d68a0c 100%); }
.c4-mb i.fall { animation: c4-fall 2.4s cubic-bezier(.5, 0, .7, 1) infinite; }
@keyframes c4-fall { 0%, 15% { transform: translateY(-130px); opacity: 0; } 20% { opacity: 1; } 55% { transform: translateY(0); } 62% { transform: translateY(-10px); } 70%, 90% { transform: translateY(0); opacity: 1; } 100% { transform: translateY(0); opacity: 0; } }
.c4-pic .ax-bot { left: auto; right: calc(50% - 168px); bottom: 64px; width: 96px; transform: rotate(10deg); z-index: 2; }

/* 시작 · 끝 화면 세부 */
.c4-ai[hidden] { display: none; }
.c4-mini { width: 16px; height: 16px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); }
.c4-moves { margin: 2px 0 4px; display: flex; justify-content: center; align-items: center; gap: 10px; font-family: 'Black Han Sans', var(--title); font-size: 40px; line-height: 1; color: #fff; }
.c4-moves .c4-st { width: 30px; height: 30px; }
.c4-moves small { font-family: inherit; font-size: 15px; color: rgba(255, 255, 255, 0.6); font-weight: 700; }
.c4-moves:empty { display: none; }

@media (max-width: 760px) {
  .c4-pic .c4-mb { transform: scale(0.78); transform-origin: bottom center; }
  .c4-pic .ax-bot { right: calc(50% - 140px); bottom: 50px; width: 78px; }
}
@media (max-width: 380px) {
  .ax-btn { font-size: 13px; gap: 4px; }
  .c4-chip b { font-size: 17px; }
}
