:root { color-scheme: light; }
body { font-family: "Hiragino Maru Gothic ProN", "Hiragino Sans", sans-serif; margin: 0; background: #f7f3ea; color: #333; }
header { display: flex; gap: 16px; padding: 10px 16px; background: #fff; border-bottom: 2px solid #d9c9a8; }
header a { color: #2f6b3a; font-weight: bold; text-decoration: none; }
main { max-width: 880px; margin: 0 auto; padding: 16px; }
.intro h1 { font-size: 24px; margin: 4px 0 8px; }
.intro p { line-height: 1.8; font-size: 15px; }
.level-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.level-card { text-align: left; background: #fff; border: 2px solid #d9c9a8; border-radius: 12px; padding: 10px; cursor: pointer; display: flex; flex-direction: column; gap: 6px; font: inherit; }
.level-card img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; }
.level-name { font-weight: bold; font-size: 16px; }
.level-meta { font-size: 13px; color: #666; }
.cleared { color: #2f8b3a; font-weight: bold; }
.game-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.game-head h2 { font-size: 20px; margin: 0; }
.game-head .moves { margin: 0; font-size: 15px; }
button { font: inherit; font-size: 15px; padding: 8px 16px; border-radius: 999px; border: 2px solid #8a6d3b; background: #fff; cursor: pointer; }
button:disabled { opacity: .45; cursor: default; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 0; }
.chip { border: 2px solid; border-radius: 999px; padding: 3px 12px; font-size: 14px; background: #fff; display: inline-flex; align-items: center; gap: 6px; }
.chip .dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.message { min-height: 1.6em; font-size: 15px; color: #a33; margin: 8px 0; }
.board-wrap { max-width: 720px; margin: 0 auto; }
.board { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #d9c9a8; border: 6px solid #8a6d3b; border-radius: 10px; box-sizing: border-box; touch-action: none; overflow: hidden; }
.tile { position: absolute; box-sizing: border-box; border: 1.5px solid rgba(255,255,255,.75); border-radius: 4px; cursor: pointer; transition: left .13s, top .13s; background-repeat: no-repeat; }
.tile.frozen { cursor: not-allowed; filter: saturate(.55) brightness(.92); }
.tile.hint { outline: 4px solid #ffcf3f; outline-offset: -4px; z-index: 2; }
.badge { position: absolute; right: 4px; top: 4px; min-width: 24px; height: 24px; border-radius: 999px; color: #fff; font-size: 13px; font-weight: bold; display: flex; align-items: center; justify-content: center; padding: 0 5px; border: 2px solid #fff; box-sizing: border-box; z-index: 2; }
.badge.key svg { width: 15px; height: 15px; display: block; }
.lock-visual { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.lock-visual .chain { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .85; }
.lock-visual .padlock { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); height: 62%; aspect-ratio: 1; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .4)); }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.tile.shake { animation: shake .3s; }
.sample { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .88; z-index: 3; pointer-events: none; }
.win { position: absolute; inset: 0; background: rgba(255, 252, 240, .92); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; z-index: 4; text-align: center; }
.win-title { font-size: 26px; margin: 0; }
.controls { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin: 14px 0; }
.thumb { max-width: 240px; margin: 8px auto; text-align: center; }
.thumb img { width: 100%; border-radius: 8px; border: 2px solid #d9c9a8; }
.thumb figcaption { font-size: 13px; color: #666; margin-top: 4px; }
footer { max-width: 880px; margin: 0 auto; padding: 0 16px 24px; font-size: 14px; line-height: 1.8; }
