:root {
  color-scheme: dark;
  font-family: "Courier New", ui-monospace, monospace;
  background: #010814;
  color: #f7fbff;
}

* { box-sizing: border-box; }

button, a, canvas { -webkit-tap-highlight-color: transparent; }

html.mobile-device,
html.mobile-device body {
  touch-action: none;
  -webkit-text-size-adjust: 100%;
}

.mobile-device .profile-modal,
.mobile-device .profile-card,
.mobile-device .leaderboard-scroll {
  touch-action: pan-y;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

html, body {
  width: 100%;
  height: 100%;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  background:
    radial-gradient(circle at 50% -20%, #103562 0 25%, transparent 55%),
    repeating-linear-gradient(90deg, #000000 0 3px, #010814 3px 6px);
}

.mobile-controls,
.rotate-device {
  display: none;
}

.mobile-controls {
  position: absolute;
  z-index: 900;
  inset: 0;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.mobile-movement,
.mobile-actions {
  position: absolute;
  bottom: max(10px, env(safe-area-inset-bottom));
  display: flex;
  align-items: flex-end;
  gap: clamp(6px, 1.2vw, 12px);
  pointer-events: auto;
}

.mobile-movement { left: max(10px, env(safe-area-inset-left)); }
.mobile-actions { right: max(10px, env(safe-area-inset-right)); }

.mobile-controls button {
  width: clamp(58px, 14vh, 86px);
  height: clamp(58px, 14vh, 86px);
  display: grid;
  place-content: center;
  gap: 1px;
  padding: 0;
  border: 3px solid #ffc300;
  border-radius: 18px;
  color: #fff;
  background: #081d3cba;
  box-shadow: 0 4px 0 #000, inset 0 0 14px #103562;
  font: 900 clamp(19px, 5vh, 31px)/1 "Courier New", monospace;
  backdrop-filter: blur(3px);
  touch-action: none;
}

.mobile-controls button small {
  color: #e9cc5e;
  font-size: clamp(6px, 1.7vh, 10px);
  letter-spacing: -.4px;
  text-transform: uppercase;
}

.mobile-controls button.is-pressed {
  color: #010814;
  background: #ffc300e8;
  box-shadow: 0 1px 0 #000, inset 0 0 10px #fff8;
  transform: translateY(3px) scale(.96);
}

.mobile-controls .mobile-fire {
  width: clamp(70px, 17vh, 100px);
  height: clamp(70px, 17vh, 100px);
  color: #6de7ff;
  border-color: #6de7ff;
}

.mobile-controls .mobile-bomb {
  --bomb-progress: 0%;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(to top, #58e676c9 0 var(--bomb-progress), #081d3cba var(--bomb-progress) 100%);
}

.mobile-controls .mobile-bomb > * {
  position: relative;
  z-index: 1;
}

.mobile-controls .mobile-bomb .mobile-bomb-icon { color: #ffc300; }

.mobile-controls .mobile-bomb.is-ready {
  color: #010814;
  border-color: #fff;
  background: #ffc300;
  box-shadow: 0 4px 0 #000, 0 0 20px #58e67699, inset 0 0 12px #fff8;
}

.mobile-controls .mobile-bomb.is-ready small,
.mobile-controls .mobile-bomb.is-ready .mobile-bomb-icon { color: #010814; }

.mobile-controls .mobile-super img {
  width: clamp(32px, 7vh, 44px);
  height: clamp(32px, 7vh, 44px);
  object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(0 2px 0 #000);
}

.mobile-game-fullscreen {
  display: none;
  place-content: center;
  padding: 0;
  position: absolute;
  z-index: 950;
  top: max(44px, env(safe-area-inset-top));
  right: max(8px, env(safe-area-inset-right));
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border: 3px solid #fff;
  border-radius: 10px;
  color: #ffc300;
  background: #010814d9;
  box-shadow: 0 4px 0 #000, inset 0 0 14px #103562;
  font: 900 23px/1 "Courier New", monospace;
  pointer-events: auto;
  touch-action: manipulation;
}

.mobile-game-fullscreen.is-active {
  color: #010814 !important;
  background: #6de7ff !important;
}

.sound-toggle {
  position: absolute;
  z-index: 960;
  right: 9px;
  bottom: 4px;
  width: 34px;
  height: 27px;
  display: grid;
  place-content: center;
  padding: 0;
  border: 2px solid #e9cc5e;
  border-radius: 6px;
  color: #ffc300;
  background: #010814;
  box-shadow: 2px 2px 0 #000;
  font: 900 17px/1 "Courier New", monospace;
  cursor: pointer;
  touch-action: manipulation;
}

.sound-toggle:hover,
.sound-toggle:focus-visible {
  color: #fff;
  border-color: #fff;
  outline: none;
}

.sound-toggle.is-muted {
  color: #010814;
  background: #ffc300;
}

.rotate-device {
  position: fixed;
  z-index: 5000;
  inset: 0;
  place-items: center;
  align-content: center;
  gap: 28px;
  padding: 28px max(24px, env(safe-area-inset-left));
  color: #fff;
  background: radial-gradient(circle at 50% 30%, #103562, #010814 70%);
  text-align: center;
  touch-action: none;
}

.rotate-device img {
  width: min(76vw, 390px);
  max-height: 170px;
  object-fit: contain;
}

.rotate-device button {
  min-height: 66px;
  padding: 13px 22px;
  border: 4px solid #fff;
  border-radius: 11px;
  color: #010814;
  background: #ffc300;
  box-shadow: 0 5px 0 #000, 0 0 28px #ffc30055;
  font: 900 clamp(14px, 4.2vw, 19px)/1.15 "Courier New", monospace;
}

body {
  display: grid;
  place-items: center;
  padding: 10px;
}

.cabinet {
  position: relative;
  width: min(100%, 1280px, calc((100vh - 50px) * 1.77778));
  border: 4px solid #103562;
  border-radius: 18px;
  overflow: hidden;
  background: #081d3c;
  box-shadow: 0 0 0 4px #000000, 0 20px 70px #000c, 0 0 45px #ffc30022;
}

#game {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #010814;
}

#game canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.home-links {
  position: absolute;
  z-index: 60;
  left: 50%;
  bottom: 43px;
  display: none;
  align-items: center;
  gap: 7px;
  transform: translateX(-50%);
}

.cabinet[data-screen="title"] .home-links {
  display: flex;
}

.home-links a,
.home-links button {
  display: grid;
  grid-template-columns: 24px auto;
  align-items: center;
  gap: 5px;
  min-height: 34px;
  padding: 5px 7px;
  border: 2px solid #e9cc5e;
  border-radius: 7px;
  color: #ffc300;
  background: #010814dc;
  box-shadow: 2px 3px 0 #000;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .3px;
  text-decoration: none;
  text-transform: uppercase;
  font-family: inherit;
  cursor: pointer;
}

.home-links a:first-child {
  color: #010814;
  background: #ffc300;
}

.home-links a:hover,
.home-links a:focus-visible,
.home-links button:hover,
.home-links button:focus-visible {
  color: #fff;
  border-color: #fff;
  transform: translateY(-2px);
  outline: none;
}

.home-fullscreen-button {
  color: #fff !important;
  background: #103562 !important;
}

.home-fullscreen-button.is-active {
  color: #010814 !important;
  background: #6de7ff !important;
}

.fullscreen-icon { font-size: 21px; line-height: 1; }

.home-links svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.home-links .icon-fill {
  fill: currentColor;
  stroke: none;
}

.profile-modal[hidden],
.profile-form[hidden],
.washer-creator-modal[hidden] {
  display: none;
}

.ui-layer-locked #game canvas,
.ui-layer-locked .home-links,
.ui-layer-locked .mobile-controls,
.ui-layer-locked .mobile-game-fullscreen,
.ui-layer-locked .sound-toggle {
  pointer-events: none !important;
}

.mobile-device .washer-creator-modal,
.mobile-device .washer-creator-card {
  touch-action: pan-y;
}

.profile-modal {
  position: absolute;
  z-index: 1000;
  inset: 0 0 30px;
  display: grid;
  place-items: center;
  padding: clamp(10px, 2vw, 26px);
  overflow: auto;
  background: #010814e8;
  backdrop-filter: blur(5px);
}

.profile-card {
  position: relative;
  width: min(970px, 100%);
  max-height: 100%;
  padding: clamp(16px, 2.5vw, 30px);
  overflow: auto;
  color: #fff;
  background: linear-gradient(145deg, #081d3c, #010814 72%);
  border: 4px solid #ffc300;
  border-radius: 14px;
  box-shadow: 0 18px 60px #000c, inset 0 0 0 2px #103562;
}

.profile-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 38px;
  height: 38px;
  border: 2px solid #e9cc5e;
  border-radius: 8px;
  color: #ffc300;
  background: #010814;
  font: 900 28px/1 "Courier New", monospace;
  cursor: pointer;
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 18px;
  padding-right: 44px;
  margin-bottom: 22px;
}

.profile-header img {
  width: 170px;
  height: 82px;
  object-fit: contain;
  object-position: center;
}

.profile-header p {
  margin: 0 0 4px;
  color: #e9cc5e;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 1.6px;
}

.profile-header h2 {
  margin: 0;
  color: #ffc300;
  font-size: clamp(22px, 3vw, 34px);
  text-transform: uppercase;
}

.profile-grid {
  display: grid;
  grid-template-columns: minmax(280px, .9fr) minmax(370px, 1.15fr);
  gap: 24px;
}

.profile-form {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 18px;
  background: #0008;
  border: 2px solid #103562;
  border-radius: 10px;
}

.profile-form[hidden] + .leaderboard-panel {
  grid-column: 1 / -1;
}

.score-summary {
  margin: 0 0 4px;
  padding: 10px;
  color: #010814;
  background: #ffc300;
  font-size: 15px;
  font-weight: 900;
  text-align: center;
}

.profile-form label {
  display: grid;
  gap: 5px;
  color: #e9cc5e;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .5px;
  text-transform: uppercase;
}

.profile-form label span {
  color: #b8c9dc;
  font-weight: 400;
  text-transform: none;
}

.profile-form input:not([type="checkbox"]) {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 2px solid #103562;
  border-radius: 5px;
  outline: none;
  color: #fff;
  background: #010814;
  font: 700 15px "Courier New", monospace;
}

.profile-form input:focus {
  border-color: #ffc300;
  box-shadow: 0 0 0 3px #ffc30028;
}

.profile-form input[aria-invalid="true"] {
  border-color: #f14d4d;
}

.privacy-check {
  grid-template-columns: 22px 1fr;
  align-items: start;
  text-transform: none !important;
}

.privacy-check input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: #ffc300;
}

.profile-submit,
.leaderboard-heading button {
  border: 3px solid #fff;
  border-radius: 5px;
  color: #010814;
  background: #ffc300;
  font: 900 14px "Courier New", monospace;
  cursor: pointer;
}

.profile-submit {
  min-height: 46px;
  margin-top: 4px;
}

.profile-submit:disabled {
  opacity: .55;
  cursor: wait;
}

.leaderboard-panel {
  min-width: 0;
  padding: 18px;
  background: #081d3c;
  border: 2px solid #103562;
  border-radius: 10px;
}

.leaderboard-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.leaderboard-heading h3 {
  margin: 0;
  color: #ffc300;
  font-size: clamp(16px, 2vw, 22px);
}

.leaderboard-heading button {
  padding: 7px 9px;
  border-width: 2px;
  font-size: 11px;
}

.leaderboard-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0 0 12px;
}

.leaderboard-tabs button {
  min-height: 38px;
  padding: 7px 9px;
  border: 2px solid #103562;
  border-radius: 5px;
  color: #b8c9dc;
  background: #010814;
  font: 900 11px "Courier New", monospace;
  cursor: pointer;
}

.leaderboard-tabs button[aria-selected="true"] {
  border-color: #fff;
  color: #010814;
  background: #ffc300;
}

.leaderboard-tabs button:focus-visible {
  outline: 3px solid #6de7ff;
  outline-offset: 2px;
}

.leaderboard-scroll {
  max-height: 355px;
  overflow: auto;
}

.leaderboard-panel table {
  width: 100%;
  border-collapse: collapse;
  font-size: clamp(11px, 1.4vw, 14px);
}

.leaderboard-panel th,
.leaderboard-panel td {
  padding: 10px 7px;
  border-bottom: 1px solid #103562;
  text-align: left;
}

.leaderboard-panel th {
  color: #e9cc5e;
  font-size: 10px;
  letter-spacing: .8px;
  text-transform: uppercase;
}

.leaderboard-panel td:last-child,
.leaderboard-panel th:last-child {
  color: #ffc300;
  font-weight: 900;
  text-align: right;
}

.leaderboard-player {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 112px;
  font-weight: 800;
}

.leaderboard-character {
  width: 28px;
  height: 38px;
  flex: 0 0 auto;
  object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(2px 2px 0 #010814);
}

.leaderboard-actions {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.leaderboard-shop,
.leaderboard-booking {
  display: block;
  padding: 10px 14px;
  border: 2px solid #fff;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 900;
  text-align: center;
  text-decoration: none;
}

.leaderboard-shop {
  color: #010814;
  background: #ffc300;
}

.leaderboard-booking {
  color: #fff;
  background: #103562;
}

.leaderboard-shop:hover,
.leaderboard-shop:focus-visible {
  color: #fff;
  background: #103562;
  outline: 3px solid #6de7ff;
  outline-offset: 2px;
}

.leaderboard-booking:hover,
.leaderboard-booking:focus-visible {
  color: #fff;
  background: #0d7f42;
  outline: 3px solid #6de7ff;
  outline-offset: 2px;
}

.leaderboard-note {
  margin: 8px 0 0;
  color: #b8c9dc;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
}

.profile-status {
  min-height: 20px;
  margin: 14px 0 0;
  color: #e9cc5e;
  font-size: 12px;
  text-align: center;
}

.washer-creator-modal {
  position: absolute;
  z-index: 1100;
  inset: 0 0 30px;
  display: grid;
  place-items: center;
  padding: clamp(8px, 2vw, 24px);
  overflow: auto;
  background: #010814f2;
  backdrop-filter: blur(7px);
}

.washer-creator-card {
  position: relative;
  width: min(900px, 100%);
  max-height: 100%;
  padding: clamp(16px, 2.5vw, 28px);
  overflow: auto;
  color: #fff;
  background: linear-gradient(145deg, #103562, #010814 75%);
  border: 5px solid #ffc300;
  border-radius: 15px;
  box-shadow: 0 18px 70px #000, inset 0 0 0 2px #e9cc5e55;
}

.washer-close {
  position: absolute;
  z-index: 2;
  top: 10px;
  right: 12px;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 2px solid #ffc300;
  border-radius: 8px;
  color: #ffc300;
  background: #010814;
  font: 900 28px/1 "Courier New", monospace;
  cursor: pointer;
}

.washer-creator-header {
  display: flex;
  align-items: center;
  gap: 18px;
  padding-right: 50px;
  margin-bottom: 18px;
}

.washer-creator-header img {
  width: 155px;
  height: 70px;
  object-fit: contain;
}

.washer-creator-header p,
.washer-creator-header h2 { margin: 0; }
.washer-creator-header p { color: #e9cc5e; font-size: 11px; font-weight: 900; letter-spacing: 1px; }
.washer-creator-header h2 { color: #ffc300; font-size: clamp(23px, 3.2vw, 37px); }

.washer-creator-grid {
  display: grid;
  grid-template-columns: minmax(250px, .8fr) minmax(360px, 1.2fr);
  gap: 24px;
}

.washer-preview-panel {
  display: grid;
  place-items: center;
  align-content: center;
  min-height: 390px;
  padding: 18px;
  background: radial-gradient(circle, #103562 0 38%, #010814 72%);
  border: 3px solid #e9cc5e;
  border-radius: 12px;
}

.washer-preview-panel canvas {
  width: min(100%, 230px);
  height: auto;
  image-rendering: pixelated;
  filter: drop-shadow(0 10px 0 #0007) drop-shadow(0 0 18px #ffc30055);
}

.washer-preview-panel p {
  margin: 10px 0 0;
  color: #e9cc5e;
  font-size: 11px;
  font-weight: 900;
  text-align: center;
}

.washer-options { display: grid; gap: 10px; align-content: start; }
.washer-name-field { display: grid; gap: 6px; color: #e9cc5e; font-size: 12px; font-weight: 900; }
.washer-name-field input {
  width: 100%;
  min-height: 46px;
  padding: 9px 12px;
  border: 3px solid #103562;
  border-radius: 7px;
  color: #fff;
  background: #010814;
  font: 900 18px/1 "Courier New", monospace;
  text-transform: uppercase;
}

.washer-name-field input:focus { border-color: #ffc300; outline: none; }
.washer-option-row {
  display: grid;
  grid-template-columns: 120px 45px minmax(100px, 1fr) 45px;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 5px 8px;
  border: 2px solid #103562;
  border-radius: 7px;
  background: #010814aa;
}

.washer-option-row > span { color: #e9cc5e; font-size: 11px; font-weight: 900; }
.washer-option-row output { color: #fff; font-size: 13px; font-weight: 900; text-align: center; }
.washer-option-row button {
  width: 45px;
  height: 37px;
  padding: 0;
  border: 2px solid #ffc300;
  border-radius: 6px;
  color: #010814;
  background: #ffc300;
  font: 900 19px/1 "Courier New", monospace;
  cursor: pointer;
}

.washer-option-row button:hover,
.washer-option-row button:focus-visible { color: #fff; background: #103562; outline: none; }
.washer-save {
  min-height: 52px;
  margin-top: 4px;
  border: 3px solid #fff;
  border-radius: 7px;
  color: #010814;
  background: #ffc300;
  font: 900 15px/1 "Courier New", monospace;
  cursor: pointer;
}
.washer-status { min-height: 18px; margin: 0; color: #6de7ff; font-size: 11px; font-weight: 900; text-align: center; }

.cabinet-footer {
  position: relative;
  min-height: 30px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 25px;
  padding: 7px 12px;
  color: #e9cc5e;
  background: #010814;
  font-size: clamp(8px, 1vw, 12px);
  font-weight: 700;
  letter-spacing: 1px;
}

.super-shortcut {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.super-shortcut img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  image-rendering: pixelated;
}

.creator-credit {
  display: none;
  position: static;
  margin-left: auto;
  color: #e9cc5e;
  font-size: 9px;
  font-weight: 400;
  letter-spacing: .2px;
  text-decoration: none;
}

.cabinet[data-screen="title"] .creator-credit {
  display: inline;
  margin-right: 40px;
}

.creator-credit:hover,
.creator-credit:focus-visible {
  color: #ffc300;
  text-decoration: underline;
}

@media (max-width: 700px) {
  body { padding: 0; }
  .cabinet { width: 100vw; border-width: 0; border-radius: 0; }
  .cabinet-footer { gap: 8px 14px; }
  .profile-modal { inset: 0 0 30px; padding: 6px; }
  .profile-grid { grid-template-columns: 1fr; }
  .profile-header { gap: 10px; }
  .profile-header img { width: 110px; height: 54px; }
  .profile-card { padding: 14px; }
  .home-links { left: 50%; bottom: 42px; gap: 4px; }
  .home-links a { grid-template-columns: 20px; padding: 4px; }
  .home-links a span { display: none; }
  .home-links svg { width: 19px; height: 19px; }
  .creator-credit { margin-left: 0; width: 100%; text-align: center; }
  .cabinet[data-screen="title"] .creator-credit { margin-right: 0; }
  .washer-creator-modal { inset: 0; padding: 5px; touch-action: pan-y; }
  .washer-creator-grid { grid-template-columns: 1fr; gap: 12px; }
  .washer-preview-panel { min-height: 260px; }
  .washer-preview-panel canvas { width: 145px; }
  .washer-option-row { grid-template-columns: 90px 42px minmax(90px, 1fr) 42px; }
}

@media (orientation: portrait) {
  .mobile-device .rotate-device { display: grid; }
}

.mobile-device.mobile-portrait-test .rotate-device { display: grid; }

@media (orientation: landscape) and (pointer: coarse),
       (orientation: landscape) and (max-height: 560px) {
  .mobile-device body {
    display: block;
    padding: 0;
    background: #010814;
    touch-action: none;
  }

  .mobile-device .cabinet {
    --mobile-side-rail: clamp(70px, 9vw, 90px);
    width: 100vw;
    height: 100dvh;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: #010814;
  }

  .mobile-device #game {
    width: 100vw;
    height: 100dvh;
    display: grid;
    place-items: center;
    aspect-ratio: auto;
  }

  .mobile-device #game canvas {
    width: min(100vw, calc(100dvh * 1.77778)) !important;
    height: min(100dvh, calc(100vw * .5625)) !important;
    margin: 0 !important;
  }

  .mobile-device .cabinet-footer { display: none; }
  .mobile-device .profile-modal { inset: 0; }

  .mobile-device .sound-toggle {
    top: max(8px, env(safe-area-inset-top));
    right: auto;
    left: max(9px, env(safe-area-inset-left));
    bottom: auto;
    width: 44px;
    height: 44px;
    border: 3px solid #fff;
    border-radius: 10px;
    background: #010814d9;
    box-shadow: 0 4px 0 #000, inset 0 0 14px #103562;
    font-size: 21px;
  }

  .mobile-device .sound-toggle.is-muted {
    color: #010814;
    background: #ffc300;
  }

  .mobile-device .mobile-game-fullscreen {
    top: max(8px, env(safe-area-inset-top));
    right: max(8px, env(safe-area-inset-right));
  }

  .mobile-device .cabinet[data-screen="title"] #game {
    height: calc(100dvh - 58px);
    align-self: start;
  }

  .mobile-device .cabinet[data-screen="title"] #game canvas {
    width: min(100vw, calc((100dvh - 58px) * 1.77778)) !important;
    height: min(calc(100dvh - 58px), calc(100vw * .5625)) !important;
  }

  .mobile-device .cabinet[data-screen="game"] #game,
  .mobile-device .cabinet[data-screen="time-boss"] #game {
    width: 100vw;
    height: 100dvh;
    align-self: center;
  }

  .mobile-device .cabinet[data-screen="game"] #game canvas,
  .mobile-device .cabinet[data-screen="time-boss"] #game canvas {
    width: min(calc(100vw - var(--mobile-side-rail) * 2), calc(100dvh * 1.77778)) !important;
    height: min(100dvh, calc((100vw - var(--mobile-side-rail) * 2) * .5625)) !important;
  }

  .mobile-device .cabinet[data-screen="title"] .home-links {
    left: max(6px, env(safe-area-inset-left));
    right: max(6px, env(safe-area-inset-right));
    bottom: max(5px, env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 5px;
    transform: none;
  }

  .mobile-device .home-links a,
  .mobile-device .home-links button {
    grid-template-columns: 19px minmax(0, auto);
    justify-content: center;
    gap: 4px;
    width: 100%;
    min-width: 0;
    min-height: 43px;
    padding: 4px 5px;
    font-size: clamp(6px, 1.25vw, 9px);
    white-space: nowrap;
    touch-action: manipulation;
  }

  .mobile-device .home-links a span,
  .mobile-device .home-links button .fullscreen-label { display: inline; }

  .mobile-device .home-links svg {
    width: 19px;
    height: 19px;
  }

  .mobile-device .cabinet[data-screen="game"] .mobile-controls,
  .mobile-device .cabinet[data-screen="time-boss"] .mobile-controls {
    inset: 0;
    height: 100dvh;
    display: block;
    border: 0;
    background: transparent;
  }

  .mobile-device .mobile-movement {
    top: 50%;
    bottom: auto;
    left: max(8px, env(safe-area-inset-left));
    flex-direction: column;
    gap: clamp(12px, 3.2vh, 22px);
    transform: translateY(-42%);
  }

  .mobile-device .mobile-actions {
    top: max(67px, calc(env(safe-area-inset-top) + 59px));
    right: max(8px, env(safe-area-inset-right));
    bottom: auto;
    flex-direction: column;
    gap: clamp(4px, 1.25vh, 7px);
  }

  .mobile-device .mobile-actions .mobile-pause { order: -1; }

  .mobile-device .mobile-controls button {
    width: clamp(50px, 14vh, 64px);
    height: clamp(50px, 14vh, 64px);
    border-radius: 14px;
    font-size: clamp(17px, 4.8vh, 25px);
  }

  .mobile-device .mobile-controls .mobile-fire {
    width: clamp(56px, 16vh, 72px);
    height: clamp(56px, 16vh, 72px);
  }

  .mobile-device .cabinet[data-screen="game"] > .mobile-game-fullscreen,
  .mobile-device .cabinet[data-screen="time-boss"] > .mobile-game-fullscreen { display: grid; }

  .mobile-device .cabinet[data-screen="time-boss"] .mobile-jump,
  .mobile-device .cabinet[data-screen="time-boss"] .mobile-bomb,
  .mobile-device .cabinet[data-screen="time-boss"] .mobile-super { display: none; }
}

@media (orientation: landscape) and (max-height: 340px) {
  .mobile-device .mobile-actions {
    top: max(48px, calc(env(safe-area-inset-top) + 44px));
    gap: 3px;
  }

  .mobile-device .mobile-controls button {
    width: 48px;
    height: 48px;
    border-width: 2px;
  }

  .mobile-device .mobile-controls .mobile-fire {
    width: 52px;
    height: 52px;
  }

  .mobile-device .mobile-controls button small { font-size: 6px; }
}
.boot-screen {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 20px;
  background: #010814;
  color: #ffc300;
  font: bold 16px monospace;
  text-align: center;
  padding: 24px;
}
.boot-screen[hidden], .boot-screen button[hidden] { display: none; }
.boot-screen progress { width: min(320px, 80vw); accent-color: #ffc300; }
.boot-screen button { padding: 16px 28px; background: #ffc300; color: #010814; border: 0; cursor: pointer; font: inherit; }
