/* 既存の乾いた石・墨・血赤・古金を、前面の小さな遊びにも引き継ぐ。 */
.kwc-experience[hidden] { display: none !important; }
.kwc-experience { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); background: rgba(3,2,2,.88); overflow: auto; overscroll-behavior: contain; touch-action: pan-y; }
.kwc-stone-panel { position: relative; width: min(560px, 100%); max-height: calc(100dvh - 28px); overflow: auto; padding: 24px; border: 1px solid #6a4b2f; outline: 1px solid #241810; outline-offset: -7px; background: radial-gradient(ellipse at 30% 10%, rgba(93,68,45,.2), transparent 70%), repeating-linear-gradient(24deg, rgba(139,113,79,.018) 0 1px, transparent 1px 5px), #120d0a; box-shadow: 0 14px 60px #000, inset 0 1px 0 #624d3038; color: var(--fg, #e9e3d5); font-family: var(--ui, serif); }
.kwc-stone-panel h2 { margin: 0 44px 12px 0; font-size: 1.25rem; font-weight: 400; letter-spacing: .13em; line-height: 1.5; color: #d5bc82; }
.kwc-stone-panel p { font-size: .86rem; line-height: 1.85; margin: 0 0 14px; overflow-wrap: anywhere; }
.kwc-stone-panel .kwc-faint { color: #b3a38b; font-size: .76rem; }
.kwc-stone-panel button, .kwc-stone-panel .kwc-link { min-height: 44px; font-family: inherit; font-size: .84rem; color: #e4d8be; background: #1e140e; border: 1px solid #674b2b; padding: 10px 12px; cursor: pointer; text-decoration: none; line-height: 1.4; border-radius: 2px; }
.kwc-stone-panel button:hover, .kwc-stone-panel .kwc-link:hover { background: #302014; border-color: #ac8748; }
.kwc-stone-panel button:focus-visible, .kwc-stone-panel .kwc-link:focus-visible { outline: 2px solid #e6c174; outline-offset: 3px; }
.kwc-stone-panel button:disabled { opacity: .48; cursor: default; }
.kwc-stone-panel .kwc-close { position: absolute; right: 12px; top: 12px; padding: 7px 12px; min-width: 44px; background: transparent; font-size: 1.4rem; line-height: 1; border-color: #44301c; }
.kwc-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 15px; }
.kwc-actions > * { flex: 1 1 auto; text-align: center; }
.kwc-status { min-height: 1.8em; margin-top: 12px !important; color: #cfab62; }
.kwc-circuit { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; position: relative; margin: 8px 0; }
.kwc-circuit-cell { position: relative; aspect-ratio: 1; padding: 0 !important; min-width: 0; background: #251a12 !important; box-shadow: inset 0 2px 6px #0008; }
.kwc-circuit-cell canvas { width: 100%; height: 100%; }
.kwc-circuit-cell .kwc-cell-number { position: absolute; left: 6px; top: 3px; font-size: .72rem; color: #b3a38b; }
.kwc-circuit-cell.is-connected { border-color: #8a682c; }
.kwc-circuit-cell.is-solved { border-color: #d1aa5b; }
.kwc-circuit-port { font-size: .78rem; color: #d7b15b; margin: 4px 0; }
.kwc-circuit-port.kwcout { text-align: right; }
.kwc-step-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.kwc-step { position: relative; padding: 10px 4px !important; min-width: 0; min-height: 86px !important; }
.kwc-step .kwc-step-number { display: block; font-size: .72rem; color: #b3a38b; }
.kwc-step .kwc-step-symbol { display: block; font-size: 1.3rem; line-height: 1.35; color: #aa9270; }
.kwc-step[data-tone="1"] .kwc-step-symbol { color: #a74432; }
.kwc-step[data-tone="2"] .kwc-step-symbol { color: #cda151; }
.kwc-step[data-tone="3"] .kwc-step-symbol { color: #e5d9bb; }
.kwc-step.is-playing { border-color: #e2bd6b; box-shadow: inset 0 0 0 1px #e2bd6b; }
.kwc-step .kwc-step-label { display: block; font-size: .76rem; }
.kwc-spotify-frame { display: block; border: 0; width: 100%; height: 352px; background: #0c0907; margin-top: 10px; }
.kwc-spotify-gate { border: 1px solid #513921; padding: 20px 14px; text-align: center; }
.kwc-spotify-gate button { margin-top: 6px; }
.kwc-spotify-gate[hidden] { display: none; }
.kwc-spotify-note { margin-top: 12px !important; }
.kwc-save-preview { display: block; width: min(100%, 300px); margin: 12px auto; border: 1px solid #785c32; }
.kwc-save-preview[hidden] { display: none; }
.kwc-status:empty { min-height: 0; margin: 0 !important; }
@media (max-width: 380px) { .kwc-stone-panel { padding: 20px 14px; } .kwc-stone-panel h2 { font-size: 1.08rem; } .kwc-step-grid, .kwc-circuit { gap: 6px; } .kwc-actions { gap: 6px; } .kwc-stone-panel button { font-size: .78rem; padding: 9px 8px; } }
@media (max-height: 600px) and (orientation: landscape) { .kwc-stone-panel { max-height: calc(100dvh - 20px); } .kwc-circuit { max-width: 300px; margin-inline: auto; } }
@media (prefers-reduced-motion: reduce) { .kwc-experience *, .kwc-experience *::before, .kwc-experience *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
