:root {
  --bg: #111314;
  --panel: #1b1f20;
  --panel-strong: #24292b;
  --text: #f4f1ea;
  --muted: #a7aea9;
  --line: #343a3d;
  --accent: #49c78a;
  --accent-strong: #32b36f;
  --warning: #f2b84b;
  --danger: #ef6a5b;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(73, 199, 138, 0.08), transparent 260px),
    radial-gradient(circle at top left, rgba(242, 184, 75, 0.12), transparent 320px),
    var(--bg);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(100%, 920px);
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 16px 32px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0 22px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 9vw, 4rem);
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 10px;
  font-size: clamp(1.55rem, 7vw, 3rem);
  line-height: 1;
  letter-spacing: 0;
}

.language-toggle {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 3px;
  background: rgba(17, 19, 20, 0.78);
}

.lang-button {
  min-width: 42px;
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-size: 0.82rem;
  font-weight: 800;
}

.lang-button.active {
  color: #0b1710;
  background: var(--accent);
}

.capture-panel {
  display: grid;
  gap: 18px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(27, 31, 32, 0.86);
  box-shadow: var(--shadow);
}

.panel-copy p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.5;
}

.capture-form {
  display: grid;
  gap: 12px;
}

.photo-drop {
  position: relative;
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 220px;
  padding: 24px;
  border: 1px dashed rgba(244, 241, 234, 0.28);
  border-radius: 8px;
  background: var(--panel-strong);
  text-align: center;
}

.photo-drop input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.photo-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  color: #0c1711;
  background: var(--accent);
}

.photo-icon svg,
.search-row svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
}

.photo-drop strong {
  font-size: 1.1rem;
}

.photo-drop small {
  max-width: 280px;
  color: var(--muted);
  line-height: 1.35;
}

.primary-button,
.search-row button {
  min-height: 52px;
  border: 0;
  border-radius: 8px;
  color: #0b1710;
  background: var(--accent);
  font-weight: 850;
}

.primary-button:disabled {
  cursor: not-allowed;
  color: #7e8581;
  background: #303638;
}

.text-search {
  display: grid;
  gap: 8px;
}

.text-search label {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 750;
}

.search-row {
  display: grid;
  grid-template-columns: 1fr 56px;
  gap: 8px;
}

.search-row input {
  min-width: 0;
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--text);
  background: #121516;
}

.status,
.recognition,
.results {
  margin-top: 18px;
}

.status {
  padding: 14px 16px;
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  line-height: 1.45;
}

.status.error {
  color: #ffd7d1;
  background: rgba(239, 106, 91, 0.16);
}

.recognition {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(17, 19, 20, 0.7);
}

.recognition p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

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

.results {
  display: grid;
  gap: 14px;
}

.result-card {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 14px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: var(--panel);
}

.poster {
  width: 96px;
  aspect-ratio: 2 / 3;
  border-radius: 6px;
  object-fit: cover;
  background: #333;
}

.result-body {
  min-width: 0;
}

.result-heading {
  display: grid;
  gap: 4px;
}

.type-pill {
  justify-self: start;
  margin: 0;
  padding: 4px 8px;
  border-radius: 999px;
  color: #101411;
  background: var(--warning);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.result-heading h3 {
  margin-bottom: 0;
  font-size: 1.15rem;
  line-height: 1.12;
}

.meta,
.overview {
  color: var(--muted);
}

.meta {
  margin-bottom: 8px;
  font-size: 0.9rem;
}

.overview {
  display: -webkit-box;
  margin-bottom: 12px;
  overflow: hidden;
  line-height: 1.42;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.ratings {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.rating {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #141718;
}

.rating-link {
  color: var(--text);
  text-decoration: none;
}

.rating-link:hover {
  border-color: var(--accent);
}

.rating span {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}

.rating strong {
  display: block;
  margin-top: 4px;
  font-size: 1.25rem;
  line-height: 1;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.link-button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--text);
  background: #131718;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 800;
}

.hidden {
  display: none;
}

@media (min-width: 720px) {
  .app-shell {
    padding-top: 32px;
  }

  .capture-panel {
    grid-template-columns: 0.9fr 1.1fr;
    align-items: start;
    padding: 24px;
  }

  .text-search {
    grid-column: 1 / -1;
  }

  .result-card {
    grid-template-columns: 130px 1fr;
    gap: 18px;
    padding: 16px;
  }

  .poster {
    width: 130px;
  }

  .ratings {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
