/* Full-viewport play. HUD and controls float over the canvas. */
body.ingame #app{position:fixed;inset:0;width:100%;height:100dvh;overflow:hidden}
body.ingame header,body.ingame footer{display:none!important}
body.ingame main{position:absolute;inset:0;display:block;padding:0!important;margin:0;width:100%;max-width:none;overflow:hidden}
body.ingame #game{position:absolute;inset:0;display:block!important;width:100%;height:100%;padding:0;margin:0;overflow:hidden;background:#0d1b23}
body.ingame .gamegrid{display:contents}
body.ingame #game .canvaswrap{position:absolute;inset:0;display:block;width:100%;height:100%;margin:0;max-height:none;border:0;border-radius:0;box-shadow:none;overflow:hidden}
body.ingame #game #world{display:block;width:100%!important;height:100%!important;max-width:none!important;max-height:none!important;margin:0;border:0!important;border-radius:0!important;box-shadow:none!important;touch-action:none}

body.ingame #game .hud{
 position:absolute;z-index:18;top:max(8px,env(safe-area-inset-top));left:max(8px,env(safe-area-inset-left));right:max(8px,env(safe-area-inset-right));
 display:flex!important;align-items:center;justify-content:flex-start;flex-wrap:nowrap!important;gap:8px!important;width:auto;margin:0;padding:0!important;
 border:0!important;background:none!important;box-shadow:none!important;backdrop-filter:none!important;pointer-events:none
}
body.ingame #game .hud .stat:is(.score,.rank,.crys){display:none!important}
body.ingame #game .hud .stat.time,body.ingame #game #teamHud,body.ingame #game .hudbtns>button{
 min-width:0;min-height:42px;padding:6px 10px!important;border:1px solid #83989b62!important;border-radius:10px!important;background:#102129ed;box-shadow:0 2px 9px #0005;color:#fff0ce
}
body.ingame #game .hud .stat.time{flex:0 0 auto!important;gap:6px!important;font-variant-numeric:tabular-nums}
body.ingame #game .hud .stat.time img{width:18px!important;height:18px!important}
body.ingame #game .hud .stat.time small{display:none}
body.ingame #game #timeLeft,body.ingame #game #teamHudScore{font-size:16px!important;line-height:1}
body.ingame #game #teamHud{display:flex;flex-direction:row;align-items:center;gap:7px;white-space:nowrap;font-size:12px}
body.ingame #game #teamHudGap{display:inline!important;color:#fed990;font-size:11px}
body.ingame #game #teamHudGap:empty{display:none!important}
#teamHudName[data-team="red"]{color:#ffa6a0}
#teamHudName[data-team="blue"]{color:#a9d9ff}
#teamHudName[data-team="green"]{color:#abed9a}
#teamHudName[data-team="yellow"]{color:#ffe291}
body.ingame #game .hudbtns{margin-left:auto!important;display:flex!important;gap:6px!important;pointer-events:auto}
body.ingame #game .hudbtns>button{display:flex!important;justify-content:center;align-items:center;width:42px!important;height:42px!important;padding:0!important;font-size:0}
body.ingame #game .hudbtns .ic{width:22px!important;height:22px!important;margin:0!important}
body.ingame #game #mapViewBtn[aria-pressed="true"]{border-color:#ffdf8a!important;color:#fff}
body.ingame #game #shopDot{display:none!important}

body.ingame #game .controls{display:contents;position:static!important;inset:auto!important}
body.ingame #game .dpad{display:none!important}
body.ingame #game .actions{
 position:absolute;z-index:20;right:max(10px,env(safe-area-inset-right));bottom:max(10px,env(safe-area-inset-bottom));
 display:flex!important;align-items:end;gap:7px;width:auto;max-width:calc(100vw - 20px);max-height:none;overflow:visible;
 border:0;padding:0;background:none;box-shadow:none
}
body.ingame #game .actions .action{min-width:48px;min-height:48px;padding:5px 7px;font-size:12px;border-radius:11px}
body.ingame #game .actions .action .ic{width:20px;height:20px;margin:0}
body.ingame #game .actions .action span{display:block;font-size:11px;max-width:100%}
body.ingame #game .actions .dig{width:62px;min-height:58px}
body.ingame #game #jumpBtn,body.ingame #game #chestBtn,body.ingame #game #interactBtn[hidden]{display:none!important}
body.ingame #game #itemTray[hidden]{display:none!important}
body.ingame #game #itemTray{
 position:absolute;right:0;bottom:calc(100% + 8px);display:grid;grid-template-columns:repeat(3,minmax(55px,1fr));gap:6px;
 width:min(235px,calc(100vw - 22px));padding:8px;border-radius:13px;background:#122832f5;border:1px solid #9ab4b075;box-shadow:0 6px 24px #0008
}
body.ingame #game #itemTray .action.notarget{display:none!important}
body.ingame #game #touchHint{bottom:81px;max-width:calc(100vw - 24px);white-space:normal;text-align:center}
body.ingame #game #toastStack{top:calc(max(8px,env(safe-area-inset-top)) + 51px);width:min(90%,420px)}
body.ingame #game #buffBar{left:max(10px,env(safe-area-inset-left));bottom:max(10px,env(safe-area-inset-bottom))}
body.ingame #itemTray .emotewrap:not(.hidden){position:static;display:block;grid-column:1/-1}
body.ingame #itemTray #emoteBtn{width:100%;height:auto;min-height:42px;padding:5px;font-size:12px;border-radius:9px}
body.ingame #itemTray .emotepanel{position:absolute;bottom:calc(100% + 6px);right:0;max-width:min(240px,calc(100vw - 20px))}
body.ingame #quizBox{max-height:calc(100dvh - 67px - env(safe-area-inset-bottom))!important;overflow-y:auto;overscroll-behavior:contain}

body.ingame #game #sheetShade{display:none;position:absolute;inset:0;z-index:40;background:#040d13a3}
body.ingame.sheet-open #game #sheetShade{display:block;pointer-events:auto;opacity:1}
body.ingame #game #sidePanel{
 display:none;position:absolute;z-index:41;inset:max(8px,env(safe-area-inset-top)) max(8px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) auto;
 width:min(380px,calc(100vw - 16px));max-height:none;min-height:0;padding:0!important;margin:0;visibility:visible;transform:none;overflow:hidden;
 background:#132932f8;border:1px solid #799b9b;border-radius:15px;box-shadow:0 10px 28px #0009
}
body.ingame.sheet-open #game #sidePanel{display:flex;flex-direction:column;gap:0}
body.ingame #game .sheethead{display:flex;margin:0;padding:7px 12px;background:#172f38;border:0;border-bottom:1px solid #78968c55}
body.ingame #game .sheethead button{width:42px;height:42px;min-height:42px;padding:0}
.play-tabs{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:4px;padding:7px 8px;border-bottom:1px solid #78968c55}
.play-tabs button{padding:6px 3px;min-height:42px;font-size:12px}
.play-tabs button[aria-pressed="true"]{background:#f5d588;color:#312a20;border-color:#ffe7a8}
.play-sheet-content{flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:10px}
body.ingame #game :is(.sheethead,.play-tabs){flex:0 0 auto}
.play-tab-page{display:grid;gap:9px;min-width:0}
.play-tab-page[hidden]{display:none!important}
.play-tab-page h3,.play-tab-page .mission,.play-tab-page ol{margin:0}
.play-tab-page ol{max-height:none}
#eventPanel:not(.active),#comboPanel{display:none!important}
.play-settings{display:grid;gap:6px}
.play-settings button{width:100%;text-align:left;min-height:44px}
#autoBtn[aria-checked="true"]{border-color:#d0b265;background:#304b4b}
#autoBtn:focus-visible{outline:2px solid #ffe492;outline-offset:-3px}
.play-settings button.hidden{display:none!important}
@media(max-width:620px) and (orientation:portrait){
 body.ingame #game #sidePanel{inset:auto max(0px,env(safe-area-inset-right)) 0 max(0px,env(safe-area-inset-left));width:auto;max-height:76dvh;border-radius:15px 15px 0 0;padding-bottom:env(safe-area-inset-bottom)}
}
@media(max-width:365px){
 body.ingame #game #teamHud{gap:4px;padding:4px 7px!important}
 body.ingame #game .hud{gap:4px!important}
}
body.ingame #itemTray .emotepanel:not(.hidden){display:grid;grid-template-columns:repeat(2,minmax(0,1fr));width:min(242px,calc(100vw - 22px))}
body.ingame #itemTray .emotepanel button{min-width:0;min-height:42px;padding:4px 6px;white-space:normal;font-size:16px}
body.ingame #itemTray .emotepanel small{font-size:11px}
@media(orientation:landscape) and (max-height:460px){
 body.ingame #itemTray .emotepanel{right:calc(100% + 7px);bottom:0}
}

/* Competitive rounds show the contextual trick menu instead of the item tray. */
body.competitive #rolePicker,
body.competitive #teacherSettings #difficultySelect:not(.force),
body.competitive #teacherSettings label:has(+ #difficultySelect),
body.competitive #teacherSettings label:has(:is(#quizEnabled,#quizCatSelect,#quizLevelSelect)),
body.competitive #game :is(#itemsBtn,#itemTray,#mudBtn),
body.competitive .play-tabs button:is([data-page="shop"],[data-page="missions"]){display:none!important}
body.competitive .play-tabs{grid-template-columns:repeat(2,minmax(0,1fr))}
#game #trickMenu[hidden]{display:none!important}
body.competitive.ingame #game #trickMenu{
 position:absolute;right:0;bottom:calc(100% + 6px);
 width:auto;max-width:calc(100vw - 20px);padding:5px;
 border:1px solid #9ab4b0;border-radius:12px;background:#122832e8;color:#fff4db;
 box-shadow:0 6px 20px #0008;text-align:center;
}
/* compact column of icon buttons so the menu never covers the player */
#trickTarget{display:block;margin:0 2px 4px;max-width:76px;font-size:11px;line-height:1.2;overflow-wrap:anywhere}
.trick-options{display:flex;flex-direction:column;gap:4px}
#game .trick-options button{
 display:grid;justify-items:center;align-content:center;gap:1px;min-width:0;width:68px;min-height:46px;
 padding:3px 2px;border:1px solid #55788b;border-radius:8px;background:#203f51;
 color:#fff4db;white-space:normal;text-align:center;font-size:11px;line-height:1.1;
}
#game .trick-options button:focus-visible{outline:2px solid #ffe492;outline-offset:2px}
#game .trick-options img{width:24px;height:24px;object-fit:contain}
#game .trick-options small{display:none}
.competitive-guide{display:none}
body.competitive .competitive-guide{display:block}
body.competitive .guide-grid,body.competitive #awardList,body.competitive .awardhead{display:none!important}
body:not(.competitive) #lobby .practice-option{display:none}

body.competitive #mudBtn .cost{display:none}

/* HUD menu button is icon-only on every screen size (the label used to spill outside the 42px button on desktop). */
body.ingame #game #menuBtn{font-size:0!important;width:42px!important;min-width:42px!important;padding:0!important;gap:0!important;overflow:hidden}
body.ingame #game #menuBtn *{font-size:0!important}

/* The decorative result sprite floated over the podium avatars; the podium already shows each player's avatar. */
#resultMiner{display:none!important}

/* Podium names/scores sit above the art; fit.css clipped them (rank 1 vanished, rank 3 cut in half). */
#results .podium{max-height:none!important;overflow:visible!important}
:is(#entry,#lobby) .class-picker {
  min-width: 0;
  margin: 12px 0 16px;
  padding: 12px 14px;
  border: 1px solid #7a6948;
  border-radius: 12px;
  background: #29251d;
  color: #fff4db;
  text-align: left;
}
:is(#entry,#lobby) .class-picker legend { padding: 0 6px; color: #fff4db; font-weight: 700; }
:is(#entry,#lobby) .class-options { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; }
:is(#entry,#lobby) .class-options label { display: block; position: relative; margin: 0; cursor: pointer; }
:is(#entry,#lobby) .class-options input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; }
:is(#entry,#lobby) .class-options span {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 5px 7px;
  border: 1px solid #8a7756;
  border-radius: 8px;
  color: #fff4db;
  font-size: .85rem;
  line-height: 1.25;
}
:is(#entry,#lobby) .class-options input:checked + span { background: #74502c; border-color: #ffd17b; }
:is(#entry,#lobby) .class-options input:focus-visible + span { outline: 2px solid #fff4db; outline-offset: 2px; }
:is(#entry,#lobby) .class-options img { width: 22px; height: 22px; flex: 0 0 22px; object-fit: contain; }
:is(#entry,#lobby) .class-details { margin-top: 10px; }
:is(#entry,#lobby) .class-details strong { color: #ffd17b; }
:is(#entry,#lobby) .class-details p { margin: 4px 0 0; font-size: .875rem; line-height: 1.5; }

#entryClassSlot { grid-area: skin; min-width: 0; }
#entry #alternateSkins > summary { cursor: pointer; color: #d1e0ef; font-size: .875rem; text-align: left; }
#entry .class-picker { margin: 0 0 6px; }
#entry .class-options { grid-template-columns: repeat(4,minmax(0,1fr)); }
#entry .class-options span {
  flex-direction: column;
  justify-content: flex-start;
  height: 100%;
  padding: 4px 2px 7px;
  gap: 0;
  text-align: center;
  overflow-wrap: anywhere;
}
#entry .class-options img { width: min(100%,76px); height: auto; flex: none; }
@media (max-width: 380px) {
  #entry .class-picker { padding-inline: 7px; }
  #entry .class-options { gap: 4px; }
}
