* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.meal-card {
  display: flex;
  align-items: center;
  gap: 8px;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: Arial, Helvetica, sans-serif;
  background: #111;
}

.game-screen {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: #000;
}

.bg,
.character,
.title-logo,
.table,
.begin-btn-bg,
.menu-btn-bg,
.icon-btn img {
  user-select: none;
  -webkit-user-drag: none;
}

.bg {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition:
    transform 0.9s cubic-bezier(0.22, 1, 0.36, 1),
    filter 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

.icon-btn {
  position: absolute;
  z-index: 8;
  width: clamp(52px, 4.8vw, 74px);
  height: clamp(52px, 4.8vw, 74px);
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    filter 0.2s ease,
    opacity 0.45s ease;
}

.icon-btn:hover {
  transform: translateY(-2px) scale(1.04);
  filter: brightness(1.05);
}

.icon-btn:active {
  transform: scale(0.97);
}

.icon-btn img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.profile-btn {
  top: 20px;
  right: 20px;
}

.profile-btn img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.character {
  position: absolute;
  left: 4vw;
  top: 1vw;
  width: 43vw;
  z-index: 2;
  transition: transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
  overflow: hidden;
}

.title-logo {
  position: absolute;
  z-index: 6;
  transition:
    transform 0.9s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.8s ease;
}

.title-big {
  right: 11vw;
  top: 1vh;
  width: 580px;
  height: auto;
  opacity: 1;
}

.title-small {
  right: 45vw;
  top: 1vh;
  width: 210px;
  height: 129px;
  opacity: 0;
  transform: scale(0.75);
}

.begin-btn,
.menu-btn {
  position: absolute;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  z-index: 7;
}

.begin-btn {
  right: 17vw;
  top: 51vh;
  width: 400px;
  height: 190px;
  transition:
    transform 0.8s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.55s ease,
    filter 0.25s ease;
}

.begin-btn:hover {
  transform: translateY(-2px) scale(1.02);
  filter: brightness(1.04);
}

.begin-btn:active {
  transform: scale(0.985);
}

.begin-btn-bg,
.menu-btn-bg {
  width: 100%;
  display: block;
}

.begin-btn span,
.menu-btn span {
  position: absolute;
  inset: 0;
  top: -1vw;
  right: -2vw;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Paytone One", Arial, sans-serif;
  font-weight: 800;
  color: #f3e5d2;
  text-shadow:
    0 3px 0 rgba(101, 49, 12, 0.7),
    0 4px 10px rgba(0, 0, 0, 0.28);
  transform: translateY(-1px);
  pointer-events: none;
}

.begin-btn span {
  font-size: 55px;
}

.menu-link {
  position: absolute;
  z-index: 7;
  pointer-events: none;
}

.menu-btn {
  width: 430px;
  height: 220px;
  transition:
    transform 0.7s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.55s ease,
    filter 0.25s ease;
}

.menu-btn span {
  font-size: 38px;
}

.menu-btn:hover {
  transform: translateY(-2px) scale(1.02);
  filter: brightness(1.04);
}

.menu-btn:active {
  transform: scale(0.985);
}

.start-link,
.about-link,
.credit-link,
.exit-link {
  right: 45vw;
}

.start-btn {
  top: 2vw;
}

.about-btn {
  top: 11vw;
}

.credit-btn {
  top: 20vw;
}

.exit-btn {
  top: 29vw;
}

.table {
  position: absolute;
  left: 0;
  bottom: -20vh;
  width: 100%;
  z-index: 4;
  pointer-events: none;
  transition: transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

.start-link,
.about-link,
.credit-link,
.exit-link {
  opacity: 0;
  transform: translateY(35px);
  transition:
    transform 0.7s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.45s ease;
}

.start-link {
  transition-delay: 0.18s;
}
.about-link {
  transition-delay: 0.26s;
}
.credit-link {
  transition-delay: 0.34s;
}
.exit-link {
  transition-delay: 0.42s;
}

/* smooth transition */
.game-screen.menu-open .bg {
  transform: scale(1.03);
  filter: brightness(0.92);
}

.game-screen.menu-open .character {
  transform: translateX(0);
}

.game-screen.menu-open .title-big {
  opacity: 0;
  transform: translate(110px, -10px) scale(0.52);
}

.game-screen.menu-open .title-small {
  opacity: 1;
  transform: scale(1);
}

.game-screen.menu-open .begin-btn {
  opacity: 0;
  transform: translate(1vw, -24vh) scale(1.06);
  pointer-events: none;
}

.game-screen.menu-open .start-link,
.game-screen.menu-open .about-link,
.game-screen.menu-open .credit-link,
.game-screen.menu-open .exit-link {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.profile-link {
  pointer-events: auto;
}

.game-screen.menu-open .table {
  transform: translateY(0);
}

.game-screen.animating .icon-btn {
  opacity: 0.5;
}

@media (max-width: 1366px), (max-aspect-ratio: 4/3) {
  .title-big {
    width: 43vw;
    right: 7.5vw;
    top: 10vh;
  }

  .begin-btn {
    width: 32vw;
    height: auto;
    right: 14vw;
    top: 51vh;
  }

  .begin-btn span {
    top: 0;
    right: 0;
    font-size: 2.9vw;
  }

  .menu-btn {
    width: 32.5vw;
  }

  .menu-btn span {
    font-size: 2.5vw;
  }

  .start-btn {
    top: 10vw;
  }
  .about-btn {
    top: 20vw;
  }
  .credit-btn {
    top: 30vw;
  }
  .exit-btn {
    top: 40vw;
  }

  .table {
    bottom: -1.25vw;
  }

  .character {
    position: absolute;
    left: 4vw;
    top: 5vw;
    width: 59vw;
    z-index: 2;
    transition: transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
    overflow: hidden;
  }

  .title-small {
    right: 45vw;
    top: -1vh;
    width: 210px;
    height: 129px;
    opacity: 0;
    transform: scale(0.75);
  }
}

/* Top-center toast (shown once after account activation) */
.toast {
  position: fixed;
  top: 22px;
  left: 50%;
  transform: translate(-50%, -22px);
  z-index: 3000;
  background: #6f4e37;
  color: #fff8f2;
  font-family: "Paytone One", Arial, sans-serif;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  padding: 14px 28px;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.4s ease,
    transform 0.4s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.rotate-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  padding: 2rem 1.4rem;
  text-align: center;
  background: rgba(23, 11, 6, 0.92);
  backdrop-filter: blur(10px);
  color: #f5e6c8;
}

.rotate-overlay .rotate-icon {
  width: 56px;
  height: 56px;
  color: #e0a45c;
  opacity: 0.95;
}

.rotate-overlay h2 {
  font-family: "Paytone One", Arial, sans-serif;
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  color: #fff8f2;
}

.rotate-overlay p {
  max-width: 28ch;
  font-size: 0.92rem;
  line-height: 1.5;
  opacity: 0.85;
}

/* ── Mobile portrait — proper responsive layout ── */
@media (max-width: 768px) {
  html,
  body {
    overflow: hidden;
    height: 100dvh;
  }

  .game-screen {
    width: 100vw;
    height: 100dvh;
    overflow: hidden;
  }

  .bg {
    object-position: 58% center;
    transform: none !important;
    filter: saturate(1.05) brightness(1.02);
  }

  .game-screen::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
      radial-gradient(
        ellipse 92% 58% at 50% 18%,
        rgba(255, 255, 255, 0.08) 0%,
        transparent 60%
      ),
      linear-gradient(
        180deg,
        rgba(0, 0, 0, 0.07) 0%,
        transparent 26%,
        transparent 62%,
        rgba(0, 0, 0, 0.14) 100%
      );
  }

  /* hide parallax inline transforms on mobile via !important overrides below */
  .profile-btn {
    top: max(10px, env(safe-area-inset-top, 0px));
    right: max(12px, env(safe-area-inset-right, 0px));
    width: 48px;
    height: 48px;
  }

  .character {
    left: 50% !important;
    right: auto !important;
    top: auto !important;
    bottom: 9vh !important;
    width: min(76vw, 330px) !important;
    max-width: 330px;
    height: auto;
    transform: translateX(-50%) !important;
    filter: drop-shadow(0 14px 28px rgba(0, 0, 0, 0.28));
    z-index: 3;
    transition:
      transform 0.6s cubic-bezier(0.22, 1, 0.36, 1),
      opacity 0.42s ease,
      filter 0.42s ease,
      visibility 0s linear !important;
    will-change: transform, opacity;
  }

  .title-logo {
    filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.35));
  }

  .title-big {
    left: 50% !important;
    right: auto !important;
    top: 4.5vh !important;
    width: min(62vw, 280px) !important;
    max-width: 280px;
    height: auto !important;
    transform: translateX(-50%) !important;
    opacity: 1;
  }

  .title-small {
    left: 50% !important;
    right: auto !important;
    top: 4vh !important;
    width: min(42vw, 170px) !important;
    height: auto !important;
    transform: translateX(-50%) scale(0.82) !important;
    opacity: 0;
  }

  .begin-btn {
    left: 50% !important;
    right: auto !important;
    top: 31vh !important;
    bottom: auto !important;
    width: min(64vw, 285px) !important;
    height: auto !important;
    aspect-ratio: 2.1 / 1;
    transform: translateX(-50%) !important;
    z-index: 7;
  }

  .begin-btn-bg,
  .menu-btn-bg {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }

  .begin-btn span,
  .menu-btn span {
    inset: 0 !important;
    top: 0 !important;
    right: 0 !important;
    transform: translateY(-1px) !important;
    font-size: clamp(1rem, 4.8vw, 1.35rem) !important;
  }

  .menu-btn span {
    font-size: clamp(0.95rem, 4.2vw, 1.2rem) !important;
  }

  /* menu stack — links control vertical position */
  .menu-link {
    left: 50% !important;
    right: auto !important;
    width: min(62vw, 300px) !important;
    max-width: 300px;
    transform: translateX(-50%) translateY(18px) !important;
    transition-delay: 0s !important;
  }

  .menu-btn {
    position: relative !important;
    left: auto !important;
    right: auto !important;
    top: 0 !important;
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 2.1 / 1;
    transform: none !important;
  }

  .start-link {
    top: 26vh !important;
    transition-delay: 0.08s !important;
  }
  .about-link {
    top: 39.5vh !important;
    transition-delay: 0.13s !important;
  }
  .credit-link {
    top: 53vh !important;
    transition-delay: 0.18s !important;
  }
  .exit-link {
    top: 66.5vh !important;
    transition-delay: 0.23s !important;
  }

  .start-btn,
  .about-btn,
  .credit-btn,
  .exit-btn {
    top: 0 !important;
  }

  .table {
    bottom: 0 !important;
    height: 14vh !important;
    min-height: 88px;
    object-fit: cover;
    object-position: top center;
    transform: none !important;
    z-index: 4;
  }

  .game-screen.menu-open .bg {
    filter: brightness(0.88) blur(1.5px);
    transform: scale(1.02) !important;
  }

  .game-screen.menu-open .character {
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateX(-50%) translateY(28px) scale(0.92) !important;
    filter: blur(6px) brightness(0.92);
    pointer-events: none;
    transition:
      opacity 0.45s ease,
      transform 0.5s cubic-bezier(0.22, 1, 0.36, 1),
      filter 0.5s ease,
      visibility 0s linear 0.5s !important;
  }

  .game-screen.menu-open .title-big {
    opacity: 0 !important;
    transform: translateX(-50%) translateY(-10px) scale(0.7) !important;
    pointer-events: none;
  }

  .game-screen.menu-open .title-small {
    opacity: 1 !important;
    transform: translateX(-50%) scale(1) !important;
  }

  .game-screen.menu-open .begin-btn {
    opacity: 0 !important;
    transform: translateX(-50%) translateY(14px) scale(0.9) !important;
    pointer-events: none;
  }

  .game-screen.menu-open .start-link,
  .game-screen.menu-open .about-link,
  .game-screen.menu-open .credit-link,
  .game-screen.menu-open .exit-link {
    opacity: 1 !important;
    transform: translateX(-50%) translateY(0) !important;
  }

  .begin-btn:hover,
  .menu-btn:hover {
    transform: translateX(-50%) !important;
    filter: none;
  }
  .menu-btn:hover {
    transform: none !important;
  }

  .toast {
    top: max(14px, env(safe-area-inset-top));
    font-size: 0.88rem;
    padding: 12px 20px;
    max-width: 86vw;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .character {
    width: min(78vw, 300px) !important;
    top: auto !important;
    bottom: 8.5vh !important;
  }

  .title-big {
    top: 4.2vh !important;
    width: min(64vw, 260px) !important;
  }

  .title-small {
    top: 4vh !important;
    width: min(46vw, 160px) !important;
  }

  .begin-btn {
    width: min(66vw, 270px) !important;
    top: 30.5vh !important;
    bottom: auto !important;
  }

  .menu-link {
    width: min(68vw, 280px) !important;
  }

  .start-link {
    top: 27vh !important;
  }
  .about-link {
    top: 40.5vh !important;
  }
  .credit-link {
    top: 54vh !important;
  }
  .exit-link {
    top: 67.5vh !important;
  }

  .table {
    height: 14vh !important;
    min-height: 84px;
  }
}

@media (max-width: 360px) {
  .character {
    width: 82vw !important;
    top: auto !important;
    bottom: 8vh !important;
  }
  .title-big {
    width: 66vw !important;
    top: 4vh !important;
  }
  .begin-btn {
    width: 70vw !important;
    top: 30vh !important;
    bottom: auto !important;
  }
  .menu-link {
    width: 70vw !important;
  }
}

@media (max-width: 768px) and (max-height: 700px) {
  .character {
    top: auto !important;
    bottom: 8vh !important;
    width: min(70vw, 265px) !important;
  }
  .title-big {
    top: 3.5vh !important;
    width: min(56vw, 230px) !important;
  }
  .begin-btn {
    top: 28vh !important;
    bottom: auto !important;
    width: min(58vw, 250px) !important;
  }
  .start-link {
    top: 20vh !important;
  }
  .about-link {
    top: 33vh !important;
  }
  .credit-link {
    top: 46vh !important;
  }
  .exit-link {
    top: 59vh !important;
  }
}

@media (max-height: 520px) and (orientation: landscape) and (max-width: 900px) {
  .rotate-overlay {
    display: none !important;
  }

  .character {
    left: 4vw !important;
    top: 2vh !important;
    width: 38vw !important;
    transform: none !important;
  }

  .title-big {
    left: auto !important;
    right: 8vw !important;
    top: 6vh !important;
    width: 36vw !important;
    transform: none !important;
  }

  .title-small {
    left: auto !important;
    right: 12vw !important;
    top: 4vh !important;
    width: 28vw !important;
    transform: scale(0.82) !important;
  }

  .game-screen.menu-open .title-small {
    transform: scale(1) !important;
  }

  .begin-btn {
    left: auto !important;
    right: 12vw !important;
    top: 44vh !important;
    bottom: auto !important;
    width: 30vw !important;
    transform: none !important;
  }

  .menu-link {
    left: auto !important;
    right: 10vw !important;
    width: 30vw !important;
    transform: translateY(18px) !important;
  }

  .game-screen.menu-open .start-link,
  .game-screen.menu-open .about-link,
  .game-screen.menu-open .credit-link,
  .game-screen.menu-open .exit-link {
    transform: translateY(0) !important;
  }

  .start-link {
    top: 12vh !important;
  }
  .about-link {
    top: 28vh !important;
  }
  .credit-link {
    top: 44vh !important;
  }
  .exit-link {
    top: 60vh !important;
  }

  .table {
    height: 22vh !important;
    bottom: -2vh !important;
  }
}
