/* Selected identity 05: energetic italic wordmark and electric yellow. */
.maiolica-identity{display:inline-flex;flex-direction:column;align-items:flex-start;gap:7px;min-width:0}
.maiolica-identity .maiolica-wordmark{display:block;margin:0;font-family:Arial,Helvetica,sans-serif;font-weight:900;font-style:italic;text-transform:uppercase;font-size:48px;letter-spacing:-2px;line-height:1;color:#fff;text-shadow:none;white-space:nowrap}
.maiolica-identity .maiolica-wordmark>span{display:inline;margin:0;font:inherit;color:#f5ee68;letter-spacing:inherit}
.maiolica-identity .maiolica-tagline{display:block;margin:0;color:#afbedb;font-family:Arial,Helvetica,sans-serif;font-size:11px;letter-spacing:.3px;line-height:1.4;font-weight:500;white-space:nowrap}
.cover .maiolica-identity{gap:12px}.cover .maiolica-wordmark{font-size:clamp(48px,6vw,76px);letter-spacing:-3px}.cover .maiolica-tagline{font-size:13px;letter-spacing:.3px}
@media(max-width:850px){header .maiolica-wordmark{font-size:35px;letter-spacing:-1.5px}header .maiolica-tagline{font-size:8px;letter-spacing:.8px}header .maiolica-identity{gap:5px}}
@media(max-width:380px){header .maiolica-wordmark{font-size:30px}header .maiolica-tagline{font-size:7px;letter-spacing:.5px}.cover .maiolica-tagline{font-size:10px;letter-spacing:1px}}

/* Quiet publisher signature beneath the game wordmark. */
header .maiolica-byline{display:inline-flex;align-self:flex-start;align-items:center;gap:6px;text-decoration:none;line-height:1.2;padding:2px 0;color:#afbedb}
header .maiolica-byline .by-label{font:400 10px Arial,Helvetica,sans-serif;letter-spacing:.2px}
header .maiolica-byline .revolving-word{font-size:14px;letter-spacing:-.5px}
header .maiolica-byline .revolving-dots{gap:2px;margin-inline:2px}
header .maiolica-byline .revolving-dots i{width:3px;height:3px;border-radius:1px}
header .maiolica-byline:focus-visible{outline:2px solid #f5ee68;outline-offset:4px;border-radius:3px}
@media(max-width:600px){header .maiolica-byline{gap:5px}header .maiolica-byline .revolving-word{font-size:12px}header .maiolica-byline .by-label{font-size:9px}}

/* Temporarily hide the promotion above the game tray. */
.game .new-game-top{display:none}

/* Compact arcade level display, above the next pieces. */
.level-hud{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:10px 14px;margin:0 0 10px;border:1px solid #536b94;border-bottom:4px solid #08162e;border-radius:16px;background:linear-gradient(120deg,#122544,#253c60);color:#fff;box-shadow:inset 0 1px 0 #ffffff18}
.level-badge{display:flex;align-items:center;gap:9px}.level-badge>span{font-size:26px}.level-badge>div{display:flex;align-items:baseline;gap:9px}#level-label{font:800 10px/1.2 Arial,sans-serif;letter-spacing:1.4px;color:#f5ee68}#level-number{font:900 italic 30px/1 Arial,sans-serif;letter-spacing:-1px;font-variant-numeric:tabular-nums;text-shadow:0 3px 0 #07142d}.level-track{display:flex;flex-direction:column;align-items:flex-end;gap:6px;min-width:70px;width:42%;max-width:180px}#level-count{font:700 10px/1 Arial,sans-serif;color:#d5e1f9;font-variant-numeric:tabular-nums}#level-progress{appearance:none;border:0;display:block;width:100%;height:6px;border-radius:10px;overflow:hidden;background:#07172f}#level-progress::-webkit-progress-bar{background:#07172f}#level-progress::-webkit-progress-value{background:linear-gradient(90deg,#24bbaa,#f5ee68);border-radius:10px}#level-progress::-moz-progress-bar{background:#f5ee68}.level-up{animation:level-flash .7s ease-out}@keyframes level-flash{40%{box-shadow:0 0 20px #f5ee6880;border-color:#f5ee68}}@media(prefers-reduced-motion:reduce){.level-up{animation:none}}
.site-menu-panel .menu-player{display:flex;align-items:center;gap:10px;width:100%;padding:12px;margin-bottom:8px;border:1px solid #536b94;border-radius:12px;background:#253c60;color:#fff;text-align:start;font:700 14px/1.3 Arial,sans-serif;cursor:pointer}.menu-player[hidden]{display:none!important}.menu-player-avatar{display:grid;place-items:center;width:32px;height:32px;flex-shrink:0;border-radius:10px;background:#f5ee68;color:#142442;font-weight:900}#menu-player-name{overflow-wrap:anywhere;min-width:0}.menu-player:focus-visible{outline:3px solid #f5ee68;outline-offset:3px}

/* In-play score strip: readable, compact, and outside playable cells. */
.game .live-scores{display:grid;grid-template-columns:1fr 1fr 1fr;gap:4px 10px;margin:0 0 12px;padding:10px 4px 8px;border:0;border-bottom:1px solid #19396b26;border-radius:0;background:transparent;box-shadow:none;align-items:start}.live-scores .score-label{font-size:9px;letter-spacing:.6px;color:#375d81}.live-scores .score-number{font:900 27px/1.2 Arial,sans-serif;letter-spacing:-1px;color:#142f55;text-shadow:none;font-variant-numeric:tabular-nums}.live-scores .best{text-align:center}.live-scores .best .score-number{font-size:23px;color:#456c91}.live-scores .session-label{display:none}.world-rank-button{display:flex;flex-direction:column;align-items:flex-end;gap:2px;border:0;padding:0;min-height:44px;background:transparent;color:#142f55;cursor:pointer}.world-rank-button strong{font:900 24px/1.2 Arial,sans-serif;font-variant-numeric:tabular-nums}.world-rank-button small{font:10px/1.2 Arial,sans-serif;color:#526d89}.score-chase{grid-column:1/-1;margin:3px 0 0;text-align:center;font:700 10px/1.4 Arial,sans-serif;color:#366e7b}.world-rank-button:focus-visible{outline:3px solid #1d8eac;outline-offset:4px;border-radius:4px}
/* A translucent breathing outline separates the held piece from solid tiles. */
.board .cell.ghost{opacity:.43;background:var(--preview);border:1px dashed #e8fcff;box-shadow:inset 0 0 0 1px #e8fcff9c,inset 0 0 12px #09234666;animation:ghost-breathe 2.4s ease-in-out infinite}.board .cell.ghost:after{display:none}@keyframes ghost-breathe{0%,100%{opacity:.34}50%{opacity:.53}}@media(prefers-reduced-motion:reduce){.board .cell.ghost{animation:none;opacity:.43}}

/* Focused replay screen; no unconnected rewarded-video offers. */
#reward{display:none!important}.modal.game-over-modal{background:linear-gradient(145deg,#152b50,#0c1933);border:2px solid #6685b0;border-bottom:7px solid #071226;border-radius:28px;padding:28px 24px 24px;box-shadow:0 16px 60px #020b2666;color:#fff;max-width:360px;width:100%}.game-over-modal .eyebrow{color:#c4d4ee;font-size:10px;letter-spacing:3px}.game-over-modal h2{font:900 italic clamp(34px,9vw,46px)/1 Arial,sans-serif;letter-spacing:-2px;color:#f5ee68;margin:18px 0 24px;text-shadow:0 4px 0 #060f23}.game-over-score{display:flex;flex-direction:column;gap:7px}.game-over-score .score-label{color:#b7cbed;font-size:10px;letter-spacing:2px}.game-over-score strong{font:900 64px/1 Arial,sans-serif;letter-spacing:-3px;font-variant-numeric:tabular-nums;color:#fff;text-shadow:0 4px 0 #071226}.game-over-level{font:800 11px/1.3 Arial,sans-serif;letter-spacing:1px;color:#79dccb;margin:14px 0 22px}.game-over-modal .primary{min-height:60px;border:1px solid #fff2b4;border-bottom:5px solid #cc9827;border-radius:16px;background:#ffce3c;color:#122544;font:900 19px/1.2 Arial,sans-serif;letter-spacing:1px;margin:0;box-shadow:0 4px 0 #061329}.game-over-modal .primary:active{transform:translateY(2px)}.game-over-modal .primary:focus-visible{outline:3px solid #75e3d0;outline-offset:5px}

/* Unified status row keeps the mobile board close to the top. */
.game .compact-hud{grid-template-columns:.8fr 1fr 1fr 1fr;align-items:start;gap:4px 6px;padding:10px 8px 7px;margin:0 0 7px;border:1px solid #405c84;border-bottom:3px solid #07172f;border-radius:14px;background:linear-gradient(120deg,#122544,#253c60);color:#fff}
.compact-hud>div,.compact-hud>button{min-width:0;text-align:center}
.compact-hud .level-hud{display:flex;flex-direction:column;align-items:stretch;gap:4px;padding:0;margin:0;border:0;border-radius:0;background:none;box-shadow:none}
.compact-hud .level-badge{justify-content:center}.compact-hud .level-badge>span{display:none}.compact-hud .level-badge>div{display:flex;flex-direction:column;align-items:center;gap:2px}
.compact-hud #level-label,.compact-hud .score-label{font:800 8px/1.3 Arial,sans-serif;letter-spacing:.35px;color:#c5d7ef;min-height:11px}
.compact-hud #level-label{color:#f5ee68}.compact-hud #level-number,.compact-hud .score-number,.compact-hud .best .score-number,.compact-hud .world-rank-button strong{font:900 23px/1.1 Arial,sans-serif;letter-spacing:-.6px;color:#fff;text-shadow:none;overflow-wrap:anywhere}
.compact-hud #level-number{font-style:italic;color:#f5ee68}.compact-hud .level-track{width:100%;min-width:0;max-width:52px;align-self:center;gap:0}.compact-hud #level-count{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}.compact-hud #level-progress{height:3px}
.compact-hud .world-rank-button{align-items:center;gap:2px;min-height:44px;color:#fff}.compact-hud .world-rank-button small{font-size:8px;color:#b8cbe5}.compact-hud .score-chase{margin:0;font-size:9px;line-height:1.2;color:#a5dcd5}.compact-hud .score-chase:empty{display:none}
@media(max-width:850px){
 main{padding-top:6px;padding-inline:max(8px,env(safe-area-inset-left)) max(8px,env(safe-area-inset-right))}
 .game{padding:8px;max-width:540px}
 .game .compact-hud{margin-bottom:5px;padding:7px 6px 5px}
 .tray-heading{margin:4px 2px;gap:4px;flex-wrap:nowrap}.tray-heading span{font-size:8px}.tray-heading small{font-size:8px;letter-spacing:0}
 .tray,.piece{min-height:48px}.piece{padding:4px}.mini-cell,.mini-empty{width:11px;height:11px}
 .rotation-controls{margin:4px 0 6px;gap:4px 6px}.rotation-controls .rotate-button,.rotation-controls .reset{min-height:44px;padding:5px 8px;font-size:12px}
 #rotation-tip{display:none}
 .board-wrap{width:100%;margin:0 auto}
}
@media(max-width:360px){.compact-hud #level-label,.compact-hud .score-label{font-size:7px;letter-spacing:0}.compact-hud #level-number,.compact-hud .score-number,.compact-hud .best .score-number,.compact-hud .world-rank-button strong{font-size:21px}}
/* Short viewports retain a usable square board; the rest of the page scrolls. */
@media(max-width:850px) and (max-height:700px){.board-wrap{width:min(100%,max(240px,calc(100svh - 305px)))}}

@media(max-width:380px){
 body[data-page] header:has(.maiolica-identity){flex-wrap:nowrap;gap:5px!important;padding:8px}
 body[data-page] header .maiolica-identity{flex:1 1 0;min-width:0}
 body[data-page] header .maiolica-wordmark{font-size:26px;letter-spacing:-1.5px}
 body[data-page] header .toolbar{gap:3px;margin-inline-start:0}
 body[data-page] header .icon-button{width:40px;height:44px;min-width:40px}
 body[data-page] header .site-menu summary{padding:8px 6px;gap:3px;font-size:11px;min-height:44px}
 body[data-page] header .maiolica-byline .revolving-word{font-size:10px}
}

.compact-hud #level-label,.compact-hud .score-label{display:flex;align-items:center;justify-content:center;min-height:21px;line-height:10px}

/* Input-specific first-visit practice, separate from the live board. */
.modal.gesture-tutorial{max-width:380px;padding:22px 18px;border-radius:24px}.gesture-tutorial h2{font-size:30px;line-height:1.1;margin:12px 0}.gesture-tutorial .gesture-copy{font-size:16px;line-height:1.4;margin:0 auto 12px;max-width:290px}.gesture-stage{display:grid;place-items:center;margin:8px 0}.gesture-practice{display:grid;place-items:center;position:relative;width:170px;height:154px;border:2px solid #41638e;border-radius:24px;background:#12294d;touch-action:none;user-select:none;-webkit-touch-callout:none;z-index:1}.gesture-practice .mini-grid{gap:4px;pointer-events:none}.gesture-practice .mini-cell,.gesture-practice .mini-empty{width:32px;height:32px}.gesture-pointer{position:absolute;z-index:2;width:40px;height:50px;left:50%;top:50%;pointer-events:none;filter:drop-shadow(0 2px 2px #0006)}.gesture-pointer svg{width:100%;height:100%;overflow:visible}.gesture-pointer.tap{animation:teach-tap 2.4s infinite}.gesture-pointer.circle{animation:teach-circle 2.5s linear infinite}.gesture-practice.learned .gesture-pointer{display:none}.gesture-feedback{font-size:14px!important;line-height:1.4!important;min-height:40px;margin:10px 0!important;color:#246b73!important}.gesture-tutorial .primary,.gesture-tutorial .extra{min-height:48px;font-size:17px}.gesture-tutorial .extra{display:block;width:100%}.gesture-tutorial .eyebrow{display:flex!important}.gesture-practice:not(.learned):not(.practicing) .mini-grid{animation:teach-turn 2.4s ease-in-out infinite}.gesture-practice:has(.circle):not(.learned) .mini-grid{animation-duration:2.5s}
.drop-stage{display:flex;justify-content:space-between;align-items:center;position:relative;width:100%;max-width:280px;height:170px;margin-inline:auto}.drop-stage .gesture-practice{width:110px;height:110px;border-radius:18px}.drop-stage .mini-cell,.drop-stage .mini-empty{width:25px;height:25px}.gesture-target{display:grid;place-items:center;flex-shrink:0;width:110px;height:110px;border:2px dashed #41638e;border-radius:18px;background:#e6f0ef;color:#41638e;font-size:30px}.drop-stage .gesture-practice:not(.learned):not(.practicing){animation:teach-drag 3s ease-in-out infinite}.drop-stage .gesture-practice .mini-grid{animation:none!important}.drop-stage .gesture-practice{cursor:grab}.drop-stage .gesture-practice:active{cursor:grabbing}
@keyframes teach-tap{0%,35%,65%,100%{transform:scale(1);opacity:1}15%,48%{transform:scale(.8);opacity:.8}}
@keyframes teach-turn{0%,50%{transform:rotate(0);opacity:1}70%,90%{transform:rotate(90deg);opacity:1}99%{transform:rotate(90deg);opacity:0}100%{transform:rotate(0);opacity:0}}
@keyframes teach-circle{from{transform:rotate(0deg) translateX(22px) rotate(0deg)}to{transform:rotate(360deg) translateX(22px) rotate(-360deg)}}
@keyframes teach-drag{0%,15%{transform:translateX(0);opacity:1}65%,85%{transform:translateX(145%);opacity:1}99%{transform:translateX(145%);opacity:0}100%{transform:translateX(0);opacity:0}}
@media(prefers-reduced-motion:reduce){.gesture-pointer,.gesture-practice,.gesture-practice .mini-grid{animation:none!important}}
@media(max-height:600px){.modal.gesture-tutorial{padding:14px}.gesture-tutorial h2{font-size:26px}.gesture-practice{height:115px;width:150px}.gesture-tutorial .gesture-copy{font-size:14px}.gesture-feedback{min-height:20px}.drop-stage{height:135px}}

/* Immediate replacement: a short burst around the arriving piece. */
.piece-arrival .mini-grid{animation:piece-emerge .42s cubic-bezier(.16,1,.3,1)}
.piece-arrival:after{content:'';position:absolute;width:44px;height:44px;border:3px solid #ffe67a;border-radius:50%;pointer-events:none;animation:piece-burst .46s ease-out both}
.piece-arrival:before{content:'';position:absolute;width:6px;height:6px;border-radius:50%;background:#fff4bd;box-shadow:0 -22px #ffdc48,22px 0 #79e4de,0 22px #ffdc48,-22px 0 #79e4de,16px 16px #fff4bd,-16px -16px #fff4bd;pointer-events:none;animation:piece-sparks .46s ease-out both}
@keyframes piece-emerge{0%{transform:scale(.25);opacity:.15}65%{transform:scale(1.16);opacity:1}100%{transform:scale(1)}}
@keyframes piece-burst{0%{transform:scale(.25);opacity:.9}100%{transform:scale(1.8);opacity:0}}
@keyframes piece-sparks{0%{transform:scale(.2) rotate(0);opacity:1}100%{transform:scale(1.6) rotate(25deg);opacity:0}}
.board .cell.invalid{background:rgba(255,35,68,.66);opacity:1;border:2px dashed #ff8f9e;box-shadow:inset 0 0 12px #ff174477,0 0 7px #ff234466;animation:none}
.board .cell.invalid:after{display:none}
@media(prefers-reduced-motion:reduce){.piece-arrival .mini-grid{animation:none}.piece-arrival:before,.piece-arrival:after{display:none}}
/* Clear device demonstrations: physical mouse, key press, and two fingers. */
.mouse-stage{display:flex;align-items:center;justify-content:center;gap:25px;min-height:180px}
.mouse-stage .gesture-practice{width:150px;height:150px}
.gesture-mouse{display:block;width:64px;height:90px;flex-shrink:0;filter:drop-shadow(0 6px 0 #0002)}
.gesture-mouse svg{width:100%;height:100%}
.mouse-right-button{animation:teach-right-click 3s infinite}
.gesture-key{width:65px;height:65px;border:2px solid #14294a;border-radius:13px;background:#fff0d0;box-shadow:0 6px 0 #8196ac;font-size:34px;font-weight:900;color:#14294a;animation:teach-key 3s infinite}
.gesture-practice:not(.learned):not(.practicing) .mini-grid{animation:teach-turn 3s ease-in-out infinite}
.gesture-stage:has(.learned) .gesture-key,.gesture-stage:has(.learned) .mouse-right-button{animation:none}
.two-finger-stage{min-height:190px;padding-right:25px}
.two-finger-stage .gesture-practice:not(.learned):not(.practicing){animation:teach-carry 3s ease-in-out infinite}
.gesture-pointer.holding{left:35%;top:57%;transform:rotate(-15deg);width:46px;height:58px}
.gesture-pointer.second-finger{left:78%;top:12%;width:46px;height:58px;animation:teach-second-finger 3s ease-in-out infinite}
.gesture-practice.practicing .gesture-pointer{display:none}
.gesture-pointer.circle{animation:teach-circle 3s linear infinite}
.gesture-practice:has(.circle):not(.learned) .mini-grid{animation-duration:3s}
@keyframes teach-turn{0%,58%{transform:rotate(0);opacity:1}72%,92%{transform:rotate(90deg);opacity:1}99%{transform:rotate(90deg);opacity:0}100%{transform:rotate(0);opacity:0}}
@keyframes teach-right-click{0%,52%,70%,100%{fill:#ffcf35}58%,64%{fill:#ff704d;transform:translateY(2px)}}
@keyframes teach-key{0%,52%,70%,100%{transform:translateY(0);box-shadow:0 6px 0 #8196ac;background:#fff0d0}58%,64%{transform:translateY(5px);box-shadow:0 1px 0 #8196ac;background:#ffcf35}}
@keyframes teach-carry{0%,10%{transform:translateX(-20px)}40%,88%{transform:translateX(20px)}100%{transform:translateX(-20px)}}
@keyframes teach-second-finger{0%,42%,92%,100%{opacity:0;transform:translate(25px,-25px) rotate(18deg)}52%,70%{opacity:1;transform:translate(0,0) rotate(18deg)}59%,64%{opacity:1;transform:translate(-5px,5px) scale(.85) rotate(18deg)}}
@media(max-height:600px){.mouse-stage,.two-finger-stage{min-height:140px}.mouse-stage .gesture-practice{width:125px;height:115px}}
@media(prefers-reduced-motion:reduce){.gesture-key,.mouse-right-button,.two-finger-stage .gesture-practice{animation:none!important}.gesture-pointer.second-finger{opacity:1;transform:rotate(18deg)}}

/* Desktop cockpit: a centered board with controls and progress on either side. */
.desktop-controls,.desktop-extras{display:contents}
@media(min-width:851px){
 main{display:block;max-width:1500px;padding:24px;margin-inline:auto}
 main>.intro{display:none}
 .game{margin-inline:auto}
}
@media(min-width:1100px){
 header{max-width:1400px;padding-top:14px;padding-bottom:14px}
 main{padding-top:22px;padding-bottom:18px}
 .game{--desktop-board:clamp(340px,calc(100svh - 190px),660px);display:grid;grid-template-columns:minmax(180px,240px) minmax(0,var(--desktop-board)) minmax(180px,240px);grid-template-rows:auto 1fr;align-items:start;gap:14px 24px;width:100%;max-width:calc(var(--desktop-board) + 528px);padding:0;background:none;border:0;border-radius:0;box-shadow:none}
 .game>.board-wrap{grid-column:2;grid-row:1/3;width:100%;margin:0;padding:12px;border:2px solid #fff7db;border-radius:26px;background:#fffbed;box-shadow:0 8px 0 #07172e,0 20px 55px #0003}
 .game .board{width:100%;padding:9px;gap:5px;border-radius:16px;box-shadow:inset 0 2px 8px #001b5040}
 .desktop-controls{display:block;grid-column:1;grid-row:1/3;padding:18px;border:1px solid #fff8df;border-radius:22px;background:#fffbed;box-shadow:0 6px 0 #07172e}
 .desktop-controls .tray-heading{display:flex;flex-direction:column;align-items:flex-start;gap:8px;margin:0 0 14px}
 .desktop-controls .tray-heading span{font-size:11px;letter-spacing:1.3px}
 .desktop-controls .tray-heading small{font-size:10px;line-height:1.5}
 .desktop-controls .tray-window:not(.flow) .tray{grid-template-columns:1fr;gap:12px}
 .desktop-controls .piece{min-height:92px;padding:10px}
 .desktop-controls .mini-cell,.desktop-controls .mini-empty{width:22px;height:22px}
 .desktop-controls .tray-window.flow .mini-cell,.desktop-controls .tray-window.flow .mini-empty{width:10px;height:10px}
 .desktop-controls .rotation-controls{display:flex;flex-direction:column;gap:10px;margin:16px 0 0}
 .desktop-controls .rotation-controls>span{display:none}
 .desktop-controls .rotate-button,.desktop-controls .reset{width:100%;min-height:46px;margin:0;font-size:14px}
 .game>.compact-hud{grid-column:3;grid-row:1;grid-template-columns:1fr 1fr;gap:14px 8px;margin:0;padding:16px 10px;border-radius:20px;box-shadow:0 5px 0 #07172e}
 .compact-hud #level-number,.compact-hud .score-number,.compact-hud .best .score-number,.compact-hud .world-rank-button strong{font-size:30px}
 .compact-hud #level-label,.compact-hud .score-label{font-size:9px;letter-spacing:.3px}
 .compact-hud .score-chase{font-size:11px;line-height:1.4;margin-top:2px}
 .desktop-extras{display:block;grid-column:3;grid-row:2;min-width:0;padding:14px;border:1px solid #fff8df;border-radius:20px;background:#fffbed;box-shadow:0 6px 0 #07172e}
 .desktop-extras .community-bar{display:flex;flex-direction:column;align-items:stretch;gap:4px;margin:0 0 10px}
 .desktop-extras .community-bar button{min-height:34px;text-align:start;font-size:12px;overflow-wrap:anywhere}
 .desktop-extras .mode-controls{display:block;margin:0}
 .desktop-extras .mode-buttons{gap:6px}
 .desktop-extras .mode-choice{min-height:76px;padding:6px 2px;gap:4px;border-radius:11px}
 .desktop-extras .mode-choice>span{font-size:18px}
 .desktop-extras .mode-choice strong{font-size:11px}
 .desktop-extras .mode-choice small{font-size:8px}
 .desktop-extras .mode-picker-title{font-size:11px;margin:0 0 10px}
 .desktop-extras .pace-panel{display:block;margin-top:10px}
 .desktop-extras .pace-panel[hidden]{display:none}
 .desktop-extras .pace-ad{display:none}
 .desktop-extras .mode-description{font-size:10px;line-height:1.5;margin:10px 0}
 .desktop-extras .mode-clock{flex-wrap:wrap;font-size:10px;gap:6px;margin-bottom:10px}
 .desktop-extras .sicily-summary{padding:9px;flex-wrap:wrap;gap:8px;margin:10px 0;font-size:11px}
 .desktop-extras .sicily-summary button{font-size:11px;padding:7px 10px}
 .desktop-extras .benefits{gap:6px;flex-wrap:wrap}
 .desktop-extras .benefits button{font-size:10px;padding:7px;min-height:34px}
 footer.game-footer{max-width:1400px;margin-top:8px}
}

/* Keep a known player visible in the menu trigger. */
.site-menu summary.has-username .menu-caption{display:none}
.site-menu .menu-username{display:block;max-width:150px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;unicode-bidi:isolate}
.site-menu .menu-username[hidden]{display:none}
@media(max-width:650px){.site-menu .menu-username{max-width:76px}}
@media(max-width:380px){.site-menu .menu-username{max-width:54px}}

/* One compact mobile control box; languages live inside the player menu. */
.header-controls{display:contents}
header:has(.maiolica-identity) .site-menu summary .current-language{display:none}
@media(max-width:850px){
 body[data-page]:has(#board) header:has(.maiolica-identity){display:flex;flex-wrap:nowrap;align-items:center;gap:8px!important;padding:8px 10px}
 body[data-page]:has(#board) header .maiolica-identity{flex:1 1 0;min-width:0;gap:5px}
 body[data-page]:has(#board) header .maiolica-wordmark{font-size:30px;letter-spacing:-1.5px}
 body[data-page]:has(#board) header .header-controls{display:flex;align-items:center;flex:0 0 auto;gap:0;padding:2px;border:1px solid #485775;border-bottom:3px solid #26344f;border-radius:16px;background:#172442;box-shadow:0 3px 0 #07172e}
 body[data-page]:has(#board) header .header-controls .toolbar{display:contents}
 body[data-page]:has(#board) header .header-controls .icon-button{width:40px;min-width:40px;height:44px;border:0;border-radius:11px;background:transparent;box-shadow:none;color:#f8f3da;font-size:20px}
 body[data-page]:has(#board) header .header-controls .icon-button:hover{background:#2b3e54}
 body[data-page]:has(#board) header .header-controls .site-menu{margin:0;font-size:11px}
 body[data-page]:has(#board) header .header-controls .site-menu summary{min-height:44px;gap:4px;padding:6px;border:0;border-inline-start:1px solid #485775;border-radius:0 11px 11px 0;background:transparent;box-shadow:none;font-size:11px}
 body[data-page]:has(#board) header .header-controls .site-menu[open] summary{background:#2b3e54}
 body[data-page]:has(#board) header .header-controls .menu-username{max-width:76px}
 body[data-page]:has(#board) header .header-controls .site-menu-panel{inset-inline-end:-3px;top:calc(100% + 10px)}
}
@media(max-width:380px){
 body[data-page]:has(#board) header:has(.maiolica-identity){padding:8px;gap:5px!important}
 body[data-page]:has(#board) header .maiolica-wordmark{font-size:26px}
 body[data-page]:has(#board) header .header-controls .menu-username{max-width:54px}
 body[data-page]:has(#board) header .maiolica-byline{gap:3px}
 body[data-page]:has(#board) header .maiolica-byline .revolving-word{font-size:10px}
}

/* Matching desktop actions: fixed geometry, shared typography and edges. */
@media(min-width:1100px){
 .desktop-controls .rotation-controls .rotate-button,.desktop-controls .rotation-controls .reset{display:flex;align-items:center;justify-content:center;gap:8px;box-sizing:border-box;flex:none;width:100%;height:48px;min-height:48px;margin:0;padding:8px 12px;border:2px solid #edb431;border-bottom:4px solid #d69d20;border-radius:12px;background:#ffcc3f;box-shadow:none;color:#194378;font:800 14px/1.2 'DM Sans',sans-serif;text-decoration:none}
 .desktop-controls .rotation-controls .rotate-button:not(:disabled):hover,.desktop-controls .rotation-controls .reset:hover{background:#ffda6c}
 .desktop-controls .rotation-controls .rotate-button:disabled{background:#edf0e6;color:#899aaa;border-color:#dce1d8}
}

/* Each cascade visibly resolves before the next one begins. */
.board .cell.chain-highlight{z-index:3;outline:2px solid #fff6b0;outline-offset:-2px;box-shadow:inset 0 0 18px #ffe775,0 0 10px #ffc63d99;animation:chain-charge .28s ease-out both}
.board .cell.chain-clear{animation:chain-shatter .18s ease-in both}
.board.settling~.toast{font-size:clamp(17px,3vw,24px);padding:10px 18px;top:32%;border-radius:14px}
@keyframes chain-charge{from{filter:brightness(1);transform:scale(1)}to{filter:brightness(1.65);transform:scale(.94)}}
@keyframes chain-shatter{from{opacity:1;transform:scale(.94);filter:brightness(1.65)}to{opacity:0;transform:scale(.35);filter:brightness(2)}}
@media(prefers-reduced-motion:reduce){.board .cell.chain-highlight,.board .cell.chain-clear{animation:none;filter:none;transform:none}.board .cell.chain-highlight{outline:3px solid #fff6b0}}

/* Keep leaderboard dismissal within reach, including while scrolling. */
.rank-close-bar{position:sticky;top:-12px;z-index:8;display:flex;justify-content:flex-end;height:44px;margin:-12px -12px -32px;pointer-events:none}
.rank-close{display:grid;place-items:center;width:44px;height:44px;flex:none;padding:0;border:1px solid #c8dae4;border-radius:50%;background:#fff8e7;color:#194988;box-shadow:0 2px 0 #d1dfdf;cursor:pointer;pointer-events:auto;font:400 30px/1 Arial,sans-serif}
.rank-close:hover{background:#ffdf79}.rank-close:focus-visible{outline:3px solid #267dbc;outline-offset:2px}

/* One full-width rescue action while the No Ads offer is unavailable. */
.benefits #no-ads{display:none!important}
.desktop-extras .benefits{display:flex;gap:0}
.desktop-extras .benefits #rescue{flex:1 1 100%;width:100%;min-height:48px;padding:12px 16px;font-size:14px;border-radius:12px}
