/* ultraviolet game, launch polish (25 Oct 2026).
   - Keyboard devices: hide the touch button bar, show a one-line key guide.
   - Touch devices: the game opens as a full-viewport "immersive" layer
     (iPhone Safari has no element fullscreen), canvas on top, buttons below.
   - Menus fit inside the small TV screen and scroll if they must. */

.uv-keys{display:none;margin:0;padding:5px 14px;background:#141526;color:#cfc4e6;font:10px/1.4 monospace;text-align:center;flex-shrink:0}
.uv-exit{display:none}
.uv-objective{padding:7px 18px}

/* keyboard + mouse */
@media (hover:hover) and (pointer:fine){
  .uv-game:not(.uv-immersive) .uv-controls{display:none!important}
  .uv-game:not(.uv-immersive) .uv-keys{display:block}
}

/* compact menus inside the TV */
.uv-menu{gap:6px;padding:10px 12px 16px;align-content:start;scrollbar-width:thin}
.uv-menu-hero{min-height:0;gap:10px}
.uv-menu-art{width:96px;height:96px}
.uv-captain-portrait{width:66px;height:88px}
.uv-menu h2{font-size:15px}
.uv-menu p{font-size:11px;max-width:44em}
.uv-menu button{min-height:40px;width:min(92%,250px);padding:6px 10px}
@media (min-width:601px){
  .uv-menu:has(> button:nth-of-type(4)){grid-template-columns:repeat(2,minmax(0,250px));justify-content:center}
  .uv-menu:has(> button:nth-of-type(4)) > :not(button){grid-column:1/-1}
  .uv-menu:has(> button:nth-of-type(4)) > button{width:100%}
}
@media (max-width:600px){
  .uv-menu-art{width:72px;height:72px}
  .uv-captain-portrait{width:54px;height:72px}
}

/* touch: immersive full-viewport play */
body.uv-immersive-open{overflow:hidden;overscroll-behavior:none}
.uv-game.uv-immersive{position:fixed;inset:0;z-index:2147483000;width:100vw;height:100vh;height:100dvh;
  padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  overflow:hidden;background:#060612}
.uv-game.uv-immersive canvas{flex:1 1 auto;min-height:0;width:100%;height:auto}
.uv-game.uv-immersive .uv-objective{font-size:12px;padding:6px 12px}
.uv-game.uv-immersive .uv-controls{padding:8px 8px 10px;gap:8px;grid-template-columns:150px 1fr}
.uv-game.uv-immersive .uv-dpad{grid-template-columns:repeat(3,50px);grid-template-rows:repeat(3,50px)}
.uv-game.uv-immersive .uv-dpad button{min-width:50px;min-height:50px;font-size:9px}
.uv-game.uv-immersive .uv-actions{gap:6px}
.uv-game.uv-immersive .uv-actions button{min-height:48px;font-size:11px;max-width:none;flex:1 1 30%}
.uv-game.uv-immersive .uv-exit{display:block;position:absolute;top:calc(env(safe-area-inset-top) + 6px);right:calc(env(safe-area-inset-right) + 6px);z-index:11;
  min-height:36px;padding:6px 10px;background:#201b36cc;border:1px solid #b59ada;color:#f0e6ff;font:11px monospace}
.uv-game.uv-immersive .uv-menu{position:absolute;inset:0;padding:48px 16px 24px}
/* landscape phones: screen left, buttons right */
@media (orientation:landscape) and (max-height:520px){
  .uv-game.uv-immersive{display:grid;grid-template-columns:minmax(0,1fr) minmax(250px,42%);grid-template-rows:minmax(0,1fr) auto;column-gap:6px}
  .uv-game.uv-immersive canvas{grid-column:1;grid-row:1/3;height:100%;width:100%;object-fit:contain}
  .uv-game.uv-immersive .uv-controls{grid-column:2;grid-row:1;align-self:center;grid-template-columns:1fr}
  .uv-game.uv-immersive .uv-dpad{justify-self:center}
  .uv-game.uv-immersive .uv-objective{grid-column:2;grid-row:2;font-size:10px}
  .uv-game.uv-immersive .uv-actions button{min-height:40px;flex-basis:30%}
}
.uv-menu{background:linear-gradient(135deg,#251d3e,#080b19)}
.uv-game.uv-immersive canvas{max-height:62dvh}
.uv-game.uv-immersive{justify-content:space-between}
@media (orientation:landscape) and (max-height:520px){.uv-game.uv-immersive canvas{max-height:none}}
.uv-game:not(.uv-immersive) .uv-objective,.uv-game:not(.uv-immersive) .uv-keys{padding-left:40px;padding-right:40px;text-align:center}

/* 30 Nov 2026: the title and pause menus fit whatever size the TV's screen is, in steps, instead of being cut off.
   Medium screens (the 3D TV on a laptop) keep the full-size logo and normal type with the buttons in two columns;
   small ones (phones) shrink the logo and type; very small ones drop the logo. Full-screen play is unchanged. */
.uv-game{container-type:size;container-name:uvscreen}
.uv-menu .uv-menu-art{width:min(300px,64%)!important;height:auto!important;aspect-ratio:640/287;object-fit:contain;image-rendering:auto;filter:drop-shadow(0 0 10px rgba(150,90,255,.35))}
.uv-menu .uv-menu-name{position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}
.uv-menu-hero{align-items:center}
@container uvscreen (max-height: 600px){
  .uv-menu{grid-template-columns:1fr 1fr;align-content:center;justify-items:stretch;gap:8px 10px;padding:14px 18px}
  .uv-menu>:not(button){grid-column:1/-1;justify-self:center;text-align:center}
  .uv-menu-hero{min-height:0;gap:12px}
  .uv-menu h2{margin:2px 0 0}
  .uv-menu p{margin:0 auto 4px!important;max-width:46em}
  .uv-menu button{width:100%!important;min-height:42px;text-align:center}
}
@container uvscreen (max-height: 400px){
  .uv-menu{gap:5px 6px;padding:8px 10px}
  .uv-menu .uv-menu-art{width:min(190px,58%)!important}
  .uv-captain-portrait{width:42px!important;height:56px!important;border-width:1px}
  .uv-menu h2{font-size:14px!important;letter-spacing:.06em}
  .uv-menu p{font-size:10px!important;line-height:1.35!important}
  .uv-menu button{min-height:38px!important;padding:5px 8px!important;font-size:10.5px!important;line-height:1.15}
}
@container uvscreen (max-height: 290px){
  /* phones: the wordmark always stays; the captain steps aside and the buttons go three across */
  .uv-menu{grid-template-columns:repeat(3,1fr);gap:4px 5px;padding:6px 8px}
  .uv-captain-portrait{display:none!important}
  .uv-menu .uv-menu-art{width:min(150px,50%)!important}
  .uv-menu p{font-size:8.5px!important;line-height:1.3!important}
  .uv-menu button{min-height:30px!important;padding:3px 4px!important;font-size:8.5px!important;letter-spacing:.02em}
}
