/* 피규어 뽑기 · 2026-10-09
   Scoped UX layer: existing official-data draw logic remains in JS. */
body.figure-gacha-page .page-wrapper { padding-top: 77px; padding-bottom: 42px; }
body.figure-gacha-page .container { max-width: 1050px; }
body.figure-gacha-page .page-header {
    padding: 15px 6px 12px;
    margin-bottom: 4px;
    text-align: center;
}
body.figure-gacha-page .page-title {
    margin: 0 0 9px;
    color: #312e81;
    font-size: clamp(1.75rem, 4.6vw, 2.4rem);
    line-height: 1.2;
    letter-spacing: -.04em;
}
body.figure-gacha-page .page-subtitle {
    max-width: 720px;
    margin-inline: auto;
    color: #64748b;
    font-size: 13px;
    line-height: 1.65;
}
.figure-source-hint {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px 10px;
    margin: 0 0 15px;
    padding: 11px 13px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    color: #64748b;
    font-size: 11px;
    line-height: 1.65;
}
.figure-source-hint span:first-child {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 21px;
    height: 21px;
    border-radius: 50%;
    background: #f5f3ff;
    color: #6d28d9;
    font-weight: 900;
}
.figure-source-hint strong { color: #334155; }
.figure-source-hint a {
    margin-left: auto;
    color: #6d28d9;
    font-weight: 850;
    text-decoration: underline;
    text-underline-offset: 2px;
}
body.figure-gacha-page .tool-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px;
    align-items: start;
}
body.figure-gacha-page .tool-card {
    padding: clamp(15px, 2vw, 21px);
    border: 1px solid #e2e8f0;
    border-radius: 17px;
    background: #fff;
    box-shadow: 0 8px 26px rgba(76,29,149,.055);
}
body.figure-gacha-page .figure-settings-card {
    border-color: #ddd6fe;
    background: linear-gradient(180deg,#fcfaff,#fff 34%);
}
.figure-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 16px;
}
.figure-section-heading .tool-title {
    margin: 3px 0 0;
    color: #312e81;
    font-size: 17px;
    line-height: 1.35;
}
.figure-eyebrow {
    color: #7c3aed;
    font-size: 9px;
    font-weight: 950;
    letter-spacing: .14em;
}
.figure-reset-inline {
    min-height: 34px;
    padding: 7px 10px;
    border: 1px solid #ddd6fe;
    border-radius: 8px;
    background: #fff;
    color: #6d28d9;
    font-family: inherit;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
    cursor: pointer;
}
.figure-reset-inline:hover { background: #f5f3ff; }
body.figure-gacha-page .tool-fields { gap: 12px; }
body.figure-gacha-page .tool-field { gap: 7px; }
body.figure-gacha-page .tool-field label { font-size: 12px; color: #334155; }
body.figure-gacha-page .tool-field select,
body.figure-gacha-page .tool-field input {
    min-height: 47px;
    padding: 10px 11px;
    border-radius: 10px;
    border-color: #cbd5e1;
    background: #fff;
    color: #1e293b;
    font-size: 16px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
body.figure-gacha-page .tool-field input:focus,
body.figure-gacha-page .tool-field select:focus {
    outline: 3px solid rgba(139,92,246,.16);
    border-color: #8b5cf6;
}
.figure-field-help {
    margin: 0;
    color: #64748b;
    font-size: 10px;
    line-height: 1.55;
}
.figure-key-presets {
    display: grid;
    grid-template-columns: repeat(3,minmax(0,1fr));
    gap: 5px;
}
.figure-key-presets button {
    min-width: 0;
    min-height: 36px;
    padding: 6px 4px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    color: #475569;
    font-family: inherit;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
    cursor: pointer;
}
.figure-key-presets button:hover { background: #faf5ff; border-color: #a78bfa; }
.figure-key-presets button.is-active,
.figure-key-presets button[aria-pressed="true"] {
    background: #ede9fe;
    border-color: #a78bfa;
    color: #5b21b6;
}
.figure-gauge-track {
    height: 7px;
    margin-top: 1px;
    border-radius: 99px;
    background: #e2e8f0;
    overflow: hidden;
}
.figure-gauge-track span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg,#7c3aed,#db2777);
}
.figure-budget-preview {
    display: grid;
    grid-template-columns: repeat(3,minmax(0,1fr));
    gap: 8px;
    margin-top: 16px;
}
.figure-budget-preview > div {
    min-width: 0;
    padding: 11px 8px;
    border: 1px solid #ede9fe;
    border-radius: 11px;
    background: #faf9ff;
}
.figure-budget-preview > div span {
    display: block;
    color: #64748b;
    font-size: 10px;
    font-weight: 750;
    line-height: 1.4;
}
.figure-budget-preview > div strong {
    display: block;
    margin-top: 6px;
    color: #4c1d95;
    font-size: clamp(13px, 1.9vw, 17px);
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}
body.figure-gacha-page #figure-keys-help { margin-top: 8px; }
.figure-rates-details {
    margin-top: 14px;
    padding: 10px 11px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}
.figure-rates-details summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    list-style: none;
    cursor: pointer;
    color: #475569;
    font-size: 11px;
    font-weight: 800;
}
.figure-rates-details summary::-webkit-details-marker { display: none; }
.figure-rates-details[open] summary span { transform: rotate(180deg); }
.figure-rates-details .grade-pills { margin-top: 12px; }
.figure-rates-details .grade-pill { font-size: 10px; }
.figure-actions { margin-top: 15px; gap: 8px; }
body.figure-gacha-page .figure-actions .tool-btn {
    flex: 1 1 55%;
    min-height: 48px;
    padding: 10px 13px;
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 850;
}
body.figure-gacha-page .figure-actions #figure-cancel {
    flex: 0 1 auto;
    border: 1px solid #fecaca;
    background: #fff1f2;
    color: #be123c;
}
body.figure-gacha-page .figure-actions #figure-cancel[hidden] { display: none !important; }
body.figure-gacha-page button:disabled { cursor: not-allowed; opacity: .6; }
.figure-progress-area {
    margin-top: 13px;
    padding: 11px 12px;
    border: 1px solid #ddd6fe;
    border-radius: 10px;
    background: #faf5ff;
}
.figure-progress-area[hidden] { display: none !important; }
.figure-progress-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px 8px;
    margin-bottom: 8px;
    color: #6d28d9;
    font-size: 11px;
    font-weight: 750;
}
.figure-progress-head strong { color: #4c1d95; font-variant-numeric: tabular-nums; }
.figure-progress-track {
    height: 8px;
    border-radius: 99px;
    overflow: hidden;
    background: #e9d5ff;
}
.figure-progress-track span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg,#7c3aed,#db2777);
    transition: width .12s linear;
}
.figure-run-note {
    margin: 9px 1px 0;
    color: #64748b;
    font-size: 11px;
    line-height: 1.6;
}
.figure-result-chip {
    padding: 5px 8px;
    border-radius: 7px;
    background: #f1f5f9;
    color: #475569;
    font-size: 10px;
    font-weight: 800;
    text-align: right;
}
body.figure-gacha-page .figure-metric-grid {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 10px;
}
body.figure-gacha-page .figure-metric-grid .metric {
    min-width: 0;
    padding: 13px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    text-align: left;
}
body.figure-gacha-page .figure-metric-grid .figure-primary-metric {
    grid-column: 1/-1;
    padding: 15px 17px;
    border-color: #ddd6fe;
    background: #f8f5ff;
}
body.figure-gacha-page .metric-label {
    min-height: 16px;
    color: #64748b;
    font-size: 11px;
    font-weight: 750;
    line-height: 1.45;
}
body.figure-gacha-page .metric-value {
    margin-top: 5px;
    color: #334155;
    font-size: clamp(18px, 2.7vw, 21px);
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}
body.figure-gacha-page .figure-primary-metric .metric-value {
    color: #5b21b6;
    font-size: clamp(32px,5vw,42px);
}
.figure-success-meter {
    height: 9px;
    margin-top: 10px;
    border-radius: 99px;
    overflow: hidden;
    background: #e9d5ff;
}
.figure-success-meter span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg,#7c3aed,#c026d3);
}
body.figure-gacha-page .result-banner {
    margin-top: 13px;
    padding: 13px;
    border-radius: 10px;
    font-size: 12px;
    line-height: 1.7;
    font-weight: 800;
    text-align: left;
}
body.figure-gacha-page .figure-result-note {
    margin-top: 10px;
    padding: 10px 12px;
    color: #64748b;
    font-size: 11px;
    line-height: 1.65;
}
.figure-result-note strong { color: #475569; }
.figure-sources {
    margin-top: 15px;
    border: 1px solid #e2e8f0;
    border-radius: 13px;
    background: #fff;
    overflow: hidden;
}
.figure-sources > summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    list-style: none;
    cursor: pointer;
}
.figure-sources > summary::-webkit-details-marker { display: none; }
.figure-sources summary strong { display: block; color: #334155; font-size: 12px; font-weight: 900; }
.figure-sources summary small { display: block; margin-top: 3px; color: #64748b; font-size: 10px; }
.figure-disclosure-arrow { color: #64748b; font-size: 22px; transition: transform .15s ease; }
.figure-sources[open] .figure-disclosure-arrow { transform: rotate(180deg); }
.figure-sources-body { padding: 0 14px 14px; }
.figure-sources-body .tool-status { margin: 0; font-size: 12px; line-height: 1.65; }
.figure-sources-body .source-note { margin-top: 10px; }
body.figure-gacha-page .tool-fields input:focus-visible,
body.figure-gacha-page .tool-fields select:focus-visible,
body.figure-gacha-page button:focus-visible,
.figure-sources summary:focus-visible,
.figure-rates-details summary:focus-visible {
    outline: 3px solid #a78bfa;
    outline-offset: 3px;
}
@media (max-width: 900px) {
    body.figure-gacha-page .tool-grid { grid-template-columns: 1fr; gap: 12px; }
    body.figure-gacha-page .tool-fields { grid-template-columns: repeat(2,minmax(0,1fr)); }
    body.figure-gacha-page .tool-fields .full { grid-column: 1/-1; }
    body.figure-gacha-page .tool-card { padding: 17px; }
    body.figure-gacha-page .figure-metric-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
    body.figure-gacha-page .figure-metric-grid .figure-primary-metric { grid-column: 1/-1; }
}
@media (max-width: 600px) {
    body.figure-gacha-page .page-wrapper { padding-top: 73px; }
    body.figure-gacha-page .container { width: min(100% - 16px,1050px); }
    body.figure-gacha-page .page-header { padding: 12px 4px 10px; }
    body.figure-gacha-page .page-title { font-size: clamp(1.55rem,6.8vw,1.96rem); }
    body.figure-gacha-page .page-subtitle { font-size: 12px; }
    body.figure-gacha-page .tool-card { padding: 14px; }
    body.figure-gacha-page .tool-fields { gap: 10px; }
    body.figure-gacha-page .tool-field input,
    body.figure-gacha-page .tool-field select { font-size: 16px; min-height: 46px; }
    body.figure-gacha-page .figure-metric-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    body.figure-gacha-page .figure-budget-preview { gap: 6px; }
    body.figure-gacha-page .figure-budget-preview > div { padding: 10px 7px; }
    body.figure-gacha-page .figure-budget-preview > div strong { font-size: 13px; }
    body.figure-gacha-page .figure-actions .tool-btn { width: auto; }
    .figure-source-hint a { margin-left: 0; }
}
@media (max-width: 380px) {
    body.figure-gacha-page .tool-fields { grid-template-columns: 1fr; }
    body.figure-gacha-page .figure-metric-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    body.figure-gacha-page .metric-value { font-size: 17px; }
    .figure-key-presets button { min-height: 39px; }
}
@media (prefers-reduced-motion: reduce) {
    .figure-progress-track span,
    .figure-disclosure-arrow { transition: none; }
}

/* Public reference figure artwork: image picker + selected target */
body.figure-gacha-page .figure-selected-preview {
    display:flex;align-items:center;gap:14px;padding:12px 13px;margin-top:6px;
    border:1px solid #ddd6fe;border-radius:13px;
    background:linear-gradient(115deg,#faf5ff,#fff);
    min-height:108px;min-width:0;
}
body.figure-gacha-page .figure-selected-image-frame {
    flex:0 0 83px;width:83px;height:83px;border:1px solid #e9d5ff;
    display:grid;place-items:center;border-radius:13px;overflow:hidden;
    background:#fff;box-shadow:0 3px 9px rgba(109,40,217,.05);
}
body.figure-gacha-page .figure-selected-image-frame img {
    display:block;width:100%;height:100%;object-fit:contain;aspect-ratio:1/1;
}
body.figure-gacha-page .figure-selected-details {
    display:flex;flex-direction:column;align-items:flex-start;gap:4px;
    min-width:0;flex:1;overflow-wrap:anywhere;
}
body.figure-gacha-page .figure-selected-details>span {
    font-size:10px;color:#7c3aed;font-weight:850;
}
body.figure-gacha-page .figure-selected-details strong {
    font-size:16px;font-weight:900;color:#312e81;line-height:1.35;
}
body.figure-gacha-page .figure-selected-details small {
    color:#64748b;font-size:10px;line-height:1.55;
}
body.figure-gacha-page .figure-image-gallery {
    margin-top:4px;border:1px solid #e2e8f0;border-radius:11px;
    background:#fff;overflow:hidden;
}
body.figure-gacha-page .figure-image-gallery>summary {
    display:flex;align-items:center;gap:8px;padding:11px 13px;
    list-style:none;color:#5b21b6;font-size:12px;font-weight:850;cursor:pointer;
    background:#faf9ff;user-select:none;
}
body.figure-gacha-page .figure-image-gallery>summary::-webkit-details-marker {display:none}
body.figure-gacha-page .figure-image-gallery>summary>span:first-child {
    margin-left:auto;color:#64748b;font-size:10px;font-weight:700;
}
body.figure-gacha-page .figure-image-gallery[open]>summary>span:last-child {
    transform:rotate(180deg);
}
body.figure-gacha-page .figure-image-gallery-grid {
    display:grid;grid-template-columns:repeat(5,minmax(0,1fr));
    gap:7px;padding:12px;max-height:390px;overflow-y:auto;
    overscroll-behavior:contain;
}
body.figure-gacha-page .figure-image-gallery-item {
    min-width:0;display:flex;align-items:center;flex-direction:column;
    justify-content:flex-start;gap:6px;
    padding:8px 4px 7px;border:1px solid #e2e8f0;border-radius:10px;
    background:#fff;font-family:inherit;cursor:pointer;
}
body.figure-gacha-page .figure-image-gallery-item:hover {
    border-color:#c4b5fd;background:#faf5ff;
}
body.figure-gacha-page .figure-image-gallery-item.is-selected {
    border-color:#8b5cf6;background:#f5f3ff;
    box-shadow:inset 0 0 0 1px #8b5cf6;
}
body.figure-gacha-page .figure-image-gallery-frame {
    width:100%;max-width:66px;aspect-ratio:1/1;
    display:grid;place-items:center;overflow:hidden;
}
body.figure-gacha-page .figure-image-gallery-frame img {
    display:block;width:100%;height:100%;object-fit:contain;
}
body.figure-gacha-page .figure-image-gallery-name {
    min-width:0;max-width:100%;font-size:10px;line-height:1.35;
    font-weight:750;color:#475569;overflow-wrap:anywhere;
    text-align:center;
}
body.figure-gacha-page .figure-image-gallery-item.is-selected .figure-image-gallery-name {
    color:#5b21b6;font-weight:900;
}
body.figure-gacha-page .figure-result-target {
    display:flex;align-items:center;gap:11px;padding:10px 13px;
    margin-bottom:14px;border:1px solid #e9d5ff;
    border-radius:12px;background:#faf7ff;min-width:0;
}
body.figure-gacha-page .figure-result-target img {
    flex:0 0 57px;width:57px;height:57px;
    object-fit:contain;border-radius:10px;background:#fff;
}
body.figure-gacha-page .figure-result-target>div {
    min-width:0;flex:1;display:flex;flex-direction:column;gap:4px;
}
body.figure-gacha-page .figure-result-target small {
    font-size:10px;color:#64748b;
}
body.figure-gacha-page .figure-result-target strong {
    font-size:14px;font-weight:900;color:#312e81;line-height:1.4;
    overflow-wrap:anywhere;
}
body.figure-gacha-page .figure-result-target>span {
    flex:0 0 auto;max-width:38%;font-size:10px;font-weight:850;
    color:#6d28d9;border:1px solid #ddd6fe;border-radius:999px;
    padding:5px 8px;background:#fff;text-align:center;
}
body.figure-gacha-page img.figure-asset-missing {
    visibility:hidden;
}
body.figure-gacha-page .figure-image-gallery>summary:focus-visible,
body.figure-gacha-page .figure-image-gallery-item:focus-visible {
    outline:3px solid #a78bfa;outline-offset:2px;
}
@media(max-width:620px) {
    body.figure-gacha-page .figure-image-gallery-grid {
        grid-template-columns:repeat(3,minmax(0,1fr));max-height:380px;
    }
    body.figure-gacha-page .figure-selected-preview {gap:10px;padding:10px}
    body.figure-gacha-page .figure-selected-image-frame {
        flex-basis:73px;width:73px;height:73px;
    }
    body.figure-gacha-page .figure-selected-details strong {font-size:14px}
}
@media (prefers-reduced-motion:reduce) {
    body.figure-gacha-page .figure-image-gallery-item {transition:none}
}
