/* 주사위 던지기(2026-10-26 개발자3, 같은 날 대표 "디자인이 구려"로 다시 그림). 공용 /psych/style.css 위에 덮는다.
   초록 펠트 테이블 위에 3D 정육면체 주사위(6면, CSS 3D)가 굴러 떨어지며 나온 눈이 앞면으로 멈춘다. 1·4 눈은 빨강(동양식). 본문 14px 이상. */
.stage.dc { padding: 0 0 40px; }
.hidden { display: none !important; }
.dc-head { text-align: center; margin: 12px 16px 0; }
.dc-eyebrow { font-size: 14px; font-weight: 800; color: #2B8A3E; }
.dc-title { font-size: 30px; font-weight: 900; color: #111827; margin: 2px 0 0; letter-spacing: -0.02em; }
.dc-sub { font-size: 15px; line-height: 1.6; color: #4B5563; margin: 6px 0 0; word-break: keep-all; }

/* 테이블 */
.dc-table-wrap { margin: 16px 16px 0; border-radius: 26px; padding: 14px; background: #5C3B1E;
    box-shadow: 0 10px 24px rgba(0,0,0,.18), inset 0 2px 0 rgba(255,255,255,.15); }
.dc-felt { position: relative; border-radius: 18px; min-height: 230px; padding: 18px 10px 14px; cursor: pointer;
    background: radial-gradient(ellipse at 50% 35%, #2F9E44 0%, #237032 60%, #1A5426 100%);
    box-shadow: inset 0 0 0 3px rgba(0,0,0,.18), inset 0 8px 30px rgba(0,0,0,.35); -webkit-tap-highlight-color: transparent; }
.dc-felt::after { content: ''; position: absolute; inset: 8px; border: 2px dashed rgba(255,255,255,.18); border-radius: 12px; pointer-events: none; }
.dc-dice { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 22px 26px; min-height: 150px; perspective: 900px; }
.dc-tap { position: relative; z-index: 1; text-align: center; font-size: 14px; font-weight: 700; color: rgba(255,255,255,.75); margin-top: 6px; }

/* 3D 주사위 */
.d3 { --s: 70px; width: var(--s); height: var(--s); position: relative; transition: translate .5s ease-out; }
.d3 .shadow { position: absolute; left: 8%; right: 8%; bottom: -14px; height: 14px; border-radius: 50%; background: rgba(0,0,0,.35); filter: blur(4px); }
.d3 .cube { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform 1.15s cubic-bezier(.2,.9,.25,1.05); }
.d3.toss { animation: dcToss 1.15s cubic-bezier(.3,.7,.4,1); }
@keyframes dcToss { 0% { transform: translateY(0); } 25% { transform: translateY(-46px); } 55% { transform: translateY(0); } 70% { transform: translateY(-12px); } 85%, 100% { transform: translateY(0); } }
.d3 .f { position: absolute; inset: 0; border-radius: 14%; background: linear-gradient(145deg, #FFFFFF 0%, #F1F3F5 70%, #DEE2E6 100%);
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.08), inset -4px -6px 10px rgba(0,0,0,.08);
    display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); padding: 13%; box-sizing: border-box; backface-visibility: hidden; }
.d3 .f i { width: 72%; height: 72%; border-radius: 50%; place-self: center; visibility: hidden;
    background: radial-gradient(circle at 35% 35%, #495057, #111827 70%); }
.d3 .f i.on { visibility: visible; }
.d3 .f.red i { background: radial-gradient(circle at 35% 35%, #FF6B6B, #C92A2A 70%); }
.d3 .f.one i.on { width: 100%; height: 100%; }
.d3 .f1 { transform: translateZ(calc(var(--s) / 2)); }
.d3 .f6 { transform: rotateY(180deg) translateZ(calc(var(--s) / 2)); }
.d3 .f3 { transform: rotateY(90deg) translateZ(calc(var(--s) / 2)); }
.d3 .f4 { transform: rotateY(-90deg) translateZ(calc(var(--s) / 2)); }
.d3 .f2 { transform: rotateX(90deg) translateZ(calc(var(--s) / 2)); }
.d3 .f5 { transform: rotateX(-90deg) translateZ(calc(var(--s) / 2)); }

/* 결과·조작 */
.dc-box { background: #fff; border: 1.5px solid #E5E7EB; border-radius: 20px; padding: 16px; margin: 16px 16px 0; }
.dc-total { text-align: center; font-size: 16px; font-weight: 800; color: #4B5563; min-height: 44px; }
.dc-total b { display: inline-block; font-size: 40px; font-weight: 900; color: #2B8A3E; margin-left: 6px; vertical-align: -6px; }
.dc-total .pop { animation: dcPop .35s ease-out; }
@keyframes dcPop { 0% { transform: scale(.4); opacity: 0; } 70% { transform: scale(1.15); } 100% { transform: scale(1); opacity: 1; } }
.dc-badge { display: inline-block; margin-left: 8px; font-size: 14px; font-weight: 900; color: #fff; background: #E8590C; border-radius: 999px; padding: 3px 10px; vertical-align: 6px; }
.dc-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 14px; }
.dc-label { font-size: 15px; font-weight: 900; color: #111827; white-space: nowrap; }
.dc-count { display: flex; gap: 6px; }
.dc-count button { font-family: inherit; width: 40px; height: 40px; border-radius: 12px; border: 1.5px solid #D1D5DB; background: #fff; font-size: 17px; font-weight: 900; color: #374151; cursor: pointer; }
.dc-count button.on { background: #2B8A3E; border-color: #2B8A3E; color: #fff; }
.dc-main { display: block; width: 100%; margin-top: 14px; font-family: inherit; font-size: 19px; font-weight: 900; color: #fff;
    background: linear-gradient(180deg, #37B24D, #2B8A3E); border: 0; border-radius: 16px; padding: 16px; cursor: pointer; box-shadow: 0 5px 0 #1E6B2E; }
.dc-main:active { transform: translateY(3px); box-shadow: 0 2px 0 #1E6B2E; }
.dc-main:disabled { opacity: .7; cursor: default; }

.dc-box-title { font-size: 17px; font-weight: 900; color: #111827; margin-bottom: 10px; }
.dc-hist { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.dc-hist li { font-size: 14px; font-weight: 700; color: #374151; background: #F1F3F5; border-radius: 10px; padding: 7px 10px; }
.dc-hist li b { color: #2B8A3E; font-weight: 900; }
.dc-hist li:first-child { background: #EBFBEE; box-shadow: inset 0 0 0 1.5px #8CE99A; }
.dc-link { display: block; width: 100%; margin-top: 12px; font-family: inherit; font-size: 15px; font-weight: 900; color: #1E4FA8; background: #DCEBFC; border: 0; border-radius: 12px; padding: 12px; cursor: pointer; }
/* 족보 반짝(10/26 대표 "살짝 더 재미있게"): 테이블 가운데 큰 글씨 + 꽃가루 */
.dc-flash { position: absolute; left: 50%; top: 42%; z-index: 3; transform: translate(-50%, -50%) scale(.6); opacity: 0; pointer-events: none; white-space: nowrap;
    font-size: 34px; font-weight: 900; color: #FFD43B; text-shadow: 0 3px 0 #1A5426, 0 0 18px rgba(255,212,59,.7); }
.dc-flash.show { animation: dcFlash 1.5s ease-out; }
.dc-flash.big { font-size: 42px; }
@keyframes dcFlash { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.6); } 15% { opacity: 1; transform: translate(-50%, -50%) scale(1.18); } 30% { transform: translate(-50%, -50%) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -75%) scale(1); } }
.dc-say { display: block; margin-top: 4px; font-size: 15px; font-weight: 800; color: #E8590C; min-height: 1.3em; }
.dc-badge.cool { background: #7048E8; }
.d3 .shadow { transition: opacity .3s; }
.d3.land { animation: dcLand .3s ease-out; }
@keyframes dcLand { 0% { transform: scale(1); } 40% { transform: scale(1.12); } 100% { transform: scale(1); } }
.dc-hist li .cb { margin-left: 4px; font-size: 13px; font-weight: 900; color: #E8590C; }
.dc-confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 70; }
@media (prefers-reduced-motion: reduce) { .d3 .cube { transition: none; } .d3.toss, .d3.land, .dc-total .pop, .dc-flash.show { animation: none; } }
@media (min-width: 768px) {
    .stage.dc { max-width: 760px; }
    .dc-title { font-size: 36px; }
    .dc-felt { min-height: 300px; }
    .dc-dice { min-height: 220px; gap: 30px 40px; }
    .d3 { --s: 96px; }
}
