:root {
  --bg-deep: #061525;
  --bg-mid: #0a2744;
  --foam: #e8f4ff;
  --foam-dim: rgba(232, 244, 255, 0.72);
  --accent: #5ec8ff;
  --accent-2: #7af0c8;
  --card: rgba(12, 40, 72, 0.72);
  --stroke: rgba(148, 210, 255, 0.22);
  --shadow: 0 18px 50px rgba(0, 12, 32, 0.45);
  --radius: 22px;
  --font: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei",
    system-ui, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  min-height: 100%;
}

body {
  font-family: var(--font);
  color: var(--foam);
  background: radial-gradient(1200px 700px at 50% -10%, #134a7a 0%, transparent 55%),
    radial-gradient(900px 600px at 100% 20%, #1a3a6a 0%, transparent 50%),
    linear-gradient(180deg, #082038 0%, var(--bg-deep) 45%, #031018 100%);
  background-attachment: fixed;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(circle at 20% 30%, rgba(94, 200, 255, 0.08) 0 1px, transparent 2px),
    radial-gradient(circle at 80% 60%, rgba(122, 240, 200, 0.07) 0 1px, transparent 2px),
    radial-gradient(circle at 40% 80%, rgba(255, 255, 255, 0.05) 0 1px, transparent 2px);
  background-size: 120px 120px, 160px 160px, 90px 90px;
  opacity: 0.9;
  z-index: 0;
}

#app {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
  margin: 0 auto;
  min-height: 100dvh;
  padding: 20px 16px calc(88px + env(safe-area-inset-bottom));
}

.screen {
  display: none;
  animation: rise 0.45s ease both;
}

.screen.active {
  display: block;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero {
  text-align: center;
  padding: 36px 8px 20px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.04);
  color: var(--accent-2);
  font-size: 12px;
  letter-spacing: 0.04em;
  margin-bottom: 22px;
}

.bubble-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 18px;
  font-size: 28px;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.35));
}

.hero h1 {
  font-size: clamp(28px, 8vw, 34px);
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 10px;
  background: linear-gradient(120deg, #fff 20%, #9adfff 55%, #7af0c8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p {
  color: var(--foam-dim);
  font-size: 14px;
  margin-bottom: 28px;
}

.hero-compact {
  padding-top: 28px;
  padding-bottom: 12px;
}

.hero-compact h1 {
  font-size: clamp(24px, 7vw, 30px);
}

.hero-compact p {
  margin-bottom: 18px;
}

.hero .gate-kicker {
  margin-bottom: 6px;
  color: var(--foam);
  font-size: 15px;
  font-weight: 600;
}

.field-label {
  display: block;
  font-size: 13px;
  color: var(--accent-2);
  margin-bottom: 8px;
  letter-spacing: 0.04em;
}

.name-input {
  width: 100%;
  appearance: none;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.06);
  color: var(--foam);
  border-radius: 16px;
  padding: 14px 16px;
  font-family: inherit;
  font-size: 18px;
  font-weight: 600;
  outline: none;
  margin-bottom: 8px;
}

.name-input::placeholder {
  color: rgba(232, 244, 255, 0.35);
  font-weight: 500;
}

.name-input:focus {
  border-color: rgba(94, 200, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(94, 200, 255, 0.15);
}

.field-hint {
  font-size: 12px;
  color: var(--foam-dim);
  margin-bottom: 18px;
}

.field-error {
  font-size: 13px;
  color: #ff8f9f;
  margin: 0 0 14px;
}

.field-error[hidden] {
  display: none;
}

@keyframes gate-shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-6px);
  }
  75% {
    transform: translateX(6px);
  }
}

.gate-shake {
  animation: gate-shake 0.35s ease;
}

.share-kicker .who {
  color: #fff;
  font-weight: 700;
}

.panel {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 22px 18px;
}

.feature-list {
  list-style: none;
  display: grid;
  gap: 12px;
  margin-bottom: 22px;
}

.feature-list li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 14px;
  color: var(--foam-dim);
}

.feature-list strong {
  color: var(--foam);
  font-weight: 600;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 7px;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 12px rgba(94, 200, 255, 0.6);
}

.btn {
  appearance: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  border-radius: 16px;
  padding: 14px 18px;
  width: 100%;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  color: #042033;
  background: linear-gradient(135deg, #8be7ff 0%, #7af0c8 100%);
  box-shadow: 0 10px 28px rgba(94, 200, 255, 0.35);
}

.btn-primary:hover {
  box-shadow: 0 12px 32px rgba(94, 200, 255, 0.45);
}

.btn:disabled,
.btn[disabled] {
  opacity: 0.55;
  cursor: wait;
  box-shadow: none;
}

.btn-ghost {
  margin-top: 10px;
  color: var(--foam);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--stroke);
}

.btn-option {
  text-align: left;
  color: var(--foam);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--stroke);
  font-weight: 500;
  font-size: 15px;
  line-height: 1.45;
  padding: 16px 16px;
}

.btn-option:hover,
.btn-option:focus-visible {
  outline: none;
  border-color: rgba(94, 200, 255, 0.55);
  background: rgba(94, 200, 255, 0.12);
}

.quiz-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.progress-meta {
  font-size: 13px;
  color: var(--foam-dim);
}

.progress-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin-bottom: 22px;
}

.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 16px rgba(122, 240, 200, 0.45);
  transition: width 0.35s ease;
}

.quiz-tip {
  font-size: 12px;
  line-height: 1.5;
  color: var(--foam-dim);
  margin-bottom: 14px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--stroke);
}

.quiz-tip[hidden] {
  display: none;
}

.q-text {
  font-size: 20px;
  font-weight: 650;
  letter-spacing: 0.01em;
  margin-bottom: 18px;
}

.dim-bars {
  display: grid;
  gap: 16px;
}

.dim-bar-top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.dim-bar-label {
  font-size: 12px;
  color: rgba(232, 244, 255, 0.45);
}

.dim-bar-label:last-child {
  text-align: right;
}

.dim-bar-label.is-active {
  color: var(--foam);
  font-weight: 650;
}

.dim-bar-pct {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-2);
  letter-spacing: 0.02em;
}

.dim-bar-track {
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: visible;
}

.dim-bar-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: inherit;
  box-shadow: 0 0 14px rgba(122, 240, 200, 0.35);
  transition: width 0.45s ease;
}

.dim-bar-fill.is-left {
  left: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.dim-bar-fill.is-right {
  right: 0;
  background: linear-gradient(270deg, var(--accent), var(--accent-2));
}

.dim-bar-thumb {
  position: absolute;
  top: 50%;
  z-index: 1;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--accent-2);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.dim-bar-caption {
  margin-top: 7px;
  font-size: 11px;
  color: var(--foam-dim);
  text-align: center;
}


.options {
  display: grid;
  gap: 12px;
}

.result-wrap {
  display: grid;
  gap: 16px;
}

.share-card {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  padding: 28px 22px 24px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: var(--shadow);
  background: linear-gradient(
    160deg,
    hsl(var(--creature-hue, 200) 55% 28%) 0%,
    hsl(var(--creature-hue, 200) 45% 14%) 45%,
    #061525 100%
  );
}

.share-card::before {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  right: -40px;
  top: -50px;
  border-radius: 50%;
  background: radial-gradient(circle, hsla(var(--creature-hue, 200), 80%, 70%, 0.35), transparent 70%);
  pointer-events: none;
}

.share-card::after {
  content: "OCEAN TYPE · 16";
  position: absolute;
  right: 16px;
  bottom: 14px;
  font-size: 10px;
  letter-spacing: 0.18em;
  color: rgba(255, 255, 255, 0.28);
}

.share-emoji {
  font-size: 56px;
  line-height: 1;
  margin-bottom: 14px;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.35));
}

.share-art {
  position: relative;
  z-index: 1;
  width: 100%;
  aspect-ratio: 1;
  margin: 0 auto 16px;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.35);
  background: rgba(0, 0, 0, 0.2);
}

.share-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.share-kicker {
  font-size: 12px;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 6px;
}

.share-name {
  font-size: 30px;
  font-weight: 750;
  margin-bottom: 4px;
}

.share-title {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.82);
  margin-bottom: 14px;
}

.share-quote {
  font-size: 15px;
  font-weight: 550;
  line-height: 1.5;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 2px;
}

.tag {
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--stroke);
  color: var(--accent-2);
}

.section-title {
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 8px;
  text-transform: uppercase;
}

.one-liner {
  font-size: 17px;
  font-weight: 650;
  margin-bottom: 10px;
}

.body-text {
  font-size: 14px;
  color: var(--foam-dim);
}

.grid-2 {
  display: grid;
  gap: 12px;
}

@media (min-width: 420px) {
  .grid-2 {
    grid-template-columns: 1fr 1fr;
  }
}

.mini-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--stroke);
  border-radius: 16px;
  padding: 14px;
}

.mini-card h4 {
  font-size: 13px;
  margin-bottom: 6px;
  color: var(--foam);
}

.mini-card p {
  font-size: 13px;
  color: var(--foam-dim);
}

.matches {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.match-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  text-decoration: none;
  color: inherit;
  padding: 10px 8px 12px;
  border-radius: 16px;
  background: rgba(122, 240, 200, 0.08);
  border: 1px solid rgba(122, 240, 200, 0.24);
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.match-card:hover,
.match-card:focus-visible {
  outline: none;
  border-color: rgba(122, 240, 200, 0.55);
  background: rgba(122, 240, 200, 0.16);
  transform: translateY(-1px);
}

.match-thumb {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  object-fit: cover;
  display: block;
  margin-bottom: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
  background: rgba(0, 0, 0, 0.2);
}

.match-thumb-emoji {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}

.match-meta {
  min-width: 0;
  width: 100%;
}

.match-name {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
}

.match-title {
  margin-top: 2px;
  font-size: 11px;
  color: var(--foam-dim);
  line-height: 1.35;
}

.actions {
  display: grid;
  gap: 10px;
  margin-top: 4px;
}

.hint {
  text-align: center;
  font-size: 12px;
  color: rgba(232, 244, 255, 0.45);
  margin-top: 8px;
}

.save-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(3, 12, 24, 0.82);
}

.save-modal[hidden] {
  display: none;
}

.save-modal-panel {
  width: min(420px, 100%);
  max-height: min(88dvh, 900px);
  overflow: auto;
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 16px;
}

.save-modal-title {
  text-align: center;
  font-size: 14px;
  font-weight: 650;
  margin-bottom: 12px;
}

.save-modal-img {
  display: block;
  width: 100%;
  border-radius: 14px;
  margin-bottom: 12px;
  background: #061525;
}

.dim-code {
  margin-top: 8px;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: rgba(232, 244, 255, 0.4);
  word-break: break-all;
}

.back-link {
  background: none;
  border: none;
  color: var(--foam-dim);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  padding: 4px 0;
}

.back-link:hover {
  color: var(--foam);
}

.footer-note {
  text-align: center;
  margin-top: 18px;
  font-size: 11px;
  color: rgba(232, 244, 255, 0.35);
}

.site-filing {
  position: fixed;
  z-index: 20;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 14px;
  margin: 0;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  text-align: center;
  font-size: 12px;
  line-height: 1.6;
  background: rgba(3, 16, 24, 0.92);
  border-top: 1px solid rgba(148, 210, 255, 0.16);
}

.site-filing a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: rgba(232, 244, 255, 0.72);
  text-decoration: none;
}

.site-filing a:hover {
  color: var(--foam);
  text-decoration: underline;
}

.site-filing img {
  display: block;
  width: 14px;
  height: 14px;
}
