:root {
  --md-sys-color-primary-light: #6750a4;
  --md-sys-color-on-primary-light: #ffffff;
  --md-sys-color-primary-container-light: #eaddff;
  --md-sys-color-on-primary-container-light: #21005d;
  --md-sys-color-secondary-container-light: #e8def8;
  --md-sys-color-on-secondary-container-light: #1d192b;
  --md-sys-color-tertiary-light: #7d5260;
  --md-sys-color-on-tertiary-light: #ffffff;
  --md-sys-color-background-light: #fffbfe;
  --md-sys-color-on-background-light: #1c1b1f;
  --md-sys-color-surface-light: #fffbfe;
  --md-sys-color-on-surface-light: #1c1b1f;
  --md-sys-color-surface-variant-light: #e7e0ec;
  --md-sys-color-on-surface-variant-light: #49454f;
  --md-sys-color-outline-light: #79747e;
  --md-sys-color-scrim-light: rgba(0, 0, 0, 0.5);

  --md-sys-color-primary-dark: #d0bcff;
  --md-sys-color-on-primary-dark: #381e72;
  --md-sys-color-primary-container-dark: #4f378b;
  --md-sys-color-on-primary-container-dark: #eaddff;
  --md-sys-color-secondary-container-dark: #4a4458;
  --md-sys-color-on-secondary-container-dark: #e8def8;
  --md-sys-color-tertiary-dark: #efb8c8;
  --md-sys-color-on-tertiary-dark: #492532;
  --md-sys-color-background-dark: #1c1b1f;
  --md-sys-color-on-background-dark: #e6e1e5;
  --md-sys-color-surface-dark: #1c1b1f;
  --md-sys-color-on-surface-dark: #e6e1e5;
  --md-sys-color-surface-variant-dark: #49454f;
  --md-sys-color-on-surface-variant-dark: #cac4d0;
  --md-sys-color-outline-dark: #938f99;
  --md-sys-color-scrim-dark: rgba(0, 0, 0, 0.6);

  --md-sys-font-family: "googlesans", "Roboto", sans-serif;
  --md-sys-motion-easing-standard: cubic-bezier(0.4, 0, 0.2, 1);
  --md-sys-motion-duration-short: 150ms;
  --md-sys-motion-duration-medium: 300ms;
}

@font-face {
  font-family: "googlesans";
  src: url(fonts/googlesans.ttf);
}

body {
  --md-sys-color-primary: var(--md-sys-color-primary-light);
  --md-sys-color-primary-container: var(--md-sys-color-primary-container-light);
  --md-sys-color-on-primary-container: var(
    --md-sys-color-on-primary-container-light
  );
  --md-sys-color-secondary-container: var(
    --md-sys-color-secondary-container-light
  );
  --md-sys-color-on-secondary-container: var(
    --md-sys-color-on-secondary-container-light
  );
  --md-sys-color-tertiary: var(--md-sys-color-tertiary-light);
  --md-sys-color-background: var(--md-sys-color-background-light);
  --md-sys-color-on-background: var(--md-sys-color-on-background-light);
  --md-sys-color-surface: var(--md-sys-color-surface-light);
  --md-sys-color-on-surface: var(--md-sys-color-on-surface-light);
  --md-sys-color-surface-variant: var(--md-sys-color-surface-variant-light);
  --md-sys-color-on-surface-variant: var(
    --md-sys-color-on-surface-variant-light
  );
  --md-sys-color-outline: var(--md-sys-color-outline-light);
  --md-sys-color-scrim: var(--md-sys-color-scrim-light);
}

body.dark-theme {
  --md-sys-color-primary: var(--md-sys-color-primary-dark);
  --md-sys-color-primary-container: var(--md-sys-color-primary-container-dark);
  --md-sys-color-on-primary-container: var(
    --md-sys-color-on-primary-container-dark
  );
  --md-sys-color-secondary-container: var(
    --md-sys-color-secondary-container-dark
  );
  --md-sys-color-on-secondary-container: var(
    --md-sys-color-on-secondary-container-dark
  );
  --md-sys-color-tertiary: var(--md-sys-color-tertiary-dark);
  --md-sys-color-background: var(--md-sys-color-background-dark);
  --md-sys-color-on-background: var(--md-sys-color-on-background-dark);
  --md-sys-color-surface: var(--md-sys-color-surface-dark);
  --md-sys-color-on-surface: var(--md-sys-color-on-surface-dark);
  --md-sys-color-surface-variant: var(--md-sys-color-surface-variant-dark);
  --md-sys-color-on-surface-variant: var(
    --md-sys-color-on-surface-variant-dark
  );
  --md-sys-color-outline: var(--md-sys-color-outline-dark);
  --md-sys-color-scrim: var(--md-sys-color-scrim-dark);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  scroll-behavior: smooth;
}
body {
  width: 100%;
  height: 100vh;
  overflow-x: hidden;
  font-family: var(--md-sys-font-family);
  background-color: var(--md-sys-color-background);
  color: var(--md-sys-color-on-background);
  transition: background-color var(--md-sys-motion-duration-medium);
  display: flex;
}

::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}
::-webkit-scrollbar-track {
  background: var(--md-sys-color-surface-variant);
}
::-webkit-scrollbar-thumb {
  background-color: var(--md-sys-color-outline);
  border-radius: 10px;
  border: 3px solid var(--md-sys-color-surface-variant);
}
::-webkit-scrollbar-thumb:hover {
  background-color: var(--md-sys-color-on-surface-variant);
}
::-webkit-scrollbar-corner {
  background: transparent;
}

::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background-color: var(--md-sys-color-outline);
  border-radius: 10px;
  border: 3px solid var(--md-sys-color-background);
}
::-webkit-scrollbar-thumb:hover {
  background-color: var(--md-sys-color-on-surface-variant);
}
::-webkit-scrollbar-corner {
  background: transparent;
}

.navbar {
  width: 300px;
  height: 100vh;
  background-color: var(--md-sys-color-surface);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: fixed;
  top: 0;
  left: 0;
  flex-shrink: 0;
  transition: transform 0.3s ease,
    background-color var(--md-sys-motion-duration-medium);
  z-index: 100;
  overflow-y: auto;
}
.page-wrapper {
  display: flex;
  flex-grow: 1;
  margin-left: 300px;
  height: 100%;
  transition: margin-left 0.3s ease, transform 0.3s ease;
}
.main-content-wrapper {
  flex-grow: 1;
  padding: 24px 32px;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.navbar-header {
  font-size: 1.5em;
  font-weight: 500;
  color: var(--md-sys-color-on-surface);
  padding: 12px 8px 0 8px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--md-sys-color-on-surface-variant);
  font-size: 1.1em;
  font-weight: 400;
  padding: 16px 24px;
  border-radius: 50px;
  margin: 0 12px 8px 12px;
  transition: all var(--md-sys-motion-duration-short)
    var(--md-sys-motion-easing-standard);
}
.nav-link.back-button {
  background-color: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
  font-weight: 700;
}
.nav-link:hover {
  background-color: var(--md-sys-color-secondary-container);
}

.main-header {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: 16px;
  gap: 8px;
}
.content-card {
  background-color: var(--md-sys-color-surface-variant);
  padding: 32px;
  border-radius: 28px;
  flex-grow: 1;
  transition: background-color var(--md-sys-motion-duration-medium);
  overflow-y: auto;
}
#content-container h1 {
  color: var(--md-sys-color-on-surface);
  font-size: 3.2em;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 24px;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-top: 24px;
}
.game-card {
  background-color: var(--md-sys-color-surface);
  border-radius: 16px;
  padding: 24px;
  text-decoration: none;
  color: var(--md-sys-color-on-surface);
  transition: transform var(--md-sys-motion-duration-short),
    box-shadow var(--md-sys-motion-duration-short);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.game-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.game-card .material-symbols-outlined {
  font-size: 48px;
  color: var(--md-sys-color-primary);
  margin-bottom: 16px;
}
.game-card h3 {
  margin-top: 0;
  margin-bottom: 8px;
}
.game-card p {
  color: var(--md-sys-color-on-surface-variant);
  flex-grow: 1;
}
.game-card.disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background-color: var(--md-sys-color-surface-variant);
}
.game-card.disabled:hover {
  transform: none;
  box-shadow: none;
}
.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: none;
  background: none;
  border-radius: 50%;
  cursor: pointer;
  color: var(--md-sys-color-on-surface-variant);
  position: relative;
  overflow: hidden;
}
.theme-switcher {
  display: flex;
  border-radius: 50px;
  border: 1px solid var(--md-sys-color-outline);
  overflow: hidden;
  background-color: var(--md-sys-color-surface-variant);
}
.theme-switcher .icon-btn {
  width: 56px;
  height: 40px;
  border-radius: 0;
  background-color: transparent;
  color: var(--md-sys-color-on-surface-variant);
}
.theme-switcher .icon-btn:first-child {
  border-right: 1px solid var(--md-sys-color-outline);
}
.theme-switcher .icon-btn.active {
  background-color: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
}

.menu-btn {
  display: none;
}

.navbar-overlay {
  position: fixed;
  inset: 0;
  background-color: var(--md-sys-color-scrim);
  z-index: 99;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

body.navbar-open .navbar-overlay {
  opacity: 1;
  pointer-events: auto;
}
@media (max-width: 1200px) {
  .navbar {
    width: 280px;
  }
  .page-wrapper {
    margin-left: 280px;
  }
}

@media (max-width: 992px) {
  .menu-btn {
    display: flex;
  }
  .main-header {
    justify-content: space-between;
  }
  .navbar {
    transform: translateX(-100%);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
  }
  body.navbar-open .navbar {
    transform: translateX(0);
  }
  body.navbar-open .page-wrapper {
    transform: translateX(280px);
  }
  .page-wrapper {
    margin-left: 0;
  }
  .main-content-wrapper {
    padding: 16px;
  }
  .content-card {
    padding: 24px;
  }
  #content-container h1 {
    font-size: 2.2em;
  }
  #content-container p {
    font-size: 1em;
  }
}

@media (max-width: 480px) {
  #content-container h1 {
    font-size: 1.8em;
  }
  .main-header {
    gap: 4px;
  }
  .game-grid {
    grid-template-columns: 1fr;
  }
}
