:root {
  color-scheme: dark;
  --bg: #07161a;
  --surface: #0d2428;
  --text: #f2f7f5;
  --muted: #a9b9b6;
  --accent: #88f2ca;
  --accent-strong: #5edfae;
  --line: rgba(255, 255, 255, .12);
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100svh;
  color: var(--text);
  background:
    radial-gradient(circle at 85% 5%, rgba(94, 223, 174, .16), transparent 36%),
    radial-gradient(circle at 0 85%, rgba(55, 114, 123, .18), transparent 38%),
    var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, a { -webkit-tap-highlight-color: transparent; }

.app {
  width: min(100%, 520px);
  min-height: 100svh;
  margin: 0 auto;
  padding: max(24px, env(safe-area-inset-top)) 22px max(20px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .92rem;
  font-weight: 600;
  letter-spacing: .04em;
}

.brand-mark {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 20px rgba(136, 242, 202, .75);
}

.stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 56px 0 40px;
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--accent);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .2em;
}

h1 {
  margin: 0;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: clamp(2.65rem, 13vw, 4.25rem);
  font-weight: 500;
  line-height: 1.23;
  letter-spacing: -.045em;
}

.intro {
  margin: 24px 0 30px;
  max-width: 30rem;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.8;
}

.random-button {
  width: 100%;
  min-height: 64px;
  border: 0;
  border-radius: 18px;
  padding: 16px 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 11px;
  color: #052019;
  background: var(--accent);
  box-shadow: 0 16px 40px rgba(35, 165, 119, .22);
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform .18s ease, background .18s ease;
}

.random-button:active { transform: scale(.975); }
.random-button:disabled { opacity: .72; cursor: wait; }
.button-icon { font-size: 1.5rem; line-height: 1; }
.is-loading .button-icon { animation: spin .8s linear infinite; }

.result {
  margin-top: 22px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(13, 36, 40, .88);
  animation: rise .35s ease both;
}

.result-label {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .12em;
}

h2 {
  margin: 0 0 18px;
  font-size: 1.22rem;
  line-height: 1.65;
  font-weight: 600;
}

.open-link {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-weight: 700;
  text-underline-offset: 5px;
}

.status {
  min-height: 1.5em;
  margin: 14px 4px 0;
  color: #ffb7ad;
  font-size: .9rem;
  line-height: 1.6;
}

footer {
  color: var(--muted);
  font-size: .75rem;
  letter-spacing: .04em;
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

@media (hover: hover) {
  .random-button:hover { background: var(--accent-strong); transform: translateY(-2px); }
}

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