/* Vial Voyage — pixel color-lab skin.
 *
 * Shared geometry comes from the --pixel-* tokens in /assets/css/tokens.css.
 * Game-specific palette and liquid colours live only in this file. The Shell
 * pixel.css is not loaded inside the iframe.
 */

:root {
  color-scheme: light;

  --vv-grid: var(--pixel-grid-size);
  --vv-border: var(--pixel-border-width);
  --vv-border-thin: var(--pixel-border-thin);
  --vv-shadow: var(--pixel-shadow-offset);
  --vv-shadow-lg: var(--pixel-shadow-offset-lg);
  --vv-font: var(--pixel-ui-font);

  --vv-bg: #eaf0f7;
  --vv-bg-2: #d6e2ef;
  --vv-surface: #fffdf4;
  --vv-surface-2: #f1eddf;
  --vv-surface-3: #e2ddcb;
  --vv-ink: #1c2a3a;
  --vv-muted: #5c6b7c;
  --vv-line: #1c2a3a;
  --vv-accent: #2f7bd6;
  --vv-accent-soft: #cfe2f7;
  --vv-warm: #b9781f;
  --vv-warm-soft: #f3dfb7;
  --vv-danger: #b8462f;
  --vv-danger-soft: #f2c9c0;
  --vv-success: #3f7a4d;
  --vv-on-accent: #fffdf4;
  --vv-glass: #f7fbff;
  --vv-glass-line: #2f5f8f;
  --vv-scrim: rgba(12, 20, 30, 0.78);

  --vv-liquid-coral: #ef6b3a;
  --vv-liquid-sky: #3b82d6;
  --vv-liquid-lime: #6dbb3e;
  --vv-liquid-violet: #8757c8;
  --vv-liquid-gold: #e9b23c;
  --vv-liquid-teal: #2f9e94;
  --vv-liquid-rose: #d9465f;

  --vv-sprite-size: 400% 200%;
  --vv-sprite-vial: 0% 100%;
  --vv-sprite-orb: 33.333% 100%;
  --vv-sprite-spark: 66.667% 100%;
}

[data-theme="dark"] {
  color-scheme: dark;

  --vv-bg: #0b1424;
  --vv-bg-2: #14233a;
  --vv-surface: #172738;
  --vv-surface-2: #202f44;
  --vv-surface-3: #2a3a50;
  --vv-ink: #edf4ff;
  --vv-muted: #9fb0c6;
  --vv-line: #edf4ff;
  --vv-accent: #6fb4ff;
  --vv-accent-soft: #244a72;
  --vv-warm: #ffd166;
  --vv-warm-soft: #4a3a18;
  --vv-danger: #ff7a6b;
  --vv-danger-soft: #4a241c;
  --vv-success: #74d6a0;
  --vv-on-accent: #08101b;
  --vv-glass: #20334a;
  --vv-glass-line: #7fb8ef;
  --vv-scrim: rgba(2, 6, 12, 0.84);

  --vv-liquid-coral: #ff8a58;
  --vv-liquid-sky: #6fb4ff;
  --vv-liquid-lime: #9adf67;
  --vv-liquid-violet: #b48cff;
  --vv-liquid-gold: #ffd166;
  --vv-liquid-teal: #5fd6c9;
  --vv-liquid-rose: #ff7d94;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--vv-bg);
}

body {
  color: var(--vv-ink);
  font-family: var(--vv-font);
  font-size: 16px;
  line-height: 1.4;
  -webkit-font-smoothing: none;
  text-rendering: optimizeSpeed;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

button {
  color: inherit;
  font: inherit;
  touch-action: manipulation;
}

button:focus-visible {
  outline: var(--vv-border) solid var(--vv-warm);
  outline-offset: 2px;
}

body.is-pointer-input button:focus-visible {
  outline: none;
}

/* App + scene ------------------------------------------------------------- */

.vv-app {
  position: relative;
  display: flex;
  width: 100%;
  height: 100dvh;
  min-height: 0;
  flex-direction: column;
  gap: var(--vv-grid);
  padding:
    max(var(--vv-grid), env(safe-area-inset-top))
    max(var(--vv-grid), env(safe-area-inset-right))
    max(var(--vv-grid), env(safe-area-inset-bottom))
    max(var(--vv-grid), env(safe-area-inset-left));
  overflow: hidden;
  isolation: isolate;
  background: var(--vv-bg);
}

.vv-scene {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.34;
  background-color: var(--vv-bg);
  background-image: url("../assets/vial-voyage-light.png");
  background-position: center;
  background-size: cover;
  image-rendering: pixelated;
}

[data-theme="dark"] .vv-scene {
  background-image: url("../assets/vial-voyage-dark.png");
  opacity: 0.46;
}

.vv-topbar,
.vv-bags,
.vv-board-panel,
.vv-controls {
  position: relative;
  z-index: 1;
}

/* Top bar ----------------------------------------------------------------- */

.vv-topbar {
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: var(--vv-grid);
  min-height: 44px;
}

.vv-icon-btn {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  padding: 0;
  border: var(--vv-border) solid var(--vv-line);
  background: var(--vv-surface);
  box-shadow: var(--vv-shadow) var(--vv-shadow) 0 var(--vv-line);
  cursor: pointer;
}

.vv-icon-btn:active {
  transform: translate(var(--vv-shadow), var(--vv-shadow));
  box-shadow: 0 0 0 var(--vv-line);
}

.vv-icon {
  display: block;
  image-rendering: pixelated;
}

.vv-icon--pause {
  display: inline-flex;
  gap: 4px;
}

.vv-icon--pause::before,
.vv-icon--pause::after {
  content: "";
  display: block;
  width: 5px;
  height: 16px;
  background: currentColor;
}

.vv-icon--hint {
  width: 20px;
  height: 20px;
  background-color: var(--vv-warm-soft);
  background-image: url("../assets/pixel/vial-voyage-sprites.png");
  background-repeat: no-repeat;
  background-size: var(--vv-sprite-size);
  background-position: var(--vv-sprite-spark);
}

.vv-level-wrap {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.vv-brand {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
}

.vv-brand__mark {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  border: var(--vv-border-thin) solid var(--vv-line);
  background-color: var(--vv-surface-2);
  background-image: url("../assets/pixel/vial-voyage-sprites.png");
  background-repeat: no-repeat;
  background-size: var(--vv-sprite-size);
  background-position: var(--vv-sprite-vial);
  box-shadow: 2px 2px 0 var(--vv-line);
  image-rendering: pixelated;
}

.vv-level-chip {
  min-width: 0;
  padding: 2px 8px;
  overflow: hidden;
  border: var(--vv-border-thin) solid var(--vv-line);
  color: var(--vv-on-accent);
  background: var(--vv-accent);
  box-shadow: 2px 2px 0 var(--vv-line);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.vv-stats {
  max-width: 100%;
  overflow: hidden;
  color: var(--vv-muted);
  font-size: 12px;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Bags -------------------------------------------------------------------- */

.vv-bags {
  display: flex;
  min-height: 64px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: clamp(4px, 1.4vw, 14px);
}

.vv-bag {
  position: relative;
  display: block;
  width: clamp(52px, 15vw, 84px);
  min-width: var(--touch-target-min);
  height: clamp(64px, 12vh, 104px);
  min-height: var(--touch-target-min);
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  transition: transform 120ms steps(2, end);
}

.vv-bag:active:not(:disabled) {
  transform: translateY(-2px);
}

.vv-bag__handle {
  position: absolute;
  z-index: 2;
  top: 0;
  left: 50%;
  width: 46%;
  height: 24%;
  border: var(--vv-border) solid var(--vv-line);
  border-bottom: 0;
  background: transparent;
  transform: translateX(-50%);
}

.vv-bag__paper {
  position: absolute;
  inset: 20% 0 0;
  overflow: hidden;
  border: var(--vv-border) solid var(--vv-line);
  background: var(--vv-surface);
  box-shadow: 3px 3px 0 var(--vv-line);
}

.vv-bag__window {
  position: absolute;
  inset: 8% 12% 10%;
  overflow: hidden;
  border: var(--vv-border-thin) solid var(--vv-line);
  background: var(--vv-surface-2);
}

.vv-bag__fill {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  height: calc(var(--fill, 0) * 100%);
  flex-direction: column-reverse;
  overflow: hidden;
  transition: height 200ms steps(4, end);
}

.vv-bag__band {
  min-height: 25%;
  flex: 1 1 25%;
  background: var(--liquid, var(--vv-accent));
  border-top: var(--vv-border-thin) solid var(--vv-line);
}

.vv-bag__check {
  position: absolute;
  z-index: 3;
  right: 2px;
  bottom: 2px;
  width: 18px;
  height: 18px;
  border: var(--vv-border-thin) solid var(--vv-line);
  background-color: var(--vv-success);
  background-image: url("../assets/pixel/vial-voyage-sprites.png");
  background-repeat: no-repeat;
  background-size: var(--vv-sprite-size);
  background-position: var(--vv-sprite-spark);
  image-rendering: pixelated;
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 120ms steps(2, end), transform 120ms steps(2, end);
}

.vv-bag__count {
  position: absolute;
  z-index: 4;
  top: 8%;
  right: -2px;
  min-width: 24px;
  height: 18px;
  padding: 0 2px;
  border: var(--vv-border-thin) solid var(--vv-line);
  color: var(--vv-on-accent);
  background: var(--vv-accent);
  font-size: 12px;
  font-weight: 700;
  line-height: 14px;
  text-align: center;
}

.vv-bag.has-fill .vv-bag__paper {
  border-color: var(--vv-accent);
}

.vv-bag.is-filled .vv-bag__paper {
  border-color: var(--vv-warm);
  box-shadow: 3px 3px 0 var(--vv-warm);
}

.vv-bag.is-filled .vv-bag__check {
  opacity: 1;
  transform: scale(1);
}

.vv-bag.is-arriving {
  animation: vv-bag-arrive 320ms steps(3, end);
}

.vv-bag.is-collecting {
  pointer-events: none;
}

.vv-bag.is-collected {
  visibility: hidden;
}

.vv-bag.is-filled:not(:disabled):hover {
  transform: translateY(-3px);
}

/* Board ------------------------------------------------------------------- */

.vv-board-panel {
  position: relative;
  display: flex;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
  overflow: hidden;
  border: var(--vv-border) solid var(--vv-line);
  background-color: var(--vv-surface-2);
  background-image: conic-gradient(
    var(--vv-surface) 0 25%,
    var(--vv-surface-2) 0 50%,
    var(--vv-surface) 0 75%,
    var(--vv-surface-2) 0
  );
  background-size: calc(var(--vv-grid) * 2) calc(var(--vv-grid) * 2);
  box-shadow: var(--vv-shadow) var(--vv-shadow) 0 var(--vv-line);
}

.vv-board {
  position: relative;
  z-index: 1;
  display: grid;
  height: 100%;
  min-height: 0;
  grid-template-columns: repeat(var(--columns, 7), minmax(0, 1fr));
  grid-template-rows: repeat(var(--rows, 3), minmax(0, 1fr));
  gap: 3px 2px;
  align-items: end;
  justify-items: center;
  padding: 6px 4px 18px;
}

.vv-vial {
  position: relative;
  width: min(100%, 52px);
  min-width: var(--touch-target-min);
  height: 100%;
  min-height: var(--touch-target-min);
  max-height: clamp(92px, 16vh, 150px);
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  transition: transform 120ms steps(2, end);
}

.vv-vial__glass {
  position: absolute;
  inset: 9% 13% 0;
  border: var(--vv-border) solid var(--vv-glass-line);
  background: var(--vv-glass);
  box-shadow: 3px 3px 0 var(--vv-line);
}

.vv-vial__glass::before {
  position: absolute;
  z-index: 2;
  top: -10%;
  right: 28%;
  left: 28%;
  height: 13%;
  border: var(--vv-border-thin) solid var(--vv-line);
  background: var(--vv-glass);
  content: "";
}

.vv-vial__cap {
  position: absolute;
  z-index: 4;
  top: -23%;
  left: 26%;
  width: 48%;
  height: 13%;
  border: var(--vv-border) solid var(--vv-line);
  background: var(--vv-accent);
}

.vv-vial__liquid-stack {
  position: absolute;
  inset: 3px 3px 4px;
  display: flex;
  flex-direction: column-reverse;
  overflow: hidden;
  background: var(--vv-glass);
}

.vv-vial__liquid {
  position: relative;
  width: 100%;
  min-height: 25%;
  flex: 0 0 25%;
  background: var(--liquid, var(--vv-accent));
  border-top: var(--vv-border-thin) solid var(--vv-line);
}

.vv-vial__liquid:first-of-type {
  border-top: 0;
}

.vv-vial__shine {
  position: absolute;
  z-index: 3;
  top: 18%;
  bottom: 10%;
  left: 15%;
  width: 3px;
  background: var(--vv-surface);
  pointer-events: none;
}

.vv-vial[aria-pressed="true"] {
  transform: translateY(-4px);
}

.vv-vial[aria-pressed="true"] .vv-vial__glass {
  border-color: var(--vv-warm);
  box-shadow:
    0 0 0 var(--vv-border) var(--vv-warm),
    3px 3px 0 var(--vv-line);
}

.vv-vial.is-hint .vv-vial__glass {
  border-color: var(--vv-warm);
  background: var(--vv-warm-soft);
  animation: vv-hint-pulse 720ms steps(2, end) infinite;
}

.vv-vial.is-invalid .vv-vial__glass {
  border-color: var(--vv-danger);
  background: var(--vv-danger-soft);
}

.vv-vial.is-invalid {
  animation: vv-invalid-shake 120ms steps(2, end) 2;
}

.vv-vial.is-pouring-source {
  opacity: 0.35;
  pointer-events: none;
}

.vv-vial.is-pouring-target .vv-vial__glass {
  border-color: var(--vv-accent);
  animation: vv-target-flash 280ms steps(2, end) 2;
}

.vv-app[data-busy] .vv-vial {
  pointer-events: none;
}

/* Effects ----------------------------------------------------------------- */

.vv-effects {
  position: absolute;
  z-index: 4;
  inset: 0;
  overflow: visible;
  pointer-events: none;
}

.vv-pour-clone {
  position: absolute;
  z-index: 5;
  pointer-events: none;
  will-change: transform;
}

.vv-pour-clone .vv-vial__glass {
  border-color: var(--vv-warm);
}

.vv-pour-clone .vv-vial__cap,
.vv-vial.is-pouring-source .vv-vial__cap,
.vv-vial.is-pouring-target .vv-vial__cap {
  opacity: 0;
}

.vv-cap-pop {
  position: absolute;
  z-index: 9;
  border: var(--vv-border) solid var(--vv-line);
  background: var(--vv-accent);
}

.vv-pour-stream {
  position: absolute;
  z-index: 6;
  border: var(--vv-border-thin) solid var(--vv-line);
  background: var(--stream, var(--vv-accent));
  transform-origin: center top;
}

.vv-pour-splash {
  position: absolute;
  z-index: 7;
  width: 12px;
  height: 12px;
  border: var(--vv-border-thin) solid var(--vv-line);
  background: var(--stream, var(--vv-accent));
  transform: translate(-50%, -50%);
}

.vv-vial__liquid--incoming {
  min-height: 0;
}

.vv-spark {
  position: absolute;
  z-index: 8;
  width: 8px;
  height: 8px;
  border: var(--vv-border-thin) solid var(--vv-line);
  background: var(--vv-warm);
  animation: vv-spark-out 520ms steps(4, end) var(--spark-delay, 0ms) both;
}

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

.vv-app progress {
  position: absolute;
  z-index: 3;
  right: 12%;
  bottom: 2px;
  left: 12%;
  width: 76%;
  height: 8px;
  overflow: hidden;
  border: var(--vv-border-thin) solid var(--vv-line);
  background: var(--vv-surface-2);
  appearance: none;
}

.vv-app progress::-webkit-progress-bar {
  background: var(--vv-surface-2);
}

.vv-app progress::-webkit-progress-value {
  background: var(--vv-accent);
}

.vv-app progress::-moz-progress-bar {
  background: var(--vv-accent);
}

/* Controls ---------------------------------------------------------------- */

.vv-controls {
  display: flex;
  min-height: 48px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 3vw, 24px);
}

.vv-control {
  display: inline-flex;
  min-width: 118px;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 10px;
  border: var(--vv-border) solid var(--vv-line);
  background: var(--vv-surface);
  box-shadow: var(--vv-shadow) var(--vv-shadow) 0 var(--vv-line);
  cursor: pointer;
  transition: transform 80ms steps(2, end);
}

.vv-control:active:not(:disabled) {
  transform: translate(var(--vv-shadow), var(--vv-shadow));
  box-shadow: 0 0 0 var(--vv-line);
}

.vv-control:disabled {
  opacity: 0.42;
  cursor: default;
}

.vv-control__icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  border: var(--vv-border-thin) solid var(--vv-line);
  background-color: var(--vv-accent-soft);
  background-image: url("../assets/pixel/vial-voyage-sprites.png");
  background-repeat: no-repeat;
  background-size: var(--vv-sprite-size);
  image-rendering: pixelated;
}

.vv-control__icon--shuffle {
  background-position: var(--vv-sprite-orb);
}

.vv-control__icon--undo {
  background-position: var(--vv-sprite-spark);
}

.vv-control__label {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

/* Dialog ------------------------------------------------------------------ */

.vv-dialog {
  width: min(380px, calc(100% - var(--vv-grid) * 2));
  max-height: 80vh;
  padding: 16px;
  overflow: auto;
  border: var(--vv-border) solid var(--vv-line);
  color: var(--vv-ink);
  background: var(--vv-surface);
  box-shadow: var(--vv-shadow-lg) var(--vv-shadow-lg) 0 var(--vv-line);
  text-align: center;
}

.vv-dialog::backdrop {
  background: var(--vv-scrim);
}

.vv-celebrate {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--vv-grid);
  border: var(--vv-border) solid var(--vv-line);
  background-color: var(--vv-warm-soft);
  background-image: url("../assets/pixel/vial-voyage-sprites.png");
  background-repeat: no-repeat;
  background-size: var(--vv-sprite-size);
  background-position: var(--vv-sprite-spark);
  box-shadow: var(--vv-shadow) var(--vv-shadow) 0 var(--vv-line);
  image-rendering: pixelated;
}

.vv-kicker {
  margin: 0 0 4px;
  color: var(--vv-accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.vv-dialog h2 {
  margin: 0;
  font-family: var(--vv-font);
  font-size: 24px;
  line-height: 1.1;
  text-transform: uppercase;
}

.vv-dialog p {
  margin: var(--vv-grid) 0;
  color: var(--vv-muted);
  font-size: 14px;
}

.vv-dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--vv-grid);
}

.vv-button {
  min-height: 48px;
  padding: 0 12px;
  border: var(--vv-border) solid var(--vv-line);
  background: var(--vv-surface-2);
  box-shadow: var(--vv-shadow) var(--vv-shadow) 0 var(--vv-line);
  font-family: var(--vv-font);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
}

.vv-button:active {
  transform: translate(var(--vv-shadow), var(--vv-shadow));
  box-shadow: 0 0 0 var(--vv-line);
}

.vv-button--primary {
  color: var(--vv-on-accent);
  background: var(--vv-accent);
}

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

/* Animations -------------------------------------------------------------- */

@keyframes vv-hint-pulse {
  0%,
  100% {
    border-color: var(--vv-warm);
    background: var(--vv-glass);
  }
  50% {
    border-color: var(--vv-accent);
    background: var(--vv-accent-soft);
  }
}

@keyframes vv-invalid-shake {
  25% {
    transform: translateX(-4px);
  }
  75% {
    transform: translateX(4px);
  }
}

@keyframes vv-target-flash {
  50% {
    background: var(--vv-accent-soft);
  }
}

@keyframes vv-bag-arrive {
  0% {
    transform: translateY(8px);
  }
  60% {
    transform: translateY(-4px);
  }
  100% {
    transform: translateY(0);
  }
}

@keyframes vv-spark-out {
  from {
    opacity: 0;
    transform: translate(-50%, -50%);
  }
  25% {
    opacity: 1;
  }
  to {
    opacity: 0;
    transform: translate(-50%, -50%) translateY(-28px);
  }
}

/* Compact portrait -------------------------------------------------------- */

@media (max-width: 480px) {
  .vv-app {
    gap: 4px;
    padding:
      max(4px, env(safe-area-inset-top))
      max(4px, env(safe-area-inset-right))
      max(4px, env(safe-area-inset-bottom))
      max(4px, env(safe-area-inset-left));
  }

  .vv-topbar {
    gap: 6px;
  }

  .vv-bags {
    min-height: 56px;
    gap: 4px;
  }

  .vv-bag {
    width: clamp(48px, 14vw, 64px);
    height: 56px;
  }

  .vv-board {
    gap: 3px 1px;
    padding: 4px 2px 18px;
  }

  .vv-controls {
    min-height: 44px;
    gap: 8px;
  }

  .vv-control {
    min-width: 106px;
    min-height: 44px;
  }
}

@media (max-width: 360px) {
  .vv-brand__mark {
    width: 20px;
    height: 20px;
  }

  .vv-level-chip {
    font-size: 12px;
    padding-inline: 6px;
  }

  .vv-vial {
    width: min(100%, 48px);
  }

  .vv-control {
    min-width: 100px;
    padding-inline: 6px;
  }
}

/* Compact landscape ------------------------------------------------------- */

@media (orientation: landscape) and (max-height: 520px) {
  .vv-app {
    display: grid;
    grid-template-columns: minmax(0, 1fr) clamp(124px, 18vw, 156px);
    grid-template-rows: 44px minmax(0, 1fr) 48px;
    grid-template-areas:
      "top bags"
      "board bags"
      "controls bags";
    gap: 4px 8px;
    padding:
      max(4px, env(safe-area-inset-top))
      max(6px, env(safe-area-inset-right))
      max(4px, env(safe-area-inset-bottom))
      max(6px, env(safe-area-inset-left));
  }

  .vv-topbar {
    grid-area: top;
    min-height: 0;
    grid-template-columns: 44px 1fr 44px;
  }

  .vv-icon-btn {
    width: 44px;
    height: 44px;
  }

  .vv-level-chip {
    font-size: 12px;
    padding: 1px 6px;
  }

  .vv-stats {
    display: none;
  }

  .vv-bags {
    grid-area: bags;
    display: grid;
    min-height: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
    place-items: center;
    gap: 4px;
    padding: 2px;
    border-left: var(--vv-border-thin) solid var(--vv-line);
  }

  .vv-bag {
    width: clamp(48px, 7vw, 64px);
    height: clamp(58px, 20vh, 76px);
    min-height: var(--touch-target-min);
  }

  .vv-board-panel {
    grid-area: board;
  }

  .vv-board {
    gap: 2px 1px;
    padding: 2px 2px 18px;
  }

  .vv-vial {
    max-height: 76px;
  }

  .vv-controls {
    grid-area: controls;
    min-height: 0;
  }

  .vv-control {
    min-height: 46px;
    min-width: 112px;
  }
}

@media (orientation: landscape) and (max-height: 340px) {
  .vv-app {
    gap: 2px 6px;
    padding:
      max(2px, env(safe-area-inset-top))
      max(4px, env(safe-area-inset-right))
      max(2px, env(safe-area-inset-bottom))
      max(4px, env(safe-area-inset-left));
  }

  .vv-bags {
    gap: 2px;
  }

  .vv-bag {
    height: 52px;
  }

  .vv-control {
    min-height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0ms !important;
    animation-duration: 0ms !important;
    animation-iteration-count: 1 !important;
  }
}
