@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,600;0,700;1,400;1,600&family=Cinzel:wght@400;600;700&family=Nunito:wght@300;400;600;700&display=swap');

:root {
  --teal-dark: #0d3535;
  --teal: #1a5252;
  --teal-mid: #1e6363;
  --teal-light: #2a7a7a;
  --gold: #b8972a;
  --gold-light: #d4b84a;
  --gold-pale: #f5e9c0;
  --cream: #f9f4e8;
  --cream2: #f0e8d0;
  --correct: #1a6b3a;
  --correct-bg: #e6f4ec;
  --wrong: #8b2020;
  --wrong-bg: #fdeaea;
  --shadow: rgba(13, 53, 53, 0.18);
  --radius-lg: 20px;
  --radius-md: 12px;
  --font-display: 'Cinzel', serif;
  --font-body: 'Cormorant Garamond', serif;
  --font-ui: 'Nunito', sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-ui);
  background: var(--cream);
  color: #1a1a1a;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ─── BACKGROUND ─── */
.bg-ornaments {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
}

.orb1 {
  width: 500px;
  height: 500px;
  top: -150px;
  right: -150px;
  background: radial-gradient(circle, #1a5252, transparent);
}

.orb2 {
  width: 400px;
  height: 400px;
  bottom: 10%;
  left: -100px;
  background: radial-gradient(circle, #b8972a33, transparent);
}

.orb3 {
  width: 300px;
  height: 300px;
  top: 50%;
  right: 10%;
  background: radial-gradient(circle, #1e636322, transparent);
}

/* ─── HEADER ─── */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(249, 244, 232, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 2px solid var(--gold);
  box-shadow: 0 2px 20px rgba(13, 53, 53, 0.1);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 28px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-emblem svg {
  width: 52px;
  height: 52px;
}

.logo-img {
  width: 52px;
  height: 52px;
  object-fit: contain;
}

.logo-text-wrap {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.logo-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--teal-dark);
  letter-spacing: 3px;
}

.logo-sub {
  font-family: var(--font-ui);
  font-size: 11px;
  color: var(--gold);
  font-weight: 600;
  letter-spacing: 1px;
}

.nav {
  display: flex;
  gap: 8px;
}

.nav-link {
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 600;
  color: var(--teal-dark);
  text-decoration: none;
  padding: 8px 18px;
  border-radius: 99px;
  transition: all 0.2s;
}

.nav-link:hover,
.nav-link.active {
  background: var(--teal-dark);
  color: var(--gold-light);
}

/* ─── MAIN ─── */
.main {
  position: relative;
  z-index: 1;
  max-width: 860px;
  margin: 0 auto;
  padding: 48px 24px 80px;
  display: flex;
  flex-direction: column;
  gap: 56px;
}

/* ─── HERO TILES ─── */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  padding-top: 16px;
}

.tiles-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.tile {
  width: 72px;
  height: 80px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  animation: tile-enter 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  animation-delay: calc(var(--d) * 0.08s);
  transition: transform 0.2s;
  cursor: default;
}

.tile:hover {
  transform: translateY(-4px) rotate(-2deg);
}

.tile:nth-child(odd) {
  background: linear-gradient(145deg, var(--teal-light), var(--teal-dark));
  color: var(--gold-light);
  box-shadow: 0 8px 24px rgba(13, 53, 53, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.15), inset 0 -3px 0 rgba(0, 0, 0, 0.2);
  border: 1px solid var(--teal-light);
}

.tile:nth-child(even) {
  background: linear-gradient(145deg, var(--gold-light), var(--gold));
  color: var(--teal-dark);
  box-shadow: 0 8px 24px rgba(184, 151, 42, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.4), inset 0 -3px 0 rgba(0, 0, 0, 0.15);
  border: 1px solid var(--gold-light);
}

@keyframes tile-enter {
  from {
    transform: translateY(-40px) scale(0.6) rotate(15deg);
    opacity: 0;
  }

  to {
    transform: translateY(0) scale(1) rotate(0deg);
    opacity: 1;
  }
}

.hero-tagline {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 20px;
  color: #5a5a5a;
  text-align: center;
}

/* ─── CHECKER CARD ─── */
.checker-card {
  background: linear-gradient(145deg, #ffffff, #f5f0e4);
  border: 2px solid rgba(184, 151, 42, 0.4);
  border-radius: var(--radius-lg);
  padding: 32px 32px 28px;
  box-shadow: 0 20px 60px rgba(13, 53, 53, 0.12), 0 4px 12px rgba(13, 53, 53, 0.08);
}

.checker-row {
  display: flex;
  gap: 14px;
  align-items: stretch;
}

.input-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  background: var(--cream);
  border: 2px solid rgba(184, 151, 42, 0.5);
  border-radius: 99px;
  padding: 0 20px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input-wrap:focus-within {
  border-color: var(--teal-mid);
  box-shadow: 0 0 0 4px rgba(26, 82, 82, 0.12);
}

.search-icon {
  color: var(--teal-mid);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  margin-right: 10px;
}

.word-input {
  flex: 1;
  height: 58px;
  border: none;
  background: transparent;
  font-family: var(--font-body);
  font-size: 22px;
  color: var(--teal-dark);
  outline: none;
}

.word-input::placeholder {
  color: #bbb;
  font-style: italic;
  font-size: 17px;
}

.clear-btn {
  background: none;
  border: none;
  color: #888;
  cursor: pointer;
  font-size: 16px;
  padding: 4px 8px;
  border-radius: 50%;
  transition: background 0.2s;
}

.clear-btn:hover {
  background: rgba(0, 0, 0, 0.08);
}

.clear-btn.hidden {
  display: none;
}

.check-btn {
  height: 62px;
  padding: 0 28px;
  background: linear-gradient(135deg, var(--teal-mid), var(--teal-dark));
  color: var(--gold-light);
  border: none;
  border-radius: 99px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 1.5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 6px 24px rgba(13, 53, 53, 0.3);
  transition: transform 0.2s, box-shadow 0.2s;
  white-space: nowrap;
}

.check-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 32px rgba(13, 53, 53, 0.4);
}

.check-btn:active {
  transform: translateY(0);
}

.check-icon {
  width: 28px;
  height: 28px;
  background: var(--gold);
  color: var(--teal-dark);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}

/* ─── RESULT ─── */
.result-area {
  margin-top: 20px;
}

.result-box {
  padding: 18px 24px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: flex-start;
  gap: 14px;
  font-family: var(--font-ui);
  font-size: 16px;
  font-weight: 600;
  animation: result-pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes result-pop {
  from {
    transform: scale(0.9);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

.result-box.correct {
  background: var(--correct-bg);
  border: 2px solid #a8d5b8;
  color: var(--correct);
}

.result-box.wrong {
  background: var(--wrong-bg);
  border: 2px solid #f5b8b8;
  color: var(--wrong);
}

.result-icon {
  font-size: 28px;
  flex-shrink: 0;
  line-height: 1;
}

.result-word {
  font-family: var(--font-body);
  font-size: 24px;
  font-weight: 700;
  font-style: italic;
  margin-top: 2px;
}

.result-hint {
  font-size: 13px;
  opacity: 0.75;
  margin-top: 4px;
  font-weight: 400;
}

/* ─── SUGGESTIONS (natija tagida) ─── */
.suggestions-area {
  margin-top: 16px;
}

.suggestions-label {
  font-family: var(--font-ui);
  font-size: 12px;
  color: #888;
  margin-bottom: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.suggestions-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.suggestion-chip {
  background: white;
  border: 1.5px solid var(--gold);
  border-radius: 12px;
  padding: 8px 16px;
  cursor: pointer;
  transition: all 0.2s;
  animation: chip-pop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  text-align: left;
}

.suggestion-chip:hover {
  background: var(--teal-dark);
  border-color: var(--teal-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(13, 53, 53, 0.2);
}

.chip-word {
  font-family: var(--font-body);
  font-size: 18px;
  font-weight: 700;
  color: var(--teal-dark);
}

.suggestion-chip:hover .chip-word {
  color: var(--gold-light);
}

.chip-hint {
  font-family: var(--font-ui);
  font-size: 11px;
  color: #888;
}

.suggestion-chip:hover .chip-hint {
  color: rgba(255, 255, 255, 0.7);
}

@keyframes chip-pop {
  from {
    transform: scale(0.7);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

.no-suggestions {
  font-family: var(--font-ui);
  font-size: 14px;
  color: #999;
  font-style: italic;
  padding: 8px 0;
}

/* ─── HIKMAT ─── */
.hikmat-section {
  text-align: center;
  padding: 16px 0;
}

.hikmat-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.divider-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.divider-label {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 20px;
  color: var(--gold);
  white-space: nowrap;
}

.hikmat-quote {
  font-family: var(--font-body);
  font-style: italic;
  font-size: clamp(18px, 3vw, 26px);
  color: var(--teal-dark);
  line-height: 1.6;
  max-width: 680px;
  margin: 0 auto 12px;
}

.hikmat-quote::before {
  content: '\201C';
  color: var(--gold);
}

.hikmat-quote::after {
  content: '\201D';
  color: var(--gold);
}

.hikmat-author {
  font-family: var(--font-ui);
  font-size: 14px;
  color: #5a5a5a;
  font-style: normal;
  font-weight: 600;
  letter-spacing: 1px;
}

/* ─── WORD GRID ─── */
.section-title {
  font-family: var(--font-display);
  font-size: 28px;
  color: var(--teal-dark);
  text-align: center;
  margin-bottom: 8px;
  letter-spacing: 2px;
}

.section-sub {
  text-align: center;
  color: #5a5a5a;
  font-size: 15px;
  margin-bottom: 32px;
}

.word-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}

.word-card {
  background: white;
  border: 1.5px solid var(--gold-pale);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  animation: card-fade 0.5s ease both;
}

@keyframes card-fade {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.word-card:hover {
  border-color: var(--teal-mid);
  box-shadow: 0 6px 20px rgba(13, 53, 53, 0.12);
  transform: translateY(-3px);
}

.word-card-text {
  font-family: var(--font-body);
  font-size: 19px;
  font-weight: 600;
  color: var(--teal-dark);
  display: block;
  margin-bottom: 4px;
}

.word-card-hint {
  font-family: var(--font-ui);
  font-size: 12px;
  color: #888;
  display: block;
}

/* ─── ABOUT ─── */
.about-card {
  background: linear-gradient(135deg, var(--teal-dark), var(--teal));
  border-radius: var(--radius-lg);
  padding: 48px;
  text-align: center;
  color: white;
  position: relative;
  overflow: hidden;
}

.about-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none'%3E%3Cg fill='%23b8972a' fill-opacity='0.08'%3E%3Cpath d='M20 0L40 20L20 40L0 20Z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

.about-ornament {
  font-size: 36px;
  color: var(--gold-light);
  margin-bottom: 16px;
  display: block;
  position: relative;
}

.about-card h2 {
  font-family: var(--font-display);
  font-size: 28px;
  color: var(--gold-light);
  margin-bottom: 16px;
  letter-spacing: 2px;
  position: relative;
}

.about-card p {
  font-family: var(--font-body);
  font-size: 18px;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.8;
  max-width: 560px;
  margin: 0 auto;
  font-style: italic;
  position: relative;
}

/* ─── FOOTER ─── */
.footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 24px;
  border-top: 1px solid rgba(184, 151, 42, 0.3);
  font-family: var(--font-ui);
  font-size: 13px;
  color: #888;
}

/* ─── MOBILE ─── */
@media (max-width: 600px) {
  .nav {
    display: none;
  }

  .checker-row {
    flex-direction: column;
  }

  .check-btn {
    height: 54px;
    justify-content: center;
  }

  .tile {
    width: 54px;
    height: 62px;
    font-size: 24px;
  }

  .about-card {
    padding: 36px 24px;
  }

  .header-inner {
    padding: 0 16px;
  }

  .main {
    padding: 32px 16px 60px;
    gap: 40px;
  }
}

/* ─── MA'NO LINKLARI ─── */
.result-label {
  font-size: 13px;
  opacity: 0.8;
  margin-bottom: 4px;
}

.meaning-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.meaning-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 99px;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
  background: var(--correct);
  color: white;
  border: none;
  box-shadow: 0 3px 10px rgba(26, 107, 58, 0.3);
}

.meaning-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(26, 107, 58, 0.4);
  background: #155c30;
}

.meaning-btn-alt {
  background: transparent;
  color: var(--correct);
  border: 2px solid var(--correct);
  box-shadow: none;
}

.meaning-btn-alt:hover {
  background: var(--correct);
  color: white;
}

/* ─── SUGGESTION CHIP ma'no linki ─── */
.chip-link {
  font-family: var(--font-ui);
  font-size: 10px;
  color: var(--gold);
  text-decoration: none;
  border: 1px solid var(--gold);
  border-radius: 99px;
  padding: 2px 7px;
  margin-top: 3px;
  display: inline-block;
  transition: all 0.15s;
}

.chip-link:hover {
  background: var(--gold);
  color: white;
}

.suggestion-chip:hover .chip-link {
  border-color: var(--gold-light);
  color: var(--gold-light);
}

/* ─── WORD CARD ma'no linki ─── */
.word-card-link {
  font-family: var(--font-ui);
  font-size: 11px;
  color: var(--teal-mid);
  text-decoration: none;
  border-bottom: 1px dashed var(--teal-mid);
  display: block;
  margin-top: 4px;
  transition: color 0.2s;
}

.word-card-link:hover {
  color: var(--gold);
  border-color: var(--gold);
}

/* ─── LOADING ─── */
.result-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--text-muted, #888);
  font-style: italic;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(26, 82, 82, 0.2);
  border-top-color: var(--teal-mid);
  border-radius: 50%;
  display: inline-block;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ─── RESULT BODY ─── */
.result-body {
  flex: 1;
}

.result-label {
  font-size: 12px;
  opacity: 0.75;
  margin-bottom: 4px;
  font-weight: 400;
}

/* ─── MA'NO BOX ─── */
.meaning-box {
  margin-top: 14px;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.7);
  border-left: 3px solid var(--correct, #1a6b3a);
  border-radius: 0 10px 10px 0;
  animation: fade-slide 0.4s ease;
}

@keyframes fade-slide {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.result-box.wrong .meaning-box {
  border-left-color: var(--wrong, #8b2020);
}

.meaning-label {
  display: block;
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--correct, #1a6b3a);
  margin-bottom: 6px;
  opacity: 0.8;
}

.meaning-text {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  color: #2c2c2c;
  font-style: italic;
}

.meaning-not-found {
  font-family: var(--font-ui);
  font-size: 13px;
  color: #999;
  border-left-color: #ccc;
}

.meaning-not-found a {
  color: var(--teal-mid);
  text-decoration: underline dotted;
}

/* ─── MEANING SOURCE BADGE ─── */
.meaning-source {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: white;
  background: var(--teal-mid);
  border-radius: 99px;
  padding: 2px 10px;
  margin-bottom: 8px;
}