/* Visible rule choices are used throughout setup, rules and guided practice. */
.choice-tiles,.guide-mode-choices{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;margin:.35rem 0 .65rem}
.choice-tiles label,.guide-mode-choices button,.phone-switch button{font:650 .95rem/1.25 system-ui,sans-serif;display:flex;align-items:center;justify-content:center;min-height:44px;padding:5px 8px;text-align:center;border:1px solid #93a38c;background:#fffaf0;color:#254838;border-radius:8px;cursor:pointer}
.choice-tiles label{position:relative;margin:0}.choice-tiles input{position:absolute;width:1px!important;height:1px!important;min-height:0!important;opacity:0;pointer-events:none}
.choice-tiles label:has(:checked),.guide-mode-choices [aria-pressed=true],.phone-switch [aria-pressed=true]{background:#265942;color:#fff9e6;box-shadow:inset 0 0 0 1px #265942}
.choice-tiles label:has(:focus-visible){outline:3px solid #df9f36;outline-offset:2px}
.choice-tiles label:has(:disabled){opacity:.5;cursor:default}
.choice-tiles.compact{grid-template-columns:repeat(auto-fit,minmax(90px,1fr))}
#setup-dialog .opponent-field:has(select[hidden]),#room-dialog .opponent-field:has(select[hidden]),#lesson-dialog .opponent-field:has(select[hidden]),#rules-dialog .opponent-field:has(select[hidden]){margin-bottom:0}
#duel-setup-extra{margin:.5rem 0;padding:.35rem .65rem;border:1px solid #babda8;border-radius:7px}
#duel-setup-extra summary{cursor:pointer;line-height:1.5;font-weight:650;min-height:34px;align-content:center}
.guide-mode-choices{margin:0}.field-pickers{align-items:stretch}.phone-switch,#phone-history,.phone-outcome{display:none}
@media(max-width:760px),(max-height:520px) and (max-width:1000px){
  .app-shell{padding-inline:clamp(6px,2vw,14px)}
  .site-header{display:flex;flex-wrap:nowrap;min-height:44px;padding:3px 0;gap:4px;justify-content:space-between}
  .site-header .brand{flex:0 1 auto;min-width:0;gap:3px}.site-header .club-mark{width:30px;height:30px}
  .site-header #school-brand{font-size:.81rem;max-width:7em}.site-header nav{display:flex;flex-wrap:nowrap;gap:3px}
  .site-header .home-link,.site-header .outline-button{min-height:36px;padding:4px 6px;gap:3px}
  .site-header .language-switch{margin:0}.site-header .language-switch button{font-size:.75rem;min-height:34px;padding:3px 6px}
  .site-header #sound-button{min-width:34px}
  body:has(#school-game:not([hidden])) .site-header .brand span,body:has(#cup-home[data-playing]) .site-header .brand span{display:none}
  body:has(#school-game:not([hidden])) :is(#online-button,#new-button,.site-footer,#mobile-dock),body:has(#cup-home[data-playing]) :is(.site-footer,#school-launch){display:none!important}
  #school-game:not([hidden]){margin:0;padding:0}
  #school-game .intro,#school-game .bindings,#school-game .notebook-bottom,#mobile-dock{display:none!important}
  .phone-switch{display:flex;gap:4px;align-items:center;margin:5px 0}
  .phone-switch button{min-height:36px;font-size:.83rem;padding:4px 10px}
  .phone-switch button[hidden]{display:none}
  #school-game .game-layout{margin:0;padding:0;display:grid;grid-template-columns:minmax(0,1fr);gap:5px}
  #school-game .arena-section,#school-game .play-sidebar{display:block;min-width:0}
  #school-game .notebook{margin:0;border-radius:9px;box-shadow:none;overflow:visible}
  #school-game .players-heading{min-height:0}.players-heading .player-heading{padding:5px 8px;gap:4px}
  #school-game .player-avatar{width:24px;height:24px;font-size:12px}
  #school-game .player-text h3{font-size:.94rem;line-height:1.2;margin:0}
  #school-game .player-text p{font-size:.68rem;margin:1px 0;line-height:1.2}
  #school-game .active-indicator{font-size:.6rem}
  #school-game .lane{min-height:0;height:clamp(36px,6.7dvh,58px)}
  #school-game .lane-number{width:22px;height:22px;font-size:.82rem}
  #school-game .fighter-cell,#school-game .fighter-cell.red{padding:2px 11px!important;flex-direction:row-reverse!important;justify-content:space-evenly;text-align:center!important;gap:3px;min-height:0}
  #school-game .fighter-cell.red{flex-direction:row!important}
  #school-game .fighter-art{width:clamp(30px,11vw,62px);height:100%;max-height:48px}
  #school-game .fighter-status{font-size:clamp(.67rem,2.5vw,.88rem);line-height:1.15}
  #school-game .fighter-next,#school-game .ready-tag{display:none}
  #school-game .progress-pips{margin:2px auto 0;justify-content:center;gap:2px}
  #school-game .fighter-info{max-width:55%}
  #school-game .arena-section>.section-label,#school-game .play-sidebar>.section-label{display:none}
  #school-game .turn-card{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:2px 8px;margin:0;padding:6px 9px;border-radius:8px;min-height:0}
  #school-game .turn-kicker{grid-column:1;grid-row:1;font-size:.68rem;line-height:1.2;align-self:center}
  #school-game #turn-title{grid-column:1;grid-row:2;font:700 clamp(.98rem,4vw,1.26rem)/1.25 Georgia,serif;margin:0;align-self:start}
  #turn-title br{display:none}#turn-title br:after{content:' '}
  #school-game .book-scene{grid-area:1/2/4/3;width:86px;height:53px;align-self:start;margin:0;transform:none}
  #school-game .book-left,#school-game .book-lines,#school-game .book-bookmark{display:none}
  #school-game .book-pages{display:block;inset:2px 3px 3px}
  #school-game .book-cover{inset:1px 0 0}.book-right{padding:2px 4px;height:100%}#school-game .book-right>span{font-size:.58rem}#school-game .book-right strong{font-size:1.3rem;letter-spacing:0;margin:0}
  #school-game #turn-caption{grid-row:3;grid-column:1;font-size:.78rem;line-height:1.25;margin:1px 0}
  #school-game #phone-outcome{display:block;grid-row:4;grid-column:1/-1;font-weight:bold;font-size:.79rem;line-height:1.2;color:#4f5c3f}
  #school-game #phone-outcome:empty{display:none}
  #school-game #action-area,#school-game #page-form{grid-column:1/-1;margin:3px 0 0;align-self:stretch}
  #school-game #page-form[hidden],#school-game #control-hint{display:none}
  #school-game #action-area .primary-button,#school-game .target-button,#school-game .enter-button{min-height:39px;font-size:.95rem;line-height:1.16;padding:5px 9px}
  #school-game .target-list{display:flex;flex-wrap:wrap;gap:4px}
  #school-game :is(.computer-status,.target-caption,.hold-button){margin:2px 0;padding:3px;font-size:.82rem}
  #school-game[data-phone-view=match] :is(.result-card,.build-guide,.arena-foot,.series-strip,#room-banner,#duel-social){display:none!important}
  #school-game[data-phone-view=details] :is(.notebook,#turn-card,#room-banner,#duel-social){display:none!important}
  #school-game[data-phone-view=details] #phone-history{display:inline-flex}
  #school-game[data-phone-view=details] .build-guide,#school-game[data-phone-view=details] .result-card{margin:6px 0;padding:9px}
  #school-game[data-phone-view=room] .game-layout{display:none}
  #school-game[data-phone-view=room] .room-banner{margin:4px 0;padding:.5rem}
  #school-game .school-pal{margin:1px;padding:3px;gap:4px}
  #school-game .pal-face{max-width:30px}#school-game .pal-words{font-size:.75rem}
  #setup-dialog .dialog-inner{padding:10px 13px}#setup-dialog .home-link{min-height:34px}
  #setup-title{font-size:1.45rem;margin:.18rem 0}
  #setup-form .opponent-choices{grid-template-columns:repeat(3,minmax(0,1fr));margin:.15rem 0!important;gap:4px}
  #setup-form .opponent-choices label{padding:.35rem .25rem;align-items:center;text-align:center;flex-direction:column;justify-content:center;gap:2px}
  #setup-form .opponent-choices svg{width:29px;height:29px}#setup-form .opponent-choices small{display:none}#setup-form .opponent-choices b{font-size:.8rem}
  #setup-form .opponent-choices input{width:12px!important;height:12px;top:3px;right:3px}
  #setup-form .choice-tiles{margin:3px 0}.dialog-inner #setup-guide{margin:4px 0;padding:5px 8px;line-height:1.3;font-size:.85rem}
  #setup-form .setup-note:empty{display:none}#setup-form .setup-note{margin:3px 0;line-height:1.2;font-size:.77rem}
  #setup-dialog .primary-button{min-height:42px;padding:7px}#setup-form .opponent-field{margin-top:5px}
  .club-hero{padding:10px 0;grid-template-columns:minmax(0,1fr) 26%;gap:8px}
  .hero-description{margin:4px 0 8px;font-size:.89rem;line-height:1.25}.origin{margin:0 0 4px;font-size:.65rem}.hero-print{padding:2px;margin:0}.cover-art{aspect-ratio:1;object-fit:cover}.hero-print .print-caption{display:none}
  #school-home-title{font-size:clamp(1.67rem,6.7vw,2.9rem)}html[lang=ta] #school-home-title{font-size:clamp(1.35rem,5.6vw,2.3rem)}
  .hero-buttons{gap:5px;flex-wrap:wrap}.hero-buttons button{font-size:.78rem;min-height:37px;padding:5px 7px}.hero-buttons img{width:22px}
  .choices-heading{margin:5px 0}.choices-heading h2{font-size:1.15rem}.club-cards{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
  .club-game{padding:8px 9px}.tile-main{display:block}.tile-main img{width:42px;height:37px}.tile-main h3{font-size:1.06rem;margin:2px 0}.tile-main small{font-size:.68rem}
  .club-game p{font-size:.78rem;line-height:1.3;margin:4px 0}.tile-links{flex-wrap:wrap;gap:4px}.tile-links a,.tile-links button{font-size:.8rem;min-height:35px;padding:3px 6px}
  #home-extras{gap:4px 10px;margin:5px 0;flex-wrap:wrap}#home-extras .text-button,.site-footer button{font-size:.81rem;min-height:32px}.site-footer{padding:5px 0;margin:5px 0}
}
@media(max-height:520px) and (min-width:560px) and (max-width:1000px){
 #school-game[data-phone-view=match] .game-layout{grid-template-columns:1.2fr 1fr;align-items:start}
 #school-game .lane{height:clamp(32px,9.5dvh,46px)}
}
@media(max-width:760px),(max-height:520px) and (max-width:1000px){
 body:has(#school-game:not([hidden])) .app-shell{padding-bottom:env(safe-area-inset-bottom,0px)}
}
/* Tamil navigation labels need more room than English at phone text sizes. */
@media(max-width:520px){
 html[lang=ta] .site-header{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:2px 6px}
 html[lang=ta] .site-header .brand{justify-self:start}html[lang=ta] .site-header #school-brand{max-width:none}
 html[lang=ta] .site-header .language-switch{justify-self:end}
 html[lang=ta] .site-header nav{grid-column:1/-1;justify-content:flex-end;min-width:0;flex-wrap:wrap}
 html[lang=ta] .site-header nav:has(#nav-home){justify-content:space-between}
}
.phone-turn-info{display:none}
@media(max-width:760px),(max-height:520px) and (max-width:1000px){
 #school-game .phone-turn-info{display:inline;font:inherit;text-transform:none;letter-spacing:0}
 #school-game .turn-kicker{flex-wrap:wrap;gap:2px 3px}
}
@media(max-width:520px){
 html[lang=ta] body:has(#school-cover:not([hidden])):has(#school-game[hidden]) .site-header{display:flex;flex-wrap:nowrap}
 body:has(#school-cover:not([hidden])):has(#school-game[hidden]) #nav-home{display:none}
 html[lang=ta] .hero-buttons button{font-size:.73rem;padding:4px;min-height:34px}
 html[lang=ta] .hero-buttons{gap:3px}
 .club-game .tile-main h3{font-size:1.13rem;line-height:1.22;letter-spacing:0}
 html[lang=ta] .club-game .tile-main small{font-size:.66rem;line-height:1.25}
 html[lang=ta] .hero-description{font-size:.81rem;line-height:1.35}
 html[lang=ta] .club-game p{font-size:.76rem;line-height:1.38}
 #school-home #home-extras{margin:3px auto}
}
@media(max-width:760px),(max-height:520px) and (max-width:1000px){
 #school-game #action-area:empty{display:none}
 #school-game #page-form{grid-row:5}#school-game #action-area{grid-row:6}
}
#phone-more{display:none}.phone-menu-links{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
.phone-menu-links :is(button,a){display:grid;place-content:center;font:600 .94rem/1.35 system-ui,sans-serif;text-align:center;min-height:45px;border:1px solid #a2af95;background:#fffaf0;border-radius:8px;color:#214836;text-decoration:none;cursor:pointer}.phone-menu-links [hidden]{display:none}
@media(max-width:760px),(max-height:520px) and (max-width:1000px){
 body:has(#school-cover:not([hidden])):has(#school-game[hidden]) .site-footer{display:none}
 #home-extras:not([hidden]){display:flex;justify-content:center;gap:10px;padding:0;margin:3px auto}
 #home-extras>:not(#phone-more):not([data-home-action=scores]){display:none!important}
 #home-extras #phone-more{display:inline-block}
}
@media(max-width:520px){
 body:has(#school-cover:not([hidden])):has(#school-game[hidden]) #nav-home{display:inline-flex;position:relative}
 body:has(#school-cover:not([hidden])):has(#school-game[hidden]) #nav-home span{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
 html[lang=ta] .site-header #school-brand{max-width:7em;overflow-wrap:anywhere}
}
