@import url("https://fonts.googleapis.com/css2?family=Bungee&family=DM+Serif+Display&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap");

:root {
  color-scheme: light;
  --bg-start: #ff9a7a;
  --bg-end: #ffa3c4;
  --ink: #3a0b3b;
  --muted: rgba(58, 11, 59, 0.65);
  --accent: #ff4d9d;
  --accent-strong: #e53682;
  --card: rgba(255, 248, 251, 0.94);
  --line: rgba(58, 11, 59, 0.12);
  --shadow: 0 18px 40px rgba(58, 11, 59, 0.2);
}

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

p,
h1,
h2,
h3,
h4,
h5,
h6,
button,
a,
li,
span,
label {
  white-space: pre-line;
}

html,
body {
  height: 100%;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  font-family: "Plus Jakarta Sans", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 15% 15%, #ffc2df 0%, transparent 55%),
    radial-gradient(circle at 80% 10%, #ffe3a6 0%, transparent 42%),
    radial-gradient(circle at 20% 80%, #ffb093 0%, transparent 55%),
    linear-gradient(135deg, var(--bg-start), var(--bg-end));
  background-repeat: no-repeat;
  background-attachment: fixed;
}

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

button {
  font-family: inherit;
}

.page-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 16px 20px 0;
}

@media (min-width: 768px) {
  .page-shell {
    padding: 56px 32px 0;
    max-width: 640px;
    margin: 0 auto;
  }
}

.locale-shell {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 25px;
  flex: 1;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.home-page {
  padding-top: 16px;
}

@media (min-width: 768px) {
  .home-page {
    padding-top: 0;
    margin-top: -30px;
  }
}

.center {
  text-align: center;
}

h1,
h2,
h3 {
  font-family: "Bungee", cursive;
  letter-spacing: 1px;
}

h2 {
  font-family: "DM Serif Display", "Bungee", cursive;
  letter-spacing: -0.02em;
}

.title {
  font-size: clamp(2.3rem, 5vw, 3.1rem);
  line-height: 1;
}

.section-title {
  font-family: "Bungee", cursive;
  letter-spacing: 1px;
  font-size: 1.1rem;
}

.subtitle {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.5;
}

.subtitle-small {
  font-size: 0.9rem;
}

.subtitle-tiny {
  font-size: 0.85rem;
}

.hero-label {
  font-weight: 600;
  letter-spacing: 2px;
}

.result-title {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
}

.result-subtitle {
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--muted);
}

.error-text {
  color: var(--accent-strong);
}

.card {
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 26px;
  padding: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 18px;
  border: 2px solid var(--line);
  background: rgba(255, 255, 255, 0.95);
  font-size: 1rem;
}

.ghost-button {
  background: transparent;
  border: 2px solid var(--line);
  padding: 12px 18px;
  border-radius: 999px;
  font-weight: 500;
}

.primary-button {
  background: var(--accent);
  border: 2px solid rgba(43, 10, 47, 0.08);
  color: #fff;
  padding: 14px 20px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 0 14px 28px rgba(255, 77, 157, 0.28);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.primary-button:hover {
  transform: translateY(-2px);
  background: var(--accent-strong);
  box-shadow: 0 16px 32px rgba(255, 77, 157, 0.32);
}

.primary-button.is-pressed {
  transform: translateY(1px) scale(0.98);
  box-shadow: 0 8px 18px rgba(255, 77, 157, 0.2);
}

.locale-switch {
  position: static;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 1px;
  margin-top: auto;
  padding-top: 0;
  padding-bottom: calc(18px + env(safe-area-inset-bottom));
}

.locale-links {
  display: flex;
  justify-content: center;
  gap: 14px;
}

.locale-switch a {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.55);
}

.locale-switch a.is-active {
  background: rgba(255, 255, 255, 0.9);
}

.locale-footer {
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted);
}

.locale-heart::before {
  content: "♡";
}

.locale-heart:hover::before {
  content: "♥";
}

.locale-heart {
  display: inline-block;
  cursor: default;
}

.home-info {
  background: rgba(255, 255, 255, 0.45);
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 10px 24px rgba(58, 11, 59, 0.12);
}

.home-info .section-title {
  font-size: 1.2rem;
  letter-spacing: 0.5px;
}

.home-info strong {
  color: var(--accent);
  font-weight: 700;
}

.home-info .stack {
  gap: 8px;
}

.theme-switcher {
  position: static;
  z-index: 50;
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(16px);
}

.theme-switcher a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
}

.theme-switcher a.is-active {
  background: #fff;
  color: #000;
}

.site-menu {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 80;
}

@media (min-width: 768px) {
  .site-menu {
    top: 24px;
    right: 26px;
  }
}

.site-menu-trigger {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.55);
  color: rgba(0, 0, 0, 0.45);
  font-size: 26px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.site-menu-trigger:hover {
  color: rgba(0, 0, 0, 0.65);
}

.site-menu-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
  z-index: 70;
  backdrop-filter: blur(6px);
}

.site-menu-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.site-menu-panel {
  position: absolute;
  top: 54px;
  right: 0;
  min-width: 180px;
  padding: 10px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.12);
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.2s ease;
  z-index: 80;
}

.site-menu-panel.is-open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.site-menu-item {
  width: 100%;
  border: none;
  background: transparent;
  padding: 10px 12px;
  border-radius: 12px;
  text-align: left;
  font-size: 0.98rem;
  font-weight: 500;
  color: rgba(0, 0, 0, 0.75);
  cursor: pointer;
  text-decoration: none;
  display: block;
}

.site-menu-item:hover {
  background: rgba(0, 0, 0, 0.06);
}

.site-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.site-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.site-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(8px);
}

.site-modal-panel {
  position: relative;
  z-index: 1;
  width: min(92vw, 520px);
  max-height: min(80vh, 560px);
  margin: auto;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 26px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.site-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px 12px;
  border-bottom: 1px solid var(--line);
}

.site-modal-title {
  margin: 0;
  font-size: 1.2rem;
  font-family: "DM Serif Display", "Bungee", cursive;
  letter-spacing: -0.02em;
}

.site-modal-close {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
  font-size: 1rem;
  cursor: pointer;
}

.site-modal-close:hover {
  background: rgba(255, 255, 255, 0.95);
}

.site-modal-body {
  padding: 18px 24px 24px;
  overflow: auto;
}

.fade-in {
  animation: fadeIn 0.6s ease;
}

.slide-up {
  animation: slideUp 0.45s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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