/* Shared premium finish for DOM-based game title screens.
   Each rule is game-scoped so gameplay UI remains untouched. */

body[data-game] {
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

/* Cat Tower: richer material separation without losing the cozy illustration. */
body[data-game="cat-tower"] #menu .menu-panel {
  position: relative;
  isolation: isolate;
  border-color: rgba(73, 41, 21, 0.92);
  background-image:
    linear-gradient(145deg, rgba(255, 255, 255, 0.52), transparent 34%),
    linear-gradient(180deg, rgba(255, 249, 226, 0.97), rgba(244, 213, 160, 0.91)),
    var(--ui-paper);
  box-shadow:
    0 9px 0 #2d1a0e,
    0 28px 58px rgba(68, 35, 16, 0.28),
    0 4px 14px rgba(101, 55, 21, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    inset 0 -10px 24px rgba(167, 94, 35, 0.07);
}

body[data-game="cat-tower"] #menu .menu-panel::before {
  content: "";
  position: absolute;
  inset: 6px;
  z-index: -1;
  border: 1px solid rgba(133, 82, 39, 0.2);
  border-radius: 17px;
  pointer-events: none;
}

body[data-game="cat-tower"] #menu .menu-panel::after {
  content: "";
  position: absolute;
  top: 8px;
  left: 14%;
  right: 14%;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.84), transparent);
  pointer-events: none;
}

body[data-game="cat-tower"] #menu .menu-visual {
  filter: drop-shadow(0 18px 24px rgba(69, 37, 18, 0.28)) saturate(1.06) contrast(1.02);
}

body[data-game="cat-tower"] #menu h1 {
  text-shadow:
    0 2px 0 rgba(255, 255, 255, 0.9),
    0 5px 12px rgba(114, 59, 23, 0.18);
}

body[data-game="cat-tower"] #menu .btn {
  transition: transform 160ms ease, filter 160ms ease, box-shadow 160ms ease;
}

body[data-game="cat-tower"] #menu .btn:not(:disabled):hover {
  transform: translateY(-2px);
  filter: saturate(1.06) brightness(1.02);
}

body[data-game="cat-tower"] #menu .btn:not(:disabled):active {
  transform: translateY(3px) scale(0.99);
}

/* Jelly Pang: candy-like specular depth and cleaner hero separation. */
body[data-game="jelly-pang"] .title-copy {
  position: relative;
  isolation: isolate;
}

body[data-game="jelly-pang"] .title-copy::before {
  content: "";
  position: absolute;
  inset: -22% -18%;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255, 255, 255, 0.56), transparent 68%);
  filter: blur(12px);
  pointer-events: none;
}

body[data-game="jelly-pang"] .title-hero h1 {
  filter: drop-shadow(0 7px 14px rgba(246, 79, 120, 0.14));
  text-shadow:
    0 3px 0 rgba(255, 255, 255, 0.98),
    0 7px 0 rgba(255, 181, 198, 0.24),
    0 17px 32px rgba(246, 79, 120, 0.24);
}

body[data-game="jelly-pang"] .title-art {
  box-shadow:
    0 0 0 2px rgba(246, 79, 120, 0.16),
    0 0 0 8px rgba(255, 255, 255, 0.22),
    0 30px 64px rgba(61, 74, 105, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.96);
}

body[data-game="jelly-pang"] .title-art img {
  filter: saturate(1.08) contrast(1.035);
}

body[data-game="jelly-pang"] .title-actions button {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.58),
    inset 0 -2px 0 rgba(91, 34, 75, 0.14),
    0 9px 0 var(--premium-button-shadow, #b63b58),
    0 22px 38px rgba(61, 74, 105, 0.22);
}

body[data-game="jelly-pang"] .title-rank {
  --premium-button-shadow: #4350bb;
}

body[data-game="jelly-pang"] .title-actions button:active {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    0 3px 0 var(--premium-button-shadow, #9f3a55),
    0 10px 20px rgba(49, 64, 82, 0.18);
}

/* Jewelria: cinematic grading around the existing illustrated splash. */
body[data-game="jewelria"] .title-bg {
  filter: saturate(1.12) contrast(1.07) brightness(0.96);
  will-change: transform, filter;
}

body[data-game="jewelria"] .title-shade {
  background:
    radial-gradient(ellipse at 50% 35%, rgba(255, 236, 180, 0.1), transparent 34%),
    linear-gradient(180deg, rgba(2, 12, 18, 0.5) 0%, rgba(2, 12, 18, 0.02) 36%, rgba(2, 12, 18, 0.58) 100%),
    linear-gradient(90deg, rgba(2, 12, 18, 0.68), transparent 30%, transparent 70%, rgba(2, 12, 18, 0.68));
}

body[data-game="jewelria"] .title-plaque {
  filter:
    drop-shadow(0 12px 18px rgba(0, 0, 0, 0.4))
    drop-shadow(0 0 20px rgba(255, 220, 133, 0.2));
}

body[data-game="jewelria"] .title-headline {
  text-shadow: 0 4px 18px rgba(0, 0, 0, 0.48);
}

body[data-game="jewelria"] .title-bottom {
  filter: drop-shadow(0 16px 30px rgba(0, 0, 0, 0.25));
}

body[data-game="jewelria"] .button-primary {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    0 10px 28px rgba(80, 231, 255, 0.2),
    0 18px 44px rgba(0, 0, 0, 0.25);
}

/* Lumen Shift: sharper sci-fi frame, controlled bloom, better button weight. */
body[data-game="lumen-shift"] .menu-layout::before {
  content: "";
  position: absolute;
  inset: -18px;
  z-index: -1;
  border: 1px solid rgba(104, 233, 255, 0.12);
  background:
    linear-gradient(90deg, rgba(104, 233, 255, 0.55), transparent 14%) top left / 160px 1px no-repeat,
    linear-gradient(180deg, rgba(255, 91, 212, 0.4), transparent 18%) top right / 1px 150px no-repeat,
    linear-gradient(270deg, rgba(104, 233, 255, 0.38), transparent 14%) bottom right / 160px 1px no-repeat;
  clip-path: polygon(16px 0, 100% 0, 100% calc(100% - 16px), calc(100% - 16px) 100%, 0 100%, 0 16px);
  pointer-events: none;
}

body[data-game="lumen-shift"] .menu-screen .menu-lockup h1 {
  filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.45));
}

body[data-game="lumen-shift"] .menu-hero::after {
  content: "";
  position: absolute;
  inset: 15%;
  z-index: -1;
  border: 1px solid rgba(104, 233, 255, 0.2);
  border-radius: 50%;
  box-shadow:
    0 0 32px rgba(104, 233, 255, 0.18),
    inset 0 0 42px rgba(255, 91, 212, 0.08);
  pointer-events: none;
}

body[data-game="lumen-shift"] .menu-screen .primary-button,
body[data-game="lumen-shift"] .menu-screen .secondary-button {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 12px 30px rgba(0, 0, 0, 0.3),
    0 0 24px rgba(104, 233, 255, 0.08);
}

/* Parking Escape: more photographic grading and premium glass controls. */
body[data-game="parking-escape"] .menu-art {
  filter: saturate(1.1) contrast(1.07) brightness(0.94);
  will-change: transform, filter;
}

body[data-game="parking-escape"] .menu-title-block h1 {
  filter: drop-shadow(0 16px 26px rgba(0, 0, 0, 0.36));
}

body[data-game="parking-escape"] .menu-title-block h1 span:last-child {
  text-shadow:
    0 10px 36px rgba(0, 0, 0, 0.56),
    0 0 30px rgba(255, 179, 63, 0.18);
}

body[data-game="parking-escape"] .menu-control-bar {
  position: relative;
  isolation: isolate;
  border-color: rgba(123, 228, 244, 0.3);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.055), transparent 42%),
    rgba(4, 13, 24, 0.91);
  box-shadow:
    0 28px 70px rgba(0, 0, 0, 0.48),
    0 0 38px rgba(62, 208, 231, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 -12px 30px rgba(0, 0, 0, 0.2);
}

body[data-game="parking-escape"] .menu-control-bar::before {
  content: "";
  position: absolute;
  top: 0;
  left: 18px;
  width: 92px;
  height: 2px;
  background: linear-gradient(90deg, var(--cyan), transparent);
  box-shadow: 0 0 16px rgba(123, 228, 244, 0.5);
  pointer-events: none;
}

body[data-game="parking-escape"] .menu-actions button {
  transition: transform 160ms ease, filter 160ms ease, box-shadow 160ms ease;
}

body[data-game="parking-escape"] .menu-actions button:hover {
  transform: translateY(-2px);
  filter: brightness(1.06) saturate(1.08);
}

body[data-game="parking-escape"] .menu-actions button:active {
  transform: translateY(2px) scale(0.99);
}

/* Slime Volley: stronger broadcast-card depth and mascot presence. */
body[data-game="slime-volley"] #main-menu .menu-container {
  border-color: rgba(76, 230, 255, 0.36);
  box-shadow:
    0 34px 100px rgba(0, 0, 0, 0.54),
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 -18px 50px rgba(0, 0, 0, 0.2),
    0 0 56px rgba(59, 141, 255, 0.12);
}

body[data-game="slime-volley"] #main-menu .game-logo {
  filter: saturate(1.08) contrast(1.03) drop-shadow(0 18px 28px rgba(0, 0, 0, 0.3));
}

body[data-game="slime-volley"] #main-menu .menu-title {
  text-shadow:
    0 4px 22px rgba(0, 0, 0, 0.58),
    -8px 0 28px rgba(59, 141, 255, 0.1),
    8px 0 28px rgba(255, 90, 98, 0.08);
}

body[data-game="slime-volley"] #main-menu .btn-large {
  transition: transform 160ms ease, filter 160ms ease, box-shadow 160ms ease;
}

body[data-game="slime-volley"] #main-menu .btn-large:hover {
  transform: translateY(-2px);
  filter: saturate(1.08) brightness(1.04);
}

body[data-game="slime-volley"] #main-menu .btn-large:active {
  transform: translateY(2px) scale(0.995);
}

@media (prefers-reduced-motion: no-preference) {
  body[data-game="jewelria"] .title-bg {
    animation: premium-keyart-drift 14s ease-in-out infinite alternate;
  }

  body[data-game="parking-escape"] .menu-art {
    animation: premium-keyart-drift 16s ease-in-out infinite alternate;
  }

  body[data-game="lumen-shift"] .menu-hero::after {
    animation: premium-ring-breathe 5.5s ease-in-out infinite;
  }
}

@keyframes premium-keyart-drift {
  from { transform: scale(1.015) translate3d(0, 0, 0); }
  to { transform: scale(1.045) translate3d(-0.35%, -0.25%, 0); }
}

@keyframes premium-ring-breathe {
  0%, 100% { opacity: 0.58; transform: scale(0.985); }
  50% { opacity: 1; transform: scale(1.025); }
}

@media (prefers-reduced-motion: reduce) {
  body[data-game] *,
  body[data-game] *::before,
  body[data-game] *::after {
    scroll-behavior: auto !important;
  }
}
