
/* =========================================================
   BiblePang Detective — 성경추리
   Word Search UI 기반 전용 CSS
   ========================================================= */

.puzzle-page{
    width:min(1360px,calc(100% - 40px));
    max-width:1360px;
    margin:28px auto 58px;
    padding:0;
    color:#24364b;
    font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans KR",sans-serif;
}

/* ---------- 상단 제목 ---------- */
.puzzle-topbar{
    display:flex;
    justify-content:space-between;
    align-items:flex-end;
    gap:18px;
    margin-bottom:16px;
}
.puzzle-kicker{
    font-size:11px;
    letter-spacing:.16em;
    font-weight:900;
    color:#155eef;
}
.puzzle-title-line{
    display:flex;
    align-items:center;
    gap:10px;
    flex-wrap:wrap;
}
.puzzle-title-line h2{
    margin:4px 0;
    font-size:29px;
    color:#0b2348;
    font-weight:900;
}
.puzzle-title-line h2 small{
    font-size:.55em;
    color:#6b7f96;
    font-weight:750;
}
.puzzle-topbar p{
    margin:0;
    color:#71839b;
    font-size:13px;
}
.puzzle-mode-badge{
    display:inline-flex;
    padding:5px 10px;
    border:1px solid #b5cbed;
    border-radius:999px;
    background:#eaf2ff;
    color:#155eef;
    font-size:11px;
    font-weight:850;
}
.puzzle-user-actions{
    display:flex;
    align-items:center;
    gap:8px;
}
.puzzle-login-user{
    font-size:12px;
    font-weight:750;
    color:#71839b;
    white-space:nowrap;
}
.puzzle-action-icon{
    width:35px;
    height:35px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    border-radius:10px;
    text-decoration:none!important;
    font-size:21px;
    font-weight:900;
}
.puzzle-home{
    background:#eaf2ff;
    color:#155eef;
    border:1px solid #b5cbed;
}

/* ---------- 통계 : PC에서는 4개 한 줄 ---------- */
.puzzle-history{
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:10px;
    margin-bottom:16px;
}
.puzzle-stat-card{
    min-width:0;
    background:linear-gradient(135deg,#fff,#f3f8ff);
    border:1px solid #bfd0e4;
    border-radius:14px;
    padding:12px 13px;
    box-shadow:0 5px 18px rgba(32,73,120,.06);
}
.puzzle-stat-title{
    display:block;
    font-size:11.5px;
    font-weight:850;
    color:#526b86;
    margin-bottom:6px;
}
.puzzle-stat-pair{
    display:flex;
    flex-direction:column;
    gap:3px;
}
.puzzle-stat-pair span{
    font-size:11.5px;
    color:#405a75;
    line-height:1.45;
}
.puzzle-stat-pair i{
    font-style:normal;
    display:inline-block;
    min-width:38px;
    color:#8a9aae;
    font-size:10px;
}
.puzzle-stat-card.points .puzzle-stat-pair span{
    color:#155eef;
    font-weight:750;
}
.puzzle-content-ad{
    margin:18px 0 20px;
}

/* ---------- 공통 버튼 ---------- */
.puzzle-primary-btn,
.puzzle-secondary-btn{
    min-height:38px;
    border-radius:10px;
    padding:0 14px;
    font-size:12px;
    font-weight:850;
    cursor:pointer;
}
.puzzle-primary-btn{
    background:#155eef;
    border:1px solid #0b4bd4;
    color:#fff;
}
.puzzle-primary-btn:hover{
    background:#0f52d6;
}
.puzzle-secondary-btn{
    background:#f1f5fa;
    border:1px solid #b9c9db;
    color:#506780;
}
.puzzle-secondary-btn:hover{
    background:#e7eff8;
    border-color:#9db7d4;
    color:#315f91;
}

/* ---------- 상단 게임 툴바 ---------- */
.detective-toolbar{
    display:grid;
    grid-template-columns:minmax(0,1fr) auto auto;
    gap:12px;
    align-items:center;
    margin-bottom:13px;
    padding:10px 12px;
    border:1px solid #c8d6e8;
    border-radius:14px;
    background:#eaf1f8;
}
.detective-toolbar>div:first-child{
    display:flex;
    flex-direction:column;
    gap:2px;
    min-width:0;
}
.detective-toolbar>div:first-child strong{
    font-size:16px;
    color:#263f5b;
}
.detective-toolbar>div:first-child span{
    font-size:11px;
    color:#71859c;
}
.detective-score-pill{
    display:inline-flex;
    align-items:center;
    gap:6px;
    min-height:34px;
    padding:0 11px;
    border:1px solid #bfd2eb;
    border-radius:999px;
    background:#fff;
    color:#61758c;
    font-size:11px;
    font-weight:850;
}
.detective-score-pill b{
    color:#155eef;
    font-size:15px;
}

/* =========================================================
   메인 레이아웃
   왼쪽 이미지 / 가운데 제시어 / 오른쪽 세로 그래프
   ========================================================= */
.detective-workspace{
    display:grid;
    grid-template-columns:minmax(0,1fr) 300px 96px;
    gap:12px;
    align-items:stretch;
}
.detective-image-card,
.detective-clue-panel,
.detective-score-panel{
    min-width:0;
    border:1px solid #b9cde5;
    border-radius:16px;
    background:linear-gradient(135deg,#f9fcff,#eef5ff 65%,#f8fbff);
    box-shadow:0 7px 22px rgba(35,76,122,.06);
}

/* ---------- 이미지 영역 ---------- */
.detective-image-card{
    padding:10px;
}
.detective-image-stage{
    position:relative;
    width:100%;
    aspect-ratio:1/1;
    overflow:hidden;
    border:1px solid #afc4dd;
    border-radius:15px;
    background:linear-gradient(135deg,#dbe9f9,#edf5ff);
}
.detective-case-image,
.detective-cover-image{
    position:absolute;
    inset:0;
    width:100%;
    height:100%;
    object-fit:cover;
    user-select:none;
    -webkit-user-drag:none;
    transition:
        opacity .48s ease,
        filter .48s ease,
        transform .48s ease;
}
.detective-case-image{
    opacity:.08;
    filter:blur(18px) saturate(1.18);
    transform:scale(1.04);
}
.detective-cover-image{
    opacity:.96;
}
.image-reveal-label{
    position:absolute;
    left:12px;
    bottom:12px;
    z-index:4;
    padding:6px 9px;
    border:1px solid rgba(155,184,214,.72);
    border-radius:999px;
    background:rgba(255,255,255,.86);
    color:#456b99;
    font-size:10.5px;
    font-weight:900;
    backdrop-filter:blur(5px);
    box-shadow:0 3px 10px rgba(33,79,128,.08);
}
.detective-solved .detective-case-image{
    opacity:1!important;
    filter:none!important;
    transform:none!important;
}
.detective-solved .detective-cover-image{
    opacity:0!important;
    pointer-events:none;
}

/* ---------- 정답 입력 ---------- */
.detective-answer-box{
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    gap:8px;
    margin-top:10px;
}
.detective-answer-box input{
    width:100%;
    min-width:0;
    height:38px;
    box-sizing:border-box;
    border:1px solid #b9c9db;
    border-radius:10px;
    padding:0 12px;
    outline:none;
    background:#fff;
    color:#29445f;
    font-size:13px;
    font-weight:800;
}
.detective-answer-box input:focus{
    border-color:#6b9cd4;
    box-shadow:0 0 0 3px rgba(21,94,239,.10);
}
.puzzle-message{
    min-height:30px;
    margin-top:8px;
    padding:7px 10px;
    border-radius:9px;
    color:#71839a;
    font-size:12px;
    font-weight:700;
}
.puzzle-message.is-success{
    background:#edf8f2;
    border:1px solid #b5dbc5;
    color:#39735a;
}
.puzzle-message.is-error{
    background:#fff0f0;
    border:1px solid #e0b9bd;
    color:#98565b;
}
.puzzle-message.is-warn{
    background:#fff8e8;
    border:1px solid #ead4a2;
    color:#84682d;
}

/* ---------- 제시어 패널 ---------- */
.detective-clue-panel{
    display:flex;
    flex-direction:column;
    padding:13px;
    overflow:hidden;
}
.puzzle-side-title{
    display:flex;
    flex-direction:column;
    gap:2px;
    margin-bottom:10px;
}
.puzzle-side-title strong{
    font-size:16px;
    color:#29445f;
}
.puzzle-side-title span{
    font-size:10.5px;
    line-height:1.45;
    color:#8091a5;
}
.detective-clue-list{
    flex:1 1 auto;
    min-height:0;
    display:flex;
    flex-direction:column;
    gap:7px;
    overflow-y:auto;
    overflow-x:hidden;
    padding-right:5px;
    scrollbar-gutter:stable;
}
.detective-clue-list::-webkit-scrollbar{
    width:9px;
}
.detective-clue-list::-webkit-scrollbar-track{
    background:rgba(107,132,162,.10);
    border-radius:10px;
}
.detective-clue-list::-webkit-scrollbar-thumb{
    background:#91aac8;
    border-radius:10px;
    border:2px solid transparent;
    background-clip:padding-box;
}
.detective-clue-card{
    position:relative;
    flex:0 0 auto;
    min-width:0;
    padding:9px 48px 9px 10px;
    border:1px solid #d0ddea;
    border-radius:9px;
    background:#fff;
    color:#506982;
    font-size:11.5px;
    line-height:1.45;
    font-weight:700;
    box-shadow:0 2px 6px rgba(35,76,122,.03);
    animation:detectiveCardIn .22s ease both;
}
.detective-clue-card b{
    display:block;
    margin-bottom:3px;
    color:#155eef;
    font-size:11px;
    font-weight:900;
}
.detective-more-btn{
    position:absolute;
    right:7px;
    top:50%;
    transform:translateY(-50%);
    min-height:25px;
    padding:0 8px;
    border:1px solid #a7c1e2;
    border-radius:999px;
    background:#eaf2ff;
    color:#155eef;
    font-size:9px;
    font-weight:900;
    cursor:pointer;
}
.detective-more-btn:hover:not(:disabled){
    background:#dceaff;
    border-color:#82aadd;
}
.detective-more-btn:disabled{
    cursor:default;
    opacity:.55;
}
@keyframes detectiveCardIn{
    from{opacity:0;transform:translateY(-7px)}
    to{opacity:1;transform:none}
}

/* =========================================================
   점수 세로 그래프 — Word Search 스타일
   100에서 시작해서 more마다 아래로 감소
   ========================================================= */
.detective-score-panel{
    padding:12px 8px;
    display:flex;
    flex-direction:column;
    align-items:center;
}
.wordsearch-progress-title{
    width:100%;
    display:flex;
    flex-direction:column;
    align-items:center;
    gap:3px;
    text-align:center;
}
.wordsearch-progress-title strong{
    color:#29445f;
    font-size:11px;
    line-height:1.25;
}
.wordsearch-progress-title span{
    color:#155eef;
    font-size:15px;
    font-weight:950;
}
.wordsearch-progress-meter{
    position:relative;
    flex:1 1 auto;
    min-height:410px;
    width:66px;
    margin:10px auto;
    display:flex;
    justify-content:center;
}
.wordsearch-progress-track{
    position:relative;
    width:30px;
    height:100%;
    min-height:410px;
    overflow:hidden;
    border:2px solid rgba(103,154,203,.26);
    border-radius:999px;
    background:linear-gradient(180deg,rgba(255,255,255,.9),rgba(224,240,249,.84));
    box-shadow:
        inset 0 4px 10px rgba(69,112,150,.08),
        0 3px 8px rgba(72,118,158,.06);
}
.wordsearch-progress-fill{
    position:absolute;
    left:0;
    right:0;
    bottom:0;
    height:100%;
    border-radius:999px;
    background:linear-gradient(
        0deg,
        #64c9ff,
        #6fd8c6 54%,
        #a398ef
    );
    box-shadow:0 0 18px rgba(91,183,221,.25);
    transition:height .42s cubic-bezier(.2,.75,.25,1);
}
.wordsearch-progress-scale{
    position:absolute;
    inset:0;
    pointer-events:none;
    color:#8195aa;
    font-size:8px;
    font-weight:800;
}
.wordsearch-progress-scale span{
    position:absolute;
    right:0;
    transform:translateY(50%);
}
.wordsearch-progress-scale .is-100{top:-5px;transform:none}
.wordsearch-progress-scale .is-75{top:27%}
.wordsearch-progress-scale .is-50{top:49%}
.wordsearch-progress-scale .is-25{top:70%}
.wordsearch-progress-scale .is-0{bottom:-1px;transform:none}
.wordsearch-progress-footer{
    width:100%;
    display:flex;
    flex-direction:column;
    align-items:center;
    gap:2px;
    padding-top:8px;
    border-top:1px solid #d4e0ec;
}
.wordsearch-progress-footer span{
    font-size:9px;
    color:#8091a5;
}
.wordsearch-progress-footer strong{
    font-size:14px;
    color:#155eef;
    font-weight:950;
}

/* ---------- Dark mode ---------- */
html.bp-dark .puzzle-page{
    color:#dce6f2;
}
html.bp-dark .puzzle-title-line h2{
    color:#f1f5fc;
}
html.bp-dark .puzzle-title-line h2 small,
html.bp-dark .puzzle-topbar p,
html.bp-dark .puzzle-login-user{
    color:#97a6b9;
}
html.bp-dark .puzzle-stat-card,
html.bp-dark .detective-image-card,
html.bp-dark .detective-clue-panel,
html.bp-dark .detective-score-panel{
    background:#151f2e!important;
    border-color:#36506d!important;
    box-shadow:none!important;
}
html.bp-dark .puzzle-stat-title{
    color:#afbed0;
}
html.bp-dark .puzzle-stat-pair span{
    color:#d5e1ed;
}
html.bp-dark .puzzle-stat-pair i{
    color:#8195aa;
}
html.bp-dark .puzzle-stat-card.points .puzzle-stat-pair span{
    color:#9fc0ff;
}
html.bp-dark .detective-toolbar{
    background:#111d2c;
    border-color:#31465f;
}
html.bp-dark .detective-toolbar>div:first-child strong,
html.bp-dark .puzzle-side-title strong,
html.bp-dark .wordsearch-progress-title strong{
    color:#e2ebf5;
}
html.bp-dark .detective-toolbar>div:first-child span,
html.bp-dark .puzzle-side-title span{
    color:#97a6b9;
}
html.bp-dark .detective-score-pill{
    background:#1b3048;
    border-color:#42658d;
    color:#a7b8ca;
}
html.bp-dark .detective-score-pill b{
    color:#9fc0ff;
}
html.bp-dark .detective-answer-box input{
    background:#101a28;
    border-color:#405570;
    color:#e6eef8;
}
html.bp-dark .detective-answer-box input:focus{
    border-color:#6299de;
    box-shadow:0 0 0 3px rgba(98,153,222,.13);
}
html.bp-dark .detective-clue-card{
    background:#111c2a;
    border-color:#36506d;
    color:#d6e2ef;
}
html.bp-dark .detective-clue-card b{
    color:#9fc0ff;
}
html.bp-dark .detective-more-btn{
    background:#192f48;
    border-color:#5689bd;
    color:#a9ceff;
}
html.bp-dark .detective-image-stage{
    background:#101a28;
    border-color:#405570;
}
html.bp-dark .image-reveal-label{
    background:rgba(16,26,40,.88);
    border-color:#405570;
    color:#b9d4f8;
}
html.bp-dark .wordsearch-progress-title span,
html.bp-dark .wordsearch-progress-footer strong{
    color:#9fc0ff;
}
html.bp-dark .wordsearch-progress-track{
    background:linear-gradient(180deg,#0f1d2d,#12253a);
    border-color:#3a5873;
    box-shadow:
        inset 0 4px 10px rgba(0,0,0,.22),
        0 3px 8px rgba(0,0,0,.10);
}
html.bp-dark .wordsearch-progress-scale,
html.bp-dark .wordsearch-progress-footer span{
    color:#91a8bd;
}
html.bp-dark .wordsearch-progress-footer{
    border-top-color:#304a62;
}
html.bp-dark .detective-clue-list{
    scrollbar-color:#465c75 #162130;
}

/* ---------- 반응형 ---------- */
@media(max-width:950px){
    .detective-workspace{
        grid-template-columns:minmax(0,1fr) 260px 82px;
    }
}
@media(max-width:779px){
    .puzzle-history{
        grid-template-columns:repeat(2,minmax(0,1fr));
    }
    .detective-workspace{
        grid-template-columns:minmax(0,1fr) 245px 78px;
        gap:9px;
    }
}
@media(max-width:720px){
    .puzzle-page{
        width:calc(100% - 24px);
        max-width:none;
        margin-top:16px;
    }
    .puzzle-topbar{
        align-items:flex-start;
    }
    .puzzle-topbar p{
        display:none;
    }
    .puzzle-history{
        grid-template-columns:1fr;
    }
    .detective-toolbar{
        grid-template-columns:minmax(0,1fr) auto;
    }
    .detective-toolbar>button{
        grid-column:1/-1;
    }
    .detective-workspace{
        grid-template-columns:minmax(0,1fr) 118px 60px;
        gap:6px;
    }
    .detective-image-card{
        padding:6px;
    }
    .detective-clue-panel{
        padding:7px;
    }
    .detective-score-panel{
        padding:7px 3px;
    }
    .detective-clue-card{
        padding:7px 5px;
        font-size:9px;
    }
    .detective-clue-card b{
        font-size:9px;
    }
    .detective-more-btn{
        position:static;
        transform:none;
        display:inline-flex;
        margin-top:5px;
    }
    .wordsearch-progress-meter,
    .wordsearch-progress-track{
        min-height:300px;
    }
    .wordsearch-progress-meter{
        width:53px;
    }
    .wordsearch-progress-track{
        width:25px;
    }
    .detective-answer-box{
        grid-template-columns:1fr;
    }
}


/* =========================================================
   Detective V2 layout + glass-shard reveal
   ========================================================= */
.detective-toolbar{
    grid-template-columns:minmax(0,1fr) auto auto auto!important;
}
.puzzle-reveal-btn{
    min-height:38px;
    border:1px solid #9fb7d7;
    border-radius:10px;
    padding:0 13px;
    background:#eef4fb;
    color:#3f5f83;
    font-size:11px;
    font-weight:850;
    cursor:pointer;
}
.puzzle-reveal-btn:hover:not(:disabled){
    background:#e2edf9;
    border-color:#7fa3d0;
    color:#2367c4;
}
.puzzle-reveal-btn:disabled{
    opacity:.58;
    cursor:not-allowed;
}

/* Smaller image panel, more space for clue cards */
.detective-workspace{
    grid-template-columns:minmax(360px,44%) minmax(0,1fr) 96px!important;
    gap:12px!important;
}
.detective-image-stage{
    width:min(100%,455px)!important;
    margin:0 auto;
}
.detective-clue-panel{
    min-width:0!important;
}

/* Actual target image is always sharp underneath the canvas. */
.detective-case-image{
    opacity:1!important;
    filter:none!important;
    transform:none!important;
}
.detective-reveal-canvas{
    position:absolute;
    inset:0;
    z-index:3;
    width:100%;
    height:100%;
    display:block;
    pointer-events:none;
}
.detective-cover-source{
    position:absolute;
    width:1px;
    height:1px;
    opacity:0;
    pointer-events:none;
}
.image-reveal-label{
    z-index:5!important;
}

/* Wider clue cards = less line wrapping */
.detective-clue-card{
    padding:10px 52px 10px 12px!important;
    font-size:12px!important;
    line-height:1.42!important;
}
.detective-clue-card span{
    word-break:keep-all;
    overflow-wrap:normal;
}
.detective-clue-card.is-current{
    box-shadow:0 0 0 2px color-mix(in srgb,var(--clue-color,#6aa8ef) 28%,transparent)!important;
    border-color:var(--clue-color,#6aa8ef)!important;
}
.detective-clue-card{
    background:
      linear-gradient(135deg,
        color-mix(in srgb,var(--clue-color,#7bbdf2) 14%,white),
        color-mix(in srgb,var(--clue-color,#7bbdf2) 5%,white)
      )!important;
}
.detective-clue-card b{
    color:var(--clue-color,#155eef)!important;
}
.detective-more-btn{
    border-color:color-mix(in srgb,var(--clue-color,#7bbdf2) 48%,#aac2dc)!important;
    background:color-mix(in srgb,var(--clue-color,#7bbdf2) 13%,white)!important;
    color:color-mix(in srgb,var(--clue-color,#155eef) 76%,#244d78)!important;
}

/* Bar uses the same active clue color */
.detective-score-panel{
    --active-score-color:#64c9ff;
}
.detective-score-panel .wordsearch-progress-fill{
    background:linear-gradient(
        0deg,
        color-mix(in srgb,var(--active-score-color) 76%,#5586df),
        var(--active-score-color)
    )!important;
    box-shadow:0 0 18px color-mix(in srgb,var(--active-score-color) 38%,transparent)!important;
}

/* Answer reveal / locked state */
.detective-page.is-answer-revealed .detective-reveal-canvas{
    opacity:0!important;
}
.detective-page.is-answer-revealed .detective-answer-box input,
.detective-page.is-answer-revealed #answerBtn,
.detective-page.is-answer-revealed .detective-more-btn{
    pointer-events:none!important;
}
html.bp-dark .puzzle-reveal-btn{
    background:#16263a;
    color:#a9c7eb;
    border-color:#405d7e;
}
html.bp-dark .detective-clue-card{
    background:
      linear-gradient(135deg,
        color-mix(in srgb,var(--clue-color,#7bbdf2) 17%,#111c2a),
        #111c2a
      )!important;
}
@media(max-width:950px){
    .detective-workspace{
        grid-template-columns:minmax(330px,43%) minmax(0,1fr) 84px!important;
    }
}
@media(max-width:720px){
    .detective-toolbar{
        grid-template-columns:1fr auto auto!important;
    }
    .detective-toolbar>button:last-child{
        grid-column:auto!important;
    }
    .detective-workspace{
        grid-template-columns:1fr!important;
    }
    .detective-image-stage{
        width:min(100%,400px)!important;
    }
    .detective-score-panel{
        min-height:180px;
    }
    .wordsearch-progress-meter,
    .wordsearch-progress-track{
        min-height:150px!important;
    }
}

.detective-dashboard-head{display:grid;grid-template-columns:minmax(250px,1.15fr) minmax(520px,2.3fr) auto;gap:12px;align-items:stretch;padding:12px;margin-bottom:18px;border:1px solid #c7d7e9;border-radius:18px;background:linear-gradient(135deg,#fbfdff,#f2f7fd);box-shadow:0 7px 24px rgba(38,79,124,.07)}
.detective-brand{display:flex;align-items:center;gap:11px;min-width:0}
.detective-brand>img{width:70px;height:70px;object-fit:cover;object-position:50% 34%;border-radius:18px;border:1px solid #c5d5e7}
.detective-brand .puzzle-title-line h2{font-size:22px;margin:2px 0 3px}
.detective-brand p{margin:0;color:#6f8298;font-size:11px;font-weight:700}
.detective-head-stats{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:8px!important;margin:0!important;align-self:stretch}
.detective-head-stats .puzzle-stat-card{display:flex;flex-direction:column;justify-content:center;min-height:72px;padding:9px 10px;border-radius:12px}
.detective-head-stats .puzzle-stat-title{font-size:10px;margin-bottom:4px}
.detective-head-stats .puzzle-stat-pair span{font-size:11px}
.detective-head-user{flex-direction:column;justify-content:center;align-items:center;min-width:70px}

.detective-clue-card{background:linear-gradient(135deg,color-mix(in srgb,var(--theme-light) calc(94% - var(--step)*7%),white),color-mix(in srgb,var(--theme-mid) calc(12% + var(--step)*9%),var(--theme-dark)))!important;border-color:color-mix(in srgb,var(--theme-mid) 50%,#c9d8e8)!important}
.detective-clue-card:nth-child(1){--step:0}.detective-clue-card:nth-child(2){--step:1}.detective-clue-card:nth-child(3){--step:2}.detective-clue-card:nth-child(4){--step:3}.detective-clue-card:nth-child(5){--step:4}.detective-clue-card:nth-child(6){--step:5}.detective-clue-card:nth-child(7){--step:6}.detective-clue-card:nth-child(8){--step:7}.detective-clue-card:nth-child(9){--step:8}.detective-clue-card:nth-child(10){--step:9}
.detective-clue-card b{color:var(--theme-text-dark)!important}
.detective-clue-card span{color:#17324e;font-weight:800}
.detective-clue-card:nth-child(n+6) span,.detective-clue-card:nth-child(n+6) b{color:#fff!important;text-shadow:0 1px 2px rgba(0,0,0,.28)}
.detective-clue-card:nth-child(n+6) .detective-more-btn{color:#fff!important;border-color:rgba(255,255,255,.68)!important;background:rgba(255,255,255,.12)!important}
.detective-more-btn{color:var(--theme-text-dark)!important;border-color:color-mix(in srgb,var(--theme-mid) 55%,white)!important;background:rgba(255,255,255,.42)!important}
.detective-score-panel .wordsearch-progress-fill{background:linear-gradient(180deg,var(--theme-light) 0%,var(--theme-mid) 52%,var(--theme-dark) 100%)!important;box-shadow:0 0 18px color-mix(in srgb,var(--theme-mid) 34%,transparent)!important}
.detective-score-panel .wordsearch-progress-title span,.detective-score-panel .wordsearch-progress-footer strong{color:var(--theme-dark)!important}

.detective-clue-panel{height:100%;max-height:560px;overflow:hidden!important}
.detective-clue-list{flex:1 1 auto!important;min-height:0!important;max-height:490px!important;overflow-y:auto!important;overscroll-behavior:contain}
.detective-clue-card{flex:0 0 auto!important}

.detective-howto{display:flex;gap:12px;margin:12px 0 0;padding:13px 16px;border:1px solid #c7d7e9;border-radius:14px;background:linear-gradient(135deg,#f7fbff,#edf5ff)}
.detective-howto-icon{color:#155eef;font-size:21px;font-weight:900}
.detective-howto strong{color:#244d78;font-size:14px}
.detective-howto ul{margin:6px 0 0;padding-left:18px;color:#5d738b;font-size:11px;line-height:1.65}
html.bp-dark .detective-dashboard-head,html.bp-dark .detective-howto{background:#111d2c!important;border-color:#31465f!important}
html.bp-dark .detective-brand p,html.bp-dark .detective-howto ul{color:#9eb0c3}
html.bp-dark .detective-howto strong{color:#dce9f7}
@media(max-width:1050px){.detective-dashboard-head{grid-template-columns:1fr}.detective-head-user{position:absolute;right:28px;top:30px}}
@media(max-width:760px){.detective-head-stats{grid-template-columns:repeat(2,minmax(0,1fr))!important}.detective-clue-panel{max-height:430px}.detective-clue-list{max-height:365px!important}}


/* =========================================================
   Detective V4 — approved mockup header + clean glass reveal
   ========================================================= */

/* Wider, flatter top dashboard like the approved concept image */
.detective-dashboard-head{
    grid-template-columns:minmax(310px,1.35fr) minmax(590px,2.6fr) 90px!important;
    min-height:94px!important;
    padding:10px 14px!important;
    border-radius:18px!important;
    background:linear-gradient(180deg,#ffffff 0%,#f8fbff 100%)!important;
    border:1px solid #d5e1ef!important;
    box-shadow:0 5px 18px rgba(39,79,124,.08)!important;
}
.detective-brand>img{
    width:76px!important;
    height:76px!important;
    border-radius:50%!important;
    object-fit:cover!important;
    object-position:center 38%!important;
    border:0!important;
    box-shadow:0 2px 12px rgba(28,68,112,.12)!important;
}
.detective-brand .puzzle-kicker{
    font-size:9.5px!important;
}
.detective-brand .puzzle-title-line h2{
    font-size:22px!important;
    color:#102b50!important;
    white-space:nowrap;
}
.detective-brand .puzzle-title-line h2 small{
    font-size:.50em!important;
}
.detective-brand p{
    font-size:11px!important;
    color:#516c88!important;
}

.detective-head-stats{
    gap:9px!important;
}
.detective-head-stats .puzzle-stat-card{
    display:grid!important;
    grid-template-columns:42px minmax(0,1fr)!important;
    align-items:center!important;
    gap:8px!important;
    min-height:72px!important;
    padding:8px 10px!important;
    background:#fff!important;
    border:1px solid #d7e2ef!important;
    border-radius:12px!important;
    box-shadow:0 3px 11px rgba(36,72,110,.07)!important;
}
.detective-head-stats .stat-icon{
    width:38px;
    height:38px;
    display:flex;
    align-items:center;
    justify-content:center;
}
.detective-head-stats .stat-icon svg{
    width:36px;
    height:36px;
    fill:none;
    stroke:currentColor;
    stroke-width:3;
    stroke-linecap:round;
    stroke-linejoin:round;
}
.detective-head-stats .stat-copy{
    min-width:0;
}
.detective-head-stats .puzzle-stat-title{
    margin:0 0 2px!important;
    color:#334e6b!important;
    font-size:10px!important;
    font-weight:850!important;
    white-space:nowrap;
}
.detective-head-stats .stat-copy>strong{
    display:block;
    color:#0d2d59;
    font-size:21px;
    font-weight:950;
    letter-spacing:-.03em;
    line-height:1.05;
}
.detective-head-stats .stat-copy>strong small{
    margin-left:3px;
    color:#405f80;
    font-size:10px;
    font-weight:850;
}
.detective-head-stats .stat-complete .stat-icon{color:#7754c9}
.detective-head-stats .stat-best .stat-icon{color:#efa818}
.detective-head-stats .stat-clues .stat-icon{color:#35b9b1}
.detective-head-stats .stat-points .stat-icon{color:#f0a51b}

.detective-head-user{
    gap:8px!important;
}
.detective-head-user .puzzle-login-user{
    color:#1d3656!important;
    font-weight:900!important;
}
.puzzle-action-icon.puzzle-home{
    width:42px!important;
    height:42px!important;
    padding:0!important;
    border-radius:11px!important;
    background:#fff!important;
    border:1px solid #c8d9ec!important;
    color:#1461e8!important;
    box-shadow:0 3px 10px rgba(30,73,121,.08)!important;
}
.puzzle-action-icon.puzzle-home svg{
    width:25px;
    height:25px;
    fill:none;
    stroke:currentColor;
    stroke-width:2.2;
    stroke-linecap:round;
    stroke-linejoin:round;
}

/* Initial cover has no visible fracture lines. Only the removed polygon edge reveals the target. */
.detective-reveal-canvas{
    image-rendering:auto;
}
.detective-image-stage{
    background:#eef5fb!important;
}

/* Header dark mode */
html.bp-dark .detective-dashboard-head{
    background:linear-gradient(180deg,#151f2e,#111b29)!important;
    border-color:#36506d!important;
}
html.bp-dark .detective-head-stats .puzzle-stat-card{
    background:#172436!important;
    border-color:#36506d!important;
    box-shadow:none!important;
}
html.bp-dark .detective-head-stats .puzzle-stat-title,
html.bp-dark .detective-head-user .puzzle-login-user{
    color:#b8c8d9!important;
}
html.bp-dark .detective-head-stats .stat-copy>strong{
    color:#eef6ff!important;
}
html.bp-dark .detective-head-stats .stat-copy>strong small{
    color:#9bb0c5!important;
}
html.bp-dark .puzzle-action-icon.puzzle-home{
    background:#17283b!important;
    border-color:#405d7c!important;
    color:#8fc1ff!important;
}

@media(max-width:1100px){
    .detective-dashboard-head{
        grid-template-columns:1fr!important;
    }
    .detective-head-user{
        position:static!important;
        flex-direction:row!important;
        justify-content:flex-end!important;
    }
}


/* =========================================================
   Detective V5 — toolbar / clue panel / score panel polish
   ========================================================= */

/* 1) 제시어 카드: 글자색을 전부 동일하게 통일 */
.detective-clue-card,
.detective-clue-card b,
.detective-clue-card span,
.detective-clue-card:nth-child(n+6) b,
.detective-clue-card:nth-child(n+6) span{
    color:#17324e!important;
    text-shadow:none!important;
}

/*
 * 카드가 아래로 갈수록 밝아지는 흐름은 유지하되
 * 너무 하얗게 날아가지 않도록 pastel 범위 안에서만 변화.
 */
.detective-clue-card{
    background:
        linear-gradient(
            135deg,
            color-mix(in srgb,var(--theme-mid) calc(26% - var(--step)*1.6%),white),
            color-mix(in srgb,var(--theme-light) calc(50% + var(--step)*3.4%),white)
        )!important;
    border-color:
        color-mix(in srgb,var(--theme-mid) 34%,#cbd9e8)!important;
}
.detective-clue-card:nth-child(n+6) .detective-more-btn{
    color:var(--theme-text-dark)!important;
    border-color:color-mix(in srgb,var(--theme-mid) 48%,white)!important;
    background:rgba(255,255,255,.55)!important;
}

/* 2) '성경추리 열고개' 게임 툴바를 테마 색상으로 더 화사하게 */
.detective-toolbar{
    position:relative!important;
    overflow:hidden!important;
    min-height:62px!important;
    padding:10px 12px 10px 15px!important;
    border:
        1px solid color-mix(in srgb,var(--theme-mid) 35%,#c7d7e8)!important;
    border-radius:16px!important;
    background:
        radial-gradient(
            circle at 2% 8%,
            color-mix(in srgb,var(--theme-light) 38%,transparent),
            transparent 28%
        ),
        linear-gradient(
            110deg,
            color-mix(in srgb,var(--theme-light) 26%,white) 0%,
            #f8fbff 44%,
            color-mix(in srgb,var(--theme-light) 16%,white) 100%
        )!important;
    box-shadow:
        0 5px 18px rgba(38,79,124,.07),
        inset 0 1px 0 rgba(255,255,255,.88)!important;
}
.detective-toolbar::before{
    content:"";
    position:absolute;
    left:0;
    top:0;
    bottom:0;
    width:5px;
    background:
        linear-gradient(
            180deg,
            var(--theme-light),
            var(--theme-mid),
            var(--theme-dark)
        );
}
.detective-toolbar::after{
    content:"";
    position:absolute;
    width:170px;
    height:170px;
    right:245px;
    top:-105px;
    border-radius:50%;
    background:
        radial-gradient(
            circle,
            color-mix(in srgb,var(--theme-light) 28%,transparent),
            transparent 70%
        );
    pointer-events:none;
}
.detective-toolbar>div:first-child,
.detective-toolbar .detective-score-pill,
.detective-toolbar button{
    position:relative;
    z-index:2;
}
.detective-toolbar>div:first-child strong{
    color:#173653!important;
    font-size:15px!important;
    font-weight:950!important;
    letter-spacing:-.02em;
}
.detective-toolbar>div:first-child span{
    color:#71859b!important;
    font-weight:700!important;
}
.detective-score-pill{
    background:rgba(255,255,255,.82)!important;
    border-color:
        color-mix(in srgb,var(--theme-mid) 35%,#c5d6e8)!important;
    box-shadow:0 2px 8px rgba(38,79,124,.05)!important;
}
.detective-score-pill b{
    color:var(--theme-dark)!important;
}

/* 정답보기 버튼도 현재 테마에 자연스럽게 연결 */
.detective-toolbar .puzzle-reveal-btn{
    background:
        color-mix(in srgb,var(--theme-light) 18%,white)!important;
    border-color:
        color-mix(in srgb,var(--theme-mid) 38%,#b8cbe0)!important;
    color:var(--theme-text-dark)!important;
}
.detective-toolbar .puzzle-reveal-btn:hover:not(:disabled){
    background:
        color-mix(in srgb,var(--theme-light) 32%,white)!important;
    border-color:var(--theme-mid)!important;
}
.detective-toolbar .puzzle-secondary-btn{
    background:
        linear-gradient(
            135deg,
            color-mix(in srgb,var(--theme-mid) 80%,#28466a),
            var(--theme-dark)
        )!important;
    border-color:var(--theme-dark)!important;
    color:#fff!important;
    box-shadow:0 3px 9px color-mix(in srgb,var(--theme-dark) 20%,transparent)!important;
}

/* 3) 제시어 패널: 회색 대신 현재 게임 테마 기반의 연한 그라데이션 */
.detective-clue-panel{
    background:
        radial-gradient(
            circle at 92% 4%,
            color-mix(in srgb,var(--theme-light) 28%,transparent),
            transparent 34%
        ),
        linear-gradient(
            155deg,
            color-mix(in srgb,var(--theme-light) 18%,white) 0%,
            #f9fcff 48%,
            color-mix(in srgb,var(--theme-mid) 10%,white) 100%
        )!important;
    border-color:
        color-mix(in srgb,var(--theme-mid) 28%,#bfd0e3)!important;
}
.detective-clue-panel .puzzle-side-title strong{
    color:#173653!important;
}
.detective-clue-panel .puzzle-side-title span{
    color:#70859a!important;
}

/* 4) 오른쪽 막대그래프 카드도 같은 테마 그라데이션 */
.detective-score-panel{
    background:
        radial-gradient(
            circle at 50% 0%,
            color-mix(in srgb,var(--theme-light) 34%,transparent),
            transparent 38%
        ),
        linear-gradient(
            180deg,
            color-mix(in srgb,var(--theme-light) 21%,white) 0%,
            #f9fcff 55%,
            color-mix(in srgb,var(--theme-mid) 10%,white) 100%
        )!important;
    border-color:
        color-mix(in srgb,var(--theme-mid) 30%,#bfd0e3)!important;
}
.detective-score-panel .wordsearch-progress-title strong{
    color:#29445f!important;
}
.detective-score-panel .wordsearch-progress-title span,
.detective-score-panel .wordsearch-progress-footer strong{
    color:var(--theme-dark)!important;
}
.detective-score-panel .wordsearch-progress-track{
    background:
        linear-gradient(
            180deg,
            color-mix(in srgb,var(--theme-light) 17%,white),
            color-mix(in srgb,var(--theme-light) 7%,#edf5fb)
        )!important;
    border-color:
        color-mix(in srgb,var(--theme-mid) 30%,#bdd0e4)!important;
}

/* 다크모드: 같은 테마 감각만 남기고 충분한 대비 유지 */
html.bp-dark .detective-toolbar{
    background:
        radial-gradient(
            circle at 2% 8%,
            color-mix(in srgb,var(--theme-mid) 16%,transparent),
            transparent 28%
        ),
        linear-gradient(110deg,#152235,#111c2a 56%,#142336)!important;
    border-color:color-mix(in srgb,var(--theme-mid) 32%,#36506d)!important;
}
html.bp-dark .detective-toolbar>div:first-child strong{
    color:#edf6ff!important;
}
html.bp-dark .detective-toolbar>div:first-child span{
    color:#9fb1c3!important;
}
html.bp-dark .detective-score-pill{
    background:#17283b!important;
    color:#a9bdd1!important;
}
html.bp-dark .detective-score-pill b{
    color:color-mix(in srgb,var(--theme-light) 72%,white)!important;
}
html.bp-dark .detective-clue-panel,
html.bp-dark .detective-score-panel{
    background:
        radial-gradient(
            circle at 90% 0,
            color-mix(in srgb,var(--theme-mid) 11%,transparent),
            transparent 34%
        ),
        linear-gradient(145deg,#151f2e,#111c2a 72%,#142335)!important;
    border-color:color-mix(in srgb,var(--theme-mid) 28%,#36506d)!important;
}
html.bp-dark .detective-clue-card,
html.bp-dark .detective-clue-card b,
html.bp-dark .detective-clue-card span,
html.bp-dark .detective-clue-card:nth-child(n+6) b,
html.bp-dark .detective-clue-card:nth-child(n+6) span{
    color:#eef6ff!important;
}
html.bp-dark .detective-clue-card{
    background:
        linear-gradient(
            135deg,
            color-mix(in srgb,var(--theme-mid) calc(16% + var(--step)*2%),#132234),
            color-mix(in srgb,var(--theme-dark) calc(9% + var(--step)*2%),#111c2a)
        )!important;
}
html.bp-dark .detective-clue-panel .puzzle-side-title strong,
html.bp-dark .detective-score-panel .wordsearch-progress-title strong{
    color:#e5eef8!important;
}
html.bp-dark .detective-clue-panel .puzzle-side-title span{
    color:#9fb0c1!important;
}


/* 2026-08-13 comprehensive dark-mode patch */
html.bp-dark .detective-page{color:#dbe7f2!important}
html.bp-dark .detective-dashboard-head{background:linear-gradient(145deg,#172334,#111b29)!important;border-color:#36516d!important}
html.bp-dark .detective-dashboard-head .puzzle-title-line h2,html.bp-dark .detective-head-user .puzzle-login-user{color:#eef6ff!important}
html.bp-dark .detective-dashboard-head .puzzle-kicker,html.bp-dark .detective-brand p{color:#9eb5ca!important}
html.bp-dark .detective-head-stats .puzzle-stat-card{background:#162638!important;border-color:#36516d!important;color:#e7f1fa!important}
html.bp-dark .detective-head-user .puzzle-home{background:#17283b!important;border-color:#405f7e!important;color:#acd3f7!important}
html.bp-dark .detective-toolbar,html.bp-dark .detective-image-card,html.bp-dark .detective-clue-panel,html.bp-dark .detective-score-panel{background:linear-gradient(145deg,#151f2e,#111c2a)!important;border-color:#36506d!important;color:#dce8f3!important}
html.bp-dark .detective-image-stage{background:#0f1926!important;border-color:#344e68!important}
html.bp-dark .detective-score-pill{background:#17283b!important;border-color:#405f7e!important;color:#b8d7f4!important}
html.bp-dark .detective-answer-box{background:#111d2b!important;border-color:#334d67!important;color:#dce8f3!important}
html.bp-dark .detective-answer-box input{background:#0f1a28!important;border-color:#3a5875!important;color:#eef6ff!important}
html.bp-dark .detective-clue-card{border-color:#35516d!important}
html.bp-dark .detective-clue-card b,html.bp-dark .detective-clue-card span{color:#eef6ff!important}
html.bp-dark .detective-score-panel .wordsearch-progress-track{background:#0f1c2b!important;border-color:#3a5873!important}
html.bp-dark .detective-page .puzzle-secondary-btn,html.bp-dark .detective-page .puzzle-reveal-btn{background:#17283b!important;border-color:#405f7e!important;color:#b8d7f4!important}
html.bp-dark .puzzle-content-ad,html.bp-dark .bp-content-ad{background:#121d2b!important;border-color:#31465f!important;color:#a7b8ca!important}
html.bp-dark .puzzle-modal-card{background:#142033!important;border-color:#3b5877!important;color:#dbe7f2!important}


/* =========================================================
   DETECTIVE THEME HEADER V1
   상단 타이틀/통계바를 현재 7색 랜덤 테마와 완전히 연동
   red / orange / yellow / green / blue / indigo / purple
   ========================================================= */

/* Light mode: header shell follows selected theme */
.detective-page .detective-dashboard-head{
    background:
        radial-gradient(circle at 4% 12%,
            color-mix(in srgb,var(--theme-light) 48%,transparent),
            transparent 29%),
        radial-gradient(circle at 96% 90%,
            color-mix(in srgb,var(--theme-mid) 12%,transparent),
            transparent 24%),
        linear-gradient(112deg,
            color-mix(in srgb,var(--theme-light) 28%,white) 0%,
            #ffffff 48%,
            color-mix(in srgb,var(--theme-light) 18%,white) 100%)!important;
    border:1px solid color-mix(in srgb,var(--theme-mid) 55%,#cad8e7)!important;
    box-shadow:0 6px 20px color-mix(in srgb,var(--theme-dark) 8%,transparent)!important;
}

/* Header detective icon follows same selected theme (image is changed by JS) */
.detective-page .detective-brand>img{
    border:2px solid color-mix(in srgb,var(--theme-mid) 68%,white)!important;
    box-shadow:
        0 0 0 3px color-mix(in srgb,var(--theme-light) 45%,transparent),
        0 4px 13px color-mix(in srgb,var(--theme-dark) 15%,transparent)!important;
}

/* Header typography */
.detective-page .detective-brand .puzzle-kicker{
    color:var(--theme-dark)!important;
}
.detective-page .detective-brand .puzzle-title-line h2{
    color:var(--theme-text-dark)!important;
}
.detective-page .detective-brand .puzzle-title-line h2 small{
    color:color-mix(in srgb,var(--theme-dark) 72%,#52677e)!important;
}
.detective-page .detective-brand p{
    color:color-mix(in srgb,var(--theme-text-dark) 68%,#70859a)!important;
}

/* All four stat cards use the same page theme rather than fixed colors */
.detective-page .detective-head-stats .puzzle-stat-card{
    background:
        linear-gradient(145deg,
            #ffffff 0%,
            color-mix(in srgb,var(--theme-light) 24%,white) 100%)!important;
    border:1px solid color-mix(in srgb,var(--theme-mid) 38%,#d5e1ed)!important;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.95),
        0 3px 10px color-mix(in srgb,var(--theme-dark) 7%,transparent)!important;
}
.detective-page .detective-head-stats .puzzle-stat-title{
    color:color-mix(in srgb,var(--theme-text-dark) 80%,#334e6b)!important;
}
.detective-page .detective-head-stats .stat-copy>strong{
    color:var(--theme-text-dark)!important;
}
.detective-page .detective-head-stats .stat-copy>strong small{
    color:color-mix(in srgb,var(--theme-dark) 75%,#526b83)!important;
}

/* Remove the four fixed icon colors; all icons now track current game theme.
   Slight variation comes from mixing the same theme to preserve visual hierarchy. */
.detective-page .detective-head-stats .stat-complete .stat-icon{
    color:var(--theme-dark)!important;
}
.detective-page .detective-head-stats .stat-best .stat-icon{
    color:color-mix(in srgb,var(--theme-dark) 82%,var(--theme-mid))!important;
}
.detective-page .detective-head-stats .stat-clues .stat-icon{
    color:color-mix(in srgb,var(--theme-mid) 76%,var(--theme-dark))!important;
}
.detective-page .detective-head-stats .stat-points .stat-icon{
    color:color-mix(in srgb,var(--theme-dark) 68%,var(--theme-mid))!important;
}

/* User + home icon follow current theme */
.detective-page .detective-head-user .puzzle-login-user{
    color:var(--theme-text-dark)!important;
}
.detective-page .detective-head-user .puzzle-home{
    background:
        linear-gradient(145deg,#fff,color-mix(in srgb,var(--theme-light) 24%,white))!important;
    border:1px solid var(--theme-mid)!important;
    color:var(--theme-dark)!important;
    box-shadow:
        0 0 0 1px color-mix(in srgb,var(--theme-mid) 12%,transparent),
        0 3px 9px color-mix(in srgb,var(--theme-dark) 9%,transparent)!important;
}
.detective-page .detective-head-user .puzzle-home:hover{
    background:color-mix(in srgb,var(--theme-light) 36%,white)!important;
    border-color:var(--theme-dark)!important;
}

/* =========================================================
   DARK MODE
   Keep the background truly dark, but retain selected theme
   in borders / accents / icons, so dark mode and random theme coexist.
   ========================================================= */
html.bp-dark .detective-page .detective-dashboard-head{
    background:
        radial-gradient(circle at 4% 12%,
            color-mix(in srgb,var(--theme-mid) 10%,transparent),
            transparent 28%),
        linear-gradient(145deg,#152234 0%,#101b2a 58%,#132134 100%)!important;
    border:1px solid color-mix(in srgb,var(--theme-mid) 58%,#334c66)!important;
    box-shadow:0 7px 20px rgba(0,0,0,.18)!important;
}
html.bp-dark .detective-page .detective-brand>img{
    border:2px solid var(--theme-mid)!important;
    box-shadow:
        0 0 0 3px color-mix(in srgb,var(--theme-mid) 15%,transparent),
        0 4px 13px rgba(0,0,0,.22)!important;
}
html.bp-dark .detective-page .detective-brand .puzzle-kicker{
    color:var(--theme-mid)!important;
}
html.bp-dark .detective-page .detective-brand .puzzle-title-line h2{
    color:#f1f7fd!important;
}
html.bp-dark .detective-page .detective-brand .puzzle-title-line h2 small{
    color:#a9bfd2!important;
}
html.bp-dark .detective-page .detective-brand p{
    color:#9eb4c7!important;
}

html.bp-dark .detective-page .detective-head-stats .puzzle-stat-card{
    background:
        linear-gradient(145deg,#17283b,#132235)!important;
    border:1px solid color-mix(in srgb,var(--theme-mid) 48%,#344e68)!important;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.035),
        0 2px 7px rgba(0,0,0,.08)!important;
}
html.bp-dark .detective-page .detective-head-stats .puzzle-stat-title{
    color:#a9bfd2!important;
}
html.bp-dark .detective-page .detective-head-stats .stat-copy>strong{
    color:#f2f7fc!important;
}
html.bp-dark .detective-page .detective-head-stats .stat-copy>strong small{
    color:#9cb2c6!important;
}

/* All stat icons keep current random theme in dark mode */
html.bp-dark .detective-page .detective-head-stats .stat-icon{
    color:var(--theme-mid)!important;
}

html.bp-dark .detective-page .detective-head-user .puzzle-login-user{
    color:#eef6fd!important;
}
html.bp-dark .detective-page .detective-head-user .puzzle-home{
    background:#172a3e!important;
    border:1px solid var(--theme-mid)!important;
    color:var(--theme-mid)!important;
    box-shadow:
        0 0 0 1px color-mix(in srgb,var(--theme-mid) 18%,transparent),
        0 3px 9px rgba(0,0,0,.13)!important;
}
html.bp-dark .detective-page .detective-head-user .puzzle-home:hover{
    background:#1c334b!important;
    border-color:var(--theme-light)!important;
    color:var(--theme-light)!important;
}

.detective-question{margin:12px 0 10px;padding:12px 14px;border-radius:12px;background:rgba(255,255,255,.9);font-weight:800;font-size:17px;line-height:1.45;color:var(--theme-text-dark,#143e70);border:1px solid rgba(0,0,0,.08)}


/* =========================================================
   v23 - Chrome / Firefox 문제 이미지 FOUC 방지
   실제 이미지가 완전히 load/decode되기 전에는 img를 그리지 않습니다.
   ========================================================= */
.detective-image-stage.is-image-loading{
    background:
        linear-gradient(110deg,
            color-mix(in srgb,var(--theme-light,#dbe9f9) 82%,#fff) 8%,
            color-mix(in srgb,var(--theme-mid,#b8d2ee) 38%,#fff) 18%,
            color-mix(in srgb,var(--theme-light,#dbe9f9) 82%,#fff) 33%),
        linear-gradient(135deg,#dbe9f9,#edf5ff);
    background-size:220% 100%,100% 100%;
    animation:detectiveImageLoading 1.15s linear infinite;
}
@keyframes detectiveImageLoading{
    to{background-position:-220% 0,0 0}
}

/* src가 없거나 아직 로딩 중인 동안 Chrome broken icon / Firefox alt text를 숨김 */
.detective-case-image:not([src]),
.detective-image-stage.is-image-loading .detective-case-image{
    visibility:hidden!important;
    opacity:0!important;
}

/* 준비된 이미지에만 기존 단서 효과 적용 */
.detective-image-stage.is-image-ready .detective-case-image{
    visibility:visible!important;
    animation:detectiveImageReady .20s ease-out both;
}
@keyframes detectiveImageReady{
    from{opacity:0}
    to{opacity:.08}
}
.detective-image-stage.is-image-ready.detective-image-stage--solved .detective-case-image,
.detective-solved .detective-image-stage.is-image-ready .detective-case-image{
    animation:none;
    opacity:1!important;
}

/* 로딩 실패 시에도 깨진 이미지 아이콘/대체문구는 표시하지 않음 */
.detective-image-stage.is-image-error .detective-case-image{
    display:none!important;
}
.detective-image-stage.is-image-error{
    animation:none;
}
.detective-image-stage.is-image-error:after{
    content:"이미지를 불러오지 못했습니다.";
    position:absolute;
    inset:0;
    display:grid;
    place-items:center;
    color:#73879c;
    font-size:12px;
    font-weight:800;
    background:linear-gradient(135deg,#eef5fb,#f8fbfe);
}
html.bp-dark .detective-image-stage.is-image-loading{
    background:
        linear-gradient(110deg,#152335 8%,#21354c 18%,#152335 33%),
        #152335;
    background-size:220% 100%,100% 100%;
}
html.bp-dark .detective-image-stage.is-image-error:after{
    color:#a8b9ca;
    background:#152335;
}
