:root {
  color-scheme: dark;
  --navy-950: #07101d;
  --navy-900: #0d1928;
  --navy-850: #122033;
  --navy-800: #18283a;
  --navy-700: #273a52;
  --line: rgba(179, 201, 225, 0.18);
  --text: #f6f8fc;
  --muted: #aebbd0;
  --blue: #2866e8;
  --blue-light: #4f85ff;
  --gold: #f6b93b;
  --green: #18a957;
  --red: #c93645;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--navy-950);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

.page-background {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(180deg, rgba(4, 9, 17, 0.18), rgba(4, 9, 17, 0.5)),
    url("/assets/fe-guess-heroes.webp");
  background-position: center top;
  background-size: cover;
  background-repeat: no-repeat;
}

.page-background::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at center 28%, rgba(4, 12, 24, 0.16) 0 16%, rgba(3, 8, 15, 0.58) 70%),
    linear-gradient(180deg, transparent 34rem, var(--navy-950) 74rem);
}

.skip-link,
.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:focus {
  z-index: 100;
  top: 0.75rem;
  left: 0.75rem;
  width: auto;
  height: auto;
  margin: 0;
  clip: auto;
  padding: 0.65rem 0.9rem;
  border-radius: 0.5rem;
  color: #07101d;
  background: white;
}

.site-header {
  min-height: 78px;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0.72rem 1.5rem;
  background: rgba(10, 22, 37, 0.96);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.26);
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(16px);
}

.brand {
  flex: 0 0 auto;
  display: grid;
  text-decoration: none;
  line-height: 0.82;
  letter-spacing: 0.2em;
}

.brand-kicker {
  color: #b72137;
  font-family: Georgia, serif;
  font-size: 1rem;
  font-weight: 800;
  font-style: italic;
  letter-spacing: 0.04em;
  margin-left: 0.08rem;
}

.brand-name {
  font-size: 1.75rem;
  font-weight: 900;
}

.primary-nav {
  display: flex;
  gap: 0.5rem;
}

.nav-card {
  position: relative;
  min-width: 132px;
  min-height: 54px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0.45rem 2.8rem 0.45rem 0.72rem;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 0.48rem;
  color: #8996aa;
  background: rgba(13, 25, 40, 0.42);
  text-decoration: none;
  font-size: 0.78rem;
  line-height: 1.18;
  transition: 160ms ease;
}

.nav-card strong {
  font-size: 0.82rem;
}

.nav-card:hover {
  color: white;
  border-color: rgba(255, 255, 255, 0.22);
}

.nav-card.active {
  color: white;
  border-color: rgba(99, 145, 255, 0.45);
  background: linear-gradient(135deg, #1848ae, #2866e8);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.13);
}

.nav-mark {
  position: absolute;
  right: 0.72rem;
  top: 50%;
  font-size: 1.7rem;
  transform: translateY(-50%);
  color: #020813;
}

.nav-mark.infinity {
  color: #8b97a9;
  font-size: 2.25rem;
  font-weight: 800;
}

.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.icon-button {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 50%;
  background: rgba(8, 16, 28, 0.6);
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
}

.icon-button:hover {
  color: white;
  border-color: rgba(255, 255, 255, 0.35);
}

.join-button,
.primary-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  border: 1px solid #5684ee;
  border-radius: 0.42rem;
  color: white;
  background: var(--blue);
  font-weight: 750;
  text-decoration: none;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.18);
}

.join-button {
  min-height: 38px;
  padding: 0.45rem 0.82rem;
  font-size: 0.84rem;
}

main {
  min-height: 100vh;
}

.game-hero {
  width: min(820px, calc(100% - 2rem));
  min-height: calc(100vh - 78px);
  margin: 0 auto;
  padding: 3.1rem 0 4.5rem;
  text-align: center;
}

.eyebrow {
  margin: 0 0 0.5rem;
  color: #82a6ff;
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.game-heading h1,
.content-panel h2 {
  margin: 0;
  line-height: 1.04;
  letter-spacing: -0.03em;
}

.game-heading h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  text-shadow: 0 3px 18px rgba(0, 0, 0, 0.7);
}

.game-heading > p:last-child {
  margin: 0.55rem 0 0;
  color: #d4ddeb;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

.attempt-meter {
  width: fit-content;
  display: flex;
  align-items: center;
  gap: 0.48rem;
  margin: 2rem auto 1.4rem;
  padding: 0.5rem 0.6rem;
  border: 2px solid #3974f5;
  border-radius: 0.36rem;
  background: #1646a8;
  box-shadow: 0 7px 20px rgba(4, 17, 39, 0.44);
}

.attempt-meter strong {
  color: #ffdf3e;
  font-size: 1.28rem;
}

.attempt-pips {
  display: flex;
  gap: 0.2rem;
}

.attempt-pips span {
  width: 15px;
  height: 28px;
  border: 2px solid white;
  background: #2fbe48;
  transition: 180ms ease;
}

.attempt-pips span.used {
  opacity: 0.2;
  background: #08182a;
}

.guess-form {
  width: min(510px, 100%);
  margin: 0 auto 1.35rem;
}

.search-wrap {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
}

.guess-form input {
  width: 100%;
  min-height: 48px;
  padding: 0.7rem 0.95rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 0.38rem;
  outline: none;
  color: white;
  background: rgba(43, 61, 86, 0.96);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.2);
}

.guess-form input::placeholder {
  color: #b2bed0;
}

.guess-form input:focus {
  border-color: #6390ff;
  box-shadow: 0 0 0 3px rgba(70, 121, 242, 0.2);
}

.guess-form button {
  min-width: 86px;
  border: 1px solid #5684ee;
  border-radius: 0.38rem;
  color: white;
  background: var(--blue);
  font-weight: 800;
  cursor: pointer;
}

.guess-form button:hover,
.primary-cta:hover,
.join-button:hover {
  background: var(--blue-light);
}

.suggestions {
  position: absolute;
  top: calc(100% + 0.4rem);
  left: 0;
  right: 94px;
  z-index: 20;
  max-height: 280px;
  overflow-y: auto;
  border: 1px solid rgba(159, 185, 222, 0.28);
  border-radius: 0.5rem;
  padding: 0.35rem;
  background: #14243a;
  box-shadow: var(--shadow);
  text-align: left;
}

.suggestions button {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.7rem;
  border: 0;
  color: white;
  background: transparent;
  font-weight: 700;
}

.suggestions button:hover,
.suggestions button:focus {
  background: #263a55;
}

.suggestions small {
  color: #8fa1bb;
  font-weight: 500;
}

.form-message {
  min-height: 1.25rem;
  margin: 0.45rem 0 0;
  color: #f3b9bf;
  font-size: 0.83rem;
}

.guess-board {
  margin: 1.2rem auto;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  overflow: hidden;
  background: rgba(12, 25, 41, 0.95);
  box-shadow: var(--shadow);
}

.board-scroll {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 790px;
  border-collapse: separate;
  border-spacing: 4px;
}

th {
  padding: 0.45rem 0.3rem;
  color: #b8c5d8;
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

td {
  min-width: 82px;
  height: 70px;
  padding: 0.45rem;
  border-radius: 0.34rem;
  color: white;
  font-size: 0.72rem;
  font-weight: 750;
  line-height: 1.18;
  vertical-align: middle;
}

td.character-cell {
  min-width: 112px;
  background: #24364c;
}

td.exact,
.dialog-key .exact {
  background: var(--green);
}

td.partial,
.dialog-key .partial {
  background: #d28a16;
}

td.wrong,
.dialog-key .wrong {
  background: var(--red);
}

.direction {
  display: block;
  margin-top: 0.28rem;
  color: #fff3bd;
  font-size: 0.62rem;
  text-transform: uppercase;
}

.clue-card,
.content-panel {
  border: 1px solid var(--line);
  background: rgba(16, 31, 49, 0.94);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.clue-card {
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
}

.clue-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.clue {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.clue-swatch {
  width: 46px;
  height: 46px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 0.25rem;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
  font-size: 1.2rem;
  font-weight: 900;
}

.clue-swatch.exact {
  background: var(--green);
}

.clue-swatch.partial {
  background: #ff7a18;
}

.clue-swatch.wrong {
  background: #c81421;
}

.clue p {
  margin: 0;
  text-align: left;
  line-height: 1.25;
}

.clue p strong,
.clue p span {
  display: block;
}

.clue p strong {
  font-size: 0.75rem;
}

.clue p span {
  margin-top: 0.15rem;
  color: #9eacc1;
  font-size: 0.68rem;
}

.release-order {
  margin-top: 1rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--line);
}

.release-order h2 {
  margin: 0 0 0.45rem;
  color: #a6b4c9;
  font-size: 0.72rem;
}

.release-order ol {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  column-gap: 2rem;
  row-gap: 0.12rem;
  margin: 0;
  padding-left: 1.7rem;
  color: #8c9ab0;
  text-align: left;
  font-size: 0.68rem;
}

.release-order li::marker {
  color: #52637b;
}

.content-panel {
  width: min(980px, calc(100% - 2rem));
  margin: 0 auto 1.5rem;
  padding: clamp(1.5rem, 4vw, 3rem);
  border-radius: 1rem;
}

.content-panel h2 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
}

.content-panel > p:not(.eyebrow) {
  max-width: 760px;
  color: #b8c6d9;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 2rem 0;
}

.steps article {
  padding: 1.15rem;
  border: 1px solid rgba(159, 185, 222, 0.15);
  border-radius: 0.7rem;
  background: rgba(6, 16, 29, 0.45);
}

.steps article > span {
  color: #608cf4;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.steps h3 {
  margin: 0.75rem 0 0.35rem;
}

.steps p {
  margin: 0;
  color: #9dacbf;
  font-size: 0.9rem;
}

.primary-cta {
  min-height: 46px;
  padding: 0.65rem 1rem;
  border: 0;
  cursor: pointer;
}

.faq details {
  border-top: 1px solid var(--line);
  padding: 1rem 0;
}

.faq details:last-child {
  border-bottom: 1px solid var(--line);
}

.faq summary {
  cursor: pointer;
  font-weight: 800;
}

.faq details p {
  margin-bottom: 0;
  color: #aebbd0;
}

footer {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 2rem;
  margin-top: 4rem;
  padding: 2rem max(1.25rem, calc((100vw - 1100px) / 2));
  border-top: 1px solid var(--line);
  background: #07111e;
  color: #8290a5;
  font-size: 0.78rem;
}

.footer-brand {
  color: white;
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-decoration: none;
}

footer p {
  margin: 0;
}

footer nav {
  display: flex;
  gap: 1rem;
}

footer nav a:hover {
  color: white;
}

.help-dialog {
  width: min(540px, calc(100% - 2rem));
  max-height: 85vh;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 0.9rem;
  padding: 2rem;
  color: white;
  background: #15263a;
  box-shadow: var(--shadow);
}

.help-dialog::backdrop {
  background: rgba(2, 7, 14, 0.78);
  backdrop-filter: blur(3px);
}

.help-dialog h2 {
  margin: 0;
  font-size: 1.8rem;
}

.help-dialog li {
  margin: 0.7rem 0;
  color: #c1ccda;
}

.dialog-close {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  border: 0;
  color: #a8b5c5;
  background: transparent;
  font-size: 1.65rem;
  cursor: pointer;
}

.dialog-key {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 1.4rem 0;
  color: #aab7c7;
  font-size: 0.82rem;
}

.dialog-key span {
  padding: 0.25rem 0.45rem;
  border-radius: 0.25rem;
  color: white;
  font-weight: 800;
}

.result-banner {
  margin: 0 0 1.2rem;
  padding: 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 0.75rem;
  background: rgba(14, 29, 46, 0.97);
  box-shadow: var(--shadow);
}

.result-banner h2 {
  margin: 0;
  font-size: 1.3rem;
}

.result-banner p {
  margin: 0.35rem 0 1rem;
  color: #bac7d8;
}

@media (max-width: 760px) {
  .site-header {
    min-height: 102px;
    flex-wrap: wrap;
    align-content: center;
    gap: 0.55rem 0.8rem;
    padding: 0.6rem 1rem;
  }

  .brand-name {
    font-size: 1.55rem;
  }

  .primary-nav {
    order: 3;
    width: 100%;
  }

  .nav-card {
    flex: 1;
    min-width: 0;
    min-height: 36px;
    flex-direction: row;
    align-items: center;
    gap: 0.25rem;
    padding: 0.35rem 0.55rem;
  }

  .nav-card span:first-child {
    display: none;
  }

  .nav-mark {
    position: static;
    margin-left: auto;
    font-size: 1.15rem;
    transform: none;
  }

  .nav-mark.infinity {
    font-size: 1.55rem;
  }

  .header-actions {
    gap: 0.35rem;
  }

  .icon-button {
    width: 34px;
    height: 34px;
  }

  .join-button {
    min-height: 34px;
    padding: 0.35rem 0.6rem;
    font-size: 0.76rem;
  }

  .game-hero {
    width: min(100% - 1rem, 620px);
    min-height: calc(100vh - 102px);
    padding-top: 2.8rem;
  }

  .game-heading h1 {
    font-size: 1.85rem;
  }

  .game-heading > p:last-child {
    font-size: 0.9rem;
  }

  .clue-card {
    padding: 0.85rem 0.75rem;
  }

  .clue-grid {
    gap: 0.45rem;
  }

  .clue {
    flex-direction: column;
    gap: 0.4rem;
  }

  .clue p {
    text-align: center;
  }

  .clue p span {
    display: none;
  }

  .release-order ol {
    column-gap: 0.8rem;
  }

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

  footer {
    grid-template-columns: 1fr;
    gap: 0.8rem;
    text-align: center;
  }

  footer nav {
    justify-content: center;
    flex-wrap: wrap;
  }
}

@media (max-width: 440px) {
  .site-header {
    gap: 0.5rem;
  }

  .brand {
    margin-right: auto;
  }

  .brand-kicker {
    font-size: 0.75rem;
  }

  .brand-name {
    font-size: 1.3rem;
  }

  #sound-toggle {
    display: none;
  }

  .join-button {
    font-size: 0;
  }

  .join-button::after {
    content: "Rules";
    font-size: 0.74rem;
  }

  .game-hero {
    padding-top: 2.1rem;
  }

  .attempt-meter {
    margin-top: 1.45rem;
  }

  .attempt-pips span {
    width: 13px;
    height: 25px;
  }

  .search-wrap {
    grid-template-columns: 1fr;
  }

  .guess-form button {
    min-height: 44px;
  }

  .suggestions {
    right: 0;
  }

  .release-order ol {
    padding-left: 1.45rem;
    font-size: 0.63rem;
  }

  .content-panel {
    width: min(100% - 1rem, 980px);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    transition: none !important;
  }
}

.static-page {
  width: min(880px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2.6rem 0 3rem;
}

.static-page .content-panel {
  width: 100%;
  margin: 0 0 1.5rem;
}

.content-panel h1 {
  margin: 0;
  font-size: clamp(1.9rem, 4.5vw, 2.6rem);
  line-height: 1.06;
  letter-spacing: -0.03em;
}

.prose h2 {
  margin: 1.9rem 0 0.5rem;
  font-size: 1.22rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.prose > p,
.prose li {
  max-width: 760px;
  color: #b8c6d9;
}

.prose ul,
.prose ol {
  padding-left: 1.35rem;
}

.prose li {
  margin: 0.35rem 0;
}

.prose a {
  color: #82a6ff;
}

.prose .page-updated {
  color: #8290a5;
  font-size: 0.8rem;
}

.table-scroll {
  overflow-x: auto;
  margin: 1rem 0 1.5rem;
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  background: rgba(8, 18, 31, 0.55);
}

.data-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  border-spacing: 0;
}

.data-table th,
.data-table td {
  min-width: 0;
  height: auto;
  padding: 0.5rem 0.7rem;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: #c6d2e2;
  font-size: 0.78rem;
  font-weight: 500;
  text-align: left;
  text-transform: none;
  letter-spacing: 0;
}

.data-table th {
  color: #93a5bd;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table td:first-child {
  color: white;
  font-weight: 700;
}
