:root {
    --cuckoo-walnut: #4d2e1d;
    --cuckoo-brass: #b47a25;
    --cuckoo-parchment: #fff8e8;
    --cuckoo-green: #486849;
    --cuckoo-plum: #69406f;
}

.cuckoo-main {
    padding: clamp(22px, 4vw, 48px) 18px 54px;
    background:
        radial-gradient(circle at 8% 4%, rgba(234, 194, 119, .2), transparent 28rem),
        var(--color-canvas);
}

.cuckoo-header,
.case-file,
.cuckoo-layout,
.solve-panel {
    width: min(1420px, 100%);
    margin-inline: auto;
}

.cuckoo-header { margin-bottom: 22px; }
.cuckoo-header .back-link { margin-bottom: 14px; }

.cuckoo-title-row,
.section-heading-row,
.notebook-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.cuckoo-header h1 {
    margin: 10px 0 0;
    color: var(--color-brand-strong);
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2.25rem, 6vw, 4.4rem);
    line-height: .98;
    letter-spacing: -.035em;
}

.interaction-instruction {
    max-width: 720px;
    margin: 16px 0 0;
    color: var(--color-muted);
    font-size: 1.04rem;
    font-weight: 700;
}

.sound-control {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border: 1px solid #bca98f;
    border-radius: 999px;
    color: var(--color-muted);
    background: #fffaf0;
    font: inherit;
    font-size: .83rem;
    font-weight: 800;
    cursor: pointer;
}

.sound-control[aria-pressed="true"] { color: #fff; background: var(--cuckoo-green); border-color: var(--cuckoo-green); }

.case-file {
    position: relative;
    overflow: hidden;
    margin-bottom: 24px;
    padding: clamp(18px, 3vw, 28px) clamp(18px, 4vw, 36px);
    border: 1px solid #cdbd9f;
    border-left: 7px solid var(--cuckoo-brass);
    border-radius: 15px;
    background: linear-gradient(110deg, #fffdf7, #f8ead1);
    box-shadow: 0 12px 32px rgba(75, 43, 24, .09);
}

.case-file::after {
    content: "";
    position: absolute;
    width: 150px;
    height: 150px;
    right: -36px;
    bottom: -55px;
    border: 2px solid rgba(180, 122, 37, .16);
    border-radius: 50%;
    box-shadow: inset 0 0 0 18px rgba(180, 122, 37, .06), inset 0 0 0 20px rgba(180, 122, 37, .12);
}

.case-label,
.solution-kicker {
    margin: 0 0 5px;
    color: var(--cuckoo-plum);
    font-size: .72rem;
    font-weight: 900;
    letter-spacing: .13em;
    text-transform: uppercase;
}

.case-file h2,
.scene-section h2,
.investigation-panel h2,
.solve-panel h2 {
    margin: 0;
    color: var(--color-brand-strong);
    font-family: Georgia, "Times New Roman", serif;
}

.case-file > p:not(.case-label) { max-width: 920px; margin: 10px 0 0; line-height: 1.58; }

.case-file blockquote {
    max-width: 980px;
    margin: 16px 0 8px;
    padding: 14px 18px;
    border-left: 3px solid var(--cuckoo-plum);
    color: #3d2b22;
    background: rgba(255, 255, 255, .66);
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1rem, 2vw, 1.22rem);
    line-height: 1.5;
}

.case-file cite { display: block; margin-top: 7px; color: var(--color-muted); font: 700 .78rem/1.3 system-ui, sans-serif; }

.cuckoo-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(320px, .7fr);
    align-items: start;
    gap: 22px;
}

.scene-section,
.investigation-panel,
.solve-panel {
    min-width: 0;
    padding: clamp(15px, 2.4vw, 24px);
    border: 1px solid var(--color-border);
    border-radius: 18px;
    background: var(--color-surface);
    box-shadow: var(--shadow-card);
}

.found-counter {
    flex: 0 0 auto;
    padding: 7px 10px;
    border-radius: 999px;
    color: #65411e;
    background: #f5e8cc;
    font-size: .75rem;
    font-weight: 850;
}

.workshop-scene {
    position: relative;
    overflow: hidden;
    margin-top: 14px;
    border: 2px solid #6b4630;
    border-radius: 14px;
    background: #3a281d;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.2), 0 15px 34px rgba(51, 29, 17, .18);
    touch-action: manipulation;
}

.workshop-scene > img {
    width: 100%;
    height: auto;
    display: block;
}

.scene-hotspot {
    position: absolute;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    border: 0;
    border-radius: 14px;
    background: transparent;
    box-shadow: none;
    cursor: pointer;
    transition: background .16s ease, border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.scene-hotspot::after {
    content: "+";
    position: absolute;
    top: 5px;
    right: 5px;
    width: 25px;
    height: 25px;
    display: grid;
    place-items: center;
    border: 2px solid #fff8de;
    border-radius: 50%;
    color: #fff;
    background: rgba(74, 44, 28, .88);
    box-shadow: 0 2px 7px rgba(0,0,0,.3);
    font-size: 1rem;
    font-weight: 900;
    line-height: 1;
    opacity: 0;
}

.scene-hotspot span {
    position: absolute;
    left: 50%;
    bottom: 7px;
    translate: -50% 0;
    max-width: calc(100% - 12px);
    padding: 4px 7px;
    border-radius: 6px;
    color: #fff;
    background: rgba(55, 31, 19, .87);
    font: 800 clamp(.59rem, 1vw, .75rem)/1.1 system-ui, sans-serif;
    white-space: nowrap;
    opacity: 0;
    transition: opacity .16s ease;
}

.scene-hotspot:hover,
.scene-hotspot:focus-visible {
    z-index: 5;
    background: rgba(255, 219, 115, .18);
    box-shadow: inset 0 0 30px rgba(255, 232, 158, .2);
    outline: 3px solid #ffdc78;
    outline-offset: -3px;
    transform: scale(1.02);
}

.scene-hotspot:hover span,
.scene-hotspot:focus-visible span { opacity: 1; }
.scene-hotspot.is-inspected::after { content: "✓"; color: #fff; background: #3f754a; opacity: 1; }

.hotspot-door { z-index: 3; left: 47%; top: 7%; width: 12%; height: 10%; }
.hotspot-face { z-index: 3; left: 45%; top: 17%; width: 16%; height: 18%; border-radius: 50%; }
.hotspot-mechanism { z-index: 2; left: 43%; top: 35%; width: 22%; height: 13%; }
.hotspot-pendulum { z-index: 3; left: 47%; top: 48%; width: 9%; height: 13%; }
.hotspot-weights { z-index: 1; left: 43%; top: 61%; width: 18%; height: 29%; }
.hotspot-workbench { z-index: 1; left: 0; top: 52%; width: 23%; height: 13%; }
.hotspot-ticket { z-index: 3; left: 8%; top: 66%; width: 18%; height: 12%; }
.hotspot-display { z-index: 3; left: 24%; top: 43%; width: 13%; height: 22%; border-radius: 45% 45% 12px 12px; }
.hotspot-statement { z-index: 3; left: 65%; top: 29%; width: 9%; height: 19%; }
.hotspot-other-clocks { z-index: 1; left: 74%; top: 4%; width: 24%; height: 53%; }

.scene-help { margin: 11px 2px 0; color: var(--color-muted); font-size: .82rem; line-height: 1.45; }

.investigation-panel { position: sticky; top: 18px; }
.notebook-icon { color: var(--cuckoo-brass); font: 2.5rem/1 Georgia, serif; }
.observations-intro { margin: 9px 0 14px; color: var(--color-muted); font-size: .88rem; line-height: 1.5; }

.observation-list {
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
    list-style: none;
}

.observation-list li {
    position: relative;
    padding: 10px 10px 10px 36px;
    border: 1px solid #dacbb7;
    border-radius: 9px;
    color: #433128;
    background: #fffcf5;
    font-size: .84rem;
    line-height: 1.42;
}

.observation-list li:not(.empty-observation)::before {
    content: "✓";
    position: absolute;
    left: 11px;
    top: 10px;
    color: var(--cuckoo-green);
    font-weight: 950;
}

.observation-list .empty-observation { padding-left: 11px; color: var(--color-muted); font-style: italic; }

.conclusion-box,
.hint-box {
    margin-top: 18px;
    padding: 15px;
    border-radius: 12px;
}

.conclusion-box { color: #fff; background: linear-gradient(135deg, #57325d, #774c79); }
.conclusion-box h3,
.hint-box h3 { margin: 0; font-size: 1rem; }
.conclusion-box p { margin: 7px 0 13px; color: #f5eafa; font-size: .84rem; line-height: 1.45; }

.solve-button,
.hint-box button,
.solve-actions button,
.return-button,
.inspection-action button {
    min-height: 44px;
    padding: 9px 14px;
    border: 0;
    border-radius: 9px;
    font: 850 .88rem/1.2 system-ui, sans-serif;
    cursor: pointer;
}

.solve-button { width: 100%; color: #4b2c51; background: #fff; }
.hint-box { border: 1px solid #d7c59e; background: #fff6df; }
.hint-box > div { display: flex; justify-content: space-between; gap: 10px; }
.hint-box span { color: var(--color-muted); font-size: .72rem; font-weight: 800; }
.hint-box p { min-height: 2.7em; margin: 8px 0 12px; color: var(--color-muted); font-size: .82rem; line-height: 1.45; }
.hint-box button { width: 100%; color: #fff; background: var(--cuckoo-walnut); }
.hint-box button:disabled { opacity: .62; cursor: default; }

.solve-panel { margin-top: 22px; scroll-margin-top: 16px; }
.solve-panel[hidden] { display: none; }
.solve-panel fieldset { margin: 18px 0 0; padding: 0; display: grid; gap: 10px; border: 0; }
.solve-panel label { min-height: 48px; display: flex; align-items: flex-start; gap: 10px; padding: 13px 14px; border: 1px solid #d7c8b4; border-radius: 10px; background: #fffaf2; line-height: 1.45; cursor: pointer; }
.solve-panel label:has(input:checked) { border-color: var(--cuckoo-plum); box-shadow: 0 0 0 2px rgba(105,64,111,.18); }
.solve-panel input { width: 20px; height: 20px; flex: 0 0 auto; margin: 1px 0 0; accent-color: var(--cuckoo-plum); }
.solve-actions { margin-top: 15px; display: flex; flex-wrap: wrap; gap: 9px; }
.solve-actions button:first-child { color: #fff; background: var(--cuckoo-plum); }
.solve-actions button:first-child:disabled { opacity: .48; cursor: not-allowed; }
.solve-actions button:last-child { color: var(--cuckoo-walnut); border: 1px solid #cbb99f; background: #fff; }
.answer-feedback { min-height: 1.5em; margin: 12px 0 0; color: #8a391f; font-weight: 750; }
.answer-feedback.is-correct { color: #2d6840; }

.final-solution { margin-top: 15px; padding: 18px; border: 1px solid #9abc9c; border-radius: 12px; background: #eff8ed; }
.final-solution h3 { margin: 3px 0 9px; color: #254c2d; }
.final-solution p { margin: 8px 0 0; line-height: 1.55; }

.inspection-dialog {
    width: min(900px, calc(100% - 28px));
    max-height: min(760px, calc(100dvh - 28px));
    padding: 0;
    overflow: auto;
    border: 0;
    border-radius: 18px;
    color: var(--color-ink);
    background: #fffaf0;
    box-shadow: 0 28px 90px rgba(30, 17, 10, .45);
}

.inspection-dialog::backdrop { background: rgba(38, 25, 18, .72); backdrop-filter: blur(3px); }
.inspection-shell { position: relative; display: grid; grid-template-columns: minmax(250px, .9fr) minmax(0, 1.1fr); min-height: 440px; }
.dialog-close { position: absolute; z-index: 3; top: 10px; right: 10px; width: 44px; height: 44px; border: 0; border-radius: 50%; color: #fff; background: rgba(54,32,21,.88); font-size: 1.7rem; line-height: 1; cursor: pointer; }
.inspection-visual { min-height: 360px; display: grid; place-items: center; overflow: hidden; background: #38281f center / cover no-repeat; }
.inspection-copy { padding: clamp(24px, 5vw, 44px); align-self: center; }
.inspection-copy h2 { margin: 4px 0 12px; color: var(--color-brand-strong); font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.7rem, 4vw, 2.5rem); }
.inspection-copy p { line-height: 1.55; }
.inspection-copy .evidence-note { padding: 11px 13px; border-left: 4px solid var(--cuckoo-brass); background: #fff1cf; }
.return-button { margin-top: 16px; color: #fff; background: var(--cuckoo-walnut); }
.inspection-action { margin-top: 13px; }
.inspection-action button { color: #fff; background: var(--cuckoo-plum); }

.detail-clock { position: relative; width: min(260px, 74%); aspect-ratio: 1; border: 16px solid #5c3825; border-radius: 50%; background: #f8e7bd; box-shadow: 0 0 0 7px #ad762b, 0 16px 30px rgba(0,0,0,.3); }
.detail-clock::before { content: "XII\A\A IX                 III\A\A VI"; white-space: pre; position: absolute; inset: 13px; color: #35251b; text-align: center; font: 800 1.35rem/2.75 Georgia, serif; }
.clock-hand { position: absolute; z-index: 2; left: 50%; bottom: 50%; width: 5px; border-radius: 5px; background: #25201d; transform-origin: center bottom; transition: transform .8s cubic-bezier(.4,.05,.2,1); }
.clock-hand-hour { height: 29%; transform: translateX(-50%) rotate(90deg); }
.clock-hand-minute { height: 39%; transform: translateX(-50%) rotate(0deg); }
.detail-clock.show-240 .clock-hand-hour { transform: translateX(-50%) rotate(80deg); }
.detail-clock.show-240 .clock-hand-minute { transform: translateX(-50%) rotate(-120deg); }
.clock-pin { position: absolute; z-index: 4; left: 50%; top: 50%; width: 18px; height: 18px; translate: -50% -50%; border: 4px solid #6c441c; border-radius: 50%; background: #d99a31; }

.detail-door { position: relative; width: 190px; height: 230px; border: 12px solid #5a3422; background: #2a1d17; box-shadow: 0 18px 28px rgba(0,0,0,.32); }
.detail-door .cuckoo-bird { position: absolute; left: 50%; top: 50%; width: 112px; translate: -50% -50%; color: #c69752; filter: drop-shadow(0 4px 3px rgba(0,0,0,.42)); }
.detail-door .cuckoo-bird svg { width: 100%; height: auto; display: block; overflow: visible; }
.detail-door .cuckoo-bird .bird-body { fill: currentColor; stroke: #f1d18f; stroke-width: 2; }
.detail-door .cuckoo-bird .bird-wing { fill: #85562f; stroke: #e5b866; stroke-width: 2; }
.detail-door .cuckoo-bird .bird-beak { fill: #dba845; stroke: #f3d58e; stroke-width: 1.5; }
.detail-door .cuckoo-bird .bird-eye { fill: #24170f; }
.detail-door .cuckoo-bird .bird-perch { fill: none; stroke: #bd8440; stroke-width: 6; stroke-linecap: round; }
.detail-door .door-panel { position: absolute; inset: 0; display: grid; place-items: center; color: #d9a968; border: 5px ridge #8a5c36; background: #71452c; transform-origin: left center; transition: transform .65s ease; backface-visibility: hidden; font-size: 3rem; }
.detail-door.is-open .door-panel { transform: perspective(400px) rotateY(-82deg); }

.mechanism-demo { width: min(310px, 82%); height: 240px; position: relative; }
.gear { position: absolute; display: grid; place-items: center; border: 12px dotted #d49a39; border-radius: 50%; color: #e7bd67; background: #55371f; font-size: 2rem; transition: rotate .9s ease; }
.gear-one { width: 110px; height: 110px; left: 8px; top: 55px; }
.gear-two { width: 90px; height: 90px; right: 12px; top: 70px; opacity: .65; }
.mechanism-demo.trace .gear-one { rotate: 110deg; }
.mechanism-demo.trace .gear-two { rotate: 0deg; }
.broken-link { position: absolute; left: 50%; top: 50%; translate: -50% -50%; padding: 6px 9px; border: 2px solid #f4d18c; color: #fff4d6; background: #6b3429; font-weight: 900; }

.detail-ticket { width: min(300px, 78%); padding: 22px; rotate: -3deg; color: #3f3027; border: 1px solid #c4aa78; background: #f8e4ad; box-shadow: 0 12px 28px rgba(0,0,0,.3); font-family: Georgia, serif; }
.detail-ticket strong { display: block; margin-bottom: 13px; padding-bottom: 8px; border-bottom: 2px solid #7f653d; letter-spacing: .08em; }
.detail-ticket p { margin: 7px 0; }

@media (max-width: 980px) {
    .cuckoo-layout { grid-template-columns: 1fr; }
    .investigation-panel { position: static; }
    .observation-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
    .site-frame[data-page="picture-mystery"] { height: auto; min-height: 100%; overflow: visible; }
    .site-frame[data-page="picture-mystery"] .site-main { overflow: visible; }
    .cuckoo-main { padding: 18px 10px 36px; }
    .cuckoo-title-row { display: block; }
    .sound-control { margin-top: 14px; }
    .case-file { border-left-width: 5px; }
    .section-heading-row { align-items: flex-end; }
    .workshop-scene { border-radius: 10px; }
    .scene-hotspot { min-width: 38px; min-height: 38px; border-radius: 10px; }
    .scene-hotspot::after { width: 22px; height: 22px; top: 3px; right: 3px; font-size: .85rem; }
    .scene-hotspot span { display: none; }
    .observation-list { grid-template-columns: 1fr; }
    .inspection-shell { grid-template-columns: 1fr; }
    .inspection-visual { min-height: 270px; }
    .inspection-copy { padding: 22px 18px 24px; }
    .inspection-dialog { width: calc(100% - 16px); max-height: calc(100dvh - 16px); }
    .solve-actions { display: grid; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

@media print {
    body[data-puzzle="cuckoo-that-lied"] { display: none !important; }
}
