body {
  display: grid;
  place-items: center;
  height: 100vh;
  height: 100dvh;
  margin: 0;
  overflow: hidden;
  background: #171411;
}

.player {
  --cover-background: #915d47;
  --cover-foreground: #f3eddf;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  width: min(100vw, 56.25vh);
  width: min(100vw, 56.25dvh);
  aspect-ratio: 9 / 16;
  background: var(--cover-background);
}

.player[data-color="greige"] {
  --cover-background: #c5bbb1;
  --cover-foreground: #433b32;
}

.player[data-color="brown"] {
  --cover-background: #433b32;
}

trepet-certificate {
  display: block;
  width: 100%;
  aspect-ratio: 9 / 16;
  background: var(--cover-background);
}

button,
#book {
  padding: 15px 22px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: #f3eddf;
  color: #79523d;
  font:
    400 14px Arial,
    sans-serif;
  cursor: pointer;
}

button:focus-visible,
#book:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

button:disabled {
  opacity: 0.55;
  cursor: wait;
}

.invitation {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: 100%;
  grid-template-rows: auto 48px 24px;
  place-content: center;
  justify-items: center;
  gap: 28px;
  background: var(--cover-background);
}

.invitation .logo {
  grid-area: 1 / 1;
  width: 72%;
  aspect-ratio: 200 / 36;
  background: var(--cover-foreground);
  mask: url('./assets/logo.svg') center / contain no-repeat;
}

#open,
#retry,
#status {
  grid-area: 2 / 1;
  align-self: center;
}

#retry:not([hidden]) ~ #status {
  grid-row: 3;
}

#status {
  margin: 0;
  max-width: 85%;
  text-align: center;
  color: var(--cover-foreground);
  font:
    12px/1.5 Arial,
    sans-serif;
}

.actions {
  position: absolute;
  z-index: 1;
  bottom: max(4%, env(safe-area-inset-bottom));
  left: 10%;
  right: 10%;
  display: grid;
  gap: 10px;
  animation: appear 0.25s ease-out both;
}

.actions button,
#book {
  background: #915d47;
  color: #fffaf2;
  box-shadow: 0 4px 16px #433b3218;
}

#book {
  text-align: center;
  text-decoration: none;
}

.actions .secondary {
  background: #f6f5ef;
  color: #79523d;
  border-color: #cbb9a8;
}

#download-status {
  margin: 0;
  padding: 8px 12px;
  border-radius: 4px;
  background: #f6f5ef;
  color: #79523d;
  text-align: center;
  font: 12px/1.5 Arial, sans-serif;
}

#download-status:empty {
  display: none;
}

[hidden] {
  display: none !important;
}

@keyframes appear {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .actions {
    animation: none;
  }
}
