.mtaa-turn-banner{flex:0 0 auto!important;font-size:1.125rem!important;font-weight:700!important;min-height:56px!important;margin:14px 0 8px!important;padding:14px 18px!important;border-left:4px solid var(--gold,var(--a,#f5b544));border-radius:14px;background:#ffffff0b;line-height:1.45!important;flex-shrink:0}
.mtaa-turn-banner strong{font-size:inherit!important;font-weight:inherit!important}.mtaa-ownership{font-size:.875rem;line-height:1.45;margin:0 0 12px;flex-shrink:0}.mtaa-game-notice{font-size:1rem;line-height:1.4;margin:0 0 12px;flex-shrink:0;font-weight:650}[hidden]{display:none!important}
.mtaa-reading-rules > *:not(.mtaa-rules-page){display:none!important}.mtaa-rules-page{max-width:700px;margin:auto;padding:24px 20px 40px;font-size:1rem;line-height:1.65}.mtaa-rules-page h1{font-size:1.6rem;letter-spacing:normal;margin:24px 0 16px}.mtaa-rules-page details,.mtaa-rules-page .panel,.mtaa-rules-page .rule,.mtaa-rules-page p{max-height:none!important;height:auto!important;overflow:visible!important}.mtaa-rules-page .small{font-size:1rem!important}.mtaa-rules-page .num{display:none}.mtaa-rules-page a{color:inherit}.mtaa-resume{width:min(480px,calc(100vw - 32px));max-height:90dvh;overflow:auto;border:1px solid #526571;border-radius:22px;background:#13232d;color:#eef4f6;padding:24px;font:16px/1.5 system-ui}.mtaa-resume h2{font-size:1.4rem;margin:0 0 20px}.mtaa-resume::backdrop{background:#000a}.mtaa-resume-actions{display:flex;gap:12px;flex-wrap:wrap}.mtaa-resume button{font:inherit;min-height:44px;padding:10px 16px;background:#172832;color:#eef4f6;border:1px solid #526571;border-radius:12px;cursor:pointer}.mtaa-resume button:first-child{background:#f5b544;color:#18212a}.mtaa-resume button:focus-visible{outline:3px solid white;outline-offset:3px}
#options details,#options details p{max-height:none!important;height:auto!important;overflow:visible!important}
#shisima-clean .player>div>div{display:block;font-size:.875rem!important}.app .controls{flex-wrap:wrap}.app .controls .action{flex:1;max-width:none}

.mtaa-game-controls{display:flex;flex-wrap:wrap;gap:8px;margin:14px 0;flex-shrink:0}.mtaa-game-controls .mtaa-control{flex:1 1 auto;min-height:44px;font:600 14px/1.4 system-ui;padding:10px 12px;margin:0;white-space:nowrap;border:1px solid #526571;border-radius:12px;background:#172832;color:#eef4f6;cursor:pointer}.mtaa-game-controls .mtaa-control:first-child{background:#f5b544;color:#18212a;border-color:#f5b544}.mtaa-game-controls .mtaa-control:disabled{opacity:.45;cursor:default}.mtaa-game-controls .mtaa-control:focus-visible{outline:3px solid white;outline-offset:3px}

/* Reflow automatically as the viewport rotates; game state and board orientation stay intact. */
body[data-mtaa-game] .mtaa-play-surface{max-width:100%;box-sizing:border-box}body[data-mtaa-game] dialog{max-width:calc(100vw - 24px);max-height:90dvh}
@media(orientation:landscape) and (max-height:600px){
 body[data-mtaa-game]:not(.mtaa-reading-rules) header{padding-top:4px;padding-bottom:4px;margin-top:0;margin-bottom:4px}
 body[data-mtaa-game]:not(.mtaa-reading-rules) .online-bar{margin-top:4px;margin-bottom:4px}
 body[data-mtaa-game] .mtaa-turn-banner{min-height:0!important;padding:6px 10px!important;margin:4px 0!important;font-size:16px!important}
 body[data-mtaa-game] .mtaa-ownership{margin:2px 0 6px}body[data-mtaa-game] .players{margin:4px 0;gap:6px}body[data-mtaa-game] .players>div{padding:4px 8px}
 body[data-mtaa-game] .mtaa-game-controls{gap:4px;margin:4px 0}body[data-mtaa-game] .mtaa-game-controls .mtaa-control{padding:6px 8px}
 body[data-mtaa-game="choko"] main{display:block;padding:4px 10px}
 body[data-mtaa-game="shisima"] #shisima-clean,body[data-mtaa-game="morabaraba"] main,body[data-mtaa-game="draughts"] main{max-width:none;padding:4px 10px}
 body[data-mtaa-game="choko"] .mtaa-play-layout,body[data-mtaa-game="shisima"] .mtaa-play-layout,body[data-mtaa-game="morabaraba"] .mtaa-play-layout,body[data-mtaa-game="draughts"] .mtaa-play-layout{display:grid;grid-template-columns:minmax(0,min(55vw,calc(100dvh - 100px))) minmax(0,1fr);gap:4px 12px;align-content:start;align-items:start}
 body[data-mtaa-game="choko"] .mtaa-play-layout>*,body[data-mtaa-game="shisima"] .mtaa-play-layout>*,body[data-mtaa-game="morabaraba"] .mtaa-play-layout>*,body[data-mtaa-game="draughts"] .mtaa-play-layout>*{grid-column:2;min-width:0}
 body[data-mtaa-game="choko"] .mtaa-play-surface,body[data-mtaa-game="shisima"] .mtaa-play-surface,body[data-mtaa-game="morabaraba"] .mtaa-play-surface,body[data-mtaa-game="draughts"] .mtaa-play-surface{grid-column:1;grid-row:1 / span 16;width:100%;padding:8px;align-self:start}
 body[data-mtaa-game="choko"] .board{gap:5px}body[data-mtaa-game="choko"] .reserve-rail{min-height:18px;padding:2px}
 body[data-mtaa-game="morabaraba"] .point{width:clamp(24px,8dvh,40px);height:clamp(24px,8dvh,40px)}
 body[data-mtaa-game="kalah"] main,body[data-mtaa-game="bao"]:not(.bao-fullscreen) main{max-width:none;padding:4px 10px}
 body[data-mtaa-game="kalah"] #board{min-height:0;height:clamp(150px,48dvh,300px);grid-template-rows:repeat(2,minmax(0,1fr));padding:8px 12px;gap:6px;border-width:3px}
 body[data-mtaa-game="bao"]:not(.bao-fullscreen) .board-wrap{width:min(100%,calc((100dvh - 160px)*1.85));margin:auto;padding:6px}
 body[data-mtaa-game="bao"] #board{gap:5px}body[data-mtaa-game="bao"] .pit.inner-bottom{margin-top:4px}
 body[data-mtaa-game="shimo"] .app{max-width:none;min-height:100dvh;padding:6px 10px;display:grid;grid-template-columns:minmax(0,65%) minmax(0,1fr);gap:6px 12px;align-content:start}
 body[data-mtaa-game="shimo"] .app>*{grid-column:2;min-width:0}
 body[data-mtaa-game="shimo"] #field{grid-column:1;grid-row:1 / span 16;min-height:0;height:calc(100dvh - 20px);max-height:none;width:100%}
 body[data-mtaa-game="shimo"] .score{margin:4px 0;gap:4px}body[data-mtaa-game="shimo"] .score>div{padding:4px;min-height:0}body[data-mtaa-game="shimo"] .controls{flex-wrap:wrap;gap:4px}
}

@media(orientation:landscape) and (max-height:600px){
 body[data-mtaa-game="choko"] main{max-width:none}
 body[data-mtaa-game="choko"] .mtaa-play-layout{grid-template-columns:minmax(0,min(48vw,calc(100dvh - 170px))) minmax(0,1fr)}
 body[data-mtaa-game="choko"] .reserve-rail{width:100%;min-width:0;min-height:24px;padding:2px 0;gap:3px;margin:0!important}
 body[data-mtaa-game="choko"] .reserve-stick{flex:0 1 24px;width:calc((100% - 33px)/12);max-width:24px;min-width:0;height:20px;min-height:0;font-size:11px}
 body[data-mtaa-game="choko"] .board-wrap{padding:6px!important}
 body[data-mtaa-game="choko"] #coach:empty,body[data-mtaa-game="choko"] #toast:empty,body[data-mtaa-game="choko"] #seriesScore:empty{display:none!important}
 body[data-mtaa-game="choko"] .player{padding:4px 8px!important}body[data-mtaa-game="choko"] .name-button{min-height:30px}
 body[data-mtaa-game] .mtaa-play-layout{row-gap:2px}
 body[data-mtaa-game] .mtaa-play-layout>.mtaa-game-controls{align-self:start}
 body[data-mtaa-game] header h1,body[data-mtaa-game] header .brand{font-size:20px!important}
 body[data-mtaa-game] header .origin,body[data-mtaa-game] header .brand-credit,body[data-mtaa-game] header .heading p{display:none}
 body[data-mtaa-game] .online-bar{min-height:0;margin:2px auto!important}body[data-mtaa-game] .online-bar button{padding:4px 10px;min-height:36px}
 body[data-mtaa-game] .mtaa-game-controls .mtaa-control{flex:1 1 90px;white-space:normal}
 body[data-mtaa-game="draughts"] .mtaa-play-layout,body[data-mtaa-game="morabaraba"] .mtaa-play-layout,body[data-mtaa-game="shisima"] .mtaa-play-layout{grid-template-columns:minmax(0,min(50vw,calc(100dvh - 120px))) minmax(0,1fr)}
}

.draughts-side{display:contents}
@media(orientation:landscape) and (max-height:600px){
 body[data-mtaa-game="draughts"] main.mtaa-play-layout{width:100%;max-width:none;min-height:100dvh;padding:8px;display:grid;grid-template-columns:minmax(0,min(65vw,calc(100dvh - 16px))) minmax(180px,260px);grid-template-rows:auto;justify-content:center;align-items:start;gap:10px}
 body[data-mtaa-game="draughts"] main.mtaa-play-layout>.board-wrap{grid-column:1;grid-row:1;width:100%;padding:6px;margin:0}
 body[data-mtaa-game="draughts"] main.mtaa-play-layout>.draughts-side{display:flex;flex-direction:column;grid-column:2;grid-row:1;gap:4px;max-height:calc(100dvh - 16px);overflow-y:auto;min-width:0;padding-right:4px}
 body[data-mtaa-game="draughts"] .draughts-side header{width:100%;padding:0;margin:0;border:0;gap:4px}
 body[data-mtaa-game="draughts"] .heading{gap:4px}body[data-mtaa-game="draughts"] .heading span{display:none}body[data-mtaa-game="draughts"] header h1{font-size:14px!important;letter-spacing:0}
 body[data-mtaa-game="draughts"] header button{padding:4px 8px;font-size:14px}
 body[data-mtaa-game="draughts"] .players{gap:4px}body[data-mtaa-game="draughts"] .players>div{padding:4px 6px}body[data-mtaa-game="draughts"] .players strong{font-size:16px}body[data-mtaa-game="draughts"] .players span{font-size:14px}
 body[data-mtaa-game="draughts"] .tools{margin:0}body[data-mtaa-game="draughts"] .tools button{padding:5px 10px;font-size:14px}
 body[data-mtaa-game="draughts"] .mtaa-game-controls{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));margin:0}
 body[data-mtaa-game="draughts"] .mtaa-game-controls button{font-size:14px;min-height:44px;padding:5px 6px}
}
@media(orientation:portrait),(min-height:601px){
 body[data-mtaa-game="draughts"] main.mtaa-play-layout{display:flex;flex-direction:column}
 body[data-mtaa-game="draughts"] .draughts-side header{order:-8;width:100%;padding:0 0 12px}
 body[data-mtaa-game="draughts"] .draughts-side .online-bar{order:-7;width:100%}
 body[data-mtaa-game="draughts"] .draughts-side .online-social,body[data-mtaa-game="draughts"] .draughts-side .tournament-match-info{order:-6}
 body[data-mtaa-game="draughts"] .draughts-side .players{order:-5}
 body[data-mtaa-game="draughts"] .draughts-side #series{order:-4}
 body[data-mtaa-game="draughts"] .draughts-side #status{order:-3}
 body[data-mtaa-game="draughts"] .draughts-side .mtaa-ownership{order:-2}
 body[data-mtaa-game="draughts"] .draughts-side .mtaa-game-notice{order:-1}
 body[data-mtaa-game="draughts"] .board-wrap{width:100%}
}

/* Shared board-first layout for every game. */
.mtaa-side{display:contents}
@media(orientation:landscape) and (max-height:600px){
 body[data-mtaa-game] .mtaa-play-layout{width:100%;max-width:none;min-height:100dvh;padding:8px;display:grid;grid-template-columns:minmax(0,min(65vw,calc(100dvh - 16px))) minmax(180px,260px);grid-template-rows:auto;justify-content:center;align-items:start;gap:10px}
 body[data-mtaa-game] .mtaa-play-layout>.mtaa-play-surface{grid-column:1;grid-row:1;width:100%;padding:6px;margin:0}
 body[data-mtaa-game] .mtaa-play-layout>.mtaa-side{display:flex;flex-direction:column;grid-column:2;grid-row:1;gap:4px;max-height:calc(100dvh - 16px);overflow-y:auto;min-width:0;padding-right:4px}
 body[data-mtaa-game] .mtaa-side header{width:100%;padding:0;margin:0;border:0;gap:4px}
 body[data-mtaa-game] .heading{gap:4px}body[data-mtaa-game] .heading span{display:none}body[data-mtaa-game] header h1{font-size:14px!important;letter-spacing:0}
 body[data-mtaa-game] header button{padding:4px 8px;font-size:14px}
 body[data-mtaa-game] .players{gap:4px}body[data-mtaa-game] .players>div{padding:4px 6px}body[data-mtaa-game] .players strong{font-size:16px}body[data-mtaa-game] .players span{font-size:14px}
 body[data-mtaa-game] .tools{margin:0}body[data-mtaa-game] .tools button{padding:5px 10px;font-size:14px}
 body[data-mtaa-game] .mtaa-game-controls{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));margin:0}
 body[data-mtaa-game] .mtaa-game-controls button{font-size:14px;min-height:44px;padding:5px 6px}
}
@media(orientation:portrait),(min-height:601px){
 body[data-mtaa-game] .mtaa-play-layout{display:flex;flex-direction:column}
 body[data-mtaa-game] .mtaa-side header{order:-8;width:100%;padding:0 0 12px}
 body[data-mtaa-game] .mtaa-side .online-bar{order:-7;width:100%}
 body[data-mtaa-game] .mtaa-side .online-social,body[data-mtaa-game] .mtaa-side .tournament-match-info{order:-6}
 body[data-mtaa-game] .mtaa-side .players{order:-5}
 body[data-mtaa-game] .mtaa-side #series{order:-4}
 body[data-mtaa-game] .mtaa-side #status{order:-3}
 body[data-mtaa-game] .mtaa-side .mtaa-ownership{order:-2}
 body[data-mtaa-game] .mtaa-side .mtaa-game-notice{order:-1}
 body[data-mtaa-game] .mtaa-play-surface{width:100%}
}

@media(orientation:landscape) and (max-height:600px){
 body[data-mtaa-game] .mtaa-play-layout>.mtaa-side{grid-column:2!important;grid-row:1!important}
 body[data-mtaa-game] .mtaa-play-layout>.mtaa-play-surface{grid-column:1!important;grid-row:1!important}
 body[data-mtaa-game="choko"] main{padding:0;max-width:none}
 body[data-mtaa-game="choko"] .mtaa-play-layout{grid-template-columns:minmax(0,min(65vw,calc(100dvh - 76px))) minmax(180px,260px)}
 body[data-mtaa-game="bao"] .mtaa-play-layout,body[data-mtaa-game="kalah"] .mtaa-play-layout,body[data-mtaa-game="shimo"] .mtaa-play-layout{grid-template-columns:minmax(0,1fr) minmax(180px,240px)}
 body[data-mtaa-game="bao"] .mtaa-play-surface{align-self:center!important;max-width:calc((100dvh - 24px)*1.85);margin:auto!important}
 body[data-mtaa-game="kalah"] #board{height:min(calc(100dvh - 24px),40vw);min-height:0;align-self:center;grid-template-rows:repeat(2,minmax(0,1fr))}
 body[data-mtaa-game="shimo"] #field{height:calc(100dvh - 16px);min-height:0;max-height:none}
 body[data-mtaa-game] .mtaa-play-layout>.mtaa-side .mtaa-game-controls{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
 body[data-mtaa-game] .mtaa-side .players strong,body[data-mtaa-game] .mtaa-side .score strong{font-size:16px}
 body[data-mtaa-game] .mtaa-side .players>div{padding:4px 6px}
 body[data-mtaa-game] .mtaa-side .mtaa-turn-banner{font-size:14px!important}
 body[data-mtaa-game] .mtaa-side #phase{font-size:14px;margin:0}
 body[data-mtaa-game] .mtaa-play-layout>.mtaa-side header{order:0}
 body[data-mtaa-game] .mtaa-side .mtaa-back-row{margin:0}
 body[data-mtaa-game] .mtaa-side .mtaa-back{min-height:32px!important;padding:2px!important}
}
@media(orientation:portrait),(min-height:601px){
 body[data-mtaa-game] .mtaa-side .score{order:-5}
 body[data-mtaa-game] .mtaa-side .mtaa-back-row{order:-9}
 body[data-mtaa-game] .mtaa-side #phase{order:-4}
 body[data-mtaa-game] .mtaa-side #seriesScore{order:-4}
 body[data-mtaa-game] .mtaa-side .status{order:-3}
 body[data-mtaa-game="choko"] main{display:block}
}
/* Keep sidebar rows at their natural height instead of compressing them into one another. */
@media(orientation:landscape) and (max-height:600px){
 body[data-mtaa-game] .mtaa-play-layout>.mtaa-side{gap:6px;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain}
 body[data-mtaa-game] .mtaa-side>*{flex-shrink:0!important;max-width:100%;box-sizing:border-box}
 body[data-mtaa-game] .mtaa-side header{display:grid!important;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:4px!important;height:auto!important;min-height:44px;padding:0!important;margin:0!important}
 body[data-mtaa-game] .mtaa-side header .choko-heading,body[data-mtaa-game] .mtaa-side header .heading{flex-wrap:wrap;gap:4px;min-width:0}
 body[data-mtaa-game] .mtaa-side header h1,body[data-mtaa-game] .mtaa-side header .brand{font-size:14px!important;letter-spacing:0!important;line-height:1.3!important}
 body[data-mtaa-game] .mtaa-side header button{font-size:14px!important;min-height:44px;padding:4px 8px!important;white-space:normal}
 body[data-mtaa-game] .mtaa-side .online-bar{width:100%;padding:0!important;margin:0!important;display:flex;flex-wrap:wrap;gap:4px;justify-content:flex-start}
 body[data-mtaa-game] .mtaa-side .online-bar button{min-height:44px;font-size:14px;padding:4px 8px;max-width:100%;white-space:normal}
 body[data-mtaa-game] .mtaa-side .mtaa-ownership{font-size:14px;line-height:1.35;margin:0}
 body[data-mtaa-game] .mtaa-side .mtaa-game-controls{gap:4px;margin:0}
 body[data-mtaa-game] .mtaa-side .mtaa-game-controls button{font-size:14px!important;padding:4px 6px!important;min-height:44px}
}
/* Landscape concentrates on play and the score. */
@media(orientation:landscape){
 body[data-mtaa-game]:not(.mtaa-reading-rules)>header,body[data-mtaa-game]:not(.mtaa-reading-rules)>.online-bar,body[data-mtaa-game]:not(.mtaa-reading-rules)>.online-social{display:none!important}
 body[data-mtaa-game]:not(.mtaa-reading-rules) .mtaa-side>*:not(.players):not(.score):not(#direction):not(#safari):not(#captureControls):not(#capture-controls):not(#result):not(.controls:has(#next:not(:disabled))){display:none!important}
 body[data-mtaa-game] .mtaa-side .controls .status{display:none!important}
 body[data-mtaa-game] .mtaa-play-layout{display:grid!important;grid-template-columns:minmax(0,min(74vw,calc(100dvh - 12px))) minmax(110px,170px)!important;grid-template-rows:auto!important;justify-content:center!important;align-items:center!important;gap:8px!important;padding:6px!important;max-width:none!important;min-height:100dvh!important}
 body[data-mtaa-game] .mtaa-play-layout>.mtaa-play-surface{grid-column:1!important;grid-row:1!important;width:100%!important;margin:0!important;padding:6px!important;align-self:center!important}
 body[data-mtaa-game] .mtaa-play-layout>.mtaa-side{display:flex!important;flex-direction:column;grid-column:2!important;grid-row:1!important;gap:8px;max-height:calc(100dvh - 12px);overflow:auto;min-width:0;padding:0}
 body[data-mtaa-game] .mtaa-side .players{display:flex;flex-direction:column;margin:0!important;gap:6px}
 body[data-mtaa-game] .mtaa-side .players>div{padding:6px 8px!important;min-width:0}
 body[data-mtaa-game] .mtaa-side .score{display:flex;flex-direction:column;margin:0!important;gap:6px}
 body[data-mtaa-game] .mtaa-side .score>div{padding:6px 8px;min-height:0}
 body[data-mtaa-game="choko"] main{display:block!important;max-width:none;padding:0!important}
 body[data-mtaa-game="choko"] .mtaa-play-layout{grid-template-columns:minmax(0,min(74vw,calc(100dvh - 76px))) minmax(110px,170px)!important}
 body[data-mtaa-game="choko"] .reserve-rail{margin:0!important;gap:3px;padding:2px 0;min-height:24px;width:100%}
 body[data-mtaa-game="choko"] .reserve-stick{flex:0 1 24px;min-width:0;width:calc((100% - 33px)/12);height:20px;min-height:0}
 body[data-mtaa-game="bao"] .mtaa-play-layout,body[data-mtaa-game="kalah"] .mtaa-play-layout,body[data-mtaa-game="shimo"] .mtaa-play-layout{grid-template-columns:minmax(0,1fr) minmax(110px,150px)!important}
 body[data-mtaa-game="bao"] .mtaa-play-surface{max-width:calc((100dvh - 20px)*1.85);justify-self:center}
 body[data-mtaa-game="kalah"] #board{height:min(calc(100dvh - 20px),42vw);min-height:0;grid-template-rows:repeat(2,minmax(0,1fr));gap:6px;border-width:3px}
 body[data-mtaa-game="shimo"] #field{height:calc(100dvh - 12px);min-height:0;max-height:none}
 body[data-mtaa-game="shimo"] #hint{display:none}
}

/* Shimo scores travel with the play field in either orientation. */
body[data-mtaa-game="shimo"] #field>#scoreboard{position:absolute;inset:8px 8px auto;z-index:3;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;margin:0;overflow:visible;pointer-events:none}
body[data-mtaa-game="shimo"] #field>#scoreboard.multi-three{grid-template-columns:repeat(4,minmax(0,1fr))}
body[data-mtaa-game="shimo"] #field>#scoreboard.multi-four{grid-template-columns:repeat(5,minmax(0,1fr))}
body[data-mtaa-game="shimo"] #field>#scoreboard>div{min-width:0;min-height:0;padding:5px 7px;background:#13232deb;border-radius:10px}
body[data-mtaa-game="shimo"] #field>#scoreboard small{font-size:14px;color:#fff4d5}
body[data-mtaa-game="shimo"] #field>#scoreboard strong{font-size:18px;line-height:1.2}
body[data-mtaa-game="shimo"] #field>#scoreboard em{font-size:12px}

/* Keep the entire reserve-ball sprite visible, including in landscape. */
body[data-mtaa-game="choko"] .reserve-stick{height:auto!important;aspect-ratio:1;background-size:contain!important;transform:none}
body[data-mtaa-game="choko"] .reserve-stick:hover{transform:translateY(-4px)}
