
@media(max-width:700px){
 html .mode-screen{display:grid!important;min-height:0!important;align-content:start!important;gap:16px!important}
 html .mode-subtitle{justify-self:start!important;margin:0!important;padding:0!important;background:none!important;border:0!important;box-shadow:none!important;border-radius:0!important;font-size:13px!important;color:#675a49!important}
 html .player-count{max-width:none!important;margin:0!important;padding:4px!important;gap:4px!important;border:1px solid #a99a7f!important;border-radius:12px!important;box-shadow:none!important;background:#e2d9c7!important}
 html .player-count button{padding:10px!important;border-radius:8px!important;font-size:15px!important;min-height:44px!important;box-shadow:none!important;background:#f5efdf!important;color:#594c38!important;border:1px solid transparent!important}
 html .player-count button.chosen{background:#23495f!important;color:white!important;border-color:#23495f!important}
 html .player-count button.chosen:after,html .mode-option.chosen:after{display:none!important}
 html .mode-label{margin:0!important;text-align:right!important;font-size:15px!important}
 html .mode-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important}
 html .mode-option{display:grid!important;grid-template-columns:32px 1fr!important;grid-template-rows:auto auto!important;column-gap:8px!important;row-gap:2px!important;padding:10px!important;align-items:center!important;text-align:right!important;border-radius:10px!important;box-shadow:none!important;background:#eae0cc!important;min-height:76px!important}
 html .mode-option.chosen{background:#e0edf0!important;border-color:#326d85!important}
 html .mode-emblem{grid-row:1/3!important;width:32px!important;height:32px!important;font-size:21px!important;border-width:1px!important;background:#d7c29d!important;text-shadow:none!important;box-shadow:none!important}
 html .mode-option strong{font-size:13px!important}
 html .mode-option small{min-height:0!important;font-size:10px!important;line-height:1.6!important}
 html .mode-explainer{margin:0!important;padding:12px!important;background:#eae2d1!important;border-radius:10px!important;font-size:12px!important;line-height:1.9!important;text-align:right!important}
 html .mode-screen label{font-size:12px!important;margin:0!important;display:grid!important;gap:6px!important}
 html .mode-screen select{min-height:44px!important;border-radius:10px!important}
 html .mode-rewards{padding:12px!important;gap:10px!important;min-height:0!important;justify-content:flex-start!important;border:1px solid #c7b897!important;box-shadow:none!important;background:#f9f4e7!important}
 html .mode-rewards>span{font-size:28px!important;text-shadow:none!important}
 html .mode-rewards strong{font-size:12px!important;line-height:1.8!important}
 html .mode-rewards p{margin:3px 0 0!important;font-size:11px!important}
 html .mode-dialog .start-game-button{width:100%!important;max-width:none!important;min-height:50px!important;margin:0!important;font-size:19px!important;justify-self:stretch!important}
 html .mode-dialog .start-game-button{position:static!important;left:auto!important;right:auto!important;bottom:auto!important;transform:none!important;z-index:auto!important}
}
/* Mobile online setup: constrain intrinsic grid widths and keep start in flow. */
@media(max-width:700px){
 html dialog.mode-dialog[open],html dialog.game-select[open]{box-sizing:border-box!important;width:100%!important;max-width:100vw!important;min-width:0!important;margin:0!important;inset:0!important;height:100dvh!important;max-height:100dvh!important;display:grid!important;grid-template-rows:auto minmax(0,1fr)!important;grid-template-columns:minmax(0,1fr)!important;border-radius:0!important}
 html .mode-dialog .dialog-head,html .game-select .dialog-head{box-sizing:border-box;min-width:0;max-width:100%}
 html .mode-dialog .dialog-body,html .game-select .dialog-body{box-sizing:border-box!important;min-width:0!important;width:100%!important;max-width:100%!important;grid-template-columns:minmax(0,1fr)!important;overflow-x:hidden!important;overflow-y:auto!important;padding:20px 14px calc(24px + env(safe-area-inset-bottom))!important}
 html .mode-dialog .mode-screen{box-sizing:border-box!important;min-width:0!important;width:100%!important;max-width:100%!important;min-height:0!important;grid-template-columns:minmax(0,1fr)!important;align-content:start!important;gap:18px!important}
 html .mode-dialog .mode-screen>*{box-sizing:border-box;min-width:0;max-width:100%}
 html .mode-dialog .mode-subtitle{justify-self:center;margin:0!important}
 html .mode-dialog .arena-book{width:100%!important;max-width:100%!important;min-width:0!important;margin:0 0 10px!important;padding:12px 8px 10px!important;overflow:hidden!important}
 html .mode-dialog .arena-book-title{margin-inline:8px;min-width:0}
 html .mode-dialog .arena-book-title span{font-size:17px}
 html .mode-dialog .arena-book-pages{box-sizing:border-box!important;min-width:0!important;max-width:100%!important;width:100%!important;min-height:0!important;padding:6px 5px 14px!important;gap:12px!important;overflow-x:auto!important;overflow-y:hidden!important;align-items:stretch!important;direction:rtl;scroll-padding-inline:5px;touch-action:pan-x pan-y!important}
 html .mode-dialog .arena-book .arena-card{box-sizing:border-box!important;flex:0 0 calc(100% - 12px)!important;min-width:0!important;max-width:100%!important;height:auto!important;min-height:0!important;grid-template-columns:minmax(0,1fr)!important;grid-template-rows:156px auto!important}
 html .mode-dialog .arena-book .arena-copy{min-width:0!important;min-height:94px!important;grid-template-columns:26px minmax(0,1fr) auto!important;padding:10px 9px 12px!important;overflow-wrap:anywhere}
 html .mode-dialog .arena-copy strong,html .mode-dialog .arena-copy small,html .mode-dialog .arena-requirement{min-width:0;white-space:normal}
 html .mode-dialog .arena-copy b{font-size:10px;white-space:nowrap}
 html .mode-dialog .arena-book-footer{gap:4px 10px;flex-wrap:wrap;margin-inline:8px;font-size:10px}
 html .mode-dialog .player-count{box-sizing:border-box!important;min-width:0!important;width:100%!important;max-width:360px!important;margin:0 auto!important;grid-template-columns:repeat(2,minmax(0,1fr))!important}
 html .mode-dialog .player-count:has(>button:only-child){grid-template-columns:minmax(0,1fr)!important}
 html .mode-dialog .player-count button{min-width:0!important;width:auto!important;padding:12px 6px!important;font-size:16px}
 html .mode-dialog .mode-grid{min-width:0;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 10px}
 html .mode-dialog .mode-option{min-width:0;max-width:100%}
 html .mode-dialog .mode-rewards{min-width:0;gap:10px;padding:14px 10px!important}
 html .mode-dialog .mode-rewards>div{min-width:0;overflow-wrap:anywhere}
 html .mode-dialog .mode-explainer{margin:0;line-height:1.9}
 html .mode-dialog .start-game-button{box-sizing:border-box!important;position:static!important;inset:auto!important;transform:none!important;width:100%!important;max-width:100%!important;min-width:0!important;margin:0 0 8px!important;justify-self:stretch!important;z-index:auto!important}
}
@media(max-width:700px){
 html .mode-dialog .mode-screen{height:max-content!important;grid-auto-rows:max-content!important;grid-template-rows:none!important}
 html .mode-dialog .arena-book{display:block!important;height:auto!important;min-height:360px!important;align-self:start!important}
 html .mode-dialog .arena-book-title{display:block!important;min-height:42px!important}
 html .mode-dialog .arena-book-pages{height:auto!important;min-height:272px!important}
 html .mode-dialog .arena-book-footer{display:flex!important;min-height:24px!important}
}
/* Phone test: retain only the arena card and its horizontal page carousel. */
@media(max-width:700px){
 html .mode-dialog .dialog-body{padding:10px 14px calc(12px + env(safe-area-inset-bottom))!important}
 html .mode-dialog .mode-screen{gap:10px!important}
 html .mode-dialog .arena-book{min-height:0!important;margin:0!important;padding:0!important;border:0!important;border-radius:0!important;background:none!important;box-shadow:none!important;overflow:visible!important}
 html .mode-dialog .arena-book::before,html .mode-dialog .arena-book::after,html .mode-dialog .arena-book-title,html .mode-dialog .arena-book-footer,html .mode-dialog .arena-book-spine{display:none!important}
 html .mode-dialog .arena-book-pages{min-height:0!important;padding:4px 3px 10px!important;gap:10px!important;scroll-padding-inline:3px!important}
 html .mode-dialog .arena-book .arena-card{flex-basis:calc(100% - 10px)!important;grid-template-rows:142px auto!important;border-radius:14px!important}
 html .mode-dialog .arena-preview{height:142px!important;min-height:0!important}
 html .mode-dialog .arena-book .arena-copy{min-height:70px!important;padding:7px 9px!important;gap:0 6px!important}
 html .mode-dialog .player-count{padding:3px!important}
 html .mode-dialog .player-count button{min-height:44px!important;padding:8px 6px!important}
 html .mode-dialog .mode-label{font-size:14px!important}
 html .mode-dialog .mode-grid{gap:8px!important}
 html .mode-dialog .mode-option{min-height:64px!important;padding:7px 9px!important}
 html .mode-dialog .mode-explainer{font-size:11px!important;line-height:1.7!important;padding:8px!important}
 html .mode-dialog .mode-rewards{padding:8px 10px!important}
 html .mode-dialog .start-game-button{min-height:48px!important;margin:0!important}
}

/* The card itself is the only frame on wider screens too. */
@media(min-width:701px){
 html .mode-dialog .mode-screen{min-height:0!important;height:auto!important;grid-auto-rows:max-content!important;grid-template-rows:none!important;gap:12px!important}
 html .mode-dialog .arena-book{display:block!important;min-height:0!important;height:auto!important;margin:0!important;padding:0!important;border:0!important;background:none!important;box-shadow:none!important}
 html .mode-dialog .arena-book-title,html .mode-dialog .arena-book-footer,html .mode-dialog .arena-book::before,html .mode-dialog .arena-book::after{display:none!important}
 html .mode-dialog .arena-book-pages{min-height:0!important;padding:4px 4px 12px!important}
 html .mode-dialog .arena-card{flex-basis:calc(100% - 12px)!important;min-width:0!important}
 html .mode-dialog .start-game-button{position:static!important;inset:auto!important;transform:none!important;margin:0!important}
}
