:root {
  color-scheme: light;
  font-family: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  font-synthesis: none;
  --ink: #111111;
  --paper: #f3f0e8;
}

* {
  box-sizing: border-box;
}

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

button {
  color: inherit;
  font: inherit;
}

#screen {
  position: fixed;
  inset: 0;
  min-height: 100dvh;
  background: var(--paper);
  transition: background-color 120ms linear;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

.intro {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  padding: max(28px, env(safe-area-inset-top)) 24px max(28px, env(safe-area-inset-bottom));
  overflow-x: hidden;
  overflow-y: auto;
  text-align: center;
  background:
    linear-gradient(rgba(17, 17, 17, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 17, 17, .045) 1px, transparent 1px),
    var(--paper);
  background-size: 28px 28px;
}

.intro__language {
  position: absolute;
  z-index: 2;
  top: max(34px, calc(env(safe-area-inset-top) + 14px));
  right: max(34px, calc(env(safe-area-inset-right) + 14px));
}

.intro__language select,
.language-select {
  height: 38px;
  padding: 0 30px 0 12px;
  border: 1px solid currentColor;
  border-radius: 19px;
  background-color: transparent;
  color: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.intro__language select {
  background-color: var(--paper);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.intro[hidden] {
  display: none;
}

.intro::before,
.intro::after {
  position: absolute;
  content: "";
  border: 1px solid rgba(17, 17, 17, .18);
  pointer-events: none;
}

.intro::before {
  inset: 20px;
}

.intro::after {
  top: 20px;
  right: 20px;
  width: 42px;
  height: 42px;
  border-left: 0;
  border-bottom: 0;
}

.intro__mark {
  display: flex;
  gap: 7px;
  margin-bottom: 24px;
}

.intro__mark i {
  width: 13px;
  height: 13px;
  border-radius: 50%;
}

.intro__mark i:nth-child(1) { background: #ff2b35; }
.intro__mark i:nth-child(2) { background: #00b957; }
.intro__mark i:nth-child(3) { background: #146cff; }

.eyebrow {
  margin: 0 0 14px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .22em;
}

h1 {
  margin: 0;
  font-size: clamp(42px, 8vw, 76px);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -.055em;
}

.lead {
  margin: 22px 0 34px;
  color: #55524c;
  font-size: 14px;
  line-height: 1.9;
}

.start-button {
  width: min(100%, 320px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 18px 24px;
  border: 0;
  border-radius: 0;
  background: var(--ink);
  color: white;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 6px 6px 0 #ff2b35;
}

.start-button:hover {
  transform: translate(-2px, -2px);
  box-shadow: 8px 8px 0 #ff2b35;
}

.start-button:active {
  transform: translate(3px, 3px);
  box-shadow: 3px 3px 0 #ff2b35;
}

.ad-container {
  position: relative;
  z-index: 1;
  width: min(calc(100% - 48px), 970px);
  min-height: 50px;
  margin: 40px auto 0;
  overflow: hidden;
}

.start-note {
  margin: 18px 0 0;
  color: #77736b;
  font-size: 11px;
}

.test-ui,
.test-ui[hidden] {
  position: absolute;
  inset: 0;
}

.test-ui[hidden] {
  display: none;
}

.topbar {
  position: absolute;
  z-index: 5;
  top: 0;
  left: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(18px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) 18px max(18px, env(safe-area-inset-left));
  opacity: 1;
  transition: opacity .25s;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .17em;
  cursor: pointer;
}

.brand:hover span:last-child,
.brand:focus-visible span:last-child {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.brand__dot {
  width: 8px;
  height: 8px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.topbar__actions {
  display: flex;
  gap: 8px;
}

.icon-button {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid currentColor;
  border-radius: 50%;
  background: transparent;
  font-weight: 800;
  cursor: pointer;
}

.language-select {
  max-width: 108px;
}

.fullscreen-button span {
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
}

.status {
  position: absolute;
  z-index: 3;
  top: 50%;
  left: 50%;
  width: min(calc(100% - 48px), 640px);
  text-align: center;
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: 1;
  transition: opacity .25s;
}

.status__label {
  margin: 0 0 8px;
  font-size: clamp(18px, 4vw, 28px);
  font-weight: 800;
  letter-spacing: .08em;
}

.status__count {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
}

.status__note {
  display: block;
  line-height: 1.7;
  letter-spacing: .06em;
}

.status__position {
  display: block;
  margin-top: 5px;
  letter-spacing: .16em;
}

.tap-zone {
  position: absolute;
  z-index: 2;
  top: 72px;
  bottom: 54px;
  width: 50%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.tap-zone--prev { left: 0; text-align: left; }
.tap-zone--next { right: 0; text-align: right; }

.tap-zone span {
  display: inline-block;
  padding: 20px;
  font-size: 34px;
  opacity: .38;
  transition: opacity .2s;
}

.tap-zone:hover span {
  opacity: 1;
}

.progress {
  position: absolute;
  z-index: 5;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(22px, env(safe-area-inset-bottom));
  left: max(18px, env(safe-area-inset-left));
  display: flex;
  gap: 6px;
  opacity: 1;
  transition: opacity .25s;
}

.progress i {
  height: 3px;
  flex: 1;
  background: currentColor;
  opacity: .25;
}

.progress i.is-active {
  opacity: 1;
}

.hint {
  position: absolute;
  z-index: 5;
  bottom: max(38px, calc(env(safe-area-inset-bottom) + 16px));
  left: 50%;
  margin: 0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  transform: translateX(-50%);
  white-space: nowrap;
  opacity: .58;
  transition: opacity .25s;
}

.is-idle .topbar,
.is-idle .status,
.is-idle .progress,
.is-idle .hint,
.is-idle .tap-zone span {
  opacity: 0;
}

.help,
.info-panel {
  position: absolute;
  z-index: 10;
  top: 50%;
  left: 50%;
  width: min(calc(100% - 36px), 430px);
  padding: 38px;
  background: #111;
  color: #fff;
  transform: translate(-50%, -50%);
  box-shadow: 10px 10px 0 rgba(0, 0, 0, .22);
}

.help[hidden],
.info-panel[hidden] {
  display: none;
}

.help__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: 0;
  background: transparent;
  color: white;
  font-size: 26px;
  cursor: pointer;
}

.help h2 {
  margin: 0 0 28px;
  font-size: 28px;
  line-height: 1.25;
  letter-spacing: -.04em;
}

.info-panel h2 {
  margin: 0 0 26px;
  font-size: 28px;
  letter-spacing: -.04em;
}

.help ul {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
}

.help li {
  display: grid;
  grid-template-columns: 30px 1fr;
  align-items: start;
  line-height: 1.6;
}

.help li b {
  font-weight: 400;
}

.help li span {
  color: #ff4b54;
  font-size: 10px;
  font-weight: 800;
}

.help__keys {
  margin: 28px 0 0;
  padding-top: 18px;
  border-top: 1px solid #444;
  color: #aaa;
  font-size: 10px;
  letter-spacing: .08em;
}

.info-button {
  font-family: Georgia, serif;
  font-size: 17px;
  font-style: italic;
}

.display-info {
  display: grid;
  gap: 0;
  margin: 0;
}

.display-info div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 0;
  border-top: 1px solid #3a3a3a;
}

.display-info dt {
  color: #aaa;
  font-size: 11px;
}

.display-info dd {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  text-align: right;
}

.info-note {
  margin: 22px 0 0;
  color: #888;
  font-size: 10px;
  line-height: 1.7;
}

@media (max-width: 520px) {
  .intro {
    align-content: center;
  }

  .intro::before {
    inset: 12px;
  }

  .intro__language {
    top: max(24px, calc(env(safe-area-inset-top) + 12px));
    right: max(24px, calc(env(safe-area-inset-right) + 12px));
  }

  .brand span:last-child {
    display: none;
  }

  .ad-container {
    width: 100%;
    margin-top: 32px;
  }

  .help,
  .info-panel {
    padding: 34px 28px;
  }

  .hint {
    bottom: max(40px, calc(env(safe-area-inset-bottom) + 18px));
  }
}

@media (max-height: 680px) {
  .intro {
    align-content: start;
    padding-top: max(86px, calc(env(safe-area-inset-top) + 70px));
  }

  .intro__mark {
    margin-bottom: 14px;
  }

  .lead {
    margin: 14px 0 20px;
  }
}

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