:root {
  --bg: #e8eef3;
  --ink: #152028;
  --muted: #5a6670;
  --line: #d2dde6;
  --card: #fbfcfd;
  --accent: #e23b2f;
  --sea: #1b4f6b;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  font: 16px/1.5 Manrope, "Noto Sans SC", "Noto Sans TC", "Noto Sans JP", "Noto Sans KR", "Noto Sans Bengali", "Noto Sans Devanagari", "Noto Sans Thai", "Noto Naskh Arabic", "Segoe UI", sans-serif;
  background:
    radial-gradient(900px 480px at 70% -10%, #ffffff 0%, transparent 60%),
    radial-gradient(700px 420px at 10% 20%, #c5daf0 0%, transparent 55%),
    linear-gradient(180deg, #d9e7f2 0%, #e8eef3 42%, #eef3f6 100%);
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(720px, 100%);
  margin: 0 auto;
  padding: 22px 24px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}

.logo {
  width: 46px;
  height: 42px;
  display: block;
}

.word {
  font-family: Outfit, Manrope, sans-serif;
  font-size: 26px;
  font-weight: 650;
  letter-spacing: -0.04em;
}

.lang select {
  min-height: 40px;
  max-width: 42vw;
  padding: 6px 28px 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%235a6670' stroke-width='1.4'/%3E%3C/svg%3E")
    no-repeat right 10px center;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  appearance: none;
  backdrop-filter: blur(8px);
}

html[dir="rtl"] .lang select {
  padding: 6px 12px 6px 28px;
  background-position: left 10px center;
}

.page {
  width: min(720px, 100%);
  margin: 0 auto;
  padding: 28px 24px 72px;
}

.hero {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

@media (min-width: 760px) {
  .hero {
    grid-template-columns: 1.05fr 0.95fr;
    align-items: center;
    gap: 28px;
  }

  .hero-copy {
    order: 0;
  }

  .hero-art {
    order: 1;
  }
}

h1 {
  margin: 0;
  max-width: 12ch;
  font-family: Outfit, Manrope, sans-serif;
  font-size: 48px;
  font-weight: 650;
  letter-spacing: -0.045em;
  line-height: 1.02;
}

.lede {
  max-width: 34rem;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 17px;
}

.hero-art {
  margin: 8px 0 0;
  justify-self: center;
  width: min(100%, 360px);
  animation: rise 0.7s ease both;
}

.hero-art img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 18px 28px rgba(27, 79, 107, 0.18));
}

.hero-art img .boat,
.hero-art object {
  pointer-events: none;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes bob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

.modes {
  margin: 22px 0 0;
  padding: 0;
  border: 0;
}

.modes legend {
  padding: 0;
  color: var(--sea);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.mode-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.mode {
  display: grid;
  place-items: center;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.78);
  cursor: pointer;
  text-align: center;
  font-size: 14px;
  font-weight: 650;
}

.mode input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.mode:has(input:checked) {
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 2px rgba(226, 59, 47, 0.15);
}

.mode-hint {
  margin: 10px 2px 0;
  color: var(--muted);
  font-size: 14px;
}

.drop {
  position: relative;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  min-height: 168px;
  margin-top: 22px;
  padding: 28px 20px;
  border: 1.5px dashed #b7c8d6;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 10px 30px rgba(21, 32, 40, 0.06);
  cursor: pointer;
  text-align: center;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
  backdrop-filter: blur(10px);
}

.drop:hover,
.drop.is-over {
  border-style: solid;
  border-color: var(--accent);
  background: #fff;
  transform: translateY(-1px);
}

.drop input {
  display: none;
}

.drop strong {
  font-size: 18px;
}

.drop-ico {
  width: 42px;
  height: 42px;
  color: var(--sea);
}

.hint,
.quiet,
.status {
  color: var(--muted);
}

.hint {
  font-size: 14px;
}

.quiet {
  margin: 12px 2px 0;
  font-size: 14px;
}

.status {
  margin: 16px 0 0;
}

.result {
  margin-top: 20px;
  padding: 16px 18px;
  border-radius: 18px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(21, 32, 40, 0.04);
}

.result dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.result dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.result dd {
  margin: 2px 0 0;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.saved-cell dd {
  color: var(--accent);
}

.share {
  width: 100%;
  min-height: 48px;
  margin-top: 14px;
  padding: 12px 16px;
  border: 0;
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

.limits,
.faq,
.prose {
  margin-top: 40px;
}

.limits h2,
.faq h2,
.prose h1 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--sea);
}

.prose h1 {
  font-size: 32px;
  letter-spacing: -0.04em;
  text-transform: none;
  color: var(--ink);
}

.limits ul {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.limits li {
  position: relative;
  margin: 0;
  padding: 10px 0 10px 18px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

.limits li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 18px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.faq p,
.prose p {
  margin: 8px 0 0;
  color: var(--muted);
}

.faq h3,
.prose h2 {
  margin: 18px 0 0;
  font-size: 16px;
}

.foot {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 18px;
  margin-top: 40px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.foot a {
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
}

.foot a:hover {
  color: var(--ink);
}

.adslot {
  margin-top: 28px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
}

.adlabel {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.consent {
  margin-top: 18px;
  padding: 14px;
  border-radius: 14px;
  background: var(--ink);
  color: #fff;
}

.consent p {
  margin: 0;
  font-size: 14px;
}

.consent-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.consent button,
.ghost {
  min-height: 40px;
  padding: 8px 12px;
  border: 0;
  border-radius: 10px;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

.consent button {
  background: #fff;
  color: var(--ink);
}

.ghost {
  background: transparent;
  color: #fff;
}

.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;
}

@media (max-width: 700px) {
  .top,
  .page {
    padding-inline: 16px;
  }

  .page {
    padding-top: 18px;
    padding-bottom: calc(32px + env(safe-area-inset-bottom));
  }

  h1 {
    font-size: 36px;
  }

  .hero-art {
    width: min(100%, 300px);
    margin-top: 4px;
  }

  .drop {
    min-height: 150px;
  }

  .result dd {
    font-size: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-art,
  .drop {
    animation: none;
    transition: none;
  }
}
