:root {
  color-scheme: dark;
  --photo: url("./xc90-r-design.jpg");
  --telegram-top: 0px;
  --telegram-bottom: 0px;
  --telegram-left: 0px;
  --telegram-right: 0px;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: #101419;
  color: #fff;
}

* { box-sizing: border-box; }
body { margin: 0; }

.menu {
  --top: max(env(safe-area-inset-top, 0px), var(--telegram-top));
  --bottom: max(env(safe-area-inset-bottom, 0px), var(--telegram-bottom));
  --gutter: clamp(11px, 2.35vw, 24px);
  isolation: isolate;
  position: relative;
  display: grid;
  align-content: end;
  width: 100%;
  min-height: max(100vh, 560px);
  min-height: max(100svh, calc(525px + var(--top) + var(--bottom)));
  padding: calc(240px + var(--top))
    calc(var(--gutter) + max(env(safe-area-inset-right, 0px), var(--telegram-right)))
    calc(clamp(20px, 5.6svh, 55px) + var(--bottom))
    calc(var(--gutter) + max(env(safe-area-inset-left, 0px), var(--telegram-left)));
  background: #101419;
}

.menu::before, .menu::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.menu::before {
  z-index: -1;
  inset: var(--top) 0 0;
  background: var(--photo) center top / cover no-repeat;
}

.actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(7px, 1.2svh, 13px);
}

.action {
  grid-column: 1 / -1;
  min-height: clamp(46px, 6.35svh, 63px);
  padding: 8px 7px;
  border: 1px solid rgb(224 235 247 / .55);
  border-radius: clamp(12px, 2.6vw, 20px);
  color: #fff;
  background: rgb(31 38 46 / .63);
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
  text-shadow: 0 1px 3px rgb(0 0 0 / .45);
  font: 650 clamp(15px, 4.5vw, 25px)/1.18 system-ui, sans-serif;
  cursor: pointer;
  touch-action: manipulation;
}

.action-primary {
  background: rgb(22 84 147 / .77);
  border-color: rgb(156 207 255 / .7);
}

.action-half {
  grid-column: auto;
  font-size: clamp(13px, 3.7vw, 20px);
}

.action:active { filter: brightness(1.2); }
.action:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.action:disabled { cursor: wait; }

.status {
  margin: 10px 0 0;
  padding: 8px 12px;
  background: #151c23;
  border-radius: 10px;
  text-align: center;
  font-size: 14px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Continue the floor on tall phones while keeping the car and wordmark in frame. */
@media (max-aspect-ratio: 3/5) {
  .menu::before {
    background-size: 100% auto;
    mask-image: linear-gradient(#000 62vw, #000 82vw, transparent 134vw);
  }

  .menu::after {
    z-index: -2;
    inset: 38% 0 0;
    background: var(--photo) center bottom / auto 220% no-repeat;
  }
}

@media (min-aspect-ratio: 3/4) {
  body::before {
    content: "";
    position: fixed;
    inset: 0;
    background: linear-gradient(#101419bd, #101419dc), var(--photo) center / cover;
  }

  .menu {
    max-width: 560px;
    margin-inline: auto;
    min-height: max(100svh, 700px);
  }
}
