body[data-ui="jewel-match"] .shell{max-width:1080px;padding-bottom:70px}
.jewel-intro{display:flex;justify-content:space-between;align-items:center;gap:24px;margin:25px 0 18px;padding:28px 34px;background:#fffaf1;border-radius:22px;color:#211c22;box-shadow:0 9px 30px #16423b14}
.jewel-intro img{width:98px;height:98px;object-fit:cover;border-radius:21px;box-shadow:0 8px 20px #24142628}
.jewel-intro h1{margin:4px 0 6px;font-size:clamp(32px,5vw,52px);line-height:1.05;letter-spacing:-.035em}
.jewel-intro p{margin:0;color:#625b5a;font-size:17px;line-height:1.5}
.jewel-stage{padding:24px;border-radius:24px;background:radial-gradient(circle at 50% 0,#56356c 0,#252448 55%,#132942 100%);box-shadow:0 13px 25px #16423b1c}
.jewel-panel{width:min(100%,620px);margin:auto;padding:18px 18px 12px;border:3px solid #bf985b;border-radius:21px;background:linear-gradient(135deg,#28345c,#142440 52%,#1d254b);box-shadow:0 18px 34px #080e2c99,inset 0 0 0 2px #eed39a5e;color:#fff}
.jewel-stats{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}
.jewel-stats>div{min-width:0;padding:8px 5px;text-align:center;border:1px solid #ffffff38;border-radius:12px;background:#ffffff13}
.jewel-stats span{display:block;color:#cad8e8;font-size:11px;font-weight:850;letter-spacing:.09em;text-transform:uppercase}
.jewel-stats strong{display:block;margin-top:2px;color:#fff3c8;font-size:clamp(19px,3vw,27px);font-variant-numeric:tabular-nums}
.jewel-board-shell{position:relative;width:100%;max-width:550px;margin:auto;border:6px solid #b9935a;border-radius:12px;background:#101a2b;box-shadow:0 0 0 3px #091325,0 12px 30px #02091677,inset 0 0 30px #081527;overflow:hidden}
.jewel-board-shell.combo-pulse{animation:jewel-combo-pulse .62s ease-out}
.jewel-board{display:grid;grid-template-columns:repeat(8,1fr);width:100%;aspect-ratio:1;touch-action:none;user-select:none}
.jewel-cell{position:relative;min-width:0;min-height:0;padding:3%;border:1px solid #ffffff0d;background:#223046;cursor:pointer;touch-action:none;transition:background .13s,box-shadow .13s}
.jewel-cell:nth-child(16n+1),.jewel-cell:nth-child(16n+3),.jewel-cell:nth-child(16n+5),.jewel-cell:nth-child(16n+7),.jewel-cell:nth-child(16n+10),.jewel-cell:nth-child(16n+12),.jewel-cell:nth-child(16n+14),.jewel-cell:nth-child(16n+16){background:#19273d}
.jewel-cell:hover{background:#77dbdf26}.jewel-cell:focus-visible{outline:3px solid #fff0a2;outline-offset:-3px;z-index:2}
.jewel-cell.selected{box-shadow:inset 0 0 0 3px #ffed9d,inset 0 0 18px #fff2ab9c;z-index:1}
.jewel-cell.hint{animation:jewel-hint .65s ease-in-out 3}
.jewel-gem{display:block;width:100%;height:100%;pointer-events:none;background-image:url('images/jewel-match/gem-sheet-v4.png');background-size:300% 200%;background-repeat:no-repeat;filter:drop-shadow(0 3px 2px #0009)}
.gem-ruby{background-position:0 0}.gem-sapphire{background-position:50% 0}.gem-emerald{background-position:100% 0}.gem-amethyst{background-position:0 100%}.gem-amber{background-position:50% 100%}.gem-crystal{background-position:100% 100%}
.jewel-cell.clearing .jewel-gem{animation:jewel-clear .45s ease-in forwards;animation-delay:var(--clear-delay,0ms)}
.jewel-particles{position:absolute;inset:0;z-index:3;overflow:hidden;pointer-events:none}
.jewel-shard{position:absolute;width:7px;height:12px;border-radius:2px;box-shadow:0 0 13px 2px currentColor;transform:translate(-50%,-50%);animation:jewel-shard .7s ease-out forwards}
.jewel-shard:nth-child(3n){width:5px;height:5px;border-radius:50%}
.jewel-flash-ring{position:absolute;width:15px;height:15px;border:3px solid #fff;border-radius:50%;box-shadow:0 0 13px 4px currentColor;transform:translate(-50%,-50%) scale(.2);animation:jewel-flash-ring .52s ease-out forwards}
.jewel-score-burst{position:absolute;z-index:4;white-space:nowrap;transform:translate(-50%,-50%);color:#fff9c8;font-size:clamp(16px,3vw,25px);font-weight:950;letter-spacing:.015em;text-shadow:0 2px 3px #14213c,0 0 11px #ffdc75,0 0 24px #ffad68;animation:jewel-score-rise 1.12s cubic-bezier(.15,.7,.28,1) forwards}
.jewel-cell.swap-bad{animation:jewel-shake .22s ease-in-out}
.jewel-cell .power-mark{position:absolute;right:4px;bottom:2px;display:grid;place-items:center;min-width:19px;height:19px;padding:0 2px;border-radius:5px;background:#fff7d6;color:#263858;font-size:13px;font-weight:900;box-shadow:0 2px 5px #0007;pointer-events:none}
.jewel-cell[data-power="prism"]{background:#ffe7a52b}.jewel-cell[data-power="prism"] .jewel-gem{filter:drop-shadow(0 0 7px #fff2a2)}
.jewel-overlay{position:absolute;inset:0;z-index:5;display:grid;place-items:center;background:#080e1abf;backdrop-filter:blur(3px)}.jewel-overlay[hidden]{display:none}
.jewel-overlay-card{width:min(87%,330px);padding:22px 24px;text-align:center;border:2px solid #f4d58b;border-radius:19px;background:#fff9eb;color:#212134;box-shadow:0 15px 35px #0009}.overlay-symbol{font-size:40px;color:#bd7b4a}
.jewel-overlay-card h2{margin:5px 0 8px;font-size:29px}.jewel-overlay-card p{line-height:1.5}.jewel-overlay-card button{width:100%;padding:12px;border:0;border-radius:10px;background:#2abdb7;color:#0c2730;font-weight:900;cursor:pointer}
.jewel-status{min-height:1.6em;margin:16px 4px 9px;text-align:center;color:#fff1c4;font-size:14px;font-weight:700}
.jewel-actions{display:flex;gap:8px}.jewel-actions button{flex:1;min-width:0;padding:11px 7px;border:1px solid #a7c7cd8c;border-radius:11px;background:#263c59;color:#fff;font-weight:800;cursor:pointer}.jewel-actions button:hover{background:#355377}.jewel-actions #restartButton{background:#2bbbb5;color:#062c34;border-color:#6fe1d4}
.jewel-best{display:flex;justify-content:space-between;margin:15px 3px 0;padding-top:10px;border-top:1px solid #ffffff28;font-size:14px}.jewel-best strong{color:#ffe49d;font-size:18px}
.jewel-help{margin:20px 0 0;padding:24px 28px;border-radius:20px;background:#fffaf1}.jewel-help h2{margin:0 0 12px;font-size:26px}.jewel-help div{display:grid;grid-template-columns:repeat(3,1fr);gap:18px}.jewel-help p{margin:0;color:#514b49;line-height:1.55}
@keyframes jewel-land{0%{transform:translateY(calc(var(--fall-rows,0)*-100%));opacity:.65}80%{transform:translateY(5%)}100%{transform:translateY(0);opacity:1}}
@keyframes jewel-clear{30%{transform:scale(1.3);filter:brightness(2.2) drop-shadow(0 0 15px white)}55%{transform:scale(1.05);opacity:1;filter:brightness(3)}to{transform:scale(.04);opacity:0;filter:brightness(2)}}
@keyframes jewel-shard{to{transform:translate(calc(-50% + var(--dx)),calc(-50% + var(--dy))) rotate(95deg);opacity:0}}
@keyframes jewel-flash-ring{28%{opacity:1}to{transform:translate(-50%,-50%) scale(4.8);opacity:0}}
@keyframes jewel-score-rise{0%{opacity:0;transform:translate(-50%,-35%) scale(.62)}18%{opacity:1;transform:translate(-50%,-68%) scale(1.14)}68%{opacity:1}100%{opacity:0;transform:translate(-50%,-180%) scale(.92)}}
@keyframes jewel-combo-pulse{45%{box-shadow:0 0 0 3px #ffe58b,0 0 38px 8px #ffdc7c88,inset 0 0 32px #fff6c177}to{box-shadow:0 0 0 3px #091325,0 12px 30px #02091677,inset 0 0 30px #081527}}
@keyframes jewel-hint{50%{box-shadow:inset 0 0 0 4px #ffef99,0 0 14px #fdf2a4}}
@keyframes jewel-shake{25%{transform:translateX(-4px)}75%{transform:translateX(4px)}}
@media(max-width:700px){.jewel-help div{grid-template-columns:1fr;gap:10px}.jewel-intro{padding:21px}.jewel-intro img{width:70px;height:70px}.jewel-stage{padding:12px}.jewel-panel{padding:11px}.jewel-board-shell{border-width:4px}.jewel-cell{padding:1%}.jewel-actions button{font-size:12px}}
@media(max-width:430px){.jewel-intro img{width:58px;height:58px}.jewel-stats{gap:3px}.jewel-stats strong{font-size:17px}.jewel-stats span{font-size:11px}.jewel-cell .power-mark{right:1px;bottom:0;min-width:14px;height:14px;font-size:10px}}
@media(prefers-reduced-motion:reduce){.jewel-gem,.jewel-cell.clearing .jewel-gem,.jewel-cell.hint,.jewel-cell.swap-bad,.jewel-shard,.jewel-score-burst{animation-duration:.01ms!important;animation-delay:0ms!important}}
