/* Home page: full-screen illustrated background with a floating menu card. */

body.home {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: clip;
  background: transparent;
}

body.home::before {
  content: "";
  position: fixed;
  z-index: -2;
  inset: 0;
  background: url("../../assets/images/ui/home-bg.jpg") center / cover no-repeat;
  filter: saturate(0.96);
  transform: scale(1.12);
  transform-origin: left center;
}

body.home::after {
  content: "";
  position: fixed;
  z-index: -1;
  inset: 0;
  background:
    linear-gradient(90deg, rgb(255 253 243 / 26%) 0%, rgb(255 253 243 / 8%) 46%, rgb(255 253 243 / 0%) 100%),
    radial-gradient(120% 90% at 50% 110%, rgb(38 61 39 / 12%) 0%, rgb(38 61 39 / 0%) 60%);
  pointer-events: none;
}

body.is-locked {
  overflow: hidden;
}

.home-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(16px, 4vw, 36px) clamp(16px, 5vw, 64px) 0;
}

.home-brand {
  display: inline-flex;
  align-items: center;
  gap: clamp(8px, 1.4vw, 14px);
  color: var(--color-primary);
  text-decoration: none;
}

.home-brand__icon {
  width: clamp(44px, 6vw, 62px);
  height: clamp(44px, 6vw, 62px);
  filter: drop-shadow(0 3px 0 rgb(255 253 243 / 65%));
}

.home-brand__text {
  display: flex;
  flex-direction: column;
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4.2vw, 2.9rem);
  font-weight: 600;
  line-height: 0.9;
  letter-spacing: 0.01em;
  text-shadow: 0 2px 0 rgb(255 253 243 / 55%);
}

.home-brand__text em {
  margin-top: 0.18em;
  padding-left: 0.12em;
  color: #3f6b2a;
  font-size: 0.42em;
  font-style: normal;
  letter-spacing: 0.34em;
  text-transform: uppercase;
}

.home-main {
  display: flex;
  flex: 1;
  align-items: flex-end;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(18px, 4vw, 44px) clamp(16px, 5vw, 64px) clamp(8px, 1.6vw, 18px);
}

.home-menu {
  position: relative;
  width: min(440px, 100%);
  padding: clamp(24px, 3.6vw, 36px);
  background: rgb(255 253 243 / 82%);
  border: 3px solid #fffdf3;
  border-radius: 34px;
  box-shadow:
    0 24px 70px rgb(38 61 39 / 26%),
    0 5px 0 rgb(38 61 39 / 10%);
  backdrop-filter: blur(14px) saturate(1.05);
}

.home-menu::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 2px dashed rgb(40 92 51 / 30%);
  border-radius: 25px;
  pointer-events: none;
}

.home-menu > * {
  position: relative;
  z-index: 1;
}

.home-menu__eyebrow {
  margin-bottom: var(--space-2);
  color: var(--color-primary);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.home-menu__title {
  margin-bottom: var(--space-1);
  color: var(--color-text);
  font-size: clamp(2.1rem, 5vw, 2.9rem);
}

.home-menu__text {
  margin-bottom: var(--space-4);
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

.menu-list {
  display: grid;
  gap: 10px;
  margin-bottom: var(--space-4);
}

.menu-game {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px 10px 10px;
  color: var(--color-text);
  text-decoration: none;
  background: #eaf5dc;
  border: 2px solid #d7e8c4;
  border-radius: 22px;
  box-shadow: 0 2px 0 rgb(68 111 42 / 10%);
  transition:
    transform 160ms ease,
    background-color 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.menu-game:hover {
  background: #fff4c7;
  border-color: var(--color-accent);
  box-shadow: 0 6px 0 rgb(68 111 42 / 12%);
  transform: translateY(-2px);
}

.menu-game:active {
  box-shadow: none;
  transform: translateY(0);
}

.menu-game__icon {
  display: grid;
  flex: 0 0 50px;
  width: 50px;
  height: 50px;
  place-items: center;
  background: #fffdf3;
  border-radius: 16px;
  box-shadow: inset 0 0 0 1px rgb(99 135 82 / 24%);
}

.menu-game__icon img {
  width: 36px;
  height: 36px;
}

.menu-game__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.menu-game__title {
  font-family: var(--font-display);
  font-size: 1.22rem;
  font-weight: 600;
  line-height: 1.15;
}

.menu-game__desc {
  color: var(--color-text-muted);
  font-size: 0.78rem;
  line-height: 1.3;
}

.menu-game__go {
  margin-left: auto;
  color: var(--color-primary);
  font-size: 1.4rem;
  line-height: 1;
}

.menu-game--soon {
  color: var(--color-text-muted);
  background: var(--color-surface-soft);
  border-style: dashed;
  cursor: not-allowed;
  opacity: 0.8;
}

.menu-game--soon:hover {
  background: var(--color-surface-soft);
  border-color: #d7e8c4;
  box-shadow: 0 2px 0 rgb(68 111 42 / 10%);
  transform: none;
}

.menu-game__badge {
  margin-left: auto;
  padding: 3px 10px;
  color: var(--color-text-muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: #fffdf3;
  border-radius: 999px;
}

.menu-settings {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  width: 100%;
  min-height: var(--target-size);
  padding: 10px 18px;
  color: var(--color-primary);
  font: inherit;
  font-family: var(--font-display);
  font-weight: 600;
  background: transparent;
  border: 2px dashed rgb(40 92 51 / 45%);
  border-radius: 999px;
  cursor: pointer;
  transition:
    background-color 160ms ease,
    border-color 160ms ease;
}

.menu-settings:hover {
  background: #eaf5dc;
  border-color: var(--color-primary);
  border-style: solid;
}

.home-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  justify-content: space-between;
  padding: 0 clamp(16px, 5vw, 64px) clamp(14px, 3vw, 26px);
  color: #3f5b36;
  font-size: 0.72rem;
}

.home-footer p {
  margin: 0;
  padding: 4px 10px;
  background: rgb(255 253 243 / 78%);
  border-radius: 999px;
}

.settings-backdrop {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: grid;
  padding: var(--space-4);
  place-items: center;
  background: rgb(38 61 39 / 46%);
  backdrop-filter: blur(4px);
}

.home-settings {
  position: relative;
  width: min(560px, 100%);
  max-width: none;
  max-height: min(88vh, 720px);
  overflow: auto;
  border: 3px solid #fffdf3;
}

.home-settings__close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  color: var(--color-primary);
  font-family: var(--font-display);
  font-size: 1.6rem;
  line-height: 1;
  background: #fffdf3;
  border: 2px solid var(--color-border);
  border-radius: 50%;
  cursor: pointer;
}

.home-settings__close:hover {
  background: var(--color-surface-soft);
}

@media (max-width: 720px) {
  body.home::before {
    background-position: 40% center;
  }

  body.home::after {
    background: linear-gradient(180deg, rgb(255 253 243 / 20%) 0%, rgb(255 253 243 / 62%) 100%);
  }

  .home-main {
    padding-bottom: var(--space-3);
  }

  .home-menu {
    width: 100%;
  }

  .home-footer {
    justify-content: center;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .menu-game,
  .menu-settings {
    transition: none;
  }

  .menu-game:hover {
    transform: none;
  }
}

:root[data-animations="off"] .menu-game:hover {
  transform: none;
}
