/* LittoralAI Word Explorer */
:root {
  --wx-sea: #0E7490;
  --wx-sea-deep: #155E75;
  --wx-sand: #F8FAFC;
  --wx-ink: #0F172A;
  --wx-mist: rgba(255, 255, 255, 0.72);
  --wx-glass: rgba(255, 255, 255, 0.55);
  --wx-line: rgba(15, 23, 42, 0.08);
  --wx-radius: 1.25rem;
}

[data-theme="dark"] {
  --wx-sand: #0B1220;
  --wx-ink: #E2E8F0;
  --wx-mist: rgba(15, 23, 42, 0.72);
  --wx-glass: rgba(15, 23, 42, 0.55);
  --wx-line: rgba(226, 232, 240, 0.1);
}

.wx-hero {
  position: relative;
  padding: 4.5rem 0 2.5rem;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(ellipse 80% 60% at 20% 0%, rgba(14, 116, 144, 0.55), transparent 55%),
    radial-gradient(ellipse 70% 50% at 90% 20%, rgba(245, 158, 11, 0.28), transparent 50%),
    linear-gradient(160deg, #0B1220 0%, #0F766E 48%, #0E7490 100%);
}
.wx-hero-glow {
  position: absolute;
  inset: auto -10% -40% 40%;
  height: 60%;
  background: radial-gradient(circle, rgba(255,255,255,.12), transparent 60%);
  pointer-events: none;
}
.wx-hero-inner { position: relative; z-index: 1; max-width: 820px; }
.wx-kicker {
  font-family: Poppins, sans-serif;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-size: .75rem;
  opacity: .85;
  margin-bottom: .75rem;
}
.wx-title {
  font-family: Poppins, sans-serif;
  font-weight: 700;
  font-size: clamp(2rem, 4vw, 3rem);
  margin: 0 0 .5rem;
  letter-spacing: -0.02em;
}
.wx-lead { font-size: 1.05rem; opacity: .9; margin-bottom: 1.5rem; max-width: 36rem; }

.wx-search { position: relative; }
.wx-search-shell {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .45rem .45rem .45rem 1rem;
  border-radius: 999px;
  background: var(--wx-mist);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,.35);
  box-shadow: 0 18px 50px rgba(0,0,0,.18);
}
.wx-search-icon { color: var(--wx-sea-deep); opacity: .7; }
.wx-input {
  flex: 1;
  border: 0;
  background: transparent;
  font-size: 1.05rem;
  color: var(--wx-ink);
  outline: none;
  min-width: 0;
  padding: .55rem .25rem;
}
.wx-mic, .wx-mini-audio {
  border: 0;
  background: transparent;
  color: var(--wx-sea-deep);
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background .2s ease, transform .2s ease;
}
.wx-mic:hover, .wx-mini-audio:hover { background: rgba(14,116,144,.12); transform: scale(1.05); }
.wx-submit { border-radius: 999px !important; white-space: nowrap; padding-inline: 1.25rem; }

.wx-suggest {
  position: absolute;
  left: 0; right: 0; top: calc(100% + .4rem);
  background: #fff;
  color: #0F172A;
  border-radius: 1rem;
  box-shadow: 0 20px 40px rgba(0,0,0,.18);
  overflow: hidden;
  z-index: 20;
}
[data-theme="dark"] .wx-suggest { background: #111827; color: #E5E7EB; }
.wx-suggest button {
  display: block; width: 100%; text-align: left; border: 0; background: transparent;
  padding: .75rem 1rem; cursor: pointer; color: inherit;
}
.wx-suggest button:hover, .wx-suggest button[aria-selected="true"] {
  background: rgba(14,116,144,.1);
}

.wx-recent, .wx-subnav {
  display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: 1rem;
}
.wx-recent span, .wx-subnav a { font-size: .85rem; opacity: .9; }
.wx-subnav a { color: #fff; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.35); }
.wx-subnav a:hover { opacity: 1; }

.wx-chip, .wx-chip-btn, .wx-lang {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .4rem .85rem; border-radius: 999px;
  border: 1px solid var(--wx-line);
  background: rgba(255,255,255,.16);
  color: inherit; text-decoration: none; font-size: .88rem;
  transition: transform .2s ease, background .2s ease, border-color .2s ease;
  cursor: pointer;
}
.wx-body .wx-chip, .wx-body .wx-chip-btn, .wx-body .wx-lang {
  background: color-mix(in srgb, var(--wx-sea) 8%, transparent);
  color: var(--wx-ink);
}
.wx-chip:hover, .wx-chip-btn:hover, .wx-lang:hover,
.wx-lang.is-active {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--wx-sea) 40%, transparent);
  background: color-mix(in srgb, var(--wx-sea) 16%, transparent);
}
.wx-chip.alt { background: color-mix(in srgb, #F43F5E 10%, transparent); }

.wx-body { padding: 2.5rem 0 4rem; color: var(--wx-ink); }
.wx-page-head {
  padding: 3rem 0 1rem;
  background: linear-gradient(180deg, color-mix(in srgb, var(--wx-sea) 12%, transparent), transparent);
}
.wx-page-head h1 { font-family: Poppins, sans-serif; }

.wx-result, .wx-glass, .wx-wotd-card, .wx-miss, .wx-quiz {
  background: var(--wx-glass);
  backdrop-filter: blur(18px);
  border: 1px solid var(--wx-line);
  border-radius: var(--wx-radius);
  padding: 1.5rem;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.06);
  animation: wxRise .45s ease both;
}
@keyframes wxRise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.wx-result-head {
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.wx-word {
  font-family: Poppins, sans-serif;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  margin: 0;
  letter-spacing: -0.02em;
}
.wx-phonetic { color: color-mix(in srgb, var(--wx-ink) 65%, transparent); margin: .25rem 0; }
.wx-pos-badge, .wx-pill {
  display: inline-block;
  padding: .2rem .65rem;
  border-radius: 999px;
  font-size: .78rem;
  background: color-mix(in srgb, var(--wx-sea) 14%, transparent);
  color: var(--wx-sea-deep);
}
[data-theme="dark"] .wx-pos-badge, [data-theme="dark"] .wx-pill { color: #67E8F9; }

.wx-pron-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; margin-bottom: 1.25rem;
}
.wx-pron-card {
  border: 1px solid var(--wx-line);
  border-radius: 1rem;
  padding: .85rem 1rem;
  display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
  background: color-mix(in srgb, #fff 40%, transparent);
}
[data-theme="dark"] .wx-pron-card { background: rgba(255,255,255,.03); }
.wx-pron-card p { margin: 0; flex: 1; }

.wx-block { margin-top: 1.5rem; }
.wx-block h3 {
  font-family: Poppins, sans-serif;
  font-size: 1.05rem;
  margin-bottom: .75rem;
}
.wx-defs { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; }
.wx-defs li {
  padding: 1rem 1.1rem;
  border-radius: 1rem;
  border: 1px solid var(--wx-line);
  background: color-mix(in srgb, var(--wx-sea) 4%, transparent);
}
.wx-def-label { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; opacity: .7; margin-bottom: .35rem; }
.wx-example { font-style: italic; opacity: .85; margin: .4rem 0 0; }
.wx-muted { opacity: .7; }
.wx-context-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .65rem; }
.wx-context-tag {
  display: inline-block; min-width: 5.5rem; font-size: .75rem; text-transform: uppercase;
  letter-spacing: .05em; opacity: .65; margin-right: .5rem;
}

.wx-ai-block {
  border-radius: 1.1rem;
  padding: 1.1rem;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--wx-sea) 10%, transparent), color-mix(in srgb, #F59E0B 8%, transparent));
  border: 1px solid var(--wx-line);
}
.wx-ai-note { font-size: .85rem; opacity: .75; }
.wx-ai-btns, .wx-lang-grid { display: flex; flex-wrap: wrap; gap: .5rem; margin: .75rem 0; }
.wx-ai-out {
  margin-top: .75rem;
  padding: 1rem;
  border-radius: .9rem;
  background: rgba(255,255,255,.55);
  border: 1px dashed color-mix(in srgb, var(--wx-sea) 35%, transparent);
}
[data-theme="dark"] .wx-ai-out { background: rgba(0,0,0,.25); }
.wx-ai-out .wx-disclaimer { font-size: .75rem; opacity: .7; margin-top: .65rem; }

.wx-wotd { margin-top: 3rem; }
.wx-section-head { margin-bottom: 1rem; }
.wx-section-head-row { display: flex; justify-content: space-between; gap: 1rem; align-items: center; flex-wrap: wrap; }
.wx-wotd-card { display: flex; justify-content: space-between; gap: 1.25rem; flex-wrap: wrap; }
.wx-wotd-actions { display: flex; gap: .5rem; align-items: flex-start; }
.wx-icon-btn {
  width: 2.6rem; height: 2.6rem; border-radius: 999px; border: 1px solid var(--wx-line);
  background: color-mix(in srgb, #fff 50%, transparent); display: grid; place-items: center;
  text-decoration: none; cursor: pointer; transition: transform .2s ease;
}
.wx-icon-btn:hover { transform: translateY(-2px); }
.wx-meta-row { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .75rem; }

.wx-vocab-list, .wx-history-list { list-style: none; padding: 0; margin: 0; }
.wx-vocab-list li, .wx-history-list li {
  display: flex; justify-content: space-between; gap: 1rem; padding: 1rem 0;
  border-bottom: 1px solid var(--wx-line);
}
.wx-note { font-size: .9rem; opacity: .8; }

.wx-quiz-choices { display: grid; gap: .65rem; margin-top: 1rem; }
.wx-quiz-choice {
  text-align: left; padding: 1rem 1.1rem; border-radius: 1rem;
  border: 1px solid var(--wx-line); background: transparent; color: inherit; cursor: pointer;
  transition: border-color .2s ease, background .2s ease;
}
.wx-quiz-choice:hover { border-color: var(--wx-sea); }
.wx-quiz-choice.is-correct { background: color-mix(in srgb, #10B981 18%, transparent); border-color: #10B981; }
.wx-quiz-choice.is-wrong { background: color-mix(in srgb, #F43F5E 16%, transparent); border-color: #F43F5E; }

.wx-skeleton { margin-bottom: 1.5rem; }
.wx-skel-line, .wx-skel-block {
  border-radius: .75rem;
  background: linear-gradient(90deg, rgba(148,163,184,.2), rgba(148,163,184,.35), rgba(148,163,184,.2));
  background-size: 200% 100%;
  animation: wxShimmer 1.2s infinite linear;
  margin-bottom: .75rem;
}
.wx-skel-line { height: 1rem; width: 70%; }
.wx-skel-line.lg { height: 2rem; width: 40%; }
.wx-skel-line.mid { width: 55%; }
.wx-skel-block { height: 8rem; width: 100%; }
@keyframes wxShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Homepage teaser */
.wx-home {
  padding: 4rem 0;
  background:
    radial-gradient(circle at 10% 20%, rgba(14,116,144,.12), transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(245,158,11,.1), transparent 35%),
    var(--wx-sand, transparent);
}
.wx-home-grid {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 1.5rem;
  align-items: stretch;
}
.wx-home-card, .wx-home-wotd {
  border-radius: 1.5rem;
  padding: 1.75rem;
  border: 1px solid var(--wx-line);
  background: var(--wx-glass);
  backdrop-filter: blur(14px);
}
.wx-home h2 { font-family: Poppins, sans-serif; letter-spacing: -0.02em; }
.wx-home-search {
  display: flex; gap: .5rem; margin-top: 1.25rem; flex-wrap: wrap;
}
.wx-home-search input {
  flex: 1; min-width: 180px; border-radius: 999px; border: 1px solid var(--wx-line);
  padding: .85rem 1.1rem; background: rgba(255,255,255,.7); color: inherit;
}
[data-theme="dark"] .wx-home-search input { background: rgba(0,0,0,.25); }

/* Reader popup / bottom sheet */
.wx-reader-pop {
  position: fixed; z-index: 12000;
  width: min(360px, calc(100vw - 1.5rem));
  max-height: min(70vh, 480px);
  overflow: auto;
  border-radius: 1.1rem;
  padding: 1rem 1.1rem;
  background: rgba(255,255,255,.94);
  color: #0F172A;
  border: 1px solid rgba(15,23,42,.08);
  box-shadow: 0 24px 60px rgba(0,0,0,.28);
  backdrop-filter: blur(16px);
  animation: wxRise .25s ease both;
}
[data-theme="dark"] .wx-reader-pop,
.reader-theme-dark .wx-reader-pop {
  background: rgba(15,23,42,.95);
  color: #E2E8F0;
  border-color: rgba(226,232,240,.1);
}
.wx-reader-pop h4 { margin: 0 0 .25rem; font-family: Poppins, sans-serif; }
.wx-reader-pop .wx-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .85rem; }
.wx-reader-pop .wx-actions button,
.wx-reader-pop .wx-actions a {
  border-radius: 999px; border: 1px solid rgba(15,23,42,.12);
  background: transparent; padding: .35rem .7rem; font-size: .8rem; cursor: pointer; color: inherit; text-decoration: none;
}
@media (max-width: 720px) {
  .wx-search-shell { flex-wrap: wrap; border-radius: 1.25rem; padding: .75rem; }
  .wx-submit { width: 100%; }
  .wx-pron-grid { grid-template-columns: 1fr; }
  .wx-home-grid { grid-template-columns: 1fr; }
  .wx-reader-pop {
    left: 0 !important; right: 0 !important; bottom: 0 !important; top: auto !important;
    width: 100%; max-width: none; border-radius: 1.25rem 1.25rem 0 0;
    max-height: 75vh;
  }
}
