* {
  box-sizing: border-box;
}

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

body {
  background:
    radial-gradient(90% 42% at 100% -8%, rgba(196, 84, 58, 0.22), transparent 52%),
    radial-gradient(70% 36% at 0% 110%, rgba(196, 148, 90, 0.1), transparent 48%),
    #161311;
  color: #f4efe8;
  font-family: "Outfit", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
p,
h1 {
  margin: 0;
}

button {
  font: inherit;
  color: inherit;
}

::selection {
  background: #e7c2b0;
  color: #1b1410;
}

.gate {
  width: min(100%, 480px);
  height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  padding:
    calc(16px + env(safe-area-inset-top))
    18px
    calc(12px + env(safe-area-inset-bottom));
}

html.open .gate {
  display: none;
}

.gate label {
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #cbbbaa;
}

.gate input {
  height: 52px;
  border-radius: 999px;
  border: 1px solid rgba(244, 239, 232, 0.18);
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 16px;
  letter-spacing: 0.14em;
  padding: 0 18px;
}

.gate button {
  height: 52px;
  border-radius: 999px;
  border: 0;
  background: #f4eee6;
  color: #1b1714;
  font-size: 15px;
  letter-spacing: 0.08em;
}

.gate-error {
  font-size: 14px;
  color: #e7b89a;
}

.app {
  width: min(100%, 480px);
  height: 100dvh;
  margin: 0 auto;
  display: none;
  flex-direction: column;
  padding:
    calc(16px + env(safe-area-inset-top))
    18px
    calc(12px + env(safe-area-inset-bottom));
  touch-action: pan-y;
}

html.open .app {
  display: flex;
}

.top {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  flex: none;
}

.count {
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  color: #cbbbaa;
}

.stage {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding-top: 18px;
  overflow: hidden;
}

.stage.from-next {
  animation: from-next 0.28s ease;
}

.stage.from-prev {
  animation: from-prev 0.28s ease;
}

@keyframes from-next {
  from { transform: translateX(18px); opacity: 0.35; }
  to { transform: none; opacity: 1; }
}

@keyframes from-prev {
  from { transform: translateX(-18px); opacity: 0.35; }
  to { transform: none; opacity: 1; }
}

h1 {
  flex: none;
  min-height: 2.35em;
  font-family: "Fraunces", Georgia, serif;
  font-weight: 560;
  font-size: clamp(1.7rem, 8vw, 2.15rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.player {
  position: relative;
  flex: none;
  margin-top: 16px;
  height: 152px;
  border-radius: 12px;
  overflow: hidden;
  background: #121212;
}

.player iframe {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 152px;
  border: 0;
}

.player iframe.is-current {
  z-index: 1;
}

.player iframe.is-staged {
  z-index: 0;
  opacity: 0;
  pointer-events: none;
}

.note-stack {
  flex: 0 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin-top: 16px;
}

.note[hidden] {
  display: none !important;
}

.note {
  position: relative;
  flex: 0 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  justify-content: safe center;
  padding: 22px 18px;
  border-radius: 20px;
  background: #f4eee6;
  color: #2a2118;
  overflow: hidden;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.note.revealed {
  overflow: auto;
  cursor: default;
  scrollbar-width: thin;
  scrollbar-color: #d9cfc2 transparent;
}

.note-text {
  font-size: 1.05rem;
  line-height: 1.45;
  filter: blur(9px);
  transition: filter 0.45s ease;
  user-select: none;
}

.note.revealed .note-text {
  filter: none;
  user-select: text;
}

.note.instant .note-text,
.note.instant .hint {
  transition: none;
}

.catjam {
  width: 26px;
  height: 26px;
  vertical-align: -7px;
  display: inline-block;
}

.hint {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 8px 14px;
  border-radius: 999px;
  background: #2a2118;
  color: #f4eee6;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.note.revealed .hint {
  opacity: 0;
}

.fade {
  display: none;
}

.note.can-scroll .fade {
  display: block;
  position: sticky;
  bottom: 0;
  height: 36px;
  margin-top: -36px;
  background: linear-gradient(transparent, #f4eee6 72%);
  pointer-events: none;
}

.nav {
  flex: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding-top: 14px;
}

.nav button {
  height: 52px;
  border-radius: 999px;
  border: 1px solid rgba(244, 239, 232, 0.18);
  background: transparent;
  font-size: 15px;
  letter-spacing: 0.08em;
  text-transform: lowercase;
}

.nav button:active:not(:disabled) {
  background: #f4eee6;
  color: #1b1714;
}

.nav button:disabled {
  opacity: 0.28;
}

:focus-visible {
  outline: 2px solid #e7b89a;
  outline-offset: 3px;
}
