:root {
  color-scheme: dark;
  --bg: #071015;
  --panel: rgba(17, 29, 38, 0.88);
  --panel-strong: #101c25;
  --border: rgba(171, 226, 255, 0.12);
  --text: #f1f8ff;
  --muted: #8ba2b5;
  --muted-strong: #b4c7d6;
  --accent: #6df6bd;
  --accent-dark: #063f2d;
  --blue: #70c8ff;
  --violet: #9f8cff;
  --warn: #ffd477;
  --danger: #ff8e97;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
  background: #050a0e;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 5% 0%, rgba(41, 179, 128, 0.16), transparent 32rem),
    radial-gradient(circle at 95% 20%, rgba(67, 118, 221, 0.14), transparent 35rem),
    linear-gradient(160deg, #09151a 0%, #050b0f 55%, #071015 100%);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Hiragino Sans GB", sans-serif;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 38px 38px;
  content: "";
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), transparent 78%);
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

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

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.orb {
  position: fixed;
  z-index: -1;
  width: 34rem;
  height: 34rem;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.09;
  pointer-events: none;
}

.orb-a {
  top: 18rem;
  left: -24rem;
  background: var(--accent);
}

.orb-b {
  right: -24rem;
  bottom: 4rem;
  background: var(--blue);
}

.topbar,
main,
footer {
  width: min(1180px, calc(100% - 40px));
  margin-right: auto;
  margin-left: auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 0 8px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
}

.brand-icon {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  color: #05130e;
  border-radius: 13px;
  background: linear-gradient(145deg, #99ffd4, #58dcae);
  box-shadow: 0 10px 28px rgba(73, 232, 174, 0.24);
  font-size: 14px;
}

.brand > span:last-child {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand b {
  font-size: 15px;
}

.brand small {
  color: var(--muted);
  font-size: 10px;
}

.top-link {
  padding: 10px 14px;
  color: var(--muted-strong);
  border: 1px solid var(--border);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.035);
  font-size: 12px;
  transition: 160ms ease;
}

.top-link:hover {
  color: var(--text);
  border-color: rgba(109, 246, 189, 0.28);
  background: rgba(109, 246, 189, 0.07);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
  align-items: center;
  gap: 50px;
  min-height: 510px;
  padding: 68px 0 54px;
}

.eyebrow {
  margin: 0 0 9px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.2em;
}

.hero h1 {
  margin: 0 0 20px;
  font-size: clamp(42px, 6.3vw, 76px);
  line-height: 0.99;
  letter-spacing: -0.065em;
}

.hero h1 span {
  color: transparent;
  background: linear-gradient(100deg, #81ffd0 0%, #74caff 54%, #b0a2ff 100%);
  background-clip: text;
  -webkit-background-clip: text;
}

.hero-description {
  max-width: 615px;
  margin-bottom: 28px;
  color: var(--muted-strong);
  font-size: 15px;
  line-height: 1.85;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 11px;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  min-height: 45px;
  align-items: center;
  justify-content: center;
  padding: 0 19px;
  border-radius: 13px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 750;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.primary-button {
  color: #05130e;
  border: 1px solid #88ffd0;
  background: linear-gradient(135deg, #94ffd2, #5bdfae);
  box-shadow: 0 12px 32px rgba(73, 232, 174, 0.2);
}

.secondary-button {
  color: var(--muted-strong);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
}

.primary-button:hover,
.secondary-button:hover {
  transform: translateY(-2px);
}

.secondary-button:hover {
  color: var(--text);
  border-color: rgba(109, 246, 189, 0.25);
}

.hero-panel {
  position: relative;
  min-height: 390px;
  padding: 21px;
  overflow: hidden;
  border: 1px solid rgba(140, 226, 255, 0.13);
  border-radius: 27px;
  background:
    radial-gradient(circle at 75% 30%, rgba(80, 190, 255, 0.15), transparent 48%),
    linear-gradient(145deg, rgba(19, 40, 48, 0.94), rgba(8, 17, 24, 0.96));
  box-shadow: var(--shadow), inset 0 1px rgba(255, 255, 255, 0.05);
}

.hero-panel::after {
  position: absolute;
  top: -70%;
  left: -120%;
  width: 70%;
  height: 250%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
  content: "";
  transform: rotate(18deg);
  animation: shine 7s ease-in-out infinite;
}

@keyframes shine {
  0%, 65% { transform: translateX(0) rotate(18deg); }
  100% { transform: translateX(540%) rotate(18deg); }
}

.hero-panel-top,
.hero-panel-bottom {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 11px;
}

.signal {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--accent);
}

.signal i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 14px currentColor;
}

.hero-illustration {
  position: relative;
  height: 260px;
  margin: 8px 0;
}

.pixel-player {
  position: absolute;
  top: 45px;
  left: 50%;
  display: grid;
  width: 108px;
  height: 108px;
  place-items: center;
  color: #06130f;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 30px;
  background: linear-gradient(145deg, #8affcf, #52d9a7 55%, #4abde2);
  box-shadow: 0 28px 70px rgba(59, 203, 167, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.65);
  font-size: 43px;
  transform: translateX(-50%) rotate(-5deg);
  animation: float 4.2s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateX(-50%) translateY(0) rotate(-5deg); }
  50% { transform: translateX(-50%) translateY(-13px) rotate(3deg); }
}

.pixel-track {
  position: absolute;
  right: 8%;
  bottom: 36px;
  left: 8%;
  display: flex;
  justify-content: space-between;
  padding: 0 19px;
}

.pixel-track::before {
  position: absolute;
  top: 50%;
  right: 0;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(112, 200, 255, 0.45), transparent);
  content: "";
}

.pixel-track span {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 14px rgba(112, 200, 255, 0.8);
}

.pixel-ball {
  position: absolute;
  right: 25%;
  bottom: 53px;
  width: 18px;
  height: 18px;
  border: 3px solid #f7fffd;
  border-radius: 50%;
  background: #ff8e97;
  box-shadow: 0 0 20px rgba(255, 142, 151, 0.55);
}

.hero-panel-bottom {
  justify-content: flex-start;
  gap: 25px;
}

.hero-panel-bottom > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hero-panel-bottom b {
  color: var(--text);
  font-size: 17px;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(12, 23, 31, 0.74);
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(16px);
}

.search-box {
  position: relative;
  display: flex;
  min-width: 310px;
  align-items: center;
}

.search-box > span {
  position: absolute;
  left: 14px;
  color: var(--muted);
  font-size: 19px;
  transform: rotate(-15deg);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  height: 43px;
  padding: 0 42px 0 43px;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  outline: none;
  background: rgba(255, 255, 255, 0.04);
}

.search-box input::placeholder {
  color: #708797;
}

.search-box input:focus {
  border-color: rgba(109, 246, 189, 0.34);
  box-shadow: 0 0 0 3px rgba(109, 246, 189, 0.06);
}

.search-box button {
  position: absolute;
  right: 9px;
  display: none;
  width: 28px;
  height: 28px;
  color: var(--muted);
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
}

.search-box.has-value button {
  display: grid;
  place-items: center;
}

.category-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.category-button {
  min-height: 35px;
  padding: 0 12px;
  color: var(--muted-strong);
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  transition: 150ms ease;
}

.category-button:hover,
.category-button.is-active {
  color: var(--accent);
  border-color: rgba(109, 246, 189, 0.18);
  background: rgba(109, 246, 189, 0.07);
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 47px 4px 19px;
}

.section-heading h2,
.resource-cta h2 {
  margin: 0;
  font-size: 25px;
  letter-spacing: -0.035em;
}

.section-heading > p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.game-card {
  min-width: 0;
}

.game-open {
  display: flex;
  width: 100%;
  height: 100%;
  min-height: 322px;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  color: inherit;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: linear-gradient(160deg, rgba(18, 33, 42, 0.94), rgba(8, 17, 23, 0.96));
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.18), inset 0 1px rgba(255, 255, 255, 0.025);
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.game-open:hover {
  border-color: rgba(109, 246, 189, 0.26);
  box-shadow: 0 23px 65px rgba(0, 0, 0, 0.31), 0 0 0 1px rgba(109, 246, 189, 0.04);
  transform: translateY(-5px);
}

.game-cover {
  position: relative;
  display: grid;
  height: 142px;
  flex: 0 0 142px;
  place-items: center;
  overflow: hidden;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 46px;
  font-weight: 850;
  letter-spacing: -0.06em;
}

.game-cover::after {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.14), transparent 30%),
    radial-gradient(circle at 70% 20%, rgba(255, 255, 255, 0.18), transparent 25%);
  content: "";
}

.game-cover span {
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 12px 20px rgba(0, 0, 0, 0.2));
}

.game-cover[data-theme="mint"] { color: #071811; background: linear-gradient(135deg, #9affd1, #4ed7a9); }
.game-cover[data-theme="orange"] { color: #241000; background: linear-gradient(135deg, #ffda83, #ff9e5f); }
.game-cover[data-theme="sky"] { color: #031620; background: linear-gradient(135deg, #9bdcff, #5cb9ef); }
.game-cover[data-theme="ice"] { color: #041823; background: linear-gradient(135deg, #d6f7ff, #78cdef); }
.game-cover[data-theme="lime"] { color: #102006; background: linear-gradient(135deg, #d4ff83, #7fd952); }
.game-cover[data-theme="blue"] { color: #03142b; background: linear-gradient(135deg, #a2c4ff, #678ee9); }
.game-cover[data-theme="pink"] { color: #2b0b21; background: linear-gradient(135deg, #ffc2eb, #ed83c8); }
.game-cover[data-theme="violet"] { color: #16082b; background: linear-gradient(135deg, #d7c8ff, #9c82f0); }

.card-body {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  padding: 17px;
}

.card-tags,
.dialog-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  padding: 4px 7px;
  color: var(--muted-strong);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.035);
  font-size: 9px;
  font-weight: 650;
}

.tag.age {
  color: var(--accent);
  border-color: rgba(109, 246, 189, 0.16);
  background: rgba(109, 246, 189, 0.06);
}

.card-body h3 {
  margin: 13px 0 7px;
  font-size: 19px;
  letter-spacing: -0.03em;
}

.card-body p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 17px;
  color: var(--muted);
  font-size: 10px;
}

.source-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.source-dot::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 9px rgba(109, 246, 189, 0.65);
  content: "";
}

.card-action {
  color: var(--accent);
  font-weight: 750;
}

.empty-state {
  display: flex;
  min-height: 240px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 17px;
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: 20px;
}

.empty-state[hidden] {
  display: none;
}

.resource-cta {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  margin-top: 55px;
  padding: 31px;
  overflow: hidden;
  border: 1px solid rgba(109, 246, 189, 0.16);
  border-radius: 23px;
  background:
    radial-gradient(circle at 80% 20%, rgba(109, 246, 189, 0.12), transparent 34%),
    linear-gradient(145deg, rgba(17, 37, 38, 0.94), rgba(8, 19, 24, 0.96));
  box-shadow: var(--shadow);
}

.resource-cta p:not(.eyebrow) {
  max-width: 680px;
  margin: 9px 0 0;
  color: var(--muted-strong);
  font-size: 12px;
  line-height: 1.7;
}

footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 30px;
  padding: 35px 4px 45px;
  color: #647b8b;
  font-size: 10px;
  line-height: 1.7;
}

footer p {
  margin: 0;
}

footer p:first-child {
  max-width: 720px;
}

dialog {
  color: var(--text);
  border: 0;
  outline: 0;
}

dialog::backdrop {
  background: rgba(1, 6, 9, 0.78);
  backdrop-filter: blur(9px);
}

.game-dialog {
  width: min(850px, calc(100% - 28px));
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(166, 230, 255, 0.16);
  border-radius: 25px;
  background: #0d1921;
  box-shadow: 0 32px 110px rgba(0, 0, 0, 0.6);
}

.game-dialog[open] {
  display: grid;
  grid-template-columns: 0.75fr 1.25fr;
  animation: dialog-in 180ms ease-out;
}

@keyframes dialog-in {
  from { opacity: 0; transform: translateY(12px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.dialog-close {
  position: absolute;
  z-index: 3;
  top: 13px;
  right: 13px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--muted-strong);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: rgba(4, 10, 14, 0.6);
  cursor: pointer;
  font-size: 20px;
}

.dialog-cover {
  position: relative;
  display: grid;
  min-height: 100%;
  place-items: center;
  overflow: hidden;
  color: #07150f;
  background: linear-gradient(145deg, #9affd1, #5cd8a9);
  font-size: 67px;
  font-weight: 850;
}

.dialog-cover::after {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 25% 15%, rgba(255, 255, 255, 0.35), transparent 28%);
  content: "";
}

.dialog-cover span {
  position: relative;
  z-index: 1;
}

.dialog-content {
  padding: 31px;
}

.dialog-content h2 {
  margin: 14px 0 10px;
  font-size: 28px;
  letter-spacing: -0.04em;
}

.dialog-description {
  margin-bottom: 22px;
  color: var(--muted-strong);
  font-size: 13px;
  line-height: 1.8;
}

.resource-box {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.025);
}

.resource-box-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 13px;
  font-size: 12px;
  font-weight: 700;
}

.resource-status {
  padding: 4px 7px;
  color: var(--accent);
  border-radius: 7px;
  background: rgba(109, 246, 189, 0.07);
  font-size: 9px;
}

.resource-action {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-top: 8px;
  padding: 0 14px;
  color: var(--muted-strong);
  border: 1px solid var(--border);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.035);
  font-size: 12px;
  font-weight: 650;
  transition: 150ms ease;
}

.resource-action:hover {
  color: var(--text);
  border-color: rgba(109, 246, 189, 0.28);
}

.resource-action.is-primary {
  color: #05130e;
  border-color: #87f9c9;
  background: linear-gradient(135deg, #93ffd0, #5edfaf);
}

.resource-action[hidden] {
  display: none;
}

.code-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  margin-top: 9px;
  padding: 9px 10px 9px 13px;
  color: var(--muted);
  border: 1px dashed rgba(109, 246, 189, 0.24);
  border-radius: 10px;
  font-size: 11px;
}

.code-row[hidden] {
  display: none;
}

.code-row code {
  color: var(--accent);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.code-row button {
  height: 29px;
  padding: 0 10px;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  font-size: 10px;
}

.not-configured {
  margin-top: 9px;
  padding: 13px;
  color: var(--warn);
  border: 1px dashed rgba(255, 212, 119, 0.22);
  border-radius: 10px;
  background: rgba(255, 212, 119, 0.045);
  font-size: 11px;
}

.not-configured[hidden] {
  display: none;
}

.not-configured b {
  display: block;
  margin-bottom: 4px;
}

.not-configured p {
  margin: 0;
  color: #9f946f;
  line-height: 1.5;
}

.legal-dialog {
  width: min(570px, calc(100% - 28px));
  padding: 31px;
  border: 1px solid rgba(166, 230, 255, 0.16);
  border-radius: 23px;
  background: #0d1921;
  box-shadow: 0 32px 110px rgba(0, 0, 0, 0.6);
}

.legal-dialog h2 {
  margin: 0 0 18px;
  font-size: 25px;
}

.legal-dialog ul {
  display: grid;
  gap: 13px;
  margin: 0;
  padding-left: 21px;
  color: var(--muted-strong);
  font-size: 12px;
  line-height: 1.75;
}

.legal-dialog .dialog-close {
  top: 16px;
  right: 16px;
}

.toast {
  position: fixed;
  z-index: 20;
  right: 23px;
  bottom: 23px;
  padding: 12px 16px;
  color: #07150f;
  border-radius: 11px;
  background: var(--accent);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.4);
  font-size: 12px;
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.dialog-cover[data-theme="mint"] { color: #071811; background: linear-gradient(145deg, #9affd1, #4ed7a9); }
.dialog-cover[data-theme="orange"] { color: #241000; background: linear-gradient(145deg, #ffda83, #ff9e5f); }
.dialog-cover[data-theme="sky"] { color: #031620; background: linear-gradient(145deg, #9bdcff, #5cb9ef); }
.dialog-cover[data-theme="ice"] { color: #041823; background: linear-gradient(145deg, #d6f7ff, #78cdef); }
.dialog-cover[data-theme="lime"] { color: #102006; background: linear-gradient(145deg, #d4ff83, #7fd952); }
.dialog-cover[data-theme="blue"] { color: #03142b; background: linear-gradient(145deg, #a2c4ff, #678ee9); }
.dialog-cover[data-theme="pink"] { color: #2b0b21; background: linear-gradient(145deg, #ffc2eb, #ed83c8); }
.dialog-cover[data-theme="violet"] { color: #16082b; background: linear-gradient(145deg, #d7c8ff, #9c82f0); }

@media (max-width: 1000px) {
  .game-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .hero {
    gap: 30px;
  }
}

@media (max-width: 780px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 48px;
  }

  .hero-panel {
    min-height: 350px;
  }

  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .search-box {
    min-width: 0;
  }

  .category-list {
    justify-content: flex-start;
  }

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

  .game-dialog[open] {
    grid-template-columns: 1fr;
  }

  .dialog-cover {
    min-height: 155px;
  }
}

@media (max-width: 540px) {
  .topbar,
  main,
  footer {
    width: min(100% - 22px, 1180px);
  }

  .topbar {
    padding-top: 16px;
  }

  .brand small {
    display: none;
  }

  .hero {
    padding: 38px 0 39px;
  }

  .hero h1 {
    font-size: 43px;
  }

  .hero-panel {
    min-height: 325px;
    padding: 17px;
  }

  .hero-panel-bottom {
    gap: 15px;
  }

  .hero-panel-bottom b {
    font-size: 14px;
  }

  .hero-panel-bottom span {
    font-size: 9px;
  }

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

  .game-open {
    min-height: 300px;
  }

  .resource-cta,
  footer {
    align-items: stretch;
    flex-direction: column;
  }

  .dialog-content,
  .legal-dialog {
    padding: 23px;
  }

  .dialog-content h2 {
    font-size: 24px;
  }

  .legal-dialog .dialog-close,
  .dialog-close {
    top: 11px;
    right: 11px;
  }
}

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

.top-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--muted-strong);
  font-size: 12px;
}

.top-nav > a:not(.top-link):hover {
  color: var(--accent);
}

.cta-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
}

.affiliate-button {
  position: relative;
  gap: 10px;
}

.affiliate-button small {
  padding: 3px 5px;
  color: #33570f;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.48);
  font-size: 8px;
  font-weight: 850;
}

.affiliate-disclosure {
  margin: 12px 2px 0;
  color: #7f918f;
  font-size: 10px;
  line-height: 1.7;
}

.affiliate-disclosure[hidden],
.affiliate-button[hidden] {
  display: none;
}

footer > div {
  display: grid;
  gap: 5px;
}

.footer-links {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 14px;
}

.footer-links a:hover {
  color: var(--accent);
}

.page-shell {
  width: min(920px, calc(100% - 40px));
  margin: 0 auto;
  padding: 58px 0 80px;
}

.page-card {
  padding: clamp(22px, 5vw, 48px);
  border: 1px solid var(--border);
  border-radius: 25px;
  background: linear-gradient(155deg, rgba(18, 33, 42, 0.96), rgba(7, 15, 21, 0.98));
  box-shadow: var(--shadow);
}

.page-card h1 {
  margin: 0 0 10px;
  font-size: clamp(34px, 6vw, 56px);
  line-height: 1.04;
  letter-spacing: -0.055em;
}

.page-card h2 {
  margin: 34px 0 10px;
  font-size: 20px;
}

.page-card p,
.page-card li {
  color: var(--muted-strong);
  font-size: 13px;
  line-height: 1.9;
}

.page-card ul,
.page-card ol {
  display: grid;
  gap: 8px;
  padding-left: 22px;
}

.page-meta {
  margin: 0 0 25px;
  color: var(--muted);
  font-size: 11px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 24px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.game-detail-layout {
  display: grid;
  grid-template-columns: 0.72fr 1.28fr;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 26px;
  background: linear-gradient(155deg, rgba(18, 33, 42, 0.97), rgba(7, 15, 21, 0.98));
  box-shadow: var(--shadow);
}

.game-detail-cover {
  display: grid;
  min-height: 500px;
  place-items: center;
  color: #071811;
  background: linear-gradient(145deg, #9affd1, #4ed7a9);
  font-size: 86px;
  font-weight: 850;
  letter-spacing: -0.06em;
}

.game-detail-cover[data-theme="orange"] { color: #241000; background: linear-gradient(145deg, #ffda83, #ff9e5f); }
.game-detail-cover[data-theme="sky"] { color: #031620; background: linear-gradient(145deg, #9bdcff, #5cb9ef); }
.game-detail-cover[data-theme="ice"] { color: #041823; background: linear-gradient(145deg, #d6f7ff, #78cdef); }
.game-detail-cover[data-theme="lime"] { color: #102006; background: linear-gradient(145deg, #d4ff83, #7fd952); }
.game-detail-cover[data-theme="blue"] { color: #03142b; background: linear-gradient(145deg, #a2c4ff, #678ee9); }
.game-detail-cover[data-theme="pink"] { color: #2b0b21; background: linear-gradient(145deg, #ffc2eb, #ed83c8); }
.game-detail-cover[data-theme="violet"] { color: #16082b; background: linear-gradient(145deg, #d7c8ff, #9c82f0); }

.game-detail-content {
  padding: clamp(24px, 4.5vw, 46px);
}

.game-detail-content h1 {
  margin: 17px 0 12px;
  font-size: clamp(34px, 5vw, 55px);
  letter-spacing: -0.055em;
}

.game-detail-description {
  margin-bottom: 25px;
  color: var(--muted-strong);
  font-size: 14px;
  line-height: 1.9;
}

.facts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin: 22px 0;
}

.fact {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.025);
}

.fact span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 9px;
}

.fact b {
  font-size: 12px;
}

.detail-actions {
  display: grid;
  gap: 9px;
  margin-top: 17px;
}

.detail-action {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 15px;
  color: var(--muted-strong);
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  font-size: 12px;
  font-weight: 700;
}

.detail-action:hover {
  color: var(--text);
  border-color: rgba(109, 246, 189, 0.27);
}

.detail-action.is-primary {
  color: #05130e;
  border-color: #87f9c9;
  background: linear-gradient(135deg, #93ffd0, #5edfaf);
}

.detail-action small {
  color: inherit;
  font-size: 9px;
  opacity: 0.72;
}

.pending-box {
  margin-top: 12px;
  padding: 13px;
  color: var(--warn);
  border: 1px dashed rgba(255, 212, 119, 0.22);
  border-radius: 10px;
  background: rgba(255, 212, 119, 0.045);
  font-size: 11px;
  line-height: 1.6;
}

.disclosure-box {
  margin-top: 15px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.7;
}

@media (max-width: 780px) {
  .top-nav > a:not(.top-link) {
    display: none;
  }

  .game-detail-layout {
    grid-template-columns: 1fr;
  }

  .game-detail-cover {
    min-height: 220px;
  }
}

@media (max-width: 540px) {
  .page-shell {
    width: min(100% - 22px, 920px);
    padding-top: 35px;
  }

  .game-detail-cover {
    font-size: 58px;
  }

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

  .cta-actions,
  .footer-links {
    width: 100%;
    align-items: stretch;
    justify-content: flex-start;
    flex-direction: column;
  }
}

/* Bright, friendly theme for students and parents. */
:root {
  color-scheme: light;
  --bg: #fff8ef;
  --panel: rgba(255, 255, 255, 0.96);
  --panel-strong: #ffffff;
  --border: rgba(36, 91, 125, 0.13);
  --text: #17364d;
  --muted: #71899a;
  --muted-strong: #486b80;
  --accent: #16b77a;
  --accent-dark: #087552;
  --blue: #2f9cff;
  --violet: #8267ee;
  --warn: #d88500;
  --danger: #e94f62;
  --shadow: 0 20px 60px rgba(46, 104, 135, 0.12);
}

html {
  background: #fff8ef;
}

body {
  color: var(--text);
  background:
    radial-gradient(circle at 7% 2%, rgba(65, 190, 255, 0.18), transparent 28rem),
    radial-gradient(circle at 96% 8%, rgba(255, 179, 85, 0.18), transparent 28rem),
    radial-gradient(circle at 50% 100%, rgba(55, 211, 151, 0.12), transparent 34rem),
    #fff8ef;
}

body::before {
  background-image:
    linear-gradient(rgba(46, 112, 145, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(46, 112, 145, 0.035) 1px, transparent 1px);
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.55), transparent 82%);
}

.orb {
  opacity: 0.13;
}

.brand-icon {
  color: #ffffff;
  background: linear-gradient(145deg, #2f9cff, #13b97c);
  box-shadow: 0 10px 25px rgba(47, 156, 255, 0.25);
}

.brand b {
  color: #17364d;
}

.brand small,
.top-nav {
  color: #668294;
}

.top-link,
.secondary-button {
  color: #486b80;
  border-color: rgba(36, 91, 125, 0.14);
  background: rgba(255, 255, 255, 0.78);
}

.top-link:hover,
.secondary-button:hover {
  color: #087552;
  border-color: rgba(22, 183, 122, 0.32);
  background: #effbf6;
}

.eyebrow {
  color: #0ca36d;
}

.hero h1 {
  color: #17364d;
}

.hero h1 span {
  background: linear-gradient(100deg, #119c69 0%, #2f9cff 55%, #8267ee 100%);
  background-clip: text;
  -webkit-background-clip: text;
}

.hero-description {
  color: #527285;
}

.primary-button {
  color: #ffffff;
  border-color: #119f6c;
  background: linear-gradient(135deg, #19c383, #109f6c);
  box-shadow: 0 12px 28px rgba(22, 183, 122, 0.22);
}

.hero-panel {
  border-color: rgba(47, 156, 255, 0.18);
  background:
    radial-gradient(circle at 75% 30%, rgba(110, 203, 255, 0.22), transparent 48%),
    linear-gradient(145deg, #ffffff, #edf9ff);
  box-shadow: 0 24px 70px rgba(47, 120, 158, 0.14), inset 0 1px #ffffff;
}

.hero-panel-top,
.hero-panel-bottom {
  color: #698696;
}

.hero-panel-bottom b {
  color: #17364d;
}

.pixel-track::before {
  background: linear-gradient(90deg, transparent, rgba(47, 156, 255, 0.4), transparent);
}

.toolbar {
  border-color: rgba(36, 91, 125, 0.12);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 16px 45px rgba(43, 105, 137, 0.1);
}

.search-box input {
  color: #17364d;
  border-color: rgba(36, 91, 125, 0.13);
  background: #f8fcff;
}

.search-box input::placeholder {
  color: #91a5b1;
}

.search-box button {
  color: #5f7e91;
  background: #eaf4f9;
}

.category-button {
  color: #5c7889;
}

.category-button:hover,
.category-button.is-active {
  color: #087552;
  border-color: rgba(22, 183, 122, 0.24);
  background: #eafaf3;
}

.section-heading > p,
.source-dot {
  color: #6f8998;
}

.game-open {
  color: #17364d;
  border-color: rgba(36, 91, 125, 0.12);
  background: #ffffff;
  box-shadow: 0 14px 38px rgba(42, 101, 132, 0.1), inset 0 1px #ffffff;
}

.game-open:hover {
  border-color: rgba(22, 183, 122, 0.32);
  box-shadow: 0 22px 55px rgba(42, 101, 132, 0.16);
}

.game-cover {
  border-bottom-color: rgba(36, 91, 125, 0.08);
}

.tag {
  color: #557486;
  border-color: rgba(36, 91, 125, 0.12);
  background: #f3f9fc;
}

.tag.age {
  color: #087552;
  border-color: rgba(22, 183, 122, 0.22);
  background: #eafaf3;
}

.card-body p {
  color: #70899a;
}

.card-action {
  color: #0ba26d;
}

.empty-state {
  color: #738b9b;
  border-color: rgba(36, 91, 125, 0.16);
  background: rgba(255, 255, 255, 0.55);
}

.resource-cta {
  border-color: rgba(22, 183, 122, 0.2);
  background:
    radial-gradient(circle at 84% 10%, rgba(255, 188, 93, 0.2), transparent 34%),
    linear-gradient(145deg, #ffffff, #eefbf6);
  box-shadow: 0 20px 60px rgba(46, 104, 135, 0.12);
}

.resource-cta p:not(.eyebrow) {
  color: #607d8d;
}

.affiliate-disclosure {
  color: #768c99;
}

footer {
  color: #7d929e;
}

.footer-links a:hover,
.top-nav > a:not(.top-link):hover {
  color: #087552;
}

.page-card,
.game-detail-layout {
  border-color: rgba(36, 91, 125, 0.13);
  background: #ffffff;
  box-shadow: 0 20px 60px rgba(46, 104, 135, 0.12);
}

.page-card h1,
.page-card h2,
.game-detail-content h1 {
  color: #17364d;
}

.page-card p,
.page-card li,
.game-detail-description {
  color: #567485;
}

.page-meta {
  color: #7f95a2;
}

.back-link {
  color: #0b9b6a;
}

.fact {
  border-color: rgba(36, 91, 125, 0.12);
  background: #f7fbfd;
}

.fact span {
  color: #7890a0;
}

.fact b {
  color: #17364d;
}

.detail-action {
  color: #486b80;
  border-color: rgba(36, 91, 125, 0.13);
  background: #f8fcff;
}

.detail-action:hover {
  color: #087552;
  border-color: rgba(22, 183, 122, 0.3);
}

.detail-action.is-primary {
  color: #ffffff;
  border-color: #119f6c;
  background: linear-gradient(135deg, #19c383, #109f6c);
}

.pending-box {
  color: #9a6800;
  border-color: rgba(216, 133, 0, 0.23);
  background: #fff8e7;
}

.disclosure-box {
  color: #768c99;
}

.toast {
  color: #ffffff;
  background: #109f6c;
}
