:root {
  --bg: #312450;
  --bg-deep: #221638;
  --sidebar: #3c2c62;
  --panel: rgba(255, 255, 255, 0.08);
  --panel-strong: rgba(255, 255, 255, 0.12);
  --panel-soft: rgba(255, 255, 255, 0.05);
  --line: rgba(255, 255, 255, 0.14);
  --line-strong: rgba(255, 255, 255, 0.24);
  --text: rgba(255, 255, 255, 0.78);
  --text-strong: #ffffff;
  --muted: rgba(255, 255, 255, 0.58);
  --accent: #5e42a6;
  --accent-alt: #b74e91;
  --accent-soft: rgba(183, 78, 145, 0.18);
  --accent-2: #5052b5;
  --success: #7bd4c7;
  --danger: #ff8fbc;
  --danger-soft: rgba(255, 143, 188, 0.18);
  --shadow: 0 1.75rem 3.5rem rgba(7, 5, 14, 0.28);
  --radius-lg: 1.25rem;
  --radius-md: 0.85rem;
  --radius-sm: 0.55rem;
  --sidebar-width: 18rem;
  --content-width: 76rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16.5pt;
  line-height: 1.75;
}

@media screen and (max-width: 1680px) {
  body {
    font-size: 13pt;
  }
}

@media screen and (max-width: 1280px) {
  body {
    font-size: 12pt;
  }
}

a {
  color: inherit;
  text-decoration: none;
  border-bottom: dotted 1px rgba(255, 255, 255, 0.35);
  transition: color 0.2s ease, border-bottom-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

a:hover,
a:focus-visible {
  color: var(--text-strong);
  border-bottom-color: transparent;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

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

p {
  margin: 0 0 1.5em;
}

h1,
h2,
h3 {
  margin: 0 0 0.65em;
  color: var(--text-strong);
  font-weight: 700;
  line-height: 1.35;
}

h1 {
  font-size: 2.75em;
}

h2 {
  font-size: 1.75em;
}

h3 {
  font-size: 1.1em;
}

@media screen and (max-width: 736px) {
  h1 {
    font-size: 2em;
  }

  h2 {
    font-size: 1.25em;
  }

  h3 {
    font-size: 1em;
  }
}

.site-header {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--sidebar);
  background-image: linear-gradient(222deg, rgba(103, 76, 177, 0.98) 0%, rgba(60, 44, 98, 0.98) 48%, rgba(44, 30, 77, 0.98) 100%);
  text-align: right;
  z-index: 50;
}

.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(0deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.035)), url("/assets/css/images/intro.svg");
  background-size: auto, cover;
  background-position: center, center;
  opacity: 0.22;
  pointer-events: none;
}

.site-header .container {
  width: 100%;
  padding: 2.5rem;
}

.site-header__bar {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 2rem;
}

.site-logo {
  display: inline-flex;
  justify-content: flex-end;
  align-items: baseline;
  gap: 0.5rem;
  margin-left: auto;
  border: 0;
  color: var(--text-strong);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.site-nav {
  display: grid;
  gap: 0.2rem;
}

.site-nav a {
  display: block;
  padding: 0.9rem 0;
  border: 0;
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.site-nav a.is-current,
.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--text-strong);
  transform: translateX(-0.15rem);
}

.site-nav a::after {
  content: "";
  display: block;
  width: 100%;
  height: 2px;
  margin-top: 0.7rem;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0.1));
  transform: scaleX(0.4);
  transform-origin: right center;
  opacity: 0.55;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.site-nav a.is-current::after,
.site-nav a:hover::after,
.site-nav a:focus-visible::after {
  transform: scaleX(1);
  opacity: 1;
}

main,
.site-footer {
  margin-left: var(--sidebar-width);
}

.container,
.article-shell {
  width: min(100% - 4.5rem, var(--content-width));
  margin: 0 auto;
}

.hero,
.section {
  position: relative;
}

.hero {
  display: flex;
  align-items: center;
  min-height: 100vh;
  padding: 3.5rem 0;
  background-image:
    linear-gradient(135deg, rgba(94, 66, 166, 0.98) 0%, rgba(80, 82, 181, 0.92) 42%, rgba(183, 78, 145, 0.88) 100%),
    url("/assets/css/images/intro.svg");
  background-size: cover;
  background-position: center;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(49, 36, 80, 0.18), rgba(49, 36, 80, 0.18));
  pointer-events: none;
}

.hero > .container,
.hero > .article-shell {
  position: relative;
  z-index: 1;
}

.hero--article,
.hero--guide {
  min-height: auto;
  padding: 5rem 0 3rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(20rem, 0.85fr);
  gap: 3rem;
  align-items: center;
}

.hero-copy {
  max-width: 38rem;
}

.eyebrow {
  display: inline-block;
  margin: 0 0 1.2rem;
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.hero-copy p,
.hero-copy li {
  color: rgba(255, 255, 255, 0.72);
}

.hero-actions,
.article-links,
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.article-links {
  margin-top: 1rem;
}

.article-links a,
.footer-links a {
  border-bottom-color: rgba(255, 255, 255, 0.25);
}

.button,
.button-secondary,
.number-pad button,
.tool-row button,
.difficulty-switch a {
  appearance: none;
  border: 0;
  border-radius: 3em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.25em;
  padding: 0 1.9em;
  font-size: 0.7em;
  font-weight: 700;
  letter-spacing: 0.25em;
  line-height: 1;
  text-transform: uppercase;
}

.button,
.button-secondary {
  border-bottom: 0;
}

.button {
  background: var(--text-strong);
  color: var(--accent);
}

.button:hover,
.button:focus-visible {
  color: var(--accent-alt);
  transform: translateY(-0.05rem);
}

.button-secondary,
.number-pad button,
.tool-row button,
.difficulty-switch a {
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--line-strong);
  color: var(--text-strong);
}

.button-secondary:hover,
.button-secondary:focus-visible,
.number-pad button:hover,
.number-pad button:focus-visible,
.tool-row button:hover,
.tool-row button:focus-visible,
.difficulty-switch a:hover,
.difficulty-switch a:focus-visible {
  box-shadow: inset 0 0 0 1px var(--text-strong);
  transform: translateY(-0.05rem);
}

.section {
  padding: 4.5rem 0;
}

.section:nth-of-type(odd):not(.hero) {
  background: #2b2044;
}

.section:nth-of-type(even):not(.hero) {
  background: #261c3d;
}

.section-head {
  max-width: 42rem;
  margin-bottom: 2.5rem;
}

.surface-card,
.article-body,
.game-card,
.link-card,
.guide-list a {
  background: var(--panel);
  backdrop-filter: blur(6px);
  box-shadow: var(--shadow);
}

.game-card {
  padding: 2.25rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
}

.game-card__top {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.game-title {
  margin-bottom: 0.1em;
}

.game-card__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.75rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.8rem;
  padding: 0 1rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-strong);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.game-status {
  margin-bottom: 1rem;
  padding: 0.9rem 1rem;
  border: solid 1px var(--line);
  border-radius: var(--radius-md);
  background: var(--panel-soft);
  color: var(--muted);
}

.game-banner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 1rem 1.1rem;
  border-radius: var(--radius-md);
  background: linear-gradient(90deg, rgba(123, 212, 199, 0.14), rgba(183, 78, 145, 0.14));
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.game-banner[hidden] {
  display: none;
}

.board-wrap {
  width: min(100%, 34rem);
}

.sudoku-board {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border: solid 2px rgba(255, 255, 255, 0.28);
  border-radius: 0.8rem;
  background: rgba(20, 15, 33, 0.7);
}

.cell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 0;
  border: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.11);
  border-bottom: 1px solid rgba(255, 255, 255, 0.11);
  background: transparent;
  color: var(--text-strong);
  font-size: clamp(1rem, 2vw, 1.55rem);
  font-weight: 700;
}

.cell:nth-child(9n) {
  border-right: 0;
}

.cell:nth-last-child(-n + 9) {
  border-bottom: 0;
}

.cell--row-divider {
  border-bottom-width: 2px;
  border-bottom-color: rgba(255, 255, 255, 0.24);
}

.cell--col-divider {
  border-right-width: 2px;
  border-right-color: rgba(255, 255, 255, 0.24);
}

.cell--given {
  background: rgba(255, 255, 255, 0.08);
}

.cell--selected {
  background: rgba(123, 212, 199, 0.18);
}

.cell--peer {
  background: rgba(255, 255, 255, 0.06);
}

.cell--match {
  color: #7bd4c7;
}

.cell--wrong,
.cell--conflict {
  background: var(--danger-soft);
  color: #ffffff;
}

.number-pad {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.number-pad button,
.tool-row button,
.difficulty-switch a {
  min-height: 3.15rem;
  padding-inline: 0.8rem;
  border-bottom: 0;
}

.number-pad button.is-active,
.tool-row button.is-active,
.difficulty-switch a.is-current {
  background: var(--text-strong);
  box-shadow: none;
  color: var(--accent);
}

.tool-row,
.difficulty-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.tool-row button {
  flex: 1 1 11rem;
}

.difficulty-switch a {
  flex: 1 1 9rem;
}

.card-grid,
.link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1.6rem;
}

.surface-card,
.link-card,
.guide-list a {
  padding: 1.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  border-bottom: 0;
}

.link-card,
.guide-list a {
  display: block;
}

.link-card strong,
.guide-list strong {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-strong);
}

.bullet-list {
  margin: 0;
  padding-left: 1.15rem;
}

.bullet-list li {
  margin-bottom: 0.75rem;
}

.article-body {
  padding: 2.4rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.article-figure {
  margin: 0 0 2rem;
}

.article-figure img {
  width: 100%;
  border-radius: 0.9rem;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.article-figure figcaption {
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.article-body h2,
.article-body h3 {
  margin-top: 1.9rem;
}

.article-body ul {
  margin: 0 0 1.5rem;
  padding-left: 1.2rem;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.article-meta span,
.breadcrumbs {
  color: var(--muted);
}

.article-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 2.5rem;
  padding: 0 1rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.breadcrumbs a {
  border-bottom-color: rgba(255, 255, 255, 0.2);
}

.guide-list {
  display: grid;
  gap: 1rem;
}

.site-footer {
  padding: 0;
  background: #211633;
}

.site-footer__card {
  padding: 2rem 0;
}

.site-footer small {
  display: block;
  color: var(--muted);
}

@media screen and (max-width: 1280px) {
  .site-header {
    width: 16rem;
  }

  main,
  .site-footer {
    margin-left: 16rem;
  }
}

@media screen and (max-width: 980px) {
  .site-header {
    position: relative;
    inset: auto;
    width: 100%;
    text-align: left;
  }

  .site-header .container {
    padding: 1.5rem 1.5rem 1.2rem;
  }

  .site-header__bar {
    gap: 1rem;
  }

  .site-logo {
    margin-left: 0;
    justify-content: flex-start;
  }

  .site-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .site-nav a {
    padding: 0.4rem 0;
  }

  .site-nav a::after {
    margin-top: 0.4rem;
    transform-origin: left center;
  }

  main,
  .site-footer {
    margin-left: 0;
  }

  .hero {
    min-height: auto;
    padding: 3rem 0;
  }

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

  .hero-copy {
    max-width: none;
  }
}

@media screen and (max-width: 736px) {
  .container,
  .article-shell {
    width: calc(100% - 2.5rem);
  }

  .game-card,
  .surface-card,
  .article-body,
  .link-card,
  .guide-list a {
    padding: 1.3rem;
  }

  .game-card__top {
    flex-direction: column;
  }

  .game-card__meta {
    justify-content: flex-start;
  }

  .number-pad {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media screen and (max-width: 480px) {
  .container,
  .article-shell {
    width: calc(100% - 1.5rem);
  }

  .site-header .container {
    padding-inline: 0.75rem;
  }

  .hero,
  .section {
    padding-block: 2.25rem;
  }

  .button,
  .button-secondary,
  .number-pad button,
  .tool-row button,
  .difficulty-switch a {
    width: 100%;
  }
}
