:root {
  --ink: #4f5665;
  --muted: #9ba3b0;
  --paper: #f7f8fa;
  --blue: #78d5f6;
  --pink: #ef71b4;
  --shadow: 0 8px 18px rgba(111, 121, 140, .13);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: #dfeaf1; color: var(--ink); font-family: "Arial Rounded MT Bold", "Microsoft YaHei", sans-serif; }
button { font: inherit; border: 0; cursor: pointer; color: inherit; }
.phone-shell { position: relative; width: min(100vw, 430px); min-height: 100vh; margin: 0 auto; padding: 16px 18px 20px; overflow: hidden; background: linear-gradient(#f4f6f9 0%, #f8f8f9 70%, #eef1f5 100%); }
.topbar, .level-line, .tray-title, .tools { display: flex; align-items: center; justify-content: space-between; }
.topbar { height: 34px; font-size: 12px; color: #7b8491; }
.brand { font-size: 15px; font-weight: 900; color: #566273; letter-spacing: 1px; }
.top-stat { display: flex; align-items: center; gap: 5px; font-weight: 700; }
.bolt { color: #69d9e9; font-size: 15px; text-shadow: 1px 1px #9dced6; }.timer { color: #737b87; }.timer span:first-child { color: #e6a64d; font-size: 17px; }
.level-line { justify-content: center; gap: 13px; height: 38px; color: #8e96a2; font-size: 12px; }.level-line strong { color: #626c7d; }.round-icon { position: absolute; background: #fff; width: 28px; height: 28px; border-radius: 50%; box-shadow: var(--shadow); color: #adb4c0; font-size: 17px; }.round-icon:first-child { left: 18px; }.round-icon:last-child { right: 18px; font-size: 15px; }
.game-stage { text-align: center; padding-top: 10px; }.stage-caption { color: #a3a9b3; font-size: 12px; margin-bottom: 12px; }
.board-wrap { position: relative; width: 100%; min-height: 300px; display: flex; align-items: center; justify-content: center; }
.board { display: grid; grid-template-columns: repeat(var(--cols), 1fr); gap: 3px; width: min(86vw, 350px); padding: 16px; border-radius: 15px; background: rgba(255,255,255,.5); box-shadow: inset 0 1px 0 #fff, 0 5px 17px rgba(129,140,155,.08); }
.cell { aspect-ratio: 1; border-radius: 39%; border: 1px solid rgba(210,215,223,.65); background: #eef0f3; box-shadow: inset 0 2px 4px rgba(255,255,255,.9), inset 0 -2px 4px rgba(190,197,206,.25); transition: transform .15s, background .2s; }
.cell.target { opacity: .36; }.cell.filled { opacity: 1; transform: scale(.96); border-color: rgba(255,255,255,.3); box-shadow: inset 1px 2px 2px rgba(255,255,255,.45), inset -2px -2px 3px rgba(76,75,91,.28), 0 1px 2px rgba(74,83,106,.22); }
.cell.misplaced { opacity: 1; transform: rotate(-5deg) scale(.9); border: 2px solid rgba(255,255,255,.65); box-shadow: inset 1px 2px 2px rgba(255,255,255,.48), inset -2px -2px 3px rgba(76,75,91,.28), 0 2px 4px rgba(74,83,106,.26); }
.cell.filled::after, .bead::after { content: ""; display: block; width: 36%; height: 20%; margin: 16% 0 0 17%; border-radius: 50%; background: rgba(255,255,255,.62); transform: rotate(-25deg); }
.cell.wrong { animation: shake .25s; background: #f3a9bb !important; }.cell.last { animation: pop .26s; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } } @keyframes pop { 50% { transform: scale(1.14); } }
.progress-track { width: 72%; height: 5px; margin: 6px auto 8px; border-radius: 10px; background: #e2e5ea; overflow: hidden; }.progress-bar { width: 0%; height: 100%; background: linear-gradient(90deg, #72d7ee, #8ccef2); border-radius: inherit; transition: width .35s; }.status-text { min-height: 19px; font-size: 11px; color: #afb5be; }
.tray-card { margin-top: 12px; padding: 11px 12px 10px; border-radius: 15px; background: rgba(255,255,255,.82); box-shadow: var(--shadow); }.tray-title { font-size: 11px; color: #abb1ba; margin-bottom: 8px; }.tray-title span:last-child { color: #7bd4e8; font-weight: 800; }.palette { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; min-height: 52px; }.bead { position: relative; width: 21px; height: 21px; padding: 0; border-radius: 40%; border: 2px solid rgba(255,255,255,.85); box-shadow: inset -2px -2px 3px rgba(58,59,80,.22), inset 1px 1px 2px rgba(255,255,255,.6), 0 1px 2px #ccd0d5; }.bead.selected { outline: 3px solid #71d7ed; outline-offset: 2px; transform: translateY(-3px); }.bead.empty { visibility: hidden; }.tray-slot-line { height: 7px; margin-top: 8px; border-top: 2px dotted #dce0e4; border-bottom: 2px dotted #dce0e4; }
.tools { justify-content: space-around; padding: 16px 4px 0; }.tool-btn { display: flex; flex-direction: column; align-items: center; gap: 4px; color: #b1b7bf; background: transparent; font-size: 10px; }.tool-icon { display: grid; place-items: center; width: 43px; height: 33px; border: 1px solid #dfe2e6; border-radius: 13px; background: #f8f9fa; box-shadow: 0 2px 4px rgba(130,140,153,.1); font-size: 20px; }.tool-btn.active .tool-icon { color: #f1bf3e; border-color: #f3d26d; background: #fff8db; }.wand { font-size: 22px; }
.modal { position: absolute; inset: 0; z-index: 5; display: none; align-items: center; justify-content: center; padding: 24px; background: rgba(63,72,95,.44); backdrop-filter: blur(2px); }.modal.visible { display: flex; }.modal-card { width: min(86%, 290px); padding: 20px 22px 24px; border: 3px solid #fff; border-radius: 21px; text-align: center; background: linear-gradient(#fff 0 20%, #fff2fb 100%); box-shadow: 0 15px 35px rgba(43,55,81,.22); }.modal-ribbon { display: inline-block; padding: 8px 27px; margin-top: -36px; color: white; font-size: 15px; font-weight: 900; border-radius: 13px 13px 9px 9px; background: linear-gradient(#8b83da, #776bc4); box-shadow: 0 4px 0 #635aaf; }.modal-tip { color: #9b849d; font-size: 12px; line-height: 1.7; margin: 16px 0; }.primary-btn { width: 80%; padding: 12px; border-radius: 13px; color: #946a1e; font-size: 15px; font-weight: 900; background: linear-gradient(#ffe47d, #ffc94b); box-shadow: 0 4px 0 #e4ad37, 0 8px 13px rgba(231,181,63,.26); }.mini-preview { width: 104px; height: 88px; margin: 20px auto 5px; display: grid; grid-template-columns: repeat(8,1fr); gap: 2px; align-content: center; }.mini-preview i { width: 10px; height: 10px; border-radius: 35%; }.complete-icon { color: #ffd354; font-size: 45px; text-shadow: 0 2px #efa94e; margin: -4px 0 8px; }.complete-card .modal-ribbon { background: linear-gradient(#f18bb8,#de5c9d); box-shadow: 0 4px 0 #c64d8c; }
.sparkles { position: absolute; inset: 0; pointer-events: none; }.sparkles::after { content: "✦  ·  ✧"; color: #f5d75f; font-size: 24px; opacity: 0; }.sparkles.show::after { animation: sparkle 1s ease-out; } @keyframes sparkle { 0% { opacity: 0; transform: scale(.4); } 35% { opacity: 1; transform: scale(1.4); } 100% { opacity: 0; transform: scale(1.8); } }
@media (min-height: 800px) { .board-wrap { min-height: 390px; } }
