/* Compact surfaces and bounded, compositor-friendly game effects. */
.product-home>.home-profile{display:grid!important;grid-template-columns:112px minmax(0,1fr);gap:10px 16px!important;padding:14px!important;align-items:center}
.product-home>.home-profile .study-avatar{width:112px!important;height:112px!important}
.product-home>.home-profile>.xp-day{grid-column:1/-1;margin:0!important;padding:10px 0 0!important;border:0;border-top:1px solid #78c7d640;border-radius:0;background:transparent!important}
.home-profile .xp-day h2{font-size:14px!important;margin:0 0 7px!important;font-weight:500;color:#c9e1e8}
.home-profile .xp-slots{gap:8px}.home-profile .xp-slots span{display:flex;justify-content:space-between;align-items:center;gap:6px;font-size:12px;padding:8px;border:0;background:#24596825}
.home-profile .xp-slots strong{font-size:13px;margin:0;white-space:nowrap}.home-profile .local-progress-note{display:block;font-size:11px;margin-top:6px;color:#b8d0da}
body #content .favorite-card>:is(.mode-card,.favorite-launch){padding-right:100px!important}
body #content .favorite-card>.game-help-toggle{position:absolute;right:51px;top:50%;transform:translateY(-50%)}
body #content .game-help-toggle,.game-help-inline{width:44px!important;height:44px!important;min-width:44px;min-height:44px!important;padding:0!important;display:grid;place-items:center;border:0!important;box-shadow:none!important;background:transparent!important;color:#bce3ed!important;font-size:21px!important;border-radius:50%!important}
.game-help-toggle:focus-visible,.game-help-inline:focus-visible{outline:2px solid #8df6ee!important;outline-offset:-5px}
.game-help-dialog{width:calc(100% - 24px);max-width:480px;max-height:85dvh;overflow:auto;box-sizing:border-box;padding:20px;border:1px solid #8fced566;border-radius:22px;background:#0b2432f5;color:#edfaff;line-height:1.65}
.game-help-dialog::backdrop{background:#00101bbc}.game-help-heading{display:flex;justify-content:space-between;align-items:center;gap:8px}.game-help-heading h2{font-size:23px;margin:0;line-height:1.2}.game-help-heading button{min-width:44px;min-height:44px;padding:5px!important;width:44px!important}.game-help-dialog>button{width:100%;margin-top:16px}.game-help-dialog summary{min-height:44px;cursor:pointer;padding:8px 0}.game-help-dialog li{margin:8px 0}.game-intro-heading{display:flex;align-items:center;justify-content:space-between;gap:8px}
.arcade-card-wrap{position:relative;min-width:0}.arcade-card-wrap>.game-help-toggle{position:absolute;right:8px;top:50%;transform:translateY(-50%)}.arcade-card-wrap .arcade-card{padding-right:57px!important}
.arcade-entry{padding:14px}.arcade-entry-title{margin-bottom:10px}.arcade-entry-title h2{font-size:21px}.arcade-infinity{font-size:30px}
body[data-arcade=play] .arcade-meta{min-height:20px;font-size:13px;font-variant-numeric:tabular-nums}.play-tetris .arcade-next>span{display:none}
body[data-arcade=play] .controls-tetris{grid-template-rows:56px}.controls-tetris [data-arcade-command]>small{display:none}body[data-arcade=play] .controls-tetris>button{height:56px;min-height:56px!important}
.arcade-block-grid,.arcade-tetris-grid{position:relative;isolation:isolate}.arcade-fx{position:absolute;inset:0;z-index:5;pointer-events:none;overflow:hidden;contain:strict}
.arcade-fx i{position:absolute;display:block;width:5px;height:5px;background:#b4ffff;box-shadow:0 0 4px #6af6ee80;pointer-events:none}
.arcade-fx .fx-spark{border-radius:50%}.arcade-fx .fx-diamond{background:#d1b6ff;clip-path:polygon(50% 0,100% 50%,50% 100%,0 50%)}.arcade-fx .fx-streak{width:12px;height:2px;background:#ffda93}
.arcade-glass,.arcade-block.filled{backface-visibility:hidden}.arcade-tetris-piece{transition:transform 65ms linear}
body[data-active-game=rectangle] #question-area .tile,body[data-active-game=groups] #question-area .tile{backdrop-filter:none!important;filter:none!important;transition:none!important;contain:layout style}
@media(max-width:380px){.product-home>.home-profile{grid-template-columns:96px minmax(0,1fr);gap:8px 10px!important}.product-home>.home-profile .study-avatar{width:96px!important;height:96px!important}.home-profile .home-nickname{font-size:19px}.home-profile .xp-slots span{flex-direction:column;gap:2px}}
@media(prefers-reduced-motion:reduce){.arcade-fx{display:none}.arcade-tetris-piece{transition:none}}

/* r8: usable controls and restrained labels at narrow phone widths. */
body[data-arcade=play] .controls-tetris{grid-template-columns:repeat(5,minmax(0,1fr));grid-template-rows:72px}
body[data-arcade=play] .controls-tetris>button{height:72px;min-height:72px!important;padding:0!important}
.controls-tetris [data-arcade-command]>span{font-size:34px!important}
.arcade-merge{touch-action:none;user-select:none;-webkit-user-select:none}
body[data-active-game=memory] #question-area .memory .tile.good{color:#c5fff6!important;font-size:32px!important}
body[data-active-game=memory] #question-area .memory .tile.bad{background:#9d2a3eaa!important;border-color:#ff7386!important;color:#fff!important;font-size:32px!important}
body[data-screen=practice] #content .favorite-card>button.mode-card{height:108px!important;min-height:108px!important;max-height:108px!important;gap:10px!important;padding-block:10px!important;align-items:center!important}
body[data-screen=practice] .mode-card strong{font-size:18px!important;line-height:1.2!important;overflow-wrap:normal!important;word-break:normal!important}
body[data-screen=practice] .mode-card small{font-size:13px!important;line-height:1.2!important}
body[data-screen=practice] .mode-card .mode-icon{width:48px!important;height:48px!important;min-width:48px!important;font-size:30px!important}
.practice-categories button,.category-tabs button{white-space:nowrap!important;word-break:normal!important;font-size:clamp(12px,3.5vw,16px)!important;padding-inline:5px!important}
.practice-mastery-result,.server-saved{font-size:16px!important}
body[data-screen=practice] .mode-list{grid-auto-rows:108px!important}
body[data-arcade=play] .app{width:auto!important}

/* Tetris: one static bitmap; no per-cell GPU layers for the settled stack. */
.arcade-tetris-grid{display:block!important;contain:layout style paint}
.tetris-stack,.tetris-shadow,.tetris-clear-layer{position:absolute;left:2px;top:2px;pointer-events:none}
.tetris-stack{display:block}.tetris-shadow{width:0;height:0}.tetris-shadow>.arcade-block{position:absolute;box-sizing:border-box}
.tetris-clear-layer{inset:2px;z-index:3}.tetris-flip{position:absolute;box-sizing:border-box;backface-visibility:visible!important;transform-origin:50% 50%}
.tetris-fall-band{position:absolute;left:2px;pointer-events:none;z-index:2}
.arcade-tetris-piece{z-index:4}.tetris-shadow{z-index:1}

/* r10: one typographic scale and consistent touch targets outside boards. */
body{font-family:Inter,system-ui,-apple-system,"Segoe UI",sans-serif}button,input,select,textarea{font-family:inherit}#content h1{font-size:clamp(26px,6.5vw,34px);line-height:1.15}#content h2{font-size:clamp(21px,5.2vw,26px);line-height:1.2}#content h3{font-size:19px;line-height:1.25}p{line-height:1.45}#content :is(h1,h2,h3){word-break:normal;overflow-wrap:break-word;text-wrap:balance}#content>*,dialog>*{min-width:0;box-sizing:border-box}
body :is(#content,dialog) :is(.primary,.secondary,.back):not(.tile):not(.mode-card):not(.favorite-toggle):not(.avatar-choice){min-height:48px;font-size:16px;line-height:1.2;padding:12px 16px;white-space:normal;word-break:normal;overflow-wrap:normal}body :is(#content,dialog) .stack{gap:10px}.game-head .round-meta{font-size:15px;line-height:1.3}.session-help,.practice-mastery-note,.product-home .local-progress-note{display:none!important}.practice-categories{gap:8px!important}.practice-categories button{min-height:48px!important;white-space:nowrap!important}
body .app>header,body.sticky-shell .app>header{grid-template-columns:minmax(0,1fr) repeat(5,44px)!important;grid-template-areas:"brand full support contact settings help"!important;gap:4px!important;padding:6px 8px!important}body.android-shell .app>header{grid-template-columns:minmax(0,1fr) repeat(4,44px)!important;grid-template-areas:"brand support contact settings help"!important}.app>header #contact-developer{grid-area:contact;width:44px;height:44px;min-width:44px;display:grid;place-items:center;padding:8px}body .app>header .brand{font-size:18px!important;gap:4px!important}body .app>header .brand-logo{width:34px!important;height:34px!important}@media(max-width:390px){body .app>header .brand{font-size:15px!important}body .app>header .brand-logo{width:26px!important;height:28px!important}body .app>header{gap:2px!important;padding-inline:5px!important}}@media(max-width:340px){body:not(.android-shell) .app>header .brand-logo{display:none}}
.player-tools-dialog{width:min(540px,calc(100vw - 24px));max-height:calc(100dvh - 32px);padding:20px;border:1px solid #70b7c688;border-radius:20px;background:#092638f2;color:#ecfaff;overflow:auto;box-sizing:border-box}.player-tools-dialog .dialog-top{display:flex;align-items:center;justify-content:space-between;gap:10px}.player-tools-dialog h2{margin:0;font-size:23px}.player-tools-dialog textarea{display:block;resize:vertical;width:100%;min-height:150px;margin:10px 0;padding:12px;border:1px solid #74c9d577;border-radius:12px;background:#051a29;color:#ecfaff;font-size:17px;box-sizing:border-box}.player-tools-dialog details{margin:12px 0}.player-tools-dialog summary{padding:12px 0;min-height:44px;box-sizing:border-box;cursor:pointer}.player-tools-dialog [type=submit]{width:100%}.opponent-summary{display:flex;align-items:center;gap:16px;margin:18px 0}.opponent-summary .study-avatar{width:88px!important;height:88px!important;flex:none}.opponent-summary p{margin:5px 0}.opponent-summary h3{margin:0;overflow-wrap:anywhere}.opponent-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.opponent-stats span{font-size:14px}.opponent-stats b{display:block;font-size:24px;margin-top:6px}.opponent-avatar{width:52px!important;min-width:52px!important;height:52px!important;min-height:52px!important;padding:3px!important;margin:0!important;background:transparent!important}.opponent-avatar .study-avatar{width:44px!important;height:44px!important}.record-rows>div{display:flex;justify-content:space-between;gap:12px;padding:12px 0;border-bottom:1px solid #658c9c44}.record-rows b{white-space:nowrap}.arcade-ranking{margin-top:20px;padding:16px;border:1px solid #70b7c666;border-radius:18px;background:#08253766}.arcade-ranking select{width:100%;min-height:48px;margin:8px 0;font:inherit;background:#113647;color:#ecfaff;border:1px solid #719faa;border-radius:12px;padding:8px}.arcade-ranking table{width:100%;border-collapse:collapse;table-layout:fixed}.arcade-ranking td,.arcade-ranking th{padding:12px 4px;text-align:left;font-size:15px;overflow-wrap:anywhere;border-bottom:1px solid #719faa44}.arcade-ranking details{margin-top:14px}.arcade-ranking summary{min-height:44px;cursor:pointer}.arcade-ranking p{font-size:16px}
body #question-area .route-board .tile{background:linear-gradient(145deg,hsl(var(--route-hue) 65% 46%/.4),hsl(var(--route-hue) 65% 25%/.5))!important;border:1px solid hsl(var(--route-hue) 70% 72%/.6)!important;opacity:1!important;transition:transform .12s,filter .12s}.route-board .tile.lit{filter:brightness(2.3);transform:scale(.93);box-shadow:inset 0 0 0 3px #e8ffff,0 0 14px #8cffff66!important}.route-board .tile.picked{box-shadow:inset 0 0 0 3px #9ef7e9!important}.route-board .tile:disabled{cursor:default}

@media(max-width:400px){body:not(.android-shell) .app>header .brand{font-size:0!important}body:not(.android-shell) .app>header .brand-logo{display:block;width:40px!important;height:40px!important}}

.player-tools-dialog .dialog-top>[data-close]{width:44px!important;min-width:44px!important;max-width:44px!important;flex:0 0 44px!important;padding:8px!important}.player-tools-dialog .dialog-top h2{flex:1;min-width:0;font-size:22px;line-height:1.2}.opponent-summary .study-avatar{background:transparent!important;border-radius:50%;overflow:hidden}

body[data-screen=practice] #content{padding-inline:12px!important}body[data-screen=practice] .mode-card:not(:disabled) small{display:none!important}body[data-screen=practice] #content .favorite-card>button.mode-card{height:96px!important;min-height:96px!important;max-height:96px!important;column-gap:10px!important}body[data-screen=practice] .mode-list{grid-auto-rows:96px!important}body[data-screen=practice] .mode-card strong{font-weight:650!important}body[data-screen=practice] .mode-card small{font-weight:450!important;font-size:14px!important}

/* Keep the result actions above the fold; details follow the primary action. */
body[data-screen=result] #content{padding:12px 16px 84px!important}body[data-screen=result] .center>.label{display:none}body[data-screen=result] .center h1{font-size:26px;margin:10px 0}body[data-screen=result] .score-circle{width:108px!important;height:108px!important;margin:12px auto!important;border-width:5px!important}body[data-screen=result] .score-circle strong{font-size:29px!important}body[data-screen=result] .score-circle span{font-size:12px;max-width:82px;line-height:1.15}body[data-screen=result] .result-stats{padding:12px 6px!important;margin:12px 0!important}body[data-screen=result] .stat span{font-size:14px!important}body[data-screen=result] .server-saved,body[data-screen=result] .practice-mastery-result{padding:4px 0!important;margin:6px 0!important;background:transparent!important;border:0!important;font-size:15px!important}body[data-screen=result] #content>.stack{grid-template-columns:repeat(2,minmax(0,1fr));margin:12px 0}body[data-screen=result] #content>.stack>button:only-child{grid-column:1/-1}body[data-screen=result] .result-list{margin:12px 0;gap:8px}body[data-screen=result] .result-row{gap:10px;font-size:15px;padding-bottom:8px}body[data-screen=result] .result-row>span:last-child{white-space:nowrap}body[data-screen=result] .xp-result{padding:6px 0!important;margin:0!important;text-align:center;background:transparent!important;border:0!important}body[data-screen=result] .xp-result p{margin:4px}
