:root {
  --panel: color-mix(in oklab, #111827 92%, transparent);
  --panel-border: color-mix(in oklab, white 18%, transparent);
  --focus: #60a5fa;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  background: #111827;
  color: white;
}

button,
input,
select,
textarea {
  font: inherit;
}

.slide {
  min-height: 100dvh;
  width: 100vw;
  display: grid;
  place-items: center;
  padding: max(4vmin, env(safe-area-inset-top)) max(4vmin, env(safe-area-inset-right))
    max(4vmin, env(safe-area-inset-bottom)) max(4vmin, env(safe-area-inset-left));
  transition: background 150ms ease;
}

.words {
  max-width: 96vw;
  max-height: 96dvh;
  min-width: min(16rem, 80vw);
  padding: 0.05em 0.1em;
  outline: 0;
  text-align: center;
  line-height: 0.95;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  caret-color: currentColor;
  border-radius: 0.08em;
}

.words:empty::before {
  content: "double-click to edit";
  opacity: 0.55;
  font-size: 0.45em;
  font-style: normal;
  text-transform: none;
}

.words:focus {
  box-shadow: 0 0 0 0.03em color-mix(in oklab, currentColor 35%, transparent);
}

.settings-button {
  position: fixed;
  left: 1rem;
  bottom: 1rem;
  z-index: 10;
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  padding: 0.65rem 0.9rem;
  color: white;
  background: color-mix(in oklab, #111827 65%, transparent);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  cursor: pointer;
  box-shadow: 0 16px 50px rgb(0 0 0 / 0.28);
}

.settings-button:hover,
.settings-button:focus-visible,
button:hover,
button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.settings {
  position: fixed;
  inset: 1rem 1rem 1rem auto;
  z-index: 20;
  width: min(25rem, calc(100vw - 2rem));
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem;
  color: white;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 1.25rem;
  box-shadow: 0 24px 80px rgb(0 0 0 / 0.38);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.settings[hidden] { display: none; }

.settings__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

h1 {
  margin: 0;
  font-size: 1.1rem;
}

label {
  display: grid;
  gap: 0.45rem;
  color: rgb(255 255 255 / 0.82);
  font-size: 0.9rem;
}

textarea,
select,
input[type="range"] {
  width: 100%;
}

textarea,
select {
  border: 1px solid var(--panel-border);
  border-radius: 0.7rem;
  padding: 0.65rem;
  color: white;
  background: rgb(255 255 255 / 0.08);
}

textarea {
  min-height: 7rem;
  resize: vertical;
}

input[type="color"] {
  width: 100%;
  height: 2.5rem;
  border: 1px solid var(--panel-border);
  border-radius: 0.7rem;
  padding: 0.2rem;
  background: rgb(255 255 255 / 0.08);
  cursor: pointer;
}

input[type="range"] { accent-color: var(--focus); }

.grid {
  display: grid;
  gap: 0.8rem;
}

.two { grid-template-columns: 1fr 1fr; }

.check {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  cursor: pointer;
}

.check input { width: 1.1rem; height: 1.1rem; }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.25rem;
}

button {
  border: 0;
  border-radius: 0.75rem;
  padding: 0.65rem 0.85rem;
  color: #0b1220;
  background: white;
  cursor: pointer;
  font-weight: 700;
}

button.secondary {
  color: white;
  background: rgb(255 255 255 / 0.12);
  border: 1px solid var(--panel-border);
}

.icon-button {
  width: 2.1rem;
  height: 2.1rem;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 999px;
  color: white;
  background: transparent;
  border: 1px solid var(--panel-border);
  font-size: 1.35rem;
  line-height: 1;
}

.status {
  min-height: 1.2em;
  margin: 0;
  color: rgb(255 255 255 / 0.72);
  font-size: 0.85rem;
}

@media (max-width: 640px) {
  .settings {
    inset: auto 0 0 0;
    width: 100vw;
    max-height: 86dvh;
    border-radius: 1.25rem 1.25rem 0 0;
  }

  .two { grid-template-columns: 1fr; }
}

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