:root {
  color-scheme: dark;
  --bg: #121212;
  --fg: #eaeaea;
  --muted: #acacac;
  --accent: #88ff00;
  --card: #212121;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", sans-serif;
}

body {
  line-height: 1.5;
}

a {
  color: var(--accent);
}

.page {
  max-width: 40rem;
  margin: 0 auto;
  padding: 4rem 1.5rem 3rem;
}

.page-coming {
  min-height: 100vh;
  max-width: none;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 1.5rem;
}

.page-coming h1 {
  margin: 0;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  letter-spacing: 0.06em;
}

.page-coming .kicker {
  margin-bottom: 1.25rem;
}

.page-coming .coming-mark::after {
  content: "";
  display: block;
  width: 2.5rem;
  height: 2px;
  margin: 1.25rem auto 0;
  background: var(--accent);
}

.kicker {
  margin: 0 0 0.5rem;
  color: var(--muted);
  letter-spacing: 0.08em;
}

.kicker a {
  color: inherit;
  text-decoration: none;
}

h1 {
  margin: 0 0 1rem;
  font-size: 2rem;
  font-weight: 700;
}

.lead {
  margin: 0 0 2rem;
  color: var(--muted);
}

.btn {
  display: inline-block;
  padding: 0.75rem 1.25rem;
  background: var(--accent);
  color: #121212;
  text-decoration: none;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.beta-login,
.beta-actions {
  display: grid;
  gap: 0.75rem;
  max-width: 20rem;
}

.beta-actions {
  grid-auto-flow: column;
  justify-content: start;
}

.beta-login label {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
}

.beta-login input {
  padding: 0.7rem 0.8rem;
  border: 1px solid #3a3a3a;
  border-radius: 0.5rem;
  background: var(--card);
  color: var(--fg);
  font: inherit;
}

.beta-login .btn {
  width: 100%;
}

.beta-msg {
  min-height: 1.5rem;
  color: var(--muted);
}

.meta {
  margin-top: 1.5rem;
  color: var(--muted);
  font-size: 0.875rem;
  word-break: break-all;
}

.beta-notice {
  word-break: normal;
  line-height: 1.7;
}

.app-screen {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: #212121;
  color: #fff;
  -webkit-font-smoothing: antialiased;
}

.app-header {
  position: relative;
  display: flex;
  align-items: flex-end;
  height: calc(112px + env(safe-area-inset-top, 0px));
  border-bottom: 1px solid #616161;
  overflow: hidden;
}

.app-halftone {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.72) 46%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.72) 46%, transparent 100%);
}

.app-halftone::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 200vmax;
  height: 200vmax;
  background-image: radial-gradient(circle, rgba(224, 224, 224, 0.8) 0.55px, transparent 0.75px);
  background-size: 3.5px 3.5px;
  transform: translate(-50%, -50%) rotate(45deg);
}

.app-halftone::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(90% 90% at 52% -10%, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.07) 42%, transparent 72%);
}

.app-header-row {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 16px;
  width: min(400px, 100%);
  margin: 0 auto;
  padding: 0 16px 28px;
}

.app-mark {
  display: block;
  width: 40px;
  height: auto;
  flex: none;
}

.app-header h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 500;
  line-height: 24px;
  letter-spacing: 0;
}

.app-body {
  width: min(400px, 100%);
  margin: 0 auto;
  padding: 24px 16px calc(24px + env(safe-area-inset-bottom, 0px));
}

.app-screen .beta-login,
.app-screen .beta-actions {
  max-width: none;
  gap: 0;
}

.app-screen .beta-actions {
  grid-auto-flow: row;
  justify-content: stretch;
  gap: 16px;
}

.app-screen .beta-login label {
  gap: 8px;
  color: #c9c9c9;
  font-size: 14px;
  line-height: 20px;
}

.app-screen .beta-login input {
  height: 48px;
  padding: 0 12px;
  border: 1px solid #535353;
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
  color: #fff;
  font-size: 14px;
  outline: none;
}

.app-screen .beta-login input::placeholder {
  color: #959595;
}

.app-screen .beta-login input:focus {
  border-color: #88ff00;
}

.app-screen .beta-login input:user-invalid {
  border-color: #f33535;
  color: #cecece;
}

.app-screen .btn {
  width: 100%;
  height: 48px;
  margin-top: 16px;
  padding: 0 16px;
  border-radius: 8px;
  background: linear-gradient(90deg, #caff37, #97c41a);
  box-shadow: inset 0 0 0 1000px rgba(255, 255, 255, 0.08);
  color: #000;
  font-size: 16px;
  font-weight: 500;
  -webkit-tap-highlight-color: transparent;
}

.app-screen .beta-login .btn:disabled {
  background: linear-gradient(90deg, #343434, #4d4d4d);
  box-shadow: none;
  color: #b7b7b7;
  cursor: default;
}

.app-screen .btn-quiet {
  margin-top: 0;
  background: linear-gradient(90deg, #303030, #3a3a3a);
  box-shadow: none;
  color: #fff;
}

.app-screen .beta-actions .btn {
  margin-top: 0;
}

.app-screen .btn:not(:disabled):active {
  filter: brightness(0.94);
}

.app-screen .btn:focus-visible {
  outline: 2px solid #88ff00;
  outline-offset: 2px;
}

.app-screen .beta-msg {
  min-height: 0;
  margin: 16px 0 0;
  color: #f30e0e;
  font-size: 14px;
  line-height: 20px;
}

.app-screen .beta-notice {
  margin-top: 24px;
  color: #ccc;
  font-size: 14px;
  line-height: 22px;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

pw-reveal {
  display: block;
}

@media (prefers-reduced-motion: no-preference) {
  .js pw-reveal {
    opacity: 0;
    transform: translateY(0.75rem);
    transition: opacity 0.6s ease, transform 0.6s ease;
  }

  .js pw-reveal.is-in {
    opacity: 1;
    transform: none;
  }

  .page-coming .coming-mark {
    animation: coming-breathe 3.2s ease-in-out infinite;
  }
}

@keyframes coming-breathe {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.55;
  }
}
