/* ============================================================================
   Tropic Auto — stiluri (fără framework, fără CDN: CSP strict, încărcare rapidă)
   ========================================================================== */

:root {
  --bg: #09090b;
  --bg-soft: #121215;
  --card: #18181b;
  --card-2: #1f1f23;
  --line: #2a2a2f;
  --text: #f4f4f5;
  --muted: #a1a1aa;
  --dim: #71717a;
  --orange: #f97316;
  --orange-2: #ea580c;
  --green: #10b981;
  --green-2: #059669;
  --red: #b91c1c;
  --amber: #d97706;
  --blue: #3b82f6;
  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 24px 48px -24px rgba(0, 0, 0, .85);
  --maxw: 36rem;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 12px 40px;
  gap: 16px;
  background: radial-gradient(1200px 600px at 50% -200px, #1c1208 0%, var(--bg) 55%) no-repeat, var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: var(--orange); text-decoration: none; }
a:hover { text-decoration: underline; }

.hidden { display: none !important; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: -999px; top: 8px; z-index: 50;
  background: var(--orange); color: #000; padding: 8px 12px; border-radius: 8px;
  font-weight: 700;
}
.skip-link:focus { left: 8px; }

/* --------------------------------------------------------------- topbar */

.topbar {
  width: 100%; max-width: var(--maxw);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding-bottom: 10px; border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 8px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-icon { font-size: 22px; line-height: 1; }
.brand-name {
  font-size: 18px; font-weight: 900; letter-spacing: .06em;
  background: linear-gradient(90deg, #ef4444, #f97316);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.badge {
  font-size: 11px; font-weight: 800; color: #d4d4d8;
  background: #27272a; border: 1px solid #3f3f46;
  padding: 2px 8px; border-radius: 999px;
}

.topbar-right { display: flex; align-items: center; gap: 8px; }

.streak {
  font-size: 13px; font-weight: 800;
  background: var(--card); border: 1px solid var(--line);
  padding: 6px 10px; border-radius: 10px; white-space: nowrap;
}
.streak-word { color: var(--muted); font-weight: 600; }

/* ---------------------------------------------------------------- buttons */

.btn {
  font: inherit; font-weight: 800; cursor: pointer;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  padding: 10px 16px; transition: background .15s ease, transform .1s ease, border-color .15s ease;
  line-height: 1.2;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }

.btn-orange {
  background: linear-gradient(180deg, var(--orange), var(--orange-2));
  color: #fff; box-shadow: 0 10px 20px -12px rgba(249, 115, 22, .9);
}
.btn-orange:hover { background: linear-gradient(180deg, #fb923c, var(--orange)); }

.btn-dark { background: #27272a; color: #e4e4e7; border-color: #3f3f46; }
.btn-dark:hover { background: #3f3f46; }

.btn-ghost {
  background: transparent; color: var(--orange); border-color: rgba(249, 115, 22, .4);
}
.btn-ghost:hover { background: rgba(249, 115, 22, .12); }

.btn-green { background: linear-gradient(180deg, var(--green), var(--green-2)); color: #fff; }
.btn-green:hover { filter: brightness(1.08); }

.btn-white { background: #fff; color: #b91c1c; }
.btn-white:hover { background: #f4f4f5; }

.btn-wide { width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

/* -------------------------------------------------------------- ad slots */

.ad-slot {
  width: 100%; max-width: var(--maxw);
  min-height: 60px;
  display: flex; align-items: center; justify-content: center;
  border: 1px dashed var(--line); border-radius: var(--radius-sm);
  color: #52525b; font-size: 11px; letter-spacing: .04em;
  background: rgba(24, 24, 27, .5);
}
.ad-slot-tall { min-height: 90px; }

/* ---------------------------------------------------------------- card */

.card {
  width: 100%; max-width: var(--maxw);
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow);
}

.card-center { text-align: center; }
.big-emoji { font-size: 48px; margin: 8px 0 0; }
.notice-title { font-size: 18px; font-weight: 900; color: #fdba74; margin: 8px 0; }

.notice {
  margin-bottom: 12px; padding: 10px 12px;
  border: 1px solid rgba(239, 68, 68, .35); background: rgba(127, 29, 29, .25);
  border-radius: var(--radius-sm); font-size: 13px; color: #fca5a5;
}

/* ------------------------------------------------------------ audio hint */

.audio-hint {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px; margin-bottom: 12px;
  background: var(--bg-soft); border: 1px solid rgba(249, 115, 22, .35);
  border-radius: var(--radius-sm);
}
.audio-title {
  margin: 0; font-size: 11px; font-weight: 900; letter-spacing: .05em;
  color: var(--orange); display: flex; gap: 6px; align-items: center;
}
.audio-sub { margin: 2px 0 0; font-size: 11px; color: var(--muted); }

/* ---------------------------------------------------------------- tabs */

.tabs-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-bottom: 10px; flex-wrap: wrap;
}
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }

.tab {
  font: inherit; font-size: 11.5px; font-weight: 800; cursor: pointer;
  padding: 6px 10px; border-radius: 9px; border: 1px solid transparent;
  background: #27272a; color: var(--muted);
}
.tab.is-active { background: #dc2626; color: #fff; }
.tab:not(.is-active):not([disabled]):hover { background: #3f3f46; color: var(--text); }
.tab[disabled] { opacity: .7; cursor: not-allowed; }
.tab:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }

.attempts { font-size: 11.5px; font-weight: 700; color: var(--muted); white-space: nowrap; }

/* --------------------------------------------------------------- photo */

.photo {
  position: relative; margin: 0 0 12px;
  aspect-ratio: 1 / 1; max-height: 20rem;
  border-radius: var(--radius-sm); overflow: hidden;
  background: #000; border: 1px solid var(--line);
}
.photo img { width: 100%; height: 100%; object-fit: cover; transition: opacity .25s ease; }
.photo img.is-loading { opacity: .25; }

.pills {
  position: absolute; left: 8px; right: 8px; bottom: 8px;
  display: flex; flex-wrap: wrap; gap: 6px;
}
.pill {
  font-size: 11px; font-weight: 800; padding: 4px 8px; border-radius: 8px;
  background: rgba(0, 0, 0, .82); border: 1px solid rgba(249, 115, 22, .4);
  color: #fdba74;
}
.pill-blue { border-color: rgba(59, 130, 246, .4); color: #93c5fd; }

/* -------------------------------------------------------------- search */

.search { position: relative; margin-bottom: 14px; }

.search-row { display: flex; gap: 8px; }

#car-input {
  flex: 1; min-width: 0;
  font: inherit; font-size: 14px; color: var(--text);
  background: var(--bg); border: 1px solid #3f3f46; border-radius: var(--radius-sm);
  padding: 12px 14px;
}
#car-input::placeholder { color: #52525b; }
#car-input:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(249, 115, 22, .18); }

.autocomplete {
  position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px);
  margin: 0; padding: 4px; list-style: none;
  background: var(--card-2); border: 1px solid #3f3f46; border-radius: var(--radius-sm);
  max-height: 230px; overflow-y: auto; box-shadow: var(--shadow);
}
.autocomplete li {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 9px 10px; border-radius: 8px; font-size: 13.5px; cursor: pointer;
}
.autocomplete li[aria-selected="true"], .autocomplete li:hover { background: #3f3f46; }
.autocomplete .ac-name { font-weight: 600; }
.autocomplete .ac-meta { font-size: 11px; color: var(--dim); }

.hint-error { margin: 8px 0 0; font-size: 12px; font-weight: 700; color: #f87171; }

/* --------------------------------------------------------- semafor rows */

.legend {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px;
  font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  color: var(--dim); text-align: center; margin-bottom: 6px; padding: 0 2px;
}

.guesses { display: flex; flex-direction: column; gap: 6px; margin-bottom: 4px; }

.guess { animation: pop .25s ease; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

.guess-caption {
  font-size: 11px; color: var(--muted); margin: 0 0 4px 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.guess-caption strong { color: var(--text); }

.guess-cells { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }

.cell {
  font-size: 12px; font-weight: 800; text-align: center;
  padding: 8px 4px; border-radius: 8px; line-height: 1.15;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 48px; word-break: break-word;
}
.cell small { font-size: 10px; font-weight: 600; opacity: .9; margin-top: 2px; }
.cell-ok { background: var(--green-2); color: #fff; }
.cell-close { background: var(--amber); color: #fff; }
.cell-bad { background: #3f2727; color: #fecaca; }
.cell-neutral { background: var(--card-2); color: var(--text); }

.empty-hint {
  font-size: 12.5px; color: var(--dim); text-align: center; padding: 10px 0 2px;
}

/* --------------------------------------------------------------- result */

.result {
  margin-top: 14px; padding: 16px;
  background: var(--bg-soft);
  border: 1px solid rgba(16, 185, 129, .35); border-radius: var(--radius-sm);
  text-align: center;
}
.result.is-lost { border-color: rgba(239, 68, 68, .35); }

.result-title { margin: 0 0 8px; font-size: 17px; font-weight: 900; color: var(--green); }
.result.is-lost .result-title { color: #f87171; }

.result-img {
  width: 100%; max-height: 220px; object-fit: cover;
  border-radius: var(--radius-sm); margin-bottom: 10px;
}

.result-car { margin: 0 0 6px; font-size: 16px; font-weight: 900; }
.result-fact { margin: 0 0 14px; font-size: 12.5px; font-style: italic; color: var(--muted); }

.copy-msg { margin: 8px 0 0; font-size: 12px; font-weight: 700; color: var(--green); }
.copy-msg-light { margin: 8px 0 0; font-size: 12px; font-weight: 700; color: #fff; }

.promo {
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  text-align: left;
}
.promo-tag {
  display: block; font-size: 10px; font-weight: 900; letter-spacing: .08em;
  text-transform: uppercase; color: var(--orange); margin-bottom: 2px;
}
.promo p { margin: 0; font-size: 12px; color: #d4d4d8; }

/* --------------------------------------------------------- share banner */

.share-banner {
  width: 100%; max-width: var(--maxw);
  background: linear-gradient(120deg, #dc2626, #ea580c 55%, #d97706);
  border: 1px solid rgba(253, 186, 116, .45);
  border-radius: var(--radius); padding: 18px 16px;
  text-align: center; box-shadow: var(--shadow);
}
.share-banner h2 { margin: 0 0 4px; font-size: 16px; font-weight: 900; }
.share-banner p { margin: 0 0 12px; font-size: 12.5px; color: #fff; opacity: .95; }

/* --------------------------------------------------------------- archive */

.archive-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  margin-bottom: 12px;
}
.archive-head h2 { margin: 0; font-size: 13px; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; }
.archive-head span { font-size: 11px; color: var(--muted); }

.archive-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
@media (min-width: 480px) { .archive-list { grid-template-columns: repeat(4, 1fr); } }

.archive-item {
  display: block; padding: 10px 6px; text-align: center;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm);
  color: var(--text);
}
.archive-item:hover { border-color: var(--orange); text-decoration: none; }
.archive-item.is-solved { border-color: rgba(16, 185, 129, .45); }
.archive-num { font-size: 12px; font-weight: 900; }
.archive-date { font-size: 10px; color: var(--muted); margin-top: 2px; }
.archive-state { font-size: 10px; font-weight: 800; margin-top: 6px; color: var(--orange); }
.archive-item.is-solved .archive-state { color: var(--green); }

/* ---------------------------------------------------------------- footer */

.footer {
  width: 100%; max-width: var(--maxw);
  font-size: 12px; color: var(--muted);
  padding-top: 16px; border-top: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 10px;
}
.footer-title { margin: 0; font-size: 13px; font-weight: 800; color: #d4d4d8; }
.footer p { margin: 0; }
.footer-legal { font-size: 11px; color: #52525b; }

.retea { display: flex; flex-direction: column; gap: 4px; }
.retea-titlu { font-size: 10px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; color: #52525b; margin: 0; }
.retea-lista { display: flex; flex-wrap: wrap; gap: 4px 10px; margin: 0; font-size: 11px; }
.retea-lista a { color: #a1a1aa; }

/* ---------------------------------------------------------------- motion */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
