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

:root {
  --bg:       #0d0e09;
  --surface:  #131510;
  --border:   #2e3020;
  --accent:   #e07b2e;
  --accent2:  #5c9e45;
  --gold:     #d4a83a;
  --text:     #e8e0cc;
  --muted:    #7a7a5a;
  --danger:   #e05252;
  --success:  #52c97a;
  --radius:   14px;
  --glow:     0 0 24px rgba(224,123,46,.2);
}

html { font-size: 16px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Lato', sans-serif;
  font-weight: 300;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 1rem 4rem;
  overflow-x: hidden;
}

.bg-layer {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 30%, rgba(80,60,10,.12) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 70%, rgba(50,90,20,.10) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

body > * { position: relative; z-index: 1; }

header {
  text-align: center;
  padding: 3rem 1rem 1.5rem;
  max-width: 700px;
  width: 100%;
}

.paw-line {
  color: var(--accent);
  font-size: .9rem;
  letter-spacing: .2rem;
  opacity: .45;
  margin: .6rem 0;
}

header h1 {
  font-family: 'Cinzel', serif;
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  font-weight: 700;
  background: linear-gradient(135deg, var(--gold) 0%, var(--accent) 60%, var(--accent2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
  margin: .4rem 0;
}

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

main { width: 100%; max-width: 700px; margin-top: 2rem; }

.tabs { display: flex; gap: .5rem; margin-bottom: 1.5rem; }

.tab {
  flex: 1;
  padding: .75rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  font-family: 'Cinzel', serif;
  font-size: .85rem;
  cursor: pointer;
  transition: all .2s;
}
.tab:hover { border-color: var(--accent); color: var(--text); }
.tab.active { border-color: var(--accent); color: var(--accent); background: rgba(224,123,46,.1); box-shadow: var(--glow); }

.tab-content { display: none; }
.tab-content.active { display: block; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: 0 4px 32px rgba(0,0,0,.4);
}

.card h2 { font-family: 'Cinzel', serif; font-size: 1.25rem; font-weight: 600; color: var(--gold); margin-bottom: .35rem; }
.card-desc { color: var(--muted); font-size: .9rem; margin-bottom: 1.75rem; line-height: 1.5; }

.form-row { display: flex; flex-wrap: wrap; gap: 1.5rem; margin-bottom: 1.75rem; }
.form-group { display: flex; flex-direction: column; gap: .6rem; flex: 1; min-width: 160px; margin-bottom: 1.5rem; }

label { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1rem; color: var(--muted); }

.gender-buttons, .count-row { display: flex; flex-wrap: wrap; gap: .5rem; }

.gender-btn, .count-btn {
  padding: .5rem 1rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  font-family: 'Lato', sans-serif;
  font-size: .9rem;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
}
.gender-btn:hover, .count-btn:hover { border-color: var(--accent2); color: var(--text); }
.gender-btn.active, .count-btn.active { border-color: var(--accent); color: var(--accent); background: rgba(224,123,46,.12); }

textarea {
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: 'Lato', sans-serif;
  font-size: .95rem;
  line-height: 1.6;
  padding: .85rem 1rem;
  resize: vertical;
  transition: border-color .2s;
  width: 100%;
}
textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(224,123,46,.15); }
textarea::placeholder { color: var(--muted); opacity: .6; }

.btn-primary {
  display: block;
  width: 100%;
  padding: .9rem 1.5rem;
  background: linear-gradient(135deg, var(--accent), #b85e1a);
  border: none;
  border-radius: 10px;
  color: #fff;
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: .05rem;
  cursor: pointer;
  transition: all .25s;
  box-shadow: 0 4px 20px rgba(224,123,46,.3);
  margin-top: .5rem;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 28px rgba(224,123,46,.5); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.results { margin-top: 1.75rem; }

.name-list { display: flex; flex-direction: column; gap: .6rem; }

.name-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .9rem 1.2rem;
  animation: fadeSlide .3s ease both;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
.name-card:hover { border-color: var(--accent2); background: rgba(92,158,69,.05); }

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

.name-card .name-text { font-family: 'Cinzel', serif; font-size: 1.2rem; font-weight: 600; color: var(--text); flex: 1; }
.name-card .copy-hint { font-size: .75rem; color: var(--muted); opacity: 0; transition: opacity .2s; }
.name-card:hover .copy-hint { opacity: 1; }
.name-card .gem { font-size: 1.1rem; }

.reasoning-box {
  margin-top: 1rem;
  background: rgba(224,123,46,.07);
  border: 1px solid rgba(224,123,46,.2);
  border-radius: 10px;
  padding: .9rem 1.1rem;
  font-size: .88rem;
  color: var(--muted);
  line-height: 1.6;
  animation: fadeSlide .4s ease .1s both;
}
.reasoning-box strong { color: var(--accent); font-weight: 700; display: block; margin-bottom: .5rem; }
.reasoning-box p { margin-bottom: .75rem; }
.reasoning-box p:last-child { margin-bottom: 0; }

.spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  padding: 1.5rem;
  color: var(--muted);
  font-size: .9rem;
}
.spinner::before {
  content: '';
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.error-msg {
  background: rgba(224,82,82,.1);
  border: 1px solid rgba(224,82,82,.3);
  border-radius: 10px;
  padding: .9rem 1.1rem;
  color: var(--danger);
  font-size: .9rem;
}

footer { margin-top: 3rem; }

@media (max-width: 500px) {
  .card { padding: 1.25rem; }
  .form-row { flex-direction: column; gap: 0; }
  .tabs { flex-direction: column; }
}

header h1::before {
  content: '◆';
  display: inline-block;
  margin-right: .5rem;
  background: linear-gradient(135deg, var(--gold), var(--accent));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  font-size: 70%;
  vertical-align: middle;
}

/* About / GEO section */
.about-section {
  margin-top: 2rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.75rem 2rem;
  font-size: .9rem; line-height: 1.75; color: var(--muted);
}
.about-section h2 {
  font-family: 'Cinzel', serif; font-size: 1rem; font-weight: 600;
  color: var(--gold); margin-bottom: .75rem;
}
.about-section p { margin-bottom: .75rem; }
.about-section p:last-of-type { margin-bottom: 1rem; }
.about-section strong { color: var(--text); }
.about-section em { color: var(--accent); font-style: normal; }
.about-section details { margin-top: .5rem; }
.about-section summary {
  cursor: pointer; color: var(--accent); font-size: .85rem;
  font-weight: 700; letter-spacing: .05rem; text-transform: uppercase;
  padding: .5rem 0; list-style: none; outline: none;
}
.about-section summary::-webkit-details-marker { display: none; }
.about-section summary::before { content: '+ '; }
details[open] summary::before { content: '- '; }
.about-section dl { margin-top: .75rem; }
.about-section dt { color: var(--text); font-weight: 700; margin-top: .75rem; }
.about-section dd { margin: .2rem 0 0 1rem; }
