:root {
  color-scheme: light;
  background: #f6f2e9;
  font-family: Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
}

#stage {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
  outline: none;
  background: #f6f2e9;
}

#word {
  width: min(86vw, calc(67vw + 73px), 1080px, 173vh);
  height: auto;
  display: block;
  overflow: visible;
  fill: #000;
  user-select: none;
  pointer-events: none;
}

#ending {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  color: #e6e2d9;
  color-scheme: dark;
  opacity: 0;
}

#ending.visible { animation: surface 850ms ease-out both; }
@keyframes surface { from { opacity: 0; } to { opacity: 1; } }

.buttons {
  display: flex;
  gap: clamp(20px, 5vw, 42px);
}

button {
  min-width: 68px;
  min-height: 48px;
  padding: 8px 10px;
  background: transparent;
  border: 0;
  border-radius: 1px;
  color: inherit;
  font: 400 1.2rem/1.4 Georgia, "Times New Roman", serif;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
  button:hover { text-decoration: underline; text-underline-offset: 0.28em; }
}
button:focus-visible, input:focus-visible {
  outline: 1px solid #e6e2d9;
  outline-offset: 3px;
}

#copy-link {
  position: absolute;
  top: calc(50% + 2.8rem);
  left: 50%;
  transform: translateX(-50%);
  width: min(85vw, 26rem);
  padding: 0.6rem;
  color: #eee;
  background: #000;
  border: 1px solid #777;
  font: 1rem/1.4 Georgia, serif;
}

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

@media (prefers-reduced-motion: reduce) {
  #ending.visible { animation-duration: 300ms; }
}
