/* mineBlok — menus look like Cecilia's pencil drawings, the game looks like blocks. */

:root {
  --paper: #f6f1e6;
  --paper-2: #ece4d4;
  --pencil: #3b3a37;
  --pencil-soft: #6d6a63;
  --pencil-light: #a6a199;
  --accent: #d4562f;
  --accent-2: #3f7ac4;
  --hand: "Chalkboard SE", "Comic Sans MS", "Bradley Hand", "Segoe Print", "Marker Felt", cursive;
  --ui: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  /* one hotbar slot; the action pad offsets itself by this so the two never
     overlap on a short landscape phone */
  --slot: clamp(30px, 6.6vh, 54px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: #8fc0e8;
  font-family: var(--ui);
  color: var(--pencil);
  touch-action: none;
}

body { position: fixed; inset: 0; width: 100%; }

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

#look-area { position: fixed; inset: 0; z-index: 1; touch-action: none; }

.hidden { display: none !important; }
.hand { font-family: var(--hand); }
.muted { color: var(--pencil-soft); }

/* ----------------------------------------------------------- paper surface */

.paper {
  background-color: var(--paper);
  background-image:
    radial-gradient(circle at 20% 15%, rgba(255,255,255,.7), transparent 55%),
    radial-gradient(circle at 82% 78%, rgba(0,0,0,.045), transparent 60%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/><feColorMatrix type='saturate' values='0'/></filter><rect width='120' height='120' filter='url(%23n)' opacity='0.055'/></svg>");
}

/* hand-drawn wobbly boxes */
.wobble {
  border: 2.5px solid var(--pencil);
  border-radius: 225px 15px 245px 15px / 15px 235px 15px 255px;
}
.wobble-2 { border-radius: 18px 190px 22px 210px / 200px 20px 220px 18px; }

/* ------------------------------------------------------------- screens */

.screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: calc(16px + var(--safe-t)) calc(16px + var(--safe-r)) calc(16px + var(--safe-b)) calc(16px + var(--safe-l));
  animation: fade .28s ease;
}
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }

.screen.dim { background: rgba(24, 26, 32, .58); backdrop-filter: blur(5px); }

/* --------------------------------------------------------------- title */

.title-hand {
  font-family: var(--hand);
  font-size: clamp(3rem, 13vw, 7.5rem);
  line-height: .95;
  margin: 0 0 .1em;
  color: var(--pencil);
  transform: rotate(-2.2deg);
  letter-spacing: .01em;
  text-shadow: 1px 1px 0 rgba(0,0,0,.13);
}
.title-hand.small { font-size: clamp(1.5rem, 5.2vw, 2.9rem); transform: rotate(-1.2deg); }

#screen-title {
  background:
    linear-gradient(180deg, rgba(10,14,26,.28) 0%, rgba(10,14,26,.06) 42%, rgba(10,14,26,.42) 100%);
}
.title-wrap { text-align: center; display: flex; flex-direction: column; align-items: center; }
#screen-title .title-hand {
  color: #fffdf6;
  text-shadow: 0 4px 0 rgba(0,0,0,.35), 0 10px 26px rgba(0,0,0,.5);
}

.oval-btn {
  position: relative;
  background: none;
  border: 0;
  padding: 0;
  margin: .4rem 0 .2rem;
  width: min(56vw, 260px);
  aspect-ratio: 2 / 1;
  cursor: pointer;
  color: #fffdf6;
  transition: transform .16s ease;
}
.oval-btn:hover { transform: scale(1.05) rotate(-1deg); }
.oval-btn:active { transform: scale(.97); }
.oval-btn .oval { position: absolute; inset: 0; width: 100%; height: 100%; }
.oval-btn .oval path {
  fill: rgba(255, 253, 246, .1);
  stroke: #fffdf6;
  stroke-width: 4;
  stroke-linecap: round;
  filter: drop-shadow(0 3px 8px rgba(0,0,0,.45));
}
.oval-btn span {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-size: clamp(1.6rem, 6vw, 2.8rem);
  text-shadow: 0 3px 10px rgba(0,0,0,.55);
}
@keyframes bob { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-6px) } }
.oval-btn { animation: bob 2.6s ease-in-out infinite; }

.credit { color: #fffdf6; font-size: clamp(.95rem, 3vw, 1.25rem); margin: 1.4rem 0 .2rem; text-shadow: 0 2px 8px rgba(0,0,0,.6); }
.credit strong { color: #ffd97a; }
.hint { font-size: .9rem; color: rgba(255,253,246,.72) !important; margin: .2rem 0 0; text-shadow: 0 2px 6px rgba(0,0,0,.6); }

/* ------------------------------------------------------------- loading */

.loading-inner { text-align: center; width: min(90vw, 420px); }
.loading-inner h1 { margin-bottom: .5rem; }
.load-bar {
  height: 18px; margin: 1rem 0 .6rem;
  border: 2.5px solid var(--pencil);
  border-radius: 200px 12px 200px 12px / 12px 200px 12px 200px;
  overflow: hidden;
  background: rgba(0,0,0,.05);
}
#load-fill { height: 100%; width: 0%; background: var(--accent); transition: width .25s ease; }

/* ------------------------------------------------------ character select */

#screen-select { justify-content: flex-start; gap: .5rem; overflow-y: auto; }
.select-head { text-align: center; flex: 0 0 auto; }
.select-head .sub { margin: -.2rem 0 .3rem; font-size: .95rem; }

.select-body {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: clamp(.6rem, 2vw, 1.6rem);
  width: min(1100px, 100%);
  min-height: 0;
  align-items: center;
}

.char-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(4px, 1vw, 10px);
  min-height: 0;
}
.char-card {
  position: relative;
  aspect-ratio: 1;
  background: rgba(255,255,255,.42);
  border: 2.5px solid var(--pencil);
  border-radius: 12px 3px 14px 4px / 4px 13px 3px 15px;
  cursor: pointer;
  padding: 2px;
  display: grid;
  place-items: center;
  transition: transform .14s ease, background .14s ease;
  overflow: hidden;
}
.char-card:nth-child(2n) { border-radius: 4px 15px 3px 13px / 14px 3px 12px 4px; }
.char-card.lone { grid-column: 2; }
.char-card img { width: 100%; height: 100%; object-fit: contain; image-rendering: auto; pointer-events: none; }
.char-card .cname {
  position: absolute; bottom: 1px; left: 0; right: 0;
  font-family: var(--hand); font-size: clamp(.5rem, 1.5vw, .78rem);
  text-align: center; color: var(--pencil-soft);
  background: linear-gradient(transparent, rgba(246,241,230,.9) 40%);
  pointer-events: none;
}
.char-card:hover { transform: scale(1.05) rotate(-1deg); background: rgba(255,255,255,.72); }
.char-card.active {
  background: #fff6d8;
  border-color: var(--accent);
  border-width: 3.5px;
  transform: scale(1.04);
  box-shadow: 0 4px 0 rgba(212,86,47,.25);
}

.char-stage {
  display: flex; flex-direction: column; align-items: center;
  min-height: 0; height: 100%;
  justify-content: center;
}
#preview {
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  max-height: 46vh;
  display: block;
}
.stage-info { text-align: center; flex: 0 0 auto; }
.stage-info h3 { margin: .1rem 0; font-size: clamp(1.2rem, 4vw, 2rem); }
.stage-info p { margin: 0 0 .3rem; font-size: clamp(.8rem, 2.4vw, 1rem); max-width: 34ch; }
.perk {
  display: inline-block;
  padding: .18em .8em;
  border: 2.5px solid var(--accent);
  border-radius: 100px 14px 100px 14px / 14px 100px 14px 100px;
  color: var(--accent);
  font-size: clamp(.78rem, 2.2vw, .98rem);
}

.select-foot { display: flex; gap: 1rem; align-items: center; flex: 0 0 auto; padding-top: .3rem; }

/* ------------------------------------------------------------- buttons */

.big-btn, .ghost-btn {
  font-family: var(--hand);
  cursor: pointer;
  border: 3px solid var(--pencil);
  background: rgba(255,255,255,.5);
  color: var(--pencil);
  border-radius: 140px 16px 150px 14px / 14px 150px 16px 140px;
  padding: .4em 1.4em;
  font-size: 1rem;
  transition: transform .14s ease, background .14s ease;
}
.big-btn {
  font-size: clamp(1.1rem, 3.6vw, 1.7rem);
  background: var(--accent);
  color: #fff8ee;
  border-color: #8f3016;
  box-shadow: 0 4px 0 #8f3016;
}
.big-btn:hover { transform: translateY(-2px); }
.big-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #8f3016; }
.ghost-btn:hover { background: rgba(255,255,255,.9); transform: translateY(-1px); }
.ghost-btn.danger { color: #a3301a; border-color: #a3301a; }

/* --------------------------------------------------------------- pause */

.paper-card {
  width: min(94vw, 500px);
  max-height: 92vh;
  overflow-y: auto;
  padding: 1.2rem 1.4rem 1.4rem;
  background-color: var(--paper);
  border: 3px solid var(--pencil);
  border-radius: 24px 6px 26px 8px / 8px 25px 6px 27px;
  box-shadow: 0 18px 44px rgba(0,0,0,.45);
  text-align: center;
}
.paper-card > h2 { margin: 0 0 1rem; }
.opt-row { margin: .6rem 0 1rem; display: flex; gap: .6rem; justify-content: center; }
.opt-row.wrap { flex-wrap: wrap; margin-top: 1rem; }
.opt-row.wrap .ghost-btn { font-size: .9rem; padding: .3em 1em; }

.opt {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: .42rem .2rem;
  border-bottom: 2px dashed var(--pencil-light);
  font-size: 1.02rem;
  cursor: pointer;
}
.opt input[type=checkbox] { position: absolute; opacity: 0; pointer-events: none; }
.opt .sw {
  width: 50px; height: 27px; border: 2.5px solid var(--pencil);
  border-radius: 40px; position: relative; transition: background .18s ease;
  background: rgba(0,0,0,.06); flex: 0 0 auto;
}
.opt .sw::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 19px; height: 19px; border-radius: 50%;
  background: var(--pencil); transition: transform .18s ease;
}
.opt input:checked + .sw { background: #a8d59a; }
.opt input:checked + .sw::after { transform: translateX(23px); }
.opt input[type=range] { flex: 0 0 150px; accent-color: var(--accent); }

.keys { font-size: .8rem; line-height: 1.7; margin: 1rem 0 0; }
.keys b { color: var(--pencil); background: rgba(0,0,0,.06); padding: .05em .4em; border-radius: 4px; }

/* ------------------------------------------------------- how to play */

.help-card { max-width: 460px; }
.help-list {
  list-style: none;
  margin: .4rem 0 1.2rem;
  padding: 0;
  text-align: left;
  font-size: clamp(.92rem, 3.1vw, 1.12rem);
}
.help-list li {
  display: flex;
  align-items: center;
  gap: .8rem;
  padding: .5rem .2rem;
  border-bottom: 2px dashed var(--pencil-light);
}
.help-list li:last-child { border-bottom: 0; }
.help-list .hico {
  flex: 0 0 2.1em;
  height: 2.1em;
  display: grid;
  place-items: center;
  font-size: 1.15em;
  border: 2.5px solid var(--pencil);
  border-radius: 46% 54% 50% 50% / 52% 48% 52% 48%;
  background: rgba(255,255,255,.6);
}

/* --------------------------------------------------- bubble panels */

.bubble-panel {
  width: min(94vw, 620px);
  max-height: 88vh;
  overflow-y: auto;
  padding: 1.2rem;
  text-align: center;
  background-color: var(--paper);
  border: 3.5px solid var(--pencil);
  border-radius: 46% 54% 44% 56% / 52% 44% 56% 48%;
  box-shadow: 0 18px 44px rgba(0,0,0,.45);
}
.bubble-panel.travel { border-radius: 52% 48% 56% 44% / 46% 56% 44% 54%; }
.bubble-panel h2 { margin: .2rem 0 .7rem; }

.block-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(58px, 1fr));
  gap: 7px;
  margin: .2rem auto 1rem;
  max-width: 400px;
}
.block-btn {
  aspect-ratio: 1;
  border: 2.5px solid var(--pencil);
  border-radius: 10px 3px 11px 4px / 4px 10px 3px 12px;
  background: rgba(255,255,255,.5);
  cursor: pointer;
  display: grid; place-items: center;
  padding: 4px;
  transition: transform .12s ease;
}
.block-btn:hover { transform: scale(1.1); background: #fff6d8; }
.block-btn.active { border-color: var(--accent); border-width: 3.5px; background: #fff6d8; }
.block-btn canvas { width: 100%; height: 100%; image-rendering: pixelated; }

.travel-list { display: grid; gap: .5rem; margin: .9rem auto 1rem; max-width: 340px; }
.travel-btn {
  font-family: var(--hand);
  font-size: 1.05rem;
  border: 2.5px solid var(--pencil);
  background: rgba(255,255,255,.55);
  border-radius: 120px 14px 130px 12px / 12px 130px 14px 120px;
  padding: .5em 1em;
  cursor: pointer;
  display: flex; align-items: center; gap: .6rem; justify-content: center;
  transition: transform .12s ease, background .12s ease;
}
.travel-btn:hover { transform: translateY(-2px); background: #fff6d8; }
.travel-btn .tico { font-size: 1.3em; }

/* ----------------------------------------------------------------- HUD */

#hud { position: fixed; inset: 0; z-index: 10; pointer-events: none; }
#hud button { pointer-events: auto; }

#crosshair {
  position: absolute; left: 50%; top: 50%;
  width: 22px; height: 22px; transform: translate(-50%, -50%);
  opacity: .85;
}
#crosshair span { position: absolute; background: #fff; box-shadow: 0 0 2px rgba(0,0,0,.9); }
#crosshair span:nth-child(1) { left: 50%; top: 0; width: 2px; height: 100%; margin-left: -1px; }
#crosshair span:nth-child(2) { top: 50%; left: 0; height: 2px; width: 100%; margin-top: -1px; }

#damage-flash {
  position: absolute; inset: 0; opacity: 0;
  background: radial-gradient(circle at center, transparent 40%, rgba(180,30,20,.55) 100%);
  transition: opacity .18s ease;
}
#damage-flash.on { opacity: 1; }

#water-overlay {
  position: absolute; inset: 0; opacity: 0;
  background: linear-gradient(rgba(30,90,170,.42), rgba(20,60,130,.55));
  transition: opacity .22s ease;
}
#water-overlay.on { opacity: 1; }

/* vertical block column down the right edge — straight from the drawing */
#hotbar {
  position: absolute;
  right: calc(10px + var(--safe-r));
  top: 50%;
  transform: translateY(-50%);
  display: flex; flex-direction: column; gap: clamp(3px, 0.7vh, 6px);
}
.slot {
  width: var(--slot);
  aspect-ratio: 1;
  flex: none;
  border: 3px solid rgba(30,28,25,.75);
  border-radius: 9px 3px 10px 4px / 4px 9px 3px 11px;
  background: rgba(246,241,230,.72);
  display: grid; place-items: center;
  cursor: pointer;
  position: relative;
  transition: transform .12s ease;
  backdrop-filter: blur(2px);
}
.slot canvas { width: 82%; height: 82%; image-rendering: pixelated; pointer-events: none; }
.slot .num {
  position: absolute; top: -2px; left: 3px;
  font: 700 10px var(--ui); color: rgba(30,28,25,.5);
}
.slot.active {
  border-color: #fff;
  background: rgba(255, 246, 216, .95);
  transform: scale(1.18) translateX(-4px);
  box-shadow: 0 0 0 3px rgba(0,0,0,.35), 0 4px 12px rgba(0,0,0,.4);
  z-index: 2;
}

/* round bubble buttons, top right */
#bubbles {
  position: absolute;
  top: calc(10px + var(--safe-t));
  right: calc(10px + var(--safe-r));
  display: flex; gap: 8px; align-items: flex-start;
}
.bubble {
  width: 62px; height: 62px;
  border: 3px solid rgba(30,28,25,.8);
  border-radius: 52% 48% 46% 54% / 48% 54% 46% 52%;
  background: rgba(246,241,230,.85);
  cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-family: var(--hand);
  color: var(--pencil);
  line-height: 1;
  gap: 1px;
  transition: transform .14s ease, background .14s ease;
  backdrop-filter: blur(3px);
}
.bubble:hover { transform: scale(1.09) rotate(-2deg); background: #fff6d8; }
.bubble:active { transform: scale(.95); }
.bubble-small { width: 46px; height: 46px; border-radius: 48% 52% 54% 46% / 52% 46% 50% 54%; }
.bubble-icon { font-size: 20px; display: grid; place-items: center; }
.bubble-label { font-size: 9px; text-align: center; color: var(--pencil-soft); }
.bubble-small .bubble-icon { font-size: 22px; }

.mini-cube {
  width: 17px; height: 17px; display: block;
  background: linear-gradient(135deg, #7bb356 0%, #7bb356 45%, #8a6142 45%, #8a6142 100%);
  border: 2px solid rgba(30,28,25,.8);
  transform: rotate(-8deg);
}

/* D-pad, bottom-left, as drawn */
#dpad {
  position: absolute;
  left: calc(14px + var(--safe-l));
  bottom: calc(14px + var(--safe-b));
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  width: clamp(140px, 34vw, 190px);
  aspect-ratio: 1;
  gap: 5px;
}

.pad {
  border: 3px solid rgba(30,28,25,.8);
  border-radius: 11px 4px 12px 4px / 4px 11px 4px 13px;
  background: rgba(246,241,230,.7);
  display: grid; place-items: center;
  cursor: pointer;
  padding: 0;
  transition: background .08s ease, transform .08s ease;
  backdrop-filter: blur(2px);
}
.pad svg { width: 62%; height: 62%; fill: rgba(30,28,25,.85); }
.pad.pressed { background: #ffd97a; transform: scale(.93); }
#pad-up { grid-area: 1 / 2 / 2 / 3; }
#pad-left { grid-area: 2 / 1 / 3 / 2; }
#pad-right { grid-area: 2 / 3 / 3 / 4; }
#pad-down { grid-area: 3 / 2 / 4 / 3; }

/* action buttons, bottom-right */
#actions {
  position: absolute;
  /* clear the hotbar column that runs down the right edge */
  right: calc(12px + var(--safe-r) + var(--slot) + 10px);
  bottom: calc(14px + var(--safe-b));
  grid-template-columns: repeat(2, auto);
  gap: 8px;
  align-items: end;
  justify-items: center;
}
#btn-power { grid-column: 1; grid-row: 1; }
#btn-fly { grid-column: 1; grid-row: 2; }
#btn-place { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
#btn-mine { grid-column: 2; grid-row: 3; }
#btn-jump { grid-column: 1; grid-row: 3; }
#btn-power.on { background: #e2c7ff; }
.act {
  width: 62px; height: 62px;
  border: 3px solid rgba(30,28,25,.8);
  border-radius: 50% 46% 54% 48% / 48% 54% 46% 52%;
  background: rgba(246,241,230,.7);
  font-size: 24px;
  color: rgba(30,28,25,.85);
  cursor: pointer;
  display: grid; place-items: center;
  transition: background .08s ease, transform .08s ease;
  backdrop-filter: blur(2px);
}
.act-big { width: 82px; height: 82px; font-size: 34px; background: rgba(255, 233, 190, .82); }
.act-small { width: 48px; height: 48px; font-size: 19px; }
.act.pressed, .act.on { background: #ffd97a; transform: scale(.94); }

/* Touch pads are hidden unless the device is touch-first or the player asks
   for them. Keep these as class selectors so nothing outranks them. */
.touch-only { display: none; }
body.touch .touch-only,
body.force-touch .touch-only { display: grid; }

#toast {
  position: absolute; left: 50%; bottom: 16%;
  transform: translateX(-50%);
  font-family: var(--hand);
  font-size: clamp(1rem, 3vw, 1.4rem);
  color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,.85);
  padding: .3em 1em;
  opacity: 0;
  transition: opacity .25s ease, transform .25s ease;
  white-space: nowrap;
  pointer-events: none;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(-8px); }

#mode-pill {
  position: absolute;
  left: 50%; top: calc(10px + var(--safe-t));
  transform: translateX(-50%);
  font-family: var(--hand);
  font-size: .95rem;
  color: #fff;
  background: rgba(20,22,28,.45);
  border-radius: 100px;
  padding: .15em .9em;
  opacity: 0;
  transition: opacity .3s ease;
  pointer-events: none;
}
#mode-pill.show { opacity: 1; }

#stats {
  position: absolute; left: calc(8px + var(--safe-l)); top: calc(8px + var(--safe-t));
  font: 11px/1.5 ui-monospace, Menlo, monospace;
  color: #fff; text-shadow: 0 1px 3px #000;
  white-space: pre;
  pointer-events: none;
}

/* ------------------------------------------------------------ responsive */

/* Portrait phones and tablets: big preview on top, the 3x3 sheet below it.
   The grid is square, so capping its width also caps its height. */
@media (orientation: portrait) {
  .select-body {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-content: center;
    gap: .5rem;
  }
  .char-stage { order: 1; }
  .char-grid {
    order: 2;
    width: min(100%, 360px, 44vh);
    margin: 0 auto;
  }
  #preview { max-height: 30vh; }
  .stage-info p { display: none; }
}

/* A phone held sideways is short but wide — keep two columns and shrink. */
@media (orientation: landscape) and (max-height: 640px) {
  #screen-select { padding-top: 8px; padding-bottom: 8px; gap: .2rem; }
  .select-head { display: none; }
  .select-body { gap: .9rem; align-items: center; }
  .char-grid { width: min(100%, 60vh); margin-left: auto; }
  #preview { max-height: 50vh; }
  .stage-info p { display: none; }
  .stage-info h3 { font-size: 1.15rem; margin: 0; }
  .perk { font-size: .8rem; padding: .1em .7em; }
  .select-foot { padding-top: .2rem; gap: .6rem; }
  .select-foot .big-btn { font-size: 1.05rem; padding: .25em 1.1em; }
  .select-foot .ghost-btn { font-size: .85rem; padding: .25em 1em; }
}

@media (max-height: 430px) {
  #preview { max-height: 42vh; }
  .char-grid { width: min(100%, 52vh); }
}

@media (hover: none) {
  .char-card:hover, .block-btn:hover, .bubble:hover { transform: none; }
}

/* Phone-sized screens: shrink every touch target so the D-pad, the action pad
   and the block column all fit side by side without stacking on each other. */
@media (max-width: 560px) {
  #dpad { width: clamp(108px, 33vw, 150px); }
  .act { width: 52px; height: 52px; font-size: 20px; }
  .act-big { width: 68px; height: 68px; font-size: 27px; }
  .act-small { width: 42px; height: 42px; font-size: 17px; }
  #actions { gap: 6px; }
  .bubble { width: 50px; height: 50px; }
  .bubble-small { width: 38px; height: 38px; }
  .bubble-icon { font-size: 17px; }
  .bubble-label { font-size: 8px; }
}

@media (max-height: 480px) {
  #dpad { width: clamp(104px, 26vh, 140px); }
  .act { width: 48px; height: 48px; font-size: 19px; }
  .act-big { width: 62px; height: 62px; font-size: 25px; }
  .act-small { width: 38px; height: 38px; font-size: 16px; }
  .bubble { width: 46px; height: 46px; }
  .bubble-small { width: 36px; height: 36px; }
  .bubble-icon { font-size: 16px; }
  .bubble-label { font-size: 7px; }
}
/* leave headroom under the bubble buttons in the top-right corner */
@media (max-height: 480px) {
  :root { --slot: clamp(26px, 6.2vh, 44px); }
}
