/* Keep after the responsive theme. Physics always uses a 468 × 612 arena.
   Desktop keeps that exact display size; small screens scale it uniformly. */
body{flex-direction:column;align-items:center;justify-content:flex-start;gap:0}
.app{
  flex:0 0 auto;
  width:524px;
  height:auto;
  min-height:0;
  max-height:none;
  padding:18px;
  border-width:2px;
  grid-template-rows:50px 76px auto 80px;
  gap:14px;
}
.game-shell{
  box-sizing:content-box;
  width:468px;
  height:612px;
  min-height:0;
  border-width:8px;
}
/* These overlays share the canvas coordinate system, also on scaled mobile. */
.danger{top:13.3986928105%;left:2.5641025641%;right:2.5641025641%}
.dropper{aspect-ratio:auto;max-width:none;padding:0}
.guide{top:9.8039215686%}
@media(max-width:600px){
  .app{
    width:100%;
    padding:4px;
    border-width:0;
    grid-template-rows:48px 72px auto 76px;
    gap:12px;
  }
  .game-shell{
    width:calc(100% - 14px);
    height:auto;
    aspect-ratio:468 / 612;
    border-width:7px;
  }
}
/* A narrow desktop window is still a desktop game. Scroll rather than squeeze. */
@media(hover:hover) and (pointer:fine){
  body{min-width:572px}
  .app{
    width:524px;
    padding:18px;
    grid-template-rows:50px 76px auto 80px;
    gap:14px;
  }
  .game-shell{width:468px;height:612px;border-width:8px}
}

/* Keep both the label and thumbnail within the yellow next-item panel. */
.next{height:52px;min-height:0;display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:16px 26px;gap:2px;place-content:center;place-items:center;text-align:center;padding:4px 6px;overflow:hidden}
.next>span{line-height:16px;margin:0}
.next img{display:block;width:32px;height:26px;max-width:100%;max-height:100%;min-height:0;margin:0;object-fit:contain;filter:drop-shadow(0 1px 1px #92714320)}
/* Keep page scrolling and settings sliders usable outside the play canvas. */
.app,dialog{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
.app img,dialog img{-webkit-user-drag:none;-webkit-user-select:none;user-select:none}
.game-shell{-webkit-tap-highlight-color:transparent}

/* Close up the spaces left by decorative copy. */
.start-card h2{margin-bottom:22px}
.touch-preview+.collection{margin-top:16px}

/* Rounded game lettering: crisp outlines for titles, solid ink for instructions. */
.help-btn{font-family:var(--game-font);font-size:26px;line-height:1}
#guideDialog{width:min(500px,calc(100% - 24px));margin:auto;max-height:92svh;font-family:var(--game-font);font-weight:400;word-break:keep-all;overflow-wrap:break-word;font-synthesis:none}
#guideDialog[open]{display:flex;flex-direction:column}
#guideDialog .modal-head{flex:0 0 auto;padding:18px 18px 10px;gap:10px}
#guideDialog #guideTitle{font-family:var(--game-font);font-size:27px;line-height:1.3;margin:0;letter-spacing:0;-webkit-text-stroke:2.5px #684275;paint-order:stroke fill;color:#fff1d2;text-shadow:0 2px 0 #684275}
.guide-body{min-height:0;overflow:auto;padding:0 18px 4px;color:#634573;font-family:var(--game-font);font-size:16px;font-weight:400;line-height:1.45;text-shadow:none}
#guideDialog strong,#guideDialog b{font-weight:400}
.guide-merge{display:flex;align-items:center;justify-content:center;gap:12px;padding:4px 0}
.guide-merge img{width:52px;height:52px;object-fit:contain}
.guide-merge span{font-size:24px;color:#79528c}
.guide-goal{text-align:center;margin:8px 0 16px}
.guide-goal strong{display:block;font-size:21px;color:#62406e;line-height:1.4}
.guide-goal>span{display:block;margin-top:4px;font-size:15px;color:#795b80}
.guide-controls{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.guide-control{min-width:0;background:#fff8e9;border:2px solid #e6d3df;border-radius:18px;padding:12px;box-shadow:0 3px 0 #e5d2df}
.guide-control h3{font-family:var(--game-font);font-size:22px;font-weight:400;color:#fff2cb;-webkit-text-stroke:2px #78518b;paint-order:stroke fill;text-shadow:0 1px 0 #78518b;margin:0 0 10px}
.guide-control p{margin:0 0 10px;font-size:15px;line-height:1.45}
.guide-control p:last-child{margin-bottom:0}
.guide-control strong{display:block;color:#604173}
.guide-control p>span{display:block;color:#806185;font-size:14px;margin-top:2px}
.guide-control kbd{display:inline-block;vertical-align:1px;white-space:nowrap;font-family:var(--game-font);font-size:13px;font-weight:400;line-height:1.5;background:#eadbf1;color:#624376;border:1px solid #c6a8d3;border-bottom-width:3px;border-radius:6px;padding:1px 4px}
.guide-limit{margin:18px 0 10px;text-align:center;color:#98506a;font-size:17px;line-height:1.45}
.guide-limit>span{display:block;width:92px;border-top:2px dashed #b3899f;margin:0 auto 8px}
.guide-touch{text-align:center;margin:0 0 12px;color:#795b80;font-size:14px}
.guide-footer{flex:0 0 auto;padding:12px 18px 14px;border-top:1px solid #e4d4e3}
.guide-actions{display:flex;gap:10px;align-items:stretch}
.guide-actions .primary{flex:1;min-width:0;min-height:48px;padding:12px;font-size:21px}
.guide-footer p{font-family:var(--game-font);font-weight:400;font-size:13px;line-height:1.5;text-align:center;color:#795b80;margin:10px 0 0;text-shadow:none}
.settings-help{display:flex;justify-content:space-between;align-items:center;gap:12px;width:100%;min-height:48px;border:1px solid #d6c0df;border-radius:14px;background:#f2e7f6;color:#694676;padding:12px 14px;margin:16px 0 0;font-family:var(--game-font);font-size:17px}
@media(max-width:374px){.guide-controls{grid-template-columns:1fr}.guide-control{padding:10px 14px}.guide-control p{display:flex;flex-wrap:wrap;align-items:center;gap:3px 8px;margin-bottom:6px}.guide-control p>span{margin:0}#guideDialog #guideTitle{font-size:24px}}
@media(pointer:coarse){.guide-control:first-child{border-color:#b5dfe0;background:#f0fbf9;box-shadow:0 3px 0 #b5dfe0}}
@media(hover:hover) and (pointer:fine){.guide-control:last-child{border-color:#b5dfe0;background:#f0fbf9;box-shadow:0 3px 0 #b5dfe0}}
/* The always-visible switch sits above the fixed playfield. */
.app{grid-template-rows:50px 76px 44px auto 80px}
.mode-toolbar{display:flex;align-items:center;gap:12px;min-width:0;padding:0 4px;font-family:var(--game-font);color:#694676}
.mode-caption{font-size:16px}
.mode-toggle{position:relative;display:grid;grid-template-columns:1fr 1fr;align-items:center;width:168px;height:44px;flex:0 0 auto;padding:4px;border:2px solid #d1b8d8;border-radius:24px;background:#e6d7ef;box-shadow:inset 0 2px 3px #82638b16;font-family:var(--game-font);font-size:17px;line-height:1;color:#82608f;transition:background .2s,border-color .2s}
.mode-toggle:before{content:'';position:absolute;top:3px;bottom:3px;left:3px;width:calc(50% - 3px);border-radius:20px;background:linear-gradient(#fff6d9,#ffe1a6);box-shadow:0 2px 0 #bd9b60;transition:transform .2s,background .2s}
.mode-toggle span{position:relative;z-index:1}
.mode-toggle[aria-checked=false] span:first-child{color:#725023}
.mode-toggle[aria-checked=true]{background:#655075;border-color:#5b436d;color:#d8c4e2}
.mode-toggle[aria-checked=true]:before{transform:translateX(100%);background:linear-gradient(#bcece6,#8dd1ce);box-shadow:0 2px 0 #407e85}
.mode-toggle[aria-checked=true] span:last-child{color:#285b63}
.round-menu{margin-left:auto;min-height:44px;padding:8px 12px;border:1px solid #ddc6e1;border-radius:16px;background:#f9effa;color:#795284;font-family:var(--game-font);font-size:16px;white-space:nowrap}
.mode-dialog{width:min(420px,calc(100% - 24px));margin:auto;max-height:90svh;font-family:var(--game-font);color:#694676;word-break:keep-all}
.mode-dialog .modal-head{padding:20px 22px 12px;gap:12px}
.mode-dialog .modal-head h2{font-size:28px;margin:0}
.mode-body{padding:4px 22px 18px;text-align:center}
.mode-vessel{height:100px;width:150px;max-width:100%;margin:0 auto 14px;position:relative;border:6px solid #eec3ae;border-radius:28px;display:grid;place-items:center;background:#fff9e9;box-shadow:inset 0 -4px 0 #f4dec1}
.mode-vessel.narrow{width:112px;border-color:#b5a2d1;background:#f4f0fb}
.mode-vessel img{width:80px;height:80px;position:static;object-fit:contain;transform:none}
#modeDescription{color:#694676;-webkit-text-fill-color:#694676;text-shadow:none;font-size:19px;line-height:1.5;margin:0 0 8px}
.mode-save-info{font-size:17px;color:#93657f;margin:0 0 20px;line-height:1.5}
.mode-actions{display:grid;gap:10px}
.mode-actions .primary{font-size:22px;min-height:50px}
.mode-new{font-family:var(--game-font);font-size:19px;color:#694676;background:#eee1f2;border:2px solid #d4bbdf;border-radius:20px;min-height:48px;padding:10px;box-shadow:0 3px 0 #d4bbdf}
#modeKeepNote{font-family:var(--game-font);font-size:14px;line-height:1.5;color:#806187;margin:16px 0 6px}
.mode-cancel{font-family:var(--game-font);font-size:16px;background:transparent;color:#806187;border:0;min-height:44px;padding:8px 18px}
@media(max-width:600px){.app{grid-template-rows:48px 72px 44px auto 76px}.mode-toolbar{gap:8px}.mode-toggle{width:154px}.round-menu{padding:8px 10px}}
@media(hover:hover) and (pointer:fine){.app{grid-template-rows:50px 76px 44px auto 80px}}
@media(prefers-reduced-motion:reduce){.mode-toggle,.mode-toggle:before{transition:none}}
/* Compact centered score, with a separate non-overlapping combo lane. */
.app{grid-template-rows:50px 100px 44px 38px auto 80px;gap:10px}
.scorebar.compact-score{display:grid;grid-template-columns:64px minmax(0,1fr) 64px;align-items:center;gap:10px;padding:4px 10px;border:0;border-radius:0;background:none;box-shadow:none}
.score-center{text-align:center;min-width:0;font-family:var(--game-font)}
#modeLabel{display:block;font-family:var(--game-font);font-size:12px;color:#795284;line-height:16px;margin-bottom:2px}
.score-center>#score{display:block;border:2px solid #a48bb9;border-radius:30px;background:linear-gradient(#625273,#837399);box-shadow:0 3px 0 #cbb9d5;font-family:var(--game-font);font-size:clamp(29px,7vw,39px);line-height:1.1;padding:5px 10px;color:#fff8de;-webkit-text-stroke:2px #473752;paint-order:stroke fill;text-shadow:0 2px 0 #473752;letter-spacing:0;font-weight:400;font-variant-numeric:tabular-nums}
.best-line{display:flex;align-items:baseline;justify-content:center;gap:6px;line-height:20px;margin-top:5px;color:#765782;font-family:var(--game-font);font-size:13px}
.best-line #best{font-family:var(--game-font);font-size:17px;font-weight:400;color:#725226;text-shadow:none;-webkit-text-stroke:0;font-variant-numeric:tabular-nums}
.rank-entry{font-family:var(--game-font);font-size:16px;border:2px solid #d8b881;border-radius:18px;background:linear-gradient(#fff3c9,#f5d595);color:#725226;min-height:48px;padding:8px 4px;box-shadow:0 3px 0 #d8b881}
.compact-score .next{border:0;width:64px;height:64px;grid-template-rows:18px 32px;padding:5px;gap:3px;box-shadow:0 3px 0 #d7bb83}
.compact-score .next img{width:38px;height:32px}
.mode-toolbar{gap:8px;padding:0 4px}.mode-tabs{display:flex;gap:3px;flex:1;padding:3px;background:#e6d7ef;border:1px solid #cdb2d6;border-radius:24px}
.mode-tabs button{flex:1;border:0;min-height:36px;border-radius:20px;padding:5px 9px;font-family:var(--game-font);font-size:16px;color:#79558a;background:none;white-space:nowrap}
.mode-tabs button[aria-pressed=true]{background:linear-gradient(#fff4d2,#ffdea5);color:#755125;box-shadow:0 2px 0 #bd9b60}
#modehard[aria-pressed=true]{background:linear-gradient(#9f82b8,#785997);color:#fff2d3;box-shadow:0 2px 0 #5a4273}
.combo-slot{height:38px;position:relative;overflow:hidden;border-radius:18px;background:#ecdeed80;pointer-events:none}
.combo-slot .combo-hud{top:50%;left:50%;max-width:95%;display:flex;align-items:center;gap:7px;line-height:1;white-space:nowrap}
.combo-slot .combo-hud strong{font-size:26px;padding:0;letter-spacing:0;-webkit-text-stroke:1.5px #835386;filter:none;background:none;-webkit-text-fill-color:#ffe0a1;color:#ffe0a1}
.combo-slot .combo-hud>span{font-size:17px;letter-spacing:1px;margin:0;text-shadow:none;-webkit-text-stroke:2px #835386}
.combo-slot .combo-spark{position:static;font-size:15px;filter:none;text-shadow:none}.combo-slot .spark-one{order:-1}
.mode-vessel.shallow{height:96px;width:145px;border-color:#a58ab9}.mode-vessel.shallow img{height:58px;width:58px}
.ranking-dialog{font-family:var(--game-font);width:min(480px,calc(100% - 24px));margin:auto;color:#694676}
.rank-body{padding:0 18px 18px}.rank-mode-tabs,.rank-period-tabs{display:flex;gap:6px;margin-bottom:10px}
.rank-mode-tabs button,.rank-period-tabs button{flex:1;font-family:var(--game-font);min-height:42px;padding:8px;border:1px solid #d6c0df;border-radius:16px;background:#f4eaf6;color:#795284;font-size:16px}
.rank-mode-tabs button[aria-pressed=true]{background:#765385;color:#fff4d7;border-color:#765385}.rank-period-tabs button[aria-pressed=true]{background:#ffe3a9;color:#745022;border-color:#d7b16e}
.rank-reset{font-family:var(--game-font);font-size:12px;line-height:1.5;color:#80678b;text-align:center;word-break:keep-all}
#nicknameForm{display:flex;align-items:center;gap:8px;margin-top:14px;font-family:var(--game-font);font-size:14px}#nicknameForm label{white-space:nowrap}
#rankNickname{min-width:0;width:100%;font-family:var(--game-font);font-size:16px;padding:10px;border:1px solid #ccb2d6;border-radius:12px;background:#fffaf2;color:#634573;user-select:text;-webkit-user-select:text}
#nicknameForm button,.rank-refresh,.end-ranking{font-family:var(--game-font);font-size:16px;min-height:42px;white-space:nowrap;border:1px solid #d6c0df;border-radius:14px;background:#eee1f2;color:#694676;padding:8px 12px}
#rankProfileStatus{font-size:13px;line-height:1.5;word-break:keep-all}.rank-mine{font-size:17px;text-align:center;padding:12px;background:#fff0ce;border-radius:14px;color:#795325}
#rankStatus{font-size:14px;text-align:center;line-height:1.5;word-break:keep-all}.ranking-list{padding:0;margin:12px 0;list-style:none;max-height:320px;overflow:auto}
.ranking-list li{display:grid;grid-template-columns:40px minmax(0,1fr) auto;gap:10px;align-items:center;padding:12px 8px;border-bottom:1px solid #e3d2e8;font-size:16px}.ranking-list li.is-me{background:#e1f3ee;border-radius:12px}.ranking-list b,.ranking-list strong{font-weight:400}.ranking-list span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ranking-list strong{color:#795325;font-variant-numeric:tabular-nums}
.rank-refresh{display:block;margin:10px auto}.gameover .rank-submit-status{font-family:var(--game-font);font-size:13px;line-height:1.4;margin:12px 0 4px;color:#795284}.end-ranking{margin-top:8px}
@media(max-width:600px){.app{grid-template-rows:48px 94px 44px 36px auto 76px;gap:8px}.combo-slot{height:36px}.scorebar.compact-score{grid-template-columns:56px minmax(0,1fr) 56px;gap:7px;padding:2px 6px}.compact-score .next{width:56px}.mode-tabs button{padding:5px 7px}.round-menu{font-size:14px}}
@media(hover:hover) and (pointer:fine){.app{grid-template-rows:50px 100px 44px 38px auto 80px}}

/* The camera fills the frame; the simulation walls never move with CSS. */
.app{grid-template-rows:50px 100px 56px auto 80px}
.game-shell{height:auto;aspect-ratio:468 / 612}
.menu-entry{min-height:44px;padding:8px 18px;font:20px var(--game-font);color:#694676;border:2px solid #d6c0df;border-radius:18px;background:#f5eaf6;box-shadow:0 3px 0 #d6c0df}
.menu-dialog{width:min(420px,calc(100% - 24px));margin:auto;font-family:var(--game-font);color:#694676}
.menu-body{padding:0 20px 24px}.menu-body h3{font:19px var(--game-font);color:#694676;margin:12px 0}
.menu-body section+section{border-top:1px solid #dfcde4;margin-top:22px;padding-top:6px}
.menu-body .mode-toolbar{flex-wrap:wrap;padding:0;gap:12px}.menu-body .mode-tabs{flex-basis:100%}
.menu-body .mode-tabs button{min-height:44px;font-size:18px}
.menu-body .round-menu{width:100%;margin:0;min-height:48px;font-size:18px}
.menu-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.menu-grid button{min-height:54px;border:2px solid #ddc8e1;border-radius:16px;background:#f5eaf6;font:18px var(--game-font);color:#694676;box-shadow:0 3px 0 #dfcde4}
.menu-grid button:last-child{grid-column:1/-1;background:#fff1d1;border-color:#e7cca0;box-shadow:0 3px 0 #e7cca0}
.combo-slot{height:56px;isolation:isolate;background:#efe2ee}
.combo-slot .combo-hud{z-index:1;gap:9px}
.combo-slot .combo-hud strong{font-size:38px;color:var(--combo-fill,#ffe6b2);-webkit-text-fill-color:var(--combo-fill,#ffe6b2);-webkit-text-stroke:2px var(--combo-ink,#795182);text-shadow:0 2px 0 var(--combo-ink,#795182)}
.combo-slot .combo-hud>span{font-size:22px;color:var(--combo-fill,#ffe6b2);-webkit-text-fill-color:var(--combo-fill,#ffe6b2);-webkit-text-stroke:2px var(--combo-ink,#795182)}
.combo-slot .combo-spark{font-size:20px;color:var(--combo-ink,#795182);animation:none}
.combo-slot[data-tier=gold]{--combo-fill:#fff1a0;--combo-ink:#976018;background:#fff0c9}
.combo-slot[data-tier=fire]{--combo-fill:#ffe2ac;--combo-ink:#aa3e5d;background:#ffddd9}
.combo-slot[data-tier=prism]{--combo-fill:#fff0cb;--combo-ink:#684099;background:#e9dcfa}
.combo-slot:before{content:'';position:absolute;inset:0;opacity:0;pointer-events:none}
.combo-slot.celebrating[data-tier=gold]:before{opacity:1;background:radial-gradient(ellipse at center,#ffe09680,transparent 70%)}
.combo-slot.celebrating[data-tier=fire]:before{opacity:1;background:repeating-conic-gradient(from 12deg at 50% 130%,#fca57045 0deg 12deg,transparent 12deg 28deg)}
.combo-slot.celebrating[data-tier=prism]:before{opacity:1;background:linear-gradient(105deg,#ffbfdd80,#c7b2ff80,#aee9ef80,#fff0b580);background-size:200% 100%;animation:combo-prism 2.2s ease-out both}
.combo-slot.celebrating[data-tier=gold] .combo-spark,.combo-slot.celebrating[data-tier=fire] .combo-spark,.combo-slot.celebrating[data-tier=prism] .combo-spark{animation:combo-sparkle 1.4s ease-out both}
.combo-slot.paused:before,.combo-slot.paused .combo-spark{animation-play-state:paused}

/* Discovery announcements use the same raised toy-console lettering as the HUD. */
.game-shell .toast{top:100px;max-width:calc(100% - 24px);padding:9px 17px 11px;border:3px solid #a77cb5;border-radius:20px;background:linear-gradient(180deg,#fff9d9 0%,#ffecb6 52%,#f6d798 100%);color:#563966;font:clamp(16px,4.2vw,21px)/1.2 var(--game-font);letter-spacing:.015em;text-shadow:none;box-shadow:inset 0 2px 0 #fffef1,inset 0 -3px 0 #e8b97f,0 4px 0 #7e5a8b,0 7px 16px #4b315446;backdrop-filter:none;-webkit-backdrop-filter:none}
@keyframes combo-prism{from{background-position:100% 0}to{background-position:0 0}}
@keyframes combo-sparkle{0%{transform:scale(.7) rotate(-20deg)}45%{transform:scale(1.25) rotate(15deg)}100%{transform:scale(1) rotate(0)}}
@media(max-width:600px){.app{grid-template-rows:48px 94px 56px auto 76px;gap:8px;padding:0}.game-shell{height:auto}.menu-entry{font-size:18px}}
@media(hover:hover) and (pointer:fine){.app{grid-template-rows:50px 100px 56px auto 80px}.game-shell{height:auto}}
@media(prefers-reduced-motion:reduce){.combo-slot:before,.combo-slot .combo-spark{animation:none!important}}

@media(max-width:600px) and (pointer:coarse){body{padding-left:max(8px,env(safe-area-inset-left));padding-right:max(8px,env(safe-area-inset-right))}}

/* Account competition, kept inside the existing ranking module. */
.rank-account{padding:15px;border:1px solid #dacbe5;border-radius:18px;background:#fff9ed;display:flex;flex-wrap:wrap;gap:10px;align-items:center}.rank-account strong{flex:1 1 180px;font-size:17px;color:#624476}.rank-account p{width:100%;font-size:13px;color:#765d7d;margin:0;line-height:1.5}.rank-login{border:1px solid #d0bbdf;border-radius:12px;background:#fff;color:#4f3865;padding:11px 15px;font:16px Jua,system-ui;min-height:44px}.rank-login:disabled{opacity:.6}.rank-rival{color:#91512b;text-align:center;font:18px Jua,system-ui}.rank-account [hidden],#nicknameForm[hidden]{display:none!important}

.guide-combo{font:16px/1.6 Jua,system-ui;color:#624476;text-align:center;margin:18px 0}

/* Framed toy-console HUD; no extra layers enter the physics canvas. */
.guide-remember{display:flex;align-items:center;justify-content:center;gap:10px;min-height:44px;margin:0 0 10px;color:#684773;font:17px var(--game-font);cursor:pointer}
.guide-remember input{appearance:auto;-webkit-appearance:checkbox;width:22px;height:22px;flex:0 0 22px;margin:0;accent-color:#8654a1}
.guide-remember input:focus-visible{outline:3px solid #8052a1;outline-offset:4px}
.guide-actions .primary{width:100%;border-radius:20px;min-height:54px;font-size:24px}
.scorebar.compact-score{position:relative;padding:6px 8px;gap:9px;border:3px solid #c398b5;border-radius:25px;background:linear-gradient(155deg,#fff5da,#f7dfe7 62%,#ebd9ef);box-shadow:inset 0 2px 0 #fff9e8,inset 0 -3px 0 #dfbfd5,0 4px 0 #a77b9f;isolation:isolate}
.score-center{padding:0 2px}
#modeLabel{color:#684771;font-size:13px;line-height:16px;margin-bottom:3px}
.score-center>#score{border:3px solid #f7dca8;outline:1px solid #84648d;border-radius:22px;background:linear-gradient(180deg,#87669e 0%,#664979 50%,#563b69 51%,#765385 100%);box-shadow:inset 0 2px 0 #b998cc,inset 0 -3px 0 #493058,0 3px 0 #b99582;padding:4px 6px;line-height:1.05;font-size:clamp(29px,7vw,38px);color:#fff0c1;-webkit-text-stroke:2px #402947;text-shadow:0 2px 0 #402947;letter-spacing:.01em}
.best-line{gap:5px;margin-top:5px;font-size:12px;line-height:18px;color:#73567d}.best-line #best{font-size:16px;color:#6c462c}
.compact-score .rank-entry{border-color:#b48b59;background:linear-gradient(#fff0bc,#edc980);box-shadow:inset 0 2px 0 #fff6d5,0 3px 0 #ad8054;border-radius:16px}
.compact-score .next{border:2px solid #c8a16c;border-radius:17px;background:linear-gradient(#fff5d3,#f2d99f);box-shadow:inset 0 2px 0 #fffbea,0 3px 0 #b89068}
.combo-slot{--combo-rim:#a37bb5;--combo-top:#fff1bd;--combo-bottom:#f7b168;--combo-depth:#6c3a75;height:64px;border:3px solid var(--combo-rim);border-radius:21px;background:linear-gradient(180deg,#fbefdc,#eddaf2 52%,#e1c9e9);box-shadow:inset 0 2px 0 #fff6e3,inset 0 -3px 0 #cfafd9,0 3px 0 #896797;overflow:hidden}
.combo-slot:after{content:'';position:absolute;inset:7px;border:1px solid #bb91c0;border-radius:12px;pointer-events:none;opacity:.55}
.combo-rest{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;font:22px var(--game-font);letter-spacing:.13em;color:#936c9d;text-shadow:0 1px 0 #e4cdec;transition:opacity .12s}
.combo-slot.celebrating .combo-rest{opacity:0}
.combo-slot .combo-hud{max-width:92%;gap:9px;z-index:2;padding:1px 2px 5px}
.combo-slot .combo-hud strong{font-size:43px;font-style:italic;letter-spacing:-.025em;padding:0 3px;color:#ffdd91;background:linear-gradient(180deg,var(--combo-top) 0%,var(--combo-top) 42%,var(--combo-bottom) 44%,var(--combo-bottom) 100%);background-clip:text;-webkit-background-clip:text;-webkit-text-fill-color:transparent;-webkit-text-stroke:2px var(--combo-depth);paint-order:stroke fill;text-shadow:none;filter:drop-shadow(0 3px 0 var(--combo-depth))}
.combo-slot .combo-hud>span{font-size:25px;letter-spacing:.035em;transform:rotate(-4deg);color:var(--combo-top);-webkit-text-fill-color:var(--combo-top);-webkit-text-stroke:2px var(--combo-depth);paint-order:stroke fill;text-shadow:0 3px 0 var(--combo-depth)}
.combo-slot .combo-spark{font-size:21px;color:var(--combo-bottom);-webkit-text-stroke:1px var(--combo-depth);text-shadow:0 2px 0 var(--combo-depth)}
.combo-slot[data-tier=gold]{--combo-rim:#bd8833;--combo-top:#fff5b5;--combo-bottom:#ffba3f;--combo-depth:#8e4b20;background:linear-gradient(#fff3bd,#f9d67d);box-shadow:inset 0 2px 0 #fff9d8,inset 0 -3px 0 #eabb62,0 3px 0 #a47136}
.combo-slot[data-tier=fire]{--combo-rim:#ce7287;--combo-top:#ffecc0;--combo-bottom:#ff9b75;--combo-depth:#933454;background:linear-gradient(#ffe8c3,#f4bdca);box-shadow:inset 0 2px 0 #fff1dc,inset 0 -3px 0 #e7a1b7,0 3px 0 #af5574}
.combo-slot[data-tier=prism]{--combo-rim:#9566c1;--combo-top:#fff4c6;--combo-bottom:#e6b2ff;--combo-depth:#603583;background:linear-gradient(110deg,#ead1fa,#cde9ed,#f9d7e4);box-shadow:inset 0 2px 0 #fbf0e4,inset 0 -3px 0 #c5a9de,0 3px 0 #755096}
.combo-slot.celebrating:before{opacity:1;background:repeating-conic-gradient(from 15deg at 50% 130%,#f9cd9150 0deg 10deg,transparent 10deg 28deg);animation:combo-flare .6s ease-out both}
.combo-slot.celebrating[data-tier=prism]:before{animation:combo-prism 2.2s ease-out both}
.combo-slot.celebrating .combo-spark{animation:combo-sparkle .8s ease-out both}
@keyframes combo-flare{from{transform:scale(.86);opacity:.3}to{transform:scale(1);opacity:1}}
.app{grid-template-rows:50px 110px 64px auto 80px}
@media(max-width:600px){.app{grid-template-rows:48px 106px 64px auto 76px}.scorebar.compact-score{gap:6px;padding:5px 7px;grid-template-columns:56px minmax(0,1fr) 56px}.compact-score .next{width:56px}.score-center>#score{font-size:clamp(27px,8vw,36px)}}
@media(max-width:360px){.combo-slot .combo-hud{gap:6px}.combo-slot .combo-hud strong{font-size:38px}.combo-slot .combo-hud>span{font-size:22px}.combo-slot .combo-spark{font-size:17px}.scorebar.compact-score{gap:4px;padding:5px}.score-center>#score{letter-spacing:-.025em;font-size:27px}}
@media(prefers-reduced-motion:reduce){.combo-slot:before,.combo-slot .combo-spark{animation:none!important}.combo-rest{transition:none}}
.combo-slot.paused:before,.combo-slot.paused .combo-spark{animation-play-state:paused}

/* Center the play surface; keep sponsorship outside the fixed physics frame. */
/* Personal standing stays prominent above compact filters and rank cards. */
.ranking-dialog[open]{display:flex;flex-direction:column;max-height:90svh;overflow:hidden}
.ranking-dialog .modal-head{flex:none;padding:18px 20px 14px}.ranking-dialog .modal-head h2{font-size:27px}.ranking-dialog .close{width:42px;height:42px;min-height:42px}
.ranking-dialog .rank-body{display:flex;flex-direction:column;min-height:0;overflow-y:auto;padding:0 16px 16px;gap:10px}
.ranking-dialog .rank-mine{display:grid;grid-template-columns:1fr 1.5fr;gap:12px;margin:0;padding:12px 16px;text-align:left;border:2px solid #b890cb;border-radius:20px;background:linear-gradient(120deg,#eee0fa,#fbf3ff);box-shadow:inset 0 2px 0 #fff,0 3px 0 #cab0d8;color:#654077}
.rank-mine>div{display:flex;flex-direction:column;gap:3px;min-width:0}.rank-mine>div+div{border-left:1px solid #cdb4dc;padding-left:14px}.rank-mine span{font-size:12px}.rank-mine strong{font-weight:400;font-size:30px;line-height:1.15;font-variant-numeric:tabular-nums;white-space:nowrap}
.rank-mine[data-podium="1"]{border-color:#d2a34e;background:linear-gradient(120deg,#ffe6a1,#fff4d6);color:#79501e;box-shadow:inset 0 2px 0 #fff9df,0 3px 0 #d6b277}
.rank-filters{display:flex;gap:8px}.rank-filters>div{flex:1;display:flex;gap:0;margin:0;padding:3px;border:1px solid #d7c3e0;border-radius:12px;background:#eadff0}
.rank-filters button{min-height:36px;padding:4px 2px;border:0;border-radius:9px;font-size:14px;box-shadow:none;background:transparent;white-space:nowrap}
.rank-list-toolbar{display:flex;align-items:start;justify-content:space-between;gap:8px;min-height:36px}.rank-list-toolbar details{flex:1;min-width:0;border-radius:12px}.rank-list-toolbar summary{display:flex;align-items:center;justify-content:space-between;gap:10px;list-style:none;cursor:pointer;min-height:36px;padding:6px 10px;background:#f3eaf5;border-radius:12px;font-size:14px}.rank-list-toolbar summary::-webkit-details-marker{display:none}#rankAccount{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}#rankIdentity[open]{padding:0 0 8px;background:#f3eaf5}
.ranking-dialog #nicknameForm{margin:8px 8px 0;gap:6px;font-size:12px}.ranking-dialog #rankNickname{font-size:14px;padding:7px;min-height:36px}.ranking-dialog #nicknameForm button{font-size:13px;min-height:36px;padding:6px 9px}.ranking-dialog #rankProfileStatus{margin:4px 10px 0;font-size:12px}.rank-list-toolbar .rank-refresh{margin:0;min-height:36px;width:36px;padding:0;font-size:24px;border-radius:12px}
.rank-table-head{display:grid;grid-template-columns:42px minmax(0,1fr) auto;gap:10px;padding:0 13px;color:#8a6b96;font-size:12px}
.ranking-dialog .ranking-list{flex:none;margin:0;max-height:none;overflow:visible;display:grid;gap:8px}.ranking-dialog .ranking-list li{grid-template-columns:42px minmax(0,1fr) auto;border:1px solid #e2cfe9;border-radius:15px;padding:10px 12px;background:#fbf7fc;min-height:56px;font-size:16px;box-shadow:0 2px 0 #e5d6eb}
.ranking-list li>b{display:grid;place-items:center;width:34px;height:34px;background:#eee1f3;border-radius:11px;color:#785287;font-size:19px}.ranking-dialog .ranking-list strong{padding:5px 8px;background:#f1e6f4;border-radius:10px;color:#694477;font-size:19px}
.ranking-dialog .ranking-list li[data-podium="1"]{background:linear-gradient(110deg,#fff0bd,#fff9e8);border-color:#ddb861;box-shadow:0 3px 0 #e1c184}.ranking-list li[data-podium="1"]>b{background:#efc45f;color:#714819}.ranking-dialog .ranking-list li[data-podium="1"] strong{background:#ffe5a1;color:#815015}
.ranking-dialog .ranking-list li[data-podium="2"]{background:linear-gradient(110deg,#e7edf9,#f6f8ff);border-color:#b3c1dc}.ranking-list li[data-podium="2"]>b{background:#c4cee5;color:#485c88}.ranking-dialog .ranking-list li[data-podium="2"] strong{background:#dce6f7;color:#4b618c}
.ranking-dialog .ranking-list li[data-podium="3"]{background:linear-gradient(110deg,#f7dcc9,#fff2e9);border-color:#d6aa8d}.ranking-list li[data-podium="3"]>b{background:#e6b18d;color:#7e4b2e}.ranking-dialog .ranking-list li[data-podium="3"] strong{background:#f3cfb5;color:#87532e}
.ranking-dialog .ranking-list li.is-me{border:2px solid #54a99b;box-shadow:0 3px 0 #9acabd}.rank-me-badge{display:inline-block;margin-left:5px;padding:2px 5px;border-radius:6px;background:#57a898;color:#fff;font-size:11px;font-style:normal;vertical-align:middle}.ranking-dialog #rankStatus{margin:0;font-size:12px;color:#94789d}.ranking-dialog #rankStatus:empty,.ranking-dialog #rankProfileStatus:empty{display:none}
@media(max-width:360px){.rank-filters{gap:5px}.rank-filters button{font-size:12px}.rank-mine strong{font-size:26px}.ranking-dialog .rank-body{padding-inline:12px}.ranking-dialog .ranking-list li{gap:6px;font-size:14px}.ranking-dialog .ranking-list strong{font-size:16px}}
.app{margin-inline:auto}
.sponsor-rail{flex:0 0 auto;width:min(100%,524px);margin:18px auto 24px}
.menu-dialog[open]{display:flex;flex-direction:column}
.menu-dialog .modal-head{flex:0 0 auto}
.menu-body{min-height:0;overflow:auto;max-height:calc(90svh - 88px)}
.menu-collection .shelf-heading{align-items:center}
.menu-collection .shelf-heading h3{margin:0;font-size:20px;line-height:1.35}
.menu-collection .discovery-card{display:grid;grid-template-columns:minmax(0,1fr) 96px;grid-template-rows:auto auto auto;align-items:center;gap:5px 8px;padding:12px 14px;border-radius:22px;text-align:left}
.menu-collection .panel-label{grid-column:1;grid-row:1;justify-self:start;padding:4px 9px;border-radius:99px;font-size:12px}
.menu-collection .discovery-plinth{grid-column:2;grid-row:1/4;display:grid;place-items:center;height:92px;margin:0;border-radius:20px;background:#fff5d9;box-shadow:inset 0 2px 4px #fff,0 3px 0 #ddc795}
.menu-collection .discovery-plinth img{display:block;width:88px;height:88px;filter:drop-shadow(0 5px 5px #354d6c18)}
.menu-collection .discovery-card h2{grid-column:1;grid-row:2;margin:0;font-size:20px;line-height:1.3}
.menu-collection .text-button{grid-column:1;grid-row:3;display:flex;align-items:center;justify-content:space-between;width:100%;min-height:40px;margin:0;padding:7px 10px;font-size:14px}
.menu-collection .material-notes{margin:14px 0 0}
.menu-collection .material-notes h4{font:16px var(--game-font);color:#795284;margin:0 0 8px}
.menu-collection .material-trio{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.menu-collection .material-trio>div{padding:7px 4px;border:1px solid #eadbea;border-radius:16px;background:#fff9f4;box-shadow:0 2px 0 #ddcce254;text-align:center}
.menu-collection .material-trio img{display:block;width:46px;height:46px;margin:auto}
.menu-collection .material-trio b{display:block;margin-top:4px;font-size:13px;color:#694676}
.menu-collection progress{appearance:none;display:block;width:100%;height:6px;margin:10px 0 14px;border:0;border-radius:8px;background:#ddcbe6;overflow:hidden}
.menu-collection progress::-webkit-progress-bar{background:#ddcbe6;border-radius:8px}
.menu-collection progress::-webkit-progress-value{background:#ab86ba;border-radius:8px}
.menu-collection progress::-moz-progress-bar{background:#ab86ba;border-radius:8px}
.menu-collection .discovery-card{background:linear-gradient(#fffdf7a8,#f6e8f2af),var(--foam-grain) repeat;box-shadow:inset 2px 2px 4px #fff,inset -3px -4px 6px #ccb4c443,0 4px 0 #d2b9cd}
@media(max-width:600px){.app{margin-inline:auto}.sponsor-rail{width:calc(100% - 16px);margin:14px auto max(16px,env(safe-area-inset-bottom))}.menu-body{max-height:calc(92svh - 88px)}}
