/* One control family; game cells retain their meaningful colours and geometry. */
:root{--control-radius:12px;--control-line:rgba(122,222,237,.45);--control-fill:linear-gradient(150deg,rgba(33,109,127,.38),rgba(9,40,59,.48))}
body .app{overflow:visible!important}
body.sticky-shell .app>header{position:sticky!important;top:0;z-index:40;background:rgba(5,23,37,.88)!important;backdrop-filter:blur(18px);padding:10px 0!important;gap:8px}
.app>header .brand{margin-right:auto;min-width:0}
.app>header #app-settings,.app>header #about{width:44px;height:44px;min-width:44px;padding:8px;display:grid;place-items:center;border-radius:var(--control-radius)!important}
#app-settings[hidden]{display:none!important}
body button:is(.primary,.secondary,.back,.icon,.session-pause,.text-button),body .bottom-tabs button,body .tier-trigger{background:var(--control-fill)!important;border:1px solid var(--control-line)!important;border-radius:var(--control-radius)!important;color:#eafcff!important;box-shadow:inset 0 1px 0 #d3ffff16!important;text-shadow:none!important;font-weight:650;min-height:44px;line-height:1.25}
body button.primary{border-color:#75e4ed!important;background:linear-gradient(145deg,#196d80b3,#154757b3)!important}
body button:is(.primary,.secondary,.back,.icon,.session-pause,.text-button):active{transform:translateY(1px);filter:brightness(1.2)}
body .bottom-tabs{grid-template-columns:repeat(3,minmax(0,1fr))!important}
body .bottom-tabs button[aria-current=page]{border-color:#7ae5ed!important;background:#235b6c99!important}
body[data-screen=practice] .mode-list,body[data-screen=practice] .recent-games{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important;overflow:visible!important}
body[data-screen=practice] button.mode-card{width:100%!important;height:148px!important;min-height:148px!important;max-height:148px!important;min-width:0!important;display:flex!important;flex-direction:column!important;justify-content:center;align-items:flex-start;gap:8px!important;padding:12px!important;border:1px solid var(--control-line)!important;border-radius:var(--control-radius)!important;background:var(--control-fill)!important}
body[data-screen=practice] .mode-card .mode-icon{width:28px!important;height:28px!important;font-size:23px!important;flex:none}
body[data-screen=practice] .mode-card strong{display:block;font-size:16px!important;line-height:1.15!important;min-height:36px;overflow-wrap:normal}
body[data-screen=practice] .mode-card small{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;font-size:12px!important;line-height:1.25!important;min-height:30px}
body .attention .tile.found{opacity:1!important;background:linear-gradient(145deg,#75ebee,#208995)!important;color:#041d29!important;border:2px solid #c5ffff!important;box-shadow:inset 0 0 0 2px #124951,0 0 12px #55dfe955!important;font-weight:900!important;position:relative;transform:scale(.94)}
body .attention .tile.found:after{content:'✓';position:absolute;top:1px;right:3px;font-size:clamp(9px,2.5vw,13px);color:#082e39}
#profile-progress{border-top:1px solid #77dbea40;margin-top:22px;padding-top:10px}
#profile-progress>.personal-summary{display:none}
.profile-readonly>.profile-summary .study-avatar{width:144px!important;height:144px!important;flex:0 0 144px;object-fit:cover}
.profile-readonly>.profile-summary>div{min-width:0}.profile-readonly h2{overflow-wrap:anywhere}
.profile-editor .dialog-top{gap:12px}.profile-editor h1{font-size:24px}
@media(max-width:360px){.profile-readonly>.profile-summary .study-avatar{width:112px!important;height:112px!important;flex-basis:112px}.app>header .brand-logo{width:50px!important;height:50px!important}.app>header .brand{font-size:23px!important}}

.test-methods{display:grid;gap:12px}.test-methods button{padding:18px;text-align:left;display:grid;gap:6px}.test-methods span{font-size:14px;color:#c1dce3}.span-digit{height:140px;display:grid;place-items:center;font-size:clamp(28px,7vw,54px);font-weight:800;letter-spacing:.08em;white-space:nowrap}.span-keypad{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}.span-keypad[hidden]{display:none}.span-keypad button{min-height:52px!important}.span-keypad #span-submit{grid-column:span 2}

/* Intrinsic table width must never enlarge the profile grid or page viewport. */
.profile-readonly{width:100%;min-width:0;max-width:100%;grid-template-columns:minmax(0,1fr)}
.profile-readonly>*{min-width:0;max-width:100%;margin-inline:0}
#profile-progress{width:100%;min-width:0;max-width:100%}
#profile-progress .personal-table,#profile-progress .day-chart{width:100%;max-width:100%;min-width:0;overflow-x:auto;overscroll-behavior-x:contain}
#profile-progress .personal-stats{grid-template-columns:repeat(3,minmax(0,1fr))}
#profile-progress .stat,#profile-progress .result-row>span{min-width:0;overflow-wrap:anywhere}
.profile-readonly .player-id{overflow-wrap:anywhere}
.profile-readonly>.profile-summary{display:grid;grid-template-columns:minmax(0,144px) minmax(0,1fr);gap:14px;padding:14px}
.profile-readonly>.profile-summary .study-avatar{width:100%!important;max-width:144px;height:auto!important;aspect-ratio:1}
body[data-screen=settings] .app{width:100%;max-width:620px;padding-bottom:calc(100px + env(safe-area-inset-bottom))!important}
body .bottom-tabs{position:fixed!important;inset:auto 0 0!important;margin-inline:auto;transform:none!important;width:100%!important;max-width:620px;z-index:100;flex-shrink:0}
@media(max-width:380px){.profile-readonly>.profile-summary{grid-template-columns:minmax(0,104px) minmax(0,1fr);gap:12px;padding:12px}.profile-readonly>.profile-summary .study-avatar{max-width:104px}.profile-readonly>.profile-summary h2{font-size:20px!important}.profile-readonly .player-id{font-size:13px}}

/* Compact training list: one clear row per game, large icon, two text lines. */
body[data-screen=practice] .mode-list{grid-template-columns:minmax(0,1fr)!important;gap:8px!important}
body[data-screen=practice] button.mode-card{display:grid!important;grid-template-columns:56px minmax(0,1fr)!important;align-items:center!important;gap:14px!important;min-height:82px!important;height:auto!important;max-height:none!important;padding:12px!important;border-radius:14px!important;background:linear-gradient(115deg,#164c6059,#09273959)!important}
body[data-screen=practice] .mode-card .mode-icon{width:56px!important;height:56px!important;font-size:35px!important;line-height:1!important;border-radius:13px!important;display:grid!important;place-items:center!important;color:#8eeef5!important;background:linear-gradient(150deg,#47bcc526,#16405e55)!important;border:1px solid #83e3ee38;box-shadow:inset 0 1px 0 #dbffff20!important}
body[data-screen=practice] .mode-card>span:last-child{min-width:0;display:grid;gap:5px}
body[data-screen=practice] .mode-card strong{font-size:17px!important;line-height:1.22!important;min-height:0!important;overflow-wrap:break-word}
body[data-screen=practice] .mode-card small{font-size:13px!important;line-height:1.35!important;min-height:0!important;color:#bbd7e1!important;-webkit-line-clamp:2}
body[data-screen=practice] .category-tabs{margin:8px 0 14px!important;padding:0!important;gap:6px!important}
body[data-screen=practice] #content>h2{font-size:18px!important;margin:12px 0 10px!important}
body[data-screen=practice] #content>.welcome{margin:8px 0 16px!important;font-size:14px}
.game-settings .game-language{display:grid;gap:10px}.game-settings select{width:100%;min-height:48px;padding:10px 12px;background:#113446;color:#eaffff;border:1px solid #6bb8c777;border-radius:12px;font:inherit}
.game-settings .row-toggle{display:flex;justify-content:space-between;gap:16px;min-height:56px;padding:12px;margin:10px 0;border:1px solid #6bb8c744;border-radius:12px}.game-settings input[type=checkbox]{width:23px;height:23px;flex:0 0 23px;accent-color:#6edee9}.game-settings h3{margin:24px 0 10px}.game-settings #game-settings-status:empty{display:none}
.game-settings .dialog-top{align-items:center;gap:16px}.game-settings .dialog-top h2{margin:0;flex:1;min-width:0}.game-settings .dialog-top button{width:auto;flex:none;min-width:88px}.game-settings #email-settings{margin-top:24px}.game-settings #email-message{color:#f2c78c;overflow-wrap:anywhere}
