/* 사다리 타기(2026-10-26 개발자3, 같은 날 "이쁘고 재밌게"로 다시 꾸밈). 공용 /psych/style.css 위에 덮는다. 본문 14px 이상. */
.stage.ld { padding: 0 0 40px; }
.hidden { display: none !important; }
.ld-head { text-align: center; margin: 12px 16px 0; }
.ld-eyebrow { font-size: 14px; font-weight: 800; color: #E8590C; }
.ld-title { font-size: 30px; font-weight: 900; color: #111827; margin: 2px 0 0; letter-spacing: -0.02em; }
.ld-sub { font-size: 15px; line-height: 1.6; color: #4B5563; margin: 6px 0 0; word-break: keep-all; }

.ld-box { background: #fff; border: 1.5px solid #E5E7EB; border-radius: 22px; padding: 16px; margin: 16px 16px 0; }
.ld-box-title { font-size: 18px; font-weight: 900; color: #111827; margin-bottom: 8px; }
.ld-row { display: flex; align-items: center; justify-content: space-between; }
.ld-label { font-size: 16px; font-weight: 900; color: #111827; }
.ld-count { display: flex; align-items: center; gap: 10px; font-size: 15px; color: #374151; }
.ld-count b { font-size: 24px; font-weight: 900; color: #111827; min-width: 24px; text-align: center; }
.ld-count button { font-family: inherit; width: 42px; height: 42px; border-radius: 50%; border: 0; background: #FFF4E6; font-size: 22px; font-weight: 900; cursor: pointer; color: #E8590C; }
.ld-count button:disabled { opacity: .35; cursor: default; }
.ld-presets { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 14px -16px 0; padding: 0 16px; align-items: center; }
.ld-presets::-webkit-scrollbar { display: none; }
.ld-presets span { flex-shrink: 0; font-size: 14px; font-weight: 800; color: #6B7280; margin-right: 2px; }
.ld-presets button { flex-shrink: 0; font-family: inherit; font-size: 14px; font-weight: 800; color: #374151; background: #F8F9FA; border: 1.5px solid #E9ECEF; border-radius: 999px; padding: 8px 12px; cursor: pointer; white-space: nowrap; }
.ld-presets button.on { background: #FFF4E6; border-color: #FFA94D; color: #D9480F; }
.ld-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; margin-top: 14px; }
.ld-col-h { font-size: 14px; font-weight: 800; color: #6B7280; }
.ld-list { display: flex; flex-direction: column; gap: 6px; }
.ld-list .in { display: flex; align-items: center; gap: 6px; background: #F9FAFB; border: 1.5px solid #E5E7EB; border-radius: 12px; padding: 0 8px; }
.ld-list .in:focus-within { border-color: #FFA94D; background: #fff; }
.ld-list .ava { font-size: 18px; flex-shrink: 0; }
.ld-list input { width: 100%; min-width: 0; box-sizing: border-box; font-family: inherit; font-size: 16px; border: 0; background: transparent; padding: 10px 0; }
.ld-list input:focus { outline: none; }
.ld-hint { font-size: 14px; color: #6B7280; margin: 10px 0 0; }
.ld-hint.center { text-align: center; margin: 0; font-weight: 700; color: #E8590C; }
.ld-guide-row { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 0 0 12px; }
#ldSvg .ld-cover { transition: opacity .45s ease; }
#ldSvg .ld-cover.off { opacity: 0; }
.ld-main { display: block; width: 100%; margin-top: 14px; font-family: inherit; font-size: 18px; font-weight: 900; color: #fff;
    background: linear-gradient(180deg, #FF922B, #E8590C); border: 0; border-radius: 16px; padding: 15px; cursor: pointer; box-shadow: 0 5px 0 #C2410C; }
.ld-main:active { transform: translateY(3px); box-shadow: 0 2px 0 #C2410C; }
.ld-main:disabled { opacity: .6; cursor: default; }
.ld-two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.ld-sub-btn { display: block; width: 100%; font-family: inherit; font-size: 15px; font-weight: 800; color: #374151; background: #F8F9FA; border: 1.5px solid #E9ECEF; border-radius: 12px; padding: 12px 6px; cursor: pointer; }
.ld-sub-btn:disabled { opacity: .5; cursor: default; }

/* 사다리 판 */
.ld-board { background: linear-gradient(180deg, #FFF9DB 0%, #FFF4E6 100%); border-color: #FFE8CC; }
.ld-ladder { position: relative; }
.ld-tops, .ld-bottoms { display: grid; gap: 4px; }
.ld-top { display: flex; flex-direction: column; align-items: center; gap: 3px; font-family: inherit; background: none; border: 0; padding: 0; cursor: pointer; min-width: 0; }
.ld-top .face { width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 24px; background: #fff;
    box-shadow: 0 0 0 3px currentColor, 0 4px 0 rgba(0,0,0,.12); transition: transform .15s; }
.ld-top:not(:disabled):hover .face { transform: translateY(-3px); }
.ld-top:not(:disabled) .face { animation: ldBob 1.8s ease-in-out infinite; }
.ld-top:nth-child(2n) .face { animation-delay: .4s; }
@keyframes ldBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
.ld-top .nm { font-size: 14px; font-weight: 900; color: #212529; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ld-top.done { cursor: default; opacity: .55; }
.ld-top.done .face { animation: none; }
.ld-svgwrap { position: relative; margin: 8px 0; }
#ldSvg { display: block; width: 100%; height: min(360px, 46vh); }
.ld-runner { position: absolute; left: 0; top: 0; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%; background: #fff; display: flex; align-items: center; justify-content: center;
    font-size: 20px; box-shadow: 0 0 0 3px currentColor, 0 4px 10px rgba(0,0,0,.25); pointer-events: none; z-index: 2; }
.ld-bottoms .card { position: relative; height: 54px; perspective: 600px; }
.ld-bottoms .card .in { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .55s cubic-bezier(.3,1.4,.5,1); }
.ld-bottoms .card.open .in { transform: rotateY(180deg); }
.ld-bottoms .side { position: absolute; inset: 0; backface-visibility: hidden; border-radius: 12px; display: flex; align-items: center; justify-content: center; text-align: center;
    font-size: 14px; font-weight: 900; line-height: 1.25; padding: 4px 3px; word-break: keep-all; overflow-wrap: anywhere; box-sizing: border-box; }
.ld-bottoms .front { background: repeating-linear-gradient(45deg, #FFD8A8 0 8px, #FFC078 8px 16px); color: #fff; font-size: 22px; text-shadow: 0 2px 0 rgba(0,0,0,.15); }
.ld-bottoms .back { transform: rotateY(180deg); background: #fff; color: #212529; box-shadow: inset 0 0 0 3px currentColor; }
.ld-bottoms .card.hit .back { animation: ldHit .7s ease-out .4s; }
@keyframes ldHit { 0%, 100% { transform: rotateY(180deg) scale(1); } 40% { transform: rotateY(180deg) scale(1.18); } }
.ld-actions { margin-top: 2px; }

/* 결과 */
.ld-res-list { list-style: none; margin: 0; padding: 0; }
.ld-res-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 4px; border-top: 1px solid #F1F1EE; font-size: 16px; }
.ld-res-list li:first-child { border-top: 0; }
.ld-res-list .who { display: flex; align-items: center; gap: 8px; font-weight: 800; color: #111827; min-width: 0; }
.ld-res-list .ava { font-size: 20px; }
.ld-res-list .what { font-weight: 900; color: #868E96; text-align: right; word-break: keep-all; }
.ld-res-list li.hit { background: #FFF4E6; border-radius: 12px; }
.ld-res-list li.hit .what { color: #E8590C; }
.ld-share { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.ld-share button { font-family: inherit; font-size: 15px; font-weight: 900; border: 0; border-radius: 12px; padding: 12px; cursor: pointer; }
.ld-save { background: #111827; color: #fff; }
.ld-link { background: #DCEBFC; color: #1E4FA8; }
.ld-confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 70; }

@media (prefers-reduced-motion: reduce) { .ld-top .face, .ld-bottoms .card.hit .back { animation: none !important; } .ld-bottoms .card .in { transition: none; } }
@media (max-width: 380px) { .ld-top .face { width: 38px; height: 38px; font-size: 21px; } .ld-bottoms .side { font-size: 13px; } }
@media (min-width: 768px) {
    .stage.ld { max-width: 760px; }
    .ld-title { font-size: 36px; }
    #ldSvg { height: min(420px, 50vh); }
    .ld-top .face { width: 54px; height: 54px; font-size: 30px; }
    .ld-bottoms .card { height: 60px; }
    .ld-bottoms .side { font-size: 15px; }
}
