:root {
  --ink: #17130f;
  --muted: #6e665d;
  --paper: #f7f4ec;
  --panel: #fffdfa;
  --coal: #12100d;
  --line: #ded7cb;
  --amber: #f2b035;
  --amber-dark: #b76717;
  --teal: #168b7d;
  --coral: #d95542;
  --sky: #4977d8;
  --green: #3f8b4a;
  --shadow: 0 18px 50px rgba(32, 24, 15, 0.16);
  --radius: 8px;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

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

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: 3px solid rgba(73, 119, 216, 0.42);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1000;
  transform: translateY(-160%);
  padding: 0.75rem 1rem;
  color: #fff;
  background: var(--coal);
  border-radius: var(--radius);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: fixed;
  z-index: 50;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 2rem;
  color: #fff;
  background: rgba(18, 16, 13, 0.7);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(14px);
}

.site-header.is-scrolled {
  background: rgba(18, 16, 13, 0.94);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  min-width: 0;
}

.brand img {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
}

.brand span {
  display: grid;
  line-height: 1.1;
}

.brand strong {
  font-size: 1rem;
}

.brand small {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.78rem;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  font-size: 0.94rem;
}

.site-nav a {
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
}

.site-nav a:hover {
  color: #fff;
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-direction: column;
  color: #fff;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius);
}

.nav-toggle span {
  width: 18px;
  height: 2px;
  background: currentColor;
}

.hero {
  position: relative;
  min-height: 88svh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  color: #fff;
  background: #17130f;
  padding: 8rem 2rem 5rem;
}

.hero-media,
.hero-overlay {
  position: absolute;
  inset: 0;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: saturate(1.05) contrast(1.03);
}

.hero-overlay {
  background:
    linear-gradient(90deg, rgba(18, 16, 13, 0.9) 0%, rgba(18, 16, 13, 0.72) 42%, rgba(18, 16, 13, 0.34) 100%),
    linear-gradient(180deg, rgba(18, 16, 13, 0.25) 0%, rgba(18, 16, 13, 0.2) 58%, rgba(18, 16, 13, 0.86) 100%);
}

.hero-content {
  position: relative;
  z-index: 1;
  width: min(780px, 100%);
}

.eyebrow {
  margin: 0 0 0.85rem;
  color: var(--amber);
  font-size: 0.86rem;
  font-weight: 800;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  font-size: 5.4rem;
  line-height: 0.95;
}

.hero-copy {
  max-width: 690px;
  margin: 1.25rem 0 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 1.28rem;
  line-height: 1.55;
}

.hero-actions,
.store-actions,
.contact-actions,
.game-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.hero-actions {
  margin-top: 2rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0.8rem 1.05rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
}

.button-primary {
  color: #1c1308;
  background: var(--amber);
  border-color: var(--amber);
}

.button-primary:hover {
  background: #ffd36b;
}

.button-secondary {
  color: inherit;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.24);
}

.section-light .button-secondary,
.section-legal .button-secondary,
.section-minigames .button-secondary,
.section-contact .button-secondary {
  color: var(--ink);
  background: #fff;
  border-color: var(--line);
}

.hero-proof {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1.5rem;
}

.hero-proof span,
.support-topics button,
.minigame-tabs button {
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius);
  padding: 0.55rem 0.7rem;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.88rem;
}

.section {
  padding: 5.5rem 2rem;
  scroll-margin-top: 78px;
}

.section-inner {
  width: min(1180px, 100%);
  margin: 0 auto;
}

.section-heading {
  width: min(790px, 100%);
  margin-bottom: 2.2rem;
}

.section-heading.compact {
  margin-bottom: 1.5rem;
}

.section-heading h2,
.game-copy h2,
.support-copy h2,
.contact-layout h2 {
  margin: 0;
  font-size: 3rem;
  line-height: 1.05;
}

.section-heading p:not(.eyebrow),
.game-copy p,
.support-copy p {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.75;
}

.section-light {
  background: var(--paper);
}

.studio-grid,
.systems-grid,
.legal-layout {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.studio-card,
.systems-grid article,
.legal-block,
.chat-panel,
.carousel-shell,
.minigame-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 26px rgba(32, 24, 15, 0.06);
}

.studio-card {
  padding: 1.25rem;
}

.studio-card img,
.systems-grid img {
  width: 54px;
  height: 54px;
  object-fit: contain;
  margin-bottom: 1rem;
}

.studio-card h3,
.systems-grid h3,
.legal-block h3 {
  margin: 0 0 0.55rem;
  font-size: 1.1rem;
}

.studio-card p,
.systems-grid p,
.legal-block p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  margin: 1rem 0 0;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.metrics div {
  padding: 1.2rem;
  background: #fffaf2;
}

.metrics dt {
  font-size: 2rem;
  font-weight: 900;
  color: var(--amber-dark);
}

.metrics dd {
  margin: 0.25rem 0 0;
  color: var(--muted);
}

.section-game,
.section-support {
  color: #fff;
  background: #17130f;
}

.game-layout,
.support-layout,
.contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  align-items: center;
  gap: 2rem;
}

.game-copy p,
.support-copy p {
  color: rgba(255, 255, 255, 0.75);
}

.feature-list {
  display: grid;
  gap: 0.65rem;
  margin: 1.5rem 0;
  padding: 0;
  list-style: none;
}

.feature-list li {
  position: relative;
  padding-left: 1.4rem;
  color: rgba(255, 255, 255, 0.84);
  line-height: 1.55;
}

.feature-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62rem;
  width: 0.55rem;
  height: 0.55rem;
  background: var(--teal);
  border-radius: 2px;
}

.carousel-shell {
  overflow: hidden;
  background: #201812;
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: var(--shadow);
}

.carousel {
  position: relative;
}

.carousel-track {
  display: flex;
  transition: transform 420ms ease;
}

.carousel-slide {
  position: relative;
  flex: 0 0 100%;
  min-height: 0;
  aspect-ratio: 101 / 45;
  margin: 0;
  background: #0d1822;
}

.carousel-slide img {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
}

.carousel-characters {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: end;
  gap: 1rem;
  padding: 2rem 2rem 4.5rem;
  background:
    linear-gradient(180deg, rgba(39, 28, 18, 0.3), rgba(39, 28, 18, 0.92)),
    url("/tiles/suelo.png");
  background-size: auto, 85px 92px;
}

.carousel-characters img {
  width: 100%;
  height: 340px;
  min-height: 0;
  object-fit: contain;
}

.carousel-slide figcaption {
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  padding: 0.8rem 0.9rem;
  color: #fff;
  background: rgba(18, 16, 13, 0.76);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  font-weight: 800;
}

.carousel-button {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 44px;
  height: 44px;
  transform: translateY(-50%);
  color: #fff;
  background: rgba(18, 16, 13, 0.76);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius);
  font-size: 2rem;
  line-height: 1;
}

.carousel-prev {
  left: 0.75rem;
}

.carousel-next {
  right: 0.75rem;
}

.carousel-dots {
  position: absolute;
  z-index: 3;
  right: 1rem;
  bottom: 1.25rem;
  display: flex;
  gap: 0.45rem;
}

.carousel-dots button {
  width: 10px;
  height: 10px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.42);
}

.carousel-dots button.is-active {
  background: var(--amber);
}

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

.systems-grid article {
  padding: 1.1rem;
}

.support-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1.25rem;
}

.support-topics button {
  color: #fff;
}

.support-topics button:hover,
.minigame-tabs button:hover {
  border-color: rgba(255, 255, 255, 0.45);
}

.chat-panel {
  display: grid;
  grid-template-rows: auto minmax(340px, 1fr) auto;
  min-height: 520px;
  overflow: hidden;
  color: var(--ink);
  box-shadow: var(--shadow);
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 1rem;
  border-bottom: 1px solid var(--line);
}

.chat-header img {
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
}

.chat-header div {
  display: grid;
}

.chat-header span {
  color: var(--muted);
  font-size: 0.86rem;
}

.chat-log {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  overflow-y: auto;
  padding: 1rem;
  background: #fbf6ed;
}

.message {
  width: min(88%, 620px);
  padding: 0.85rem 0.95rem;
  border-radius: var(--radius);
  line-height: 1.55;
}

.message-agent {
  align-self: flex-start;
  background: #fff;
  border: 1px solid var(--line);
}

.message-user {
  align-self: flex-end;
  color: #fff;
  background: var(--teal);
}

.related {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.65rem;
}

.related button {
  padding: 0.42rem 0.55rem;
  color: var(--ink);
  background: #f7f4ec;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 0.82rem;
}

.chat-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.6rem;
  padding: 1rem;
  border-top: 1px solid var(--line);
}

.chat-form input {
  width: 100%;
  min-height: 46px;
  padding: 0 0.9rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.section-minigames {
  background:
    linear-gradient(180deg, rgba(247, 244, 236, 0.94), rgba(247, 244, 236, 0.94)),
    url("/tiles/suelo.png");
  background-size: auto, 85px 92px;
}

.minigame-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 1rem;
}

.minigame-tabs button {
  color: var(--ink);
  background: #fff;
  border-color: var(--line);
}

.minigame-tabs button.is-active {
  color: #fff;
  background: var(--coal);
  border-color: var(--coal);
}

.minigame-panel {
  padding: 1rem;
}

.game-hud {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.7rem;
  margin-bottom: 1rem;
}

.game-hud div {
  padding: 0.8rem;
  background: #fffaf2;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

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

.game-hud strong {
  display: block;
  margin-top: 0.2rem;
  font-size: 1.45rem;
}

#aim-canvas {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  background: #21170f;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  touch-action: manipulation;
}

.game-controls {
  margin-top: 1rem;
}

.memory-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.7rem;
}

.memory-card {
  position: relative;
  min-height: 124px;
  padding: 0;
  background: #21170f;
  border: 1px solid #33261b;
  border-radius: var(--radius);
  overflow: hidden;
}

.memory-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(242, 176, 53, 0.25), rgba(22, 139, 125, 0.18)),
    url("/tiles/bloque_destructible.png") center / 82px 84px;
}

.memory-card img {
  position: relative;
  width: 74%;
  height: 110px;
  margin: 0 auto;
  object-fit: contain;
  opacity: 0;
  transform: scale(0.82);
  transition: opacity 180ms ease, transform 180ms ease;
}

.memory-card.is-open,
.memory-card.is-match {
  background: #fffaf2;
  border-color: var(--amber);
}

.memory-card.is-open::before,
.memory-card.is-match::before {
  opacity: 0;
}

.memory-card.is-open img,
.memory-card.is-match img {
  opacity: 1;
  transform: scale(1);
}

.section-legal {
  background: #fffdfa;
}

.section-legal-alt {
  background: #f0f7f5;
}

.legal-layout {
  grid-template-columns: repeat(2, 1fr);
}

.legal-block {
  padding: 1.15rem;
}

.legal-block a {
  color: var(--sky);
  font-weight: 800;
}

.legal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.legal-page {
  min-height: 100vh;
  background: var(--paper);
}

.legal-site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 2rem;
  color: #fff;
  background: rgba(18, 16, 13, 0.96);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.legal-site-header nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.legal-site-header nav a {
  padding: 0.6rem 0.7rem;
  color: rgba(255, 255, 255, 0.76);
  border-radius: var(--radius);
  text-decoration: none;
}

.legal-site-header nav a:hover,
.legal-site-header nav a.is-active {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.legal-page-main {
  width: min(960px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 4.5rem 0 6rem;
}

.legal-page-main-narrow {
  width: min(820px, calc(100% - 2rem));
}

.legal-page-title {
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--line);
}

.legal-page-title h1 {
  margin: 0;
  max-width: 800px;
  font-size: 3.4rem;
  line-height: 1.02;
}

.legal-page-title > p:not(.eyebrow) {
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.legal-language-links {
  display: flex;
  gap: 0.55rem;
  margin-top: 1.25rem;
}

.legal-language-links a {
  padding: 0.55rem 0.7rem;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-weight: 800;
  text-decoration: none;
}

.legal-document {
  padding-top: 3rem;
  scroll-margin-top: 90px;
}

.legal-document + .legal-document {
  margin-top: 3rem;
  border-top: 4px solid var(--coal);
}

.legal-document > h2 {
  margin: 0 0 1.6rem;
  font-size: 2rem;
}

.legal-document article {
  padding: 1.4rem 0;
  border-top: 1px solid var(--line);
}

.legal-document article:last-child {
  border-bottom: 1px solid var(--line);
}

.legal-document h3 {
  margin: 0 0 0.6rem;
  font-size: 1.1rem;
}

.legal-document p,
.legal-document li {
  color: var(--muted);
  line-height: 1.75;
}

.legal-document p {
  margin: 0.55rem 0 0;
}

.legal-document a:not(.button) {
  color: var(--sky);
  font-weight: 800;
}

.legal-document ul {
  margin: 0.7rem 0 0;
  padding-left: 1.25rem;
}

.legal-mail-button {
  width: fit-content;
  margin-top: 1rem;
}

.legal-page-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.2rem 2rem;
  color: rgba(255, 255, 255, 0.72);
  background: var(--coal);
}

.legal-page-footer a {
  color: #fff;
  font-weight: 800;
  text-decoration: none;
}

.section-contact {
  color: #fff;
  background: #17130f;
}

.contact-layout {
  grid-template-columns: 1fr auto;
}

.contact-actions {
  justify-content: flex-end;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.2rem 2rem;
  color: rgba(255, 255, 255, 0.72);
  background: #12100d;
}

.site-footer div,
.site-footer nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.site-footer strong {
  color: #fff;
}

.site-footer a {
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
}

.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;
}

@media (max-width: 980px) {
  .site-header {
    padding: 0.7rem 1rem;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .site-nav {
    position: absolute;
    top: calc(100% + 1px);
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.6rem;
    background: rgba(18, 16, 13, 0.98);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  }

  .site-nav.is-open {
    display: flex;
  }

  .site-nav a {
    padding: 0.85rem;
  }

  .hero {
    min-height: 88svh;
    padding: 7rem 1rem 3rem;
  }

  .hero h1 {
    font-size: 3.7rem;
  }

  .hero-copy {
    font-size: 1.05rem;
  }

  .section {
    padding: 4rem 1rem;
  }

  .section-heading h2,
  .game-copy h2,
  .support-copy h2,
  .contact-layout h2 {
    font-size: 2.25rem;
  }

  .studio-grid,
  .systems-grid,
  .game-layout,
  .support-layout,
  .legal-layout,
  .contact-layout {
    grid-template-columns: 1fr;
  }

  .metrics,
  .game-hud {
    grid-template-columns: repeat(2, 1fr);
  }

  .contact-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 620px) {
  .brand small {
    display: none;
  }

  .hero h1 {
    font-size: 2.85rem;
  }

  .hero-actions,
  .store-actions,
  .contact-actions,
  .game-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .metrics,
  .game-hud {
    grid-template-columns: 1fr;
  }

  .carousel-slide,
  .carousel-slide img {
    min-height: 0;
  }

  .carousel-characters {
    grid-template-columns: 1fr 1fr;
    padding: 1rem 1rem 4.2rem;
  }

  .carousel-characters img {
    height: 160px;
  }

  .chat-panel {
    min-height: 560px;
  }

  .chat-form {
    grid-template-columns: 1fr;
  }

  .memory-grid {
    gap: 0.45rem;
  }

  .memory-card {
    min-height: 86px;
  }

  .memory-card img {
    height: 78px;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .legal-site-header {
    align-items: flex-start;
    flex-direction: column;
    padding: 0.7rem 1rem;
  }

  .legal-site-header nav {
    width: 100%;
  }

  .legal-site-header nav a {
    flex: 1 1 auto;
    text-align: center;
  }

  .legal-page-main {
    padding-top: 3rem;
  }

  .legal-page-title h1 {
    font-size: 2.45rem;
  }

  .legal-mail-button {
    width: 100%;
  }

  .legal-page-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
