:root {
  --bg-1: #fff8e8;
  --bg-2: #ffeec8;
  --ink: #1f2a44;
  --ink-soft: #475569;
  --card: #fffdf7;
  --line: #f2d7a1;
  --accent: #d66b1f;
  --accent-2: #0f766e;
  --danger: #b42318;
  --ok: #0f7a4f;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Outfit", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 25% 15%, rgba(214, 107, 31, 0.18), transparent 35%),
    radial-gradient(circle at 85% 5%, rgba(15, 118, 110, 0.16), transparent 28%),
    linear-gradient(180deg, var(--bg-1), var(--bg-2));
  position: relative;
  overflow-x: hidden;
}

.bg-orb {
  position: fixed;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  filter: blur(40px);
  pointer-events: none;
  z-index: 0;
}

.orb-left {
  top: -130px;
  left: -70px;
  background: rgba(214, 107, 31, 0.17);
  animation: drift 11s ease-in-out infinite;
}

.orb-right {
  top: 20%;
  right: -130px;
  background: rgba(15, 118, 110, 0.18);
  animation: drift 14s ease-in-out infinite reverse;
}

.hero,
.container,
.footer {
  position: relative;
  z-index: 1;
}

.hero {
  max-width: 1120px;
  margin: 0 auto;
  padding: 2.8rem 1rem 1rem;
  animation: rise-in 550ms ease-out;
}

.lang-switcher {
  position: absolute;
  top: 1.1rem;
  right: 1rem;
  display: flex;
  gap: 0.25rem;
}

.btn-lang {
  font-size: 0.72rem;
  font-weight: 700;
  font-family: inherit;
  letter-spacing: 0.06em;
  padding: 0.22rem 0.55rem;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink-soft);
  cursor: pointer;
  transition: background 120ms, color 120ms, border-color 120ms;
}

.btn-lang.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn-lang:hover:not(.active) {
  background: var(--bg-2);
  color: var(--ink);
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--accent-2);
  font-weight: 700;
  font-size: 0.75rem;
}

h1 {
  margin: 0.25rem 0 0.3rem;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(2.1rem, 4.2vw, 3.6rem);
  line-height: 1;
}

.brand-title {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
}

.brand-logo {
  width: clamp(44px, 6.2vw, 72px);
  height: auto;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(31, 42, 68, 0.18);
}

.subtitle {
  margin: 0;
  max-width: 760px;
  color: var(--ink-soft);
}

.container {
  max-width: 1120px;
  margin: 1.2rem auto 2rem;
  padding: 0 1rem;
}

.controls {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  align-items: end;
  background: rgba(255, 253, 247, 0.9);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 0.9rem;
  backdrop-filter: blur(2px);
}

label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.9rem;
  font-weight: 600;
}

input,
select {
  width: 100%;
  border: 1px solid #ddb875;
  border-radius: 10px;
  padding: 0.62rem 0.72rem;
  font: inherit;
  color: var(--ink);
  background: #fffcf3;
}

input:focus,
select:focus {
  outline: 2px solid color-mix(in srgb, var(--accent) 65%, white);
  outline-offset: 1px;
}

.check-wrap {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  font-weight: 600;
}

.check-wrap input {
  width: 1rem;
  height: 1rem;
}

.status-strip {
  margin: 1rem 0;
  padding: 0.7rem 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fffaf0;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.status-strip.warn {
  border-color: #f9b58f;
  color: #7a2c07;
  background: #fff4ea;
}

.status-strip.ok {
  border-color: #99dfc0;
  color: #085b3c;
  background: #effcf6;
}

.results-head {
  margin: 1.2rem 0 0.55rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.results-head h2 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
}

.results-head p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.93rem;
}

.grid {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.card {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 16px;
  padding: 0.9rem;
  display: grid;
  gap: 0.55rem;
  box-shadow: 0 7px 18px rgba(31, 42, 68, 0.06);
  transform-origin: center;
  animation: rise-in 450ms ease-out both;
}

.card h3 {
  margin: 0;
  font-size: 1.05rem;
}

.card-image {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid #eed6ab;
  background: #f7ead2;
  transition: transform 180ms ease;
}

.card-image-link {
  display: block;
  justify-self: stretch;
  width: 100%;
  border: none;
  padding: 0;
  margin: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
}

.card a.card-image-link {
  justify-self: stretch;
  color: inherit;
}

.card-image-link:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 65%, white);
  outline-offset: 2px;
}

.card-image-link:hover .card-image {
  transform: scale(1.015);
}

.meta {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.tag {
  font-size: 0.75rem;
  border-radius: 999px;
  padding: 0.16rem 0.5rem;
  border: 1px solid #e6c993;
  background: #fff6e2;
}

.tag.lang {
  background: #e9f8f5;
  border-color: #97d9ce;
}

.note {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.card a {
  justify-self: start;
  font-weight: 700;
  color: #003f7f;
  text-decoration-thickness: 2px;
}

.health {
  margin: 0;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.card.broken {
  border-color: #f5b19a;
  background: #fff5f1;
}

.card.broken .health {
  color: var(--danger);
  font-weight: 600;
}

.tag.flash {
  background: #fff0e0;
  border-color: #f5a623;
  color: #7a3b00;
}

.btn-flash {
  justify-self: start;
  font-weight: 700;
  font-size: 0.95rem;
  font-family: inherit;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 8px;
  padding: 0.35rem 0.75rem;
  cursor: pointer;
  transition: background 150ms;
}

.btn-flash:hover {
  background: #b85a18;
}

.flash-dialog {
  border: none;
  border-radius: 18px;
  padding: 0;
  width: min(900px, 96vw);
  box-shadow: 0 24px 60px rgba(31, 42, 68, 0.25);
  background: #1a1a2e;
}

.flash-dialog::backdrop {
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(3px);
}

.flash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 1rem;
  background: #0f0f1a;
  border-radius: 18px 18px 0 0;
}

.flash-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.flash-title {
  color: #e2d9c0;
  font-weight: 700;
  font-size: 0.95rem;
}

.flash-close {
  background: none;
  border: 1px solid #444;
  color: #aaa;
  border-radius: 6px;
  width: 2rem;
  height: 2rem;
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1;
}

.flash-fullscreen {
  background: none;
  border: 1px solid #444;
  color: #aaa;
  border-radius: 6px;
  width: 2rem;
  height: 2rem;
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1;
}

.flash-fullscreen:hover {
  background: #333;
  color: #fff;
}

.flash-close:hover {
  background: #333;
  color: #fff;
}

.flash-container {
  width: 100%;
  aspect-ratio: 4/3;
  display: flex;
  align-items: center;
  justify-content: center;
}

.flash-container ruffle-player {
  width: 100%;
  height: 100%;
}

.flash-error {
  display: grid;
  gap: 0.75rem;
  justify-items: center;
  color: var(--ink);
  font-weight: 700;
  text-align: center;
}

.flash-error p {
  margin: 0;
}

.flash-error a {
  color: var(--accent);
}

.hidden {
  display: none;
}

.load-more-wrap {
  display: flex;
  justify-content: center;
  margin: 2rem 0 1rem;
}

.btn-load-more {
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.6rem 1.8rem;
  border-radius: 8px;
  border: 2px solid var(--accent);
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  transition: background 140ms, color 140ms;
}

.btn-load-more:hover {
  background: var(--accent);
  color: #fff;
}

.empty {
  color: var(--ink-soft);
  font-weight: 600;
}

.footer {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1rem 2rem;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

code {
  background: #f8ecd6;
  border: 1px solid #e5cb9a;
  border-radius: 7px;
  padding: 0.1rem 0.3rem;
  font-family: ui-monospace, "Cascadia Mono", "SFMono-Regular", Menlo, monospace;
}

@keyframes drift {
  0%,
  100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(16px, -18px);
  }
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.995);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 700px) {
  .hero {
    padding-top: 2rem;
  }

  .brand-title {
    gap: 0.5rem;
  }

  .controls {
    grid-template-columns: 1fr;
  }
}
