.game-page[data-game-id="match-three-quest"]{padding-top:18px;display:grid;grid-template-columns:minmax(0,1.16fr) minmax(420px,.84fr);column-gap:14px;row-gap:6px}
.game-page[data-game-id="match-three-quest"]>.crumbs{grid-column:1/-1}
.game-page[data-game-id="match-three-quest"]>h1{grid-column:1;grid-row:2;margin:12px 0 0;font-size:clamp(3rem,3.6vw,4rem)}
.game-page[data-game-id="match-three-quest"]>.lede{grid-column:1;grid-row:3;margin:0;font-size:.82rem;line-height:1.45}
.game-page[data-game-id="match-three-quest"]>.play-layout,.game-page[data-game-id="match-three-quest"]>.play-layout>section{display:contents}
.game-page[data-game-id="match-three-quest"] .mode-bar{grid-column:2;grid-row:2/4;margin:12px 0 0}
.game-page[data-game-id="match-three-quest"] .mode-bar>div{display:grid;align-content:center;padding:9px 12px}
.game-page[data-game-id="match-three-quest"] .mode-bar h2{margin-bottom:7px;font-size:1.05rem}
.game-page[data-game-id="match-three-quest"] .difficulty button{padding:7px 4px}
.game-page[data-game-id="match-three-quest"] .game-shell{grid-column:1/-1;grid-row:4;margin-top:4px}
.game-page[data-game-id="match-three-quest"]>.game-info{grid-column:1/-1;grid-row:5}
.game-shell:has(.mtq-game){min-height:0;grid-template-columns:minmax(0,1fr);gap:8px;padding:10px;background:#020b18 url('/assets/match-three-quest-backdrop.webp') center/cover no-repeat}
.game-shell:has(.mtq-game) .game-root{min-height:0}
.game-shell:has(.mtq-game) .game-status{flex-direction:row;align-items:center;justify-content:space-between;gap:18px;padding:8px 12px;background:#04101de8}
.game-shell:has(.mtq-game) .game-status strong{max-width:68%}
.game-shell:has(.mtq-game) .game-tools{flex-direction:row;padding:0}
.game-shell:has(.mtq-game) .game-tools button{flex:1;padding:9px 8px;text-align:center}

.mtq-game{--mtq-night:#020b18;--mtq-panel:#07182a;--mtq-panel-2:#0b2135;--mtq-line:#9b7a43;--mtq-gold:#e2ba69;--mtq-paper:#f4e8c7;--mtq-muted:#a8bbc4;--mtq-cyan:#67d8e4;--mtq-coral:#e85e3f;min-width:0;width:min(100%,1180px);display:grid;gap:8px;color:var(--mtq-paper);font-family:Inter,"Segoe UI",sans-serif}
.mtq-topbar{display:grid;grid-template-columns:116px 116px minmax(220px,1fr) auto;align-items:stretch;gap:8px}
.mtq-readout,.mtq-title,.mtq-top-actions button{border:1px solid var(--mtq-line);border-radius:7px;background:linear-gradient(180deg,#0b2137f2,#061523f5);box-shadow:inset 0 0 0 2px #102c42,0 5px 14px #0008}
.mtq-readout{min-width:0;display:grid;place-items:center;align-content:center;gap:2px;padding:7px 10px;text-align:center}
.mtq-readout small{color:var(--mtq-gold);font:800 .53rem "Barlow Condensed",sans-serif;letter-spacing:.13em;text-transform:uppercase}
.mtq-readout strong{font:800 1.25rem Georgia,"Times New Roman",serif}
.mtq-title{display:grid;place-items:center;padding:8px 18px;color:var(--mtq-gold);font:700 clamp(1.35rem,3vw,2.25rem)/1 Georgia,"Times New Roman",serif;letter-spacing:.055em;text-align:center;text-transform:uppercase;text-shadow:0 2px 0 #000}
.mtq-top-actions{display:grid;grid-template-columns:repeat(3,minmax(72px,1fr));gap:8px}
.mtq-top-actions button{min-width:76px;display:grid;place-items:center;align-content:center;gap:2px;padding:6px 9px;color:var(--mtq-paper);font:800 .58rem "Barlow Condensed",sans-serif;letter-spacing:.07em;text-transform:uppercase;cursor:pointer}
.mtq-top-actions svg{width:18px;height:18px;fill:none;stroke:var(--mtq-gold);stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.mtq-top-actions button:hover:not(:disabled),.mtq-top-actions button:focus-visible{border-color:var(--mtq-paper);outline:2px solid var(--mtq-paper);outline-offset:2px}
.mtq-top-actions button:disabled{opacity:.42;cursor:not-allowed}

.mtq-layout{min-width:0;display:grid;grid-template-columns:minmax(0,1fr) 248px;align-items:start;gap:8px}
.mtq-board-wrap{position:relative;isolation:isolate;min-width:0;display:grid;place-items:center;padding:10px;border:1px solid var(--mtq-line);border-radius:8px;background:#030a12d9;box-shadow:inset 0 0 32px #000c,0 12px 34px #0009}
.mtq-board{width:min(100%,690px);aspect-ratio:1;display:grid;grid-template-columns:repeat(8,1fr);grid-template-rows:repeat(8,1fr);gap:4px;padding:8px;border:2px solid #8f764e;border-radius:8px;background:linear-gradient(135deg,#202a31,#0a1219 55%,#18232b);box-shadow:inset 0 0 0 3px #05090c,inset 0 0 32px #000,0 0 0 2px #2c3941;touch-action:manipulation}
.mtq-tile{position:relative;min-width:0;min-height:0;display:grid;place-items:center;overflow:hidden;border:1px solid #384957;border-radius:5px;background:radial-gradient(circle at 35% 28%,#253744,#101a22 58%,#080e13);box-shadow:inset 0 1px 0 #52636c,inset 0 -2px 5px #0008;cursor:pointer;transition:border-color .14s,background .14s,transform .14s}
.mtq-tile:nth-child(odd){background:radial-gradient(circle at 35% 28%,#2a3b46,#111b23 58%,#080e13)}
.mtq-tile:hover:not(:disabled){border-color:#829aa6;background:radial-gradient(circle at 35% 28%,#314856,#13212b 58%,#080e13)}
.mtq-tile:focus-visible{z-index:4;outline:3px solid var(--mtq-paper);outline-offset:-3px}
.mtq-tile.selected{z-index:3;border-color:var(--mtq-gold);box-shadow:inset 0 0 0 2px var(--mtq-gold),inset 0 0 18px #d8a93d55,0 0 13px #e2ba698c;transform:translateY(-1px)}
.mtq-tile.hinted{animation:mtq-hint .7s ease-in-out infinite alternate;border-color:var(--mtq-cyan)}
.mtq-tile.invalid{animation:mtq-shake .28s ease both;border-color:var(--mtq-coral)}
.mtq-tile.matched .mtq-relic{animation:mtq-clear .32s ease both}
.mtq-relic{width:92%;height:92%;display:block;background-image:url('/assets/match-three-quest-relics.webp');background-repeat:no-repeat;background-size:600% 100%;background-position:calc(var(--mtq-type) * 20%) center;filter:drop-shadow(0 3px 2px #000b);pointer-events:none;will-change:transform,opacity}
.mtq-tile[data-type="0"] .mtq-relic{--mtq-type:0}.mtq-tile[data-type="1"] .mtq-relic{--mtq-type:1}.mtq-tile[data-type="2"] .mtq-relic{--mtq-type:2}.mtq-tile[data-type="3"] .mtq-relic{--mtq-type:3}.mtq-tile[data-type="4"] .mtq-relic{--mtq-type:4}.mtq-tile[data-type="5"] .mtq-relic{--mtq-type:5}
.mtq-game[data-phase="resolving"] .mtq-relic{animation:mtq-settle .22s ease both}

.mtq-overlay,.mtq-pause-cover{position:absolute;z-index:20;inset:10px;display:grid;place-items:center;border-radius:7px;background:#020b18df;backdrop-filter:blur(4px)}
.mtq-overlay[hidden],.mtq-pause-cover[hidden]{display:none}
.mtq-dialog{width:min(78%,430px);display:grid;gap:10px;padding:clamp(20px,4vw,34px);border:1px solid var(--mtq-line);border-radius:8px;background:linear-gradient(180deg,#0a2036f7,#051421f7);box-shadow:inset 0 0 0 2px #15334a,0 20px 50px #000c;text-align:center}
.mtq-dialog small{color:var(--mtq-cyan);font:800 .56rem "Barlow Condensed",sans-serif;letter-spacing:.16em;text-transform:uppercase}
.mtq-dialog strong,.mtq-pause-cover strong{color:var(--mtq-paper);font:700 clamp(1.6rem,4vw,2.5rem)/1 Georgia,"Times New Roman",serif}
.mtq-dialog p,.mtq-pause-cover p{margin:0;color:var(--mtq-muted);font-size:.72rem;line-height:1.55}
.mtq-dialog button,.mtq-pause-cover button{min-height:44px;border:1px solid #f2d797;border-radius:5px;background:linear-gradient(#f1d48e,#c99635);color:#07131c;font:900 .75rem "Barlow Condensed",sans-serif;letter-spacing:.08em;text-transform:uppercase;box-shadow:inset 0 1px 0 #fff8,0 4px 0 #77511b;cursor:pointer}
.mtq-dialog button:hover,.mtq-dialog button:focus-visible,.mtq-pause-cover button:hover,.mtq-pause-cover button:focus-visible{outline:3px solid white;outline-offset:3px}
.mtq-pause-cover{align-content:center;gap:10px}.mtq-pause-cover button{min-width:150px;padding-inline:20px}

.mtq-quest{min-width:0;display:grid;align-content:start;gap:8px;padding:10px;border:1px solid var(--mtq-line);border-radius:8px;background:linear-gradient(180deg,#081d30f2,#04111ff2);box-shadow:inset 0 0 0 2px #123047,inset 0 0 30px #0009,0 12px 34px #0008}
.mtq-quest h3{margin:2px 0 4px;color:var(--mtq-gold);font:700 1.35rem Georgia,"Times New Roman",serif;text-align:center}
.mtq-route{position:relative;display:grid;gap:9px}.mtq-route::before{content:"";position:absolute;left:19px;top:29px;bottom:29px;border-left:2px dashed #b9944c99}
.mtq-objective{position:relative;z-index:1;min-height:92px;display:grid;grid-template-columns:38px 1fr;align-items:center;gap:8px;padding:8px;border:1px solid #51606a;border-radius:6px;background:#0a1721d9;color:#82939c;transition:.2s}
.mtq-objective.active{border-color:var(--mtq-gold);background:linear-gradient(135deg,#34250f,#121d22 58%);color:var(--mtq-paper);box-shadow:inset 0 0 15px #d6a94720}
.mtq-objective.complete{border-color:#4d8f7c;background:#09251f;color:#b9e2d1}
.mtq-step{width:38px;aspect-ratio:1;display:grid;place-items:center;border:1px solid currentColor;border-radius:50%;background:#071520;font:800 1rem Georgia,"Times New Roman",serif}
.mtq-objective.active .mtq-step{color:var(--mtq-gold);box-shadow:0 0 10px #e2ba6966}.mtq-objective.complete .mtq-step{color:#84d9b6}
.mtq-objective-copy{min-width:0;display:grid;grid-template-columns:36px 1fr;align-items:center;column-gap:7px}
.mtq-mini-relic{width:36px;aspect-ratio:1;grid-row:1/3;background:url('/assets/match-three-quest-relics.webp') no-repeat;background-size:600% 100%;background-position:calc(var(--mtq-type) * 20%) center;filter:drop-shadow(0 2px 1px #0008)}
.mtq-objective-copy small{font:800 .5rem "Barlow Condensed",sans-serif;letter-spacing:.08em;text-transform:uppercase}.mtq-objective-copy strong{font-size:.82rem}.mtq-objective-copy b{grid-column:2;color:var(--mtq-gold);font:800 .76rem "Barlow Condensed",sans-serif}
.mtq-objective.complete .mtq-objective-copy b{color:#84d9b6}
.mtq-quest-note{min-height:36px;margin:1px 0 0;color:var(--mtq-muted);font-size:.65rem;line-height:1.45;text-align:center}
.mtq-actions{display:grid;grid-template-columns:1fr;gap:7px}
.mtq-actions button{min-height:39px;border:1px solid #506977;border-radius:5px;background:#0b2538;color:var(--mtq-paper);font:800 .62rem "Barlow Condensed",sans-serif;letter-spacing:.055em;text-transform:uppercase;cursor:pointer}
.mtq-actions button:hover:not(:disabled),.mtq-actions button:focus-visible{border-color:var(--mtq-gold);outline:2px solid var(--mtq-gold);outline-offset:2px}.mtq-actions button:disabled{opacity:.42;cursor:not-allowed}
.mtq-help{margin:0;padding:6px 9px;border:1px solid #3b5361;border-radius:5px;background:#04111ee8;color:#a9bdc5;font-size:.61rem;line-height:1.45;text-align:center}
.mtq-help i{display:inline-block;width:3px;height:3px;margin:0 7px;border-radius:50%;background:var(--mtq-gold);vertical-align:middle}

@keyframes mtq-settle{from{transform:translateY(-14%);opacity:.45}to{transform:translateY(0);opacity:1}}
@keyframes mtq-clear{to{transform:scale(.35) rotate(18deg);opacity:0;filter:brightness(2) drop-shadow(0 0 8px white)}}
@keyframes mtq-hint{to{box-shadow:inset 0 0 0 2px var(--mtq-cyan),0 0 16px #67d8e48c}}
@keyframes mtq-shake{25%{transform:translateX(-4px)}50%{transform:translateX(4px)}75%{transform:translateX(-2px)}}

@media(max-width:900px){
  .game-page[data-game-id="match-three-quest"]{display:block;padding-top:14px}.game-page[data-game-id="match-three-quest"]>h1{margin-top:14px}.game-page[data-game-id="match-three-quest"]>.lede{margin:4px 0 15px}.game-page[data-game-id="match-three-quest"] .mode-bar{margin:0 0 10px}.game-page[data-game-id="match-three-quest"] .game-shell{margin-top:0}
  .mtq-topbar{grid-template-columns:92px 92px minmax(180px,1fr) auto}.mtq-layout{grid-template-columns:minmax(0,1fr) 220px}.mtq-top-actions button{min-width:64px}
}
@media(max-width:680px){
  .game-shell:has(.mtq-game){padding:6px;background-position:center top}.game-shell:has(.mtq-game) .game-status{align-items:flex-start;gap:6px;padding:7px 8px;font-size:.69rem}.game-shell:has(.mtq-game) .game-status strong{max-width:61%}
  .mtq-game{gap:6px}.mtq-topbar{grid-template-columns:1fr 1fr auto;gap:5px}.mtq-title{grid-column:1/-1;grid-row:1;min-height:46px;font-size:1.35rem}.mtq-readout{grid-row:2;min-height:46px;padding:4px 7px}.mtq-readout strong{font-size:1.04rem}.mtq-top-actions{grid-column:3;grid-row:2;gap:5px}.mtq-top-actions button{min-width:54px;padding:4px 6px;font-size:.49rem}.mtq-top-actions svg{width:15px;height:15px}
  .mtq-layout{display:grid;grid-template-columns:1fr;gap:6px}.mtq-board-wrap{padding:5px}.mtq-board{gap:2px;padding:5px;border-width:1px}.mtq-tile{border-radius:3px}.mtq-overlay,.mtq-pause-cover{inset:5px}.mtq-dialog{width:min(84%,360px);padding:18px 16px}.mtq-dialog p{font-size:.67rem}
  .mtq-quest{padding:7px;gap:6px}.mtq-quest h3{font-size:1.05rem}.mtq-route{grid-template-columns:repeat(3,minmax(0,1fr));gap:5px}.mtq-route::before{left:15%;right:15%;top:16px;bottom:auto;border-left:0;border-top:2px dashed #b9944c99}.mtq-objective{min-height:78px;grid-template-columns:28px minmax(0,1fr);gap:3px;padding:5px}.mtq-step{width:28px}.mtq-objective-copy{grid-template-columns:25px minmax(0,1fr);column-gap:3px}.mtq-mini-relic{width:25px}.mtq-objective-copy small{font-size:.39rem}.mtq-objective-copy strong{font-size:.56rem;line-height:1.05;overflow-wrap:anywhere}.mtq-objective-copy b{font-size:.56rem}.mtq-quest-note{min-height:0;font-size:.58rem}.mtq-help{font-size:.55rem}
}
@media(max-width:410px){.game-page[data-game-id="match-three-quest"]>h1{font-size:2.45rem}.mtq-route{gap:3px}.mtq-objective{grid-template-columns:24px 1fr}.mtq-step{width:24px;font-size:.75rem}.mtq-objective-copy{grid-template-columns:21px 1fr}.mtq-mini-relic{width:21px}.mtq-objective-copy strong{font-size:.52rem}.mtq-top-actions button{min-width:49px}.mtq-board{gap:1px}}
@media(prefers-reduced-motion:reduce){.mtq-tile,.mtq-relic{animation:none!important;transition:none!important}}
