:root {
  color-scheme: dark;
  --doge-bg: #080d1a;
  --doge-surface: #111a2d;
  --doge-surface-raised: #18243c;
  --doge-border: rgba(148, 163, 184, 0.2);
  --doge-text: #eef2ff;
  --doge-muted: #a5b2c7;
  --doge-accent: #a99aff;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
  background: var(--doge-bg);
}

body {
  min-height: 100vh;
  margin: 0 !important;
  padding: 0 !important;
  color: var(--doge-text) !important;
  background:
    radial-gradient(ellipse at 12% 0%, rgba(91, 76, 209, 0.2), transparent 35rem),
    radial-gradient(ellipse at 92% 12%, rgba(18, 153, 190, 0.12), transparent 32rem),
    var(--doge-bg) !important;
}

body > header,
body header.sticky {
  top: 0 !important;
  margin-top: 0 !important;
  color: var(--doge-text) !important;
  border-color: var(--doge-border) !important;
  background: rgba(8, 13, 26, 0.9) !important;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

body header :not(.material-symbols-outlined) {
  font-family: Inter, "Public Sans", system-ui, sans-serif !important;
  font-style: normal !important;
}

body header h1,
body header :is(.text-slate-900, .text-slate-800, .text-gray-900) {
  color: #f8faff !important;
}

body header h1 {
  font-size: 24px !important;
  font-weight: 800 !important;
  letter-spacing: -0.025em;
  line-height: 1.2 !important;
}

body header nav a {
  color: #dbe4f5 !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  line-height: 1.4 !important;
  transition: color 180ms ease;
}

body header nav a:not([aria-current="page"]):hover {
  color: var(--doge-accent) !important;
}

body header nav a[aria-current="page"] {
  color: #c4b5fd !important;
  text-shadow: 0 0 16px rgba(169, 154, 255, 0.28);
}

@media (max-width: 1023px) {
  body header > div {
    flex-wrap: wrap;
    gap: 12px;
  }

  body header nav {
    display: flex !important;
    flex: 1 0 100%;
    order: 2;
    gap: 18px;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 2px 0 5px;
    scrollbar-width: none;
  }

  body header nav::-webkit-scrollbar {
    display: none;
  }

  body header nav a {
    flex: 0 0 auto;
    white-space: nowrap;
  }
}

body main :is(h1, h2, h3, h4, h5, h6) {
  color: var(--doge-text) !important;
}

body main :is(.text-slate-900, .text-slate-800, .text-slate-700, .text-gray-900, .text-gray-800, .text-blue-900) {
  color: var(--doge-text) !important;
}

body main :is(.text-slate-600, .text-slate-500, .text-slate-400, .text-gray-700, .text-gray-600, .text-gray-500) {
  color: var(--doge-muted) !important;
}

body main :is(.bg-white, .bg-white\/80, .bg-slate-50, .bg-slate-100, .bg-gray-50, .bg-gray-100) {
  color: var(--doge-text) !important;
  border-color: var(--doge-border) !important;
  background: linear-gradient(145deg, rgba(24, 36, 60, 0.96), rgba(13, 21, 37, 0.98)) !important;
  box-shadow:
    0 2px 0 rgba(255, 255, 255, 0.05) inset,
    0 8px 0 rgba(5, 9, 18, 0.48),
    0 22px 44px rgba(0, 0, 0, 0.28);
}

body main .game-container {
  border: 1px solid rgba(169, 154, 255, 0.28);
  background: rgba(9, 16, 30, 0.86) !important;
  border-color: rgba(169, 154, 255, 0.32);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.3);
}

body main .game-container .grid-cell {
  border-radius: 8px;
  background: rgba(148, 163, 184, 0.16) !important;
}

body main .game-container.bg-white {
  color: var(--doge-text) !important;
  border: 1px solid var(--doge-border);
  background: linear-gradient(145deg, #18243c, #0d1525) !important;
}

body main .game-container :is(.text-gray-900, .text-gray-800, .text-slate-900) {
  color: var(--doge-text) !important;
}

body main .game-container :is(.text-gray-700, .text-gray-600, .text-gray-500) {
  color: var(--doge-muted) !important;
}

body main .doge-game-width {
  color: var(--doge-text);
}

body main .doge-game-width .game-explanation,
body main .doge-game-width p {
  color: var(--doge-muted);
}

body main .doge-game-width a:not(.restart-button):not(.keep-playing-button):not(.retry-button) {
  color: #c4b5fd;
}

body main .games-heading {
  margin: 32px auto 18px;
  color: var(--doge-text) !important;
  text-align: center;
}

body main .games {
  gap: 18px;
  padding: 18px;
}

body main .games .game-tile {
  overflow: hidden;
  border: 1px solid var(--doge-border);
  border-radius: 18px;
  background: linear-gradient(145deg, #18243c, #0d1525);
  box-shadow:
    0 2px 0 rgba(255, 255, 255, 0.05) inset,
    0 7px 0 rgba(5, 9, 18, 0.45),
    0 18px 34px rgba(0, 0, 0, 0.25);
  transition: transform 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}

body main .games .game-tile:hover {
  border-color: rgba(169, 154, 255, 0.58);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35), 0 0 22px rgba(110, 94, 240, 0.14);
  transform: translateY(-4px);
}

body main .games .game-tile a {
  color: #e8edf7;
}

body main .game-intro,
body main .important {
  color: #e8edf7;
}

body.doge-meme2048-page,
body.doge-meme2048-page :not(.material-symbols-outlined) {
  font-family: Inter, "Public Sans", system-ui, sans-serif !important;
}

body.doge-meme2048-page {
  font-size: 16px !important;
  line-height: 1.55;
}

body.doge-meme2048-page .doge-game-width {
  width: min(500px, calc(100vw - 32px)) !important;
}

body.doge-meme2048-page .doge-game-width .heading {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  margin-top: 24px;
}

body.doge-meme2048-page .doge-game-width .title {
  float: none;
  width: 100%;
  margin: 0;
}

body.doge-meme2048-page .doge-game-width .scores-container {
  float: none;
  align-self: flex-end;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 8px;
}

body.doge-meme2048-page .doge-game-width .above-game {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

body.doge-meme2048-page .doge-game-width .game-intro {
  float: none;
  flex: 1 1 auto;
  width: auto;
}

body.doge-meme2048-page .doge-game-width .restart-button {
  float: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: auto;
  height: 52px;
  margin: 0;
  padding: 0 18px;
  border: 1px solid rgba(196, 181, 253, 0.35);
  border-radius: 12px;
  background: linear-gradient(145deg, #8b7bff, #5143b1);
  box-shadow: 0 4px 0 #352a91, 0 10px 20px rgba(101, 82, 220, 0.25);
  line-height: 1 !important;
  text-align: center;
}

body.doge-meme2048-page .doge-game-width .score-container,
body.doge-meme2048-page .doge-game-width .best-container {
  box-sizing: border-box;
  display: inline-flex;
  align-items: flex-end;
  justify-content: center;
  width: 76px;
  min-width: 76px;
  height: 64px;
  padding: 22px 8px 7px;
  line-height: 1 !important;
  vertical-align: top;
  border: 1px solid rgba(169, 154, 255, 0.35);
  border-radius: 12px;
  background: linear-gradient(145deg, #30295f, #1b2140);
  box-shadow: 0 4px 0 #141832, 0 9px 20px rgba(0, 0, 0, 0.25);
}

body.doge-meme2048-page .doge-game-width .score-container::after,
body.doge-meme2048-page .doge-game-width .best-container::after {
  top: 6px;
  color: #c4b5fd;
  line-height: 12px !important;
}

body.doge-meme2048-page .doge-game-width .game-container {
  margin-right: auto;
  margin-left: auto;
}

body.doge-meme2048-page .doge-game-width .title {
  font-size: clamp(26px, 5vw, 36px) !important;
  line-height: 1.2 !important;
}

body.doge-meme2048-page .doge-game-width .game-intro,
body.doge-meme2048-page .doge-game-width .game-explanation {
  font-size: 16px !important;
  line-height: 1.6 !important;
}

body.doge-meme2048-page .doge-game-width .restart-button,
body.doge-meme2048-page .doge-game-width .game-message .lower a {
  font-size: 14px !important;
  line-height: 1.35 !important;
}

body.doge-meme2048-page .doge-game-width .score-container,
body.doge-meme2048-page .doge-game-width .best-container {
  font-size: 24px !important;
}

body.doge-meme2048-page .doge-game-width .score-container::after,
body.doge-meme2048-page .doge-game-width .best-container::after {
  font-size: 12px !important;
}

body.doge-meme2048-page .doge-game-width .game-message p {
  font-size: clamp(32px, 8vw, 52px) !important;
  line-height: 1.15 !important;
}

body.doge-meme2048-page main > section h2 {
  font-size: clamp(22px, 4vw, 28px) !important;
  line-height: 1.25 !important;
}

body.doge-meme2048-page main > section p {
  font-size: 16px !important;
  line-height: 1.65 !important;
}

body.doge-meme2048-page main > section p.text-sm {
  font-size: 14px !important;
}

body.doge-meme2048-page footer h2 {
  font-size: 20px !important;
  line-height: 1.3 !important;
}

body.doge-meme2048-page footer h3 {
  font-size: 16px !important;
  line-height: 1.4 !important;
}

body.doge-meme2048-page footer :is(p, a) {
  font-size: 14px !important;
  line-height: 1.5 !important;
}

body footer {
  color: var(--doge-muted) !important;
  border-color: var(--doge-border) !important;
  background: #070b14 !important;
}

body footer :is(h1, h2, h3, h4, h5, h6) {
  color: var(--doge-text) !important;
}

body footer :is(p, li, a) {
  color: var(--doge-muted) !important;
}

body footer a:hover {
  color: var(--doge-accent) !important;
}

body :focus-visible {
  outline: 2px solid #c4b5fd;
  outline-offset: 3px;
}

@keyframes doge-page-enter {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

body main > section,
body main > .container {
  animation: doge-page-enter 460ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
