:root{font-family:Segoe UI,Helvetica Neue,Arial,sans-serif;line-height:1.4;font-weight:400;font-kerning:normal;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;color:#f4f9ff;background-color:#667eea}*,*:before,*:after{box-sizing:border-box}body{margin:0;min-height:100vh;position:relative}button{font-family:inherit;cursor:pointer}.app{min-height:100vh;height:100vh;padding:16px 12px;background:linear-gradient(135deg,#667eea,#764ba2);color:#f3f6fa;display:flex;flex-direction:column;align-items:center;gap:12px;box-sizing:border-box;overflow:hidden}.app__header{width:100%;max-width:1200px;display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px;flex-shrink:0}.app__header h1{font-size:2.2rem;font-weight:700;margin:0}.app__actions{display:flex;flex-wrap:wrap;gap:8px}.app__actions button{background:#ffffff14;color:inherit;padding:10px 16px;border-radius:8px;border:1px solid rgba(255,255,255,.25);font-size:.95rem;letter-spacing:.02em;transition:background .2s ease,transform .2s ease,box-shadow .2s ease;touch-action:manipulation}.app__actions button:hover:enabled{background:#ffffff2e;transform:translateY(-1px);box-shadow:0 8px 16px #00000047}.app__actions button:disabled{opacity:.55;cursor:not-allowed}.app__status{width:100%;max-width:1200px;display:flex;flex-wrap:wrap;justify-content:space-between;gap:8px;font-size:1rem;flex-shrink:0}.board{position:relative;margin:0 auto;padding:14px;background:#0f2836eb;border:1px solid rgba(255,255,255,.1);border-radius:18px;box-shadow:inset 0 0 0 1px #ffffff0d,0 24px 40px #00000073;overflow:hidden;flex:1 1 auto;min-height:0;max-height:100%;transition:transform .3s ease,box-shadow .3s ease}.board--won{box-shadow:inset 0 0 0 1px #ffffff2e,0 32px 48px #18c77459}.board--stuck{box-shadow:inset 0 0 0 1px #ffffff1f,0 32px 48px #ff595959}.tile{position:absolute;display:block;background:linear-gradient(135deg,#fefdfc,#ede7dd 60%,#d4c7ae);border:1px solid rgba(0,0,0,.18);border-radius:12px;box-shadow:0 6px 10px #00000059,inset 0 1px #fff6;cursor:pointer;padding:4px;transition:transform .18s ease,box-shadow .18s ease,border .18s ease,filter .18s ease;touch-action:manipulation;-webkit-tap-highlight-color:transparent;-webkit-user-select:none;user-select:none}.tile--layer-1{background:linear-gradient(135deg,#e8e0d0,#d4c7ae 60%,#b8a68a);border:1px solid rgba(0,0,0,.25);box-shadow:0 8px 14px #00000073,inset 0 1px #ffffff4d}.tile--layer-2{background:linear-gradient(135deg,#d4c7ae,#b8a68a 60%,#9d8868);border:1px solid rgba(0,0,0,.3);box-shadow:0 10px 18px #00000080,inset 0 1px #ffffff40}.tile--layer-3,.tile--layer-4,.tile--layer-5{background:linear-gradient(135deg,#b8a68a,#9d8868 60%,#7a6548);border:1px solid rgba(0,0,0,.35);box-shadow:0 12px 20px #0000008c,inset 0 1px #fff3}.tile img{width:100%;height:100%;object-fit:contain;pointer-events:none}.tile--free:hover{transform:translateY(-4px);box-shadow:0 14px 22px #00000073,inset 0 1px #ffffff80}.tile--layer-1.tile--free:hover{box-shadow:0 16px 26px #00000080,inset 0 1px #fff6}.tile--layer-2.tile--free:hover,.tile--layer-3.tile--free:hover,.tile--layer-4.tile--free:hover,.tile--layer-5.tile--free:hover{box-shadow:0 18px 30px #0000008c,inset 0 1px #ffffff59}.tile--selected{border:2px solid #5cb3ff;box-shadow:0 16px 26px #006aff59,inset 0 1px #fff9}.tile--hint{border:3px solid rgba(255,223,88,.95);box-shadow:0 18px 32px #ffce0059,inset 0 1px #ffffffb3;filter:drop-shadow(0 0 18px rgba(255,234,0,.95));animation:hint-pulse 1.2s ease-in-out infinite}.rules-backdrop{position:fixed;inset:0;background:#000000a6;display:flex;align-items:center;justify-content:center;padding:20px;z-index:2000}.rules-modal{width:min(540px,92vw);background:#0f2433;border-radius:16px;padding:24px 24px 20px;color:#f4f9ff;box-shadow:0 24px 48px #00000073;display:flex;flex-direction:column;gap:20px;position:relative;z-index:2010}.rules-modal h2{margin:0;font-size:1.6rem}.rules-modal__body{display:flex;flex-direction:column;gap:18px;max-height:60vh;overflow-y:auto;padding-right:4px}.rules-modal__body::-webkit-scrollbar{width:6px}.rules-modal__body::-webkit-scrollbar-thumb{background:#ffffff40;border-radius:999px}.rules-modal__section{display:flex;flex-direction:column;gap:10px;font-size:.96rem;line-height:1.5}.rules-modal__section h3{margin:0;font-size:1.05rem;font-weight:600;letter-spacing:.01em}.rules-modal__section p{margin:0}.rules-modal__list{margin:0;padding-left:20px;display:flex;flex-direction:column;gap:6px;line-height:1.45}.rules-modal__footer{display:flex;justify-content:flex-end}.rules-modal__footer button{background:#ffffff26;color:inherit;border:1px solid rgba(255,255,255,.25);border-radius:8px;padding:8px 14px;transition:background .2s ease}.rules-modal__footer button:hover{background:#ffffff47}@keyframes hint-pulse{0%{transform:translateY(-2px) scale(1);filter:drop-shadow(0 0 10px rgba(255,234,0,.75))}50%{transform:translateY(-4px) scale(1.03);filter:drop-shadow(0 0 20px rgba(255,234,0,1))}to{transform:translateY(-2px) scale(1);filter:drop-shadow(0 0 10px rgba(255,234,0,.75))}}@media(max-width:1024px)and (min-width:768px){.app{padding:12px 8px;gap:10px}.app__header{gap:10px}.app__header h1{font-size:1.8rem}.app__actions button{padding:8px 14px;font-size:.9rem}.board{padding:12px}}@media(max-width:767px){.app{padding:2px 4px!important;gap:3px!important}.app__header{flex-direction:column!important;align-items:stretch!important;gap:3px!important;padding:1px 0!important;margin:0!important}.app__header h1{font-size:.95rem!important;text-align:center!important;margin:0!important;line-height:1.1!important;font-weight:600!important;padding:0!important}.app__actions{justify-content:center!important;gap:3px!important;margin:0!important;padding:0!important}.app__actions button{padding:4px 6px!important;font-size:.65rem!important;flex:1 1 auto!important;min-width:0!important;line-height:1.1!important;border-radius:4px!important;margin:0!important}.app__status{font-size:.7rem!important;gap:3px!important;justify-content:center!important;text-align:center!important;line-height:1.1!important;padding:1px 0!important;margin:0!important}.board{padding:8px;border-radius:12px}.tile{border-radius:8px;padding:3px}.rules-modal{width:min(95vw,480px);padding:20px 18px 16px;max-height:90vh}.rules-modal h2{font-size:1.4rem}.rules-modal__body{max-height:calc(90vh - 120px);font-size:.9rem}.rules-modal__section{font-size:.88rem}.rules-modal__section h3{font-size:1rem}}@media(max-width:480px){.app{padding:1px 2px!important;gap:2px!important}.app__header{gap:2px!important;padding:1px 0!important}.app__header h1{font-size:.85rem!important;line-height:1.1!important}.app__actions{gap:2px!important}.app__actions button{padding:3px 5px!important;font-size:.6rem!important}.app__status{font-size:.65rem!important;gap:2px!important;padding:1px 0!important}.board{padding:6px!important}}@media(max-width:896px)and (max-height:500px)and (orientation:landscape){.app{padding:3px 4px;gap:3px;height:100vh;overflow:hidden}.app__header{flex-direction:row;gap:4px;flex-wrap:nowrap;padding:2px 0}.app__header h1{font-size:1rem;white-space:nowrap;margin:0;line-height:1.2}.app__actions{gap:3px;flex-wrap:nowrap}.app__actions button{padding:4px 6px;font-size:.65rem;white-space:nowrap;line-height:1.2}.app__status{font-size:.7rem;gap:3px;flex-wrap:nowrap;line-height:1.2;padding:2px 0}.board{padding:4px;margin:0}}@media(max-width:896px)and (max-height:400px)and (orientation:landscape){.app{padding:2px 3px;gap:2px}.app__header h1{font-size:.9rem}.app__actions button{padding:3px 5px;font-size:.6rem}.app__status{font-size:.65rem}.board{padding:3px}}
