:root {
  --floor-gold: #ffe39a;
  --floor-cyan: #6ce9ff;
  --floor-panel: rgba(6, 27, 41, 0.78);
}

html[data-world="lili"] {
  --floor-gold: #ffd8f2;
  --floor-cyan: #ff9ddd;
  --floor-panel: rgba(61, 21, 70, 0.8);
}

html[data-world="lili"] .floor-overlay {
  background:
    linear-gradient(180deg, rgba(44, 12, 53, 0.48), rgba(38, 18, 55, 0.12) 45%, rgba(21, 8, 39, 0.72)),
    radial-gradient(circle at 50% 42%, transparent 0 23%, rgba(32, 7, 42, 0.3) 86%);
}

html[data-world="lili"] .floor-control,
html[data-world="lili"] .floor-identity { background: rgba(54, 18, 67, 0.74); }

html[data-world="lili"] .panel_wrap {
  background: linear-gradient(145deg, rgba(78, 28, 88, 0.82), rgba(31, 25, 68, 0.84)) !important;
}

html[data-world="lili"] .card {
  background: linear-gradient(155deg, rgba(132, 53, 120, 0.92), rgba(45, 25, 73, 0.96)) !important;
}

html[data-world="lili"] .game-memory { background: linear-gradient(155deg, rgba(156, 78, 135, 0.94), rgba(62, 35, 78, 0.96)) !important; }
html[data-world="lili"] .game-squirrel { background: linear-gradient(155deg, rgba(126, 77, 51, 0.94), rgba(59, 34, 57, 0.97)) !important; }
html[data-world="lili"] .game-jump { background: linear-gradient(155deg, rgba(80, 77, 154, 0.94), rgba(45, 26, 91, 0.97)) !important; }
html[data-world="lili"] .yt_bubble_card,
html[data-world="lili"] .ui-narration { background: rgba(64, 23, 75, 0.92) !important; }

* { box-sizing: border-box; }

html, body { min-width: 320px; min-height: 100%; }

body {
  min-height: 100vh;
  min-height: 100svh;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  color: #fff;
  font-family: "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
}

.bg { background-position: center 65% !important; }

.floor-overlay {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(3, 20, 30, 0.5), rgba(3, 18, 27, 0.14) 45%, rgba(2, 12, 22, 0.74)),
    radial-gradient(circle at 50% 42%, transparent 0 23%, rgba(3, 13, 24, 0.32) 86%);
}

.floor-topbar {
  width: min(1260px, calc(100% - 24px));
  min-height: 72px;
  margin: 0 auto;
  position: relative;
  z-index: 2100;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
}

.floor-control, .floor-identity {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  color: #fff;
  background: rgba(3, 23, 36, 0.7);
  box-shadow: 0 9px 25px rgba(0, 0, 0, 0.28), 0 0 12px rgba(83, 218, 255, 0.12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.floor-control {
  position: static !important;
  width: auto !important;
  height: auto !important;
  padding: 8px 15px !important;
  gap: 9px;
  text-decoration: none;
  cursor: pointer;
  font: inherit;
  overflow: visible !important;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.floor-control:hover, .floor-control:focus-visible { transform: translateY(-2px) !important; outline: none; border-color: rgba(255, 235, 164, 0.8); background: rgba(8, 56, 73, 0.88); }
.back-control { justify-self: start; }
.back-control > span, .next-control > span { font-size: 1.35rem; }

.floor-identity { justify-self: center; padding: 4px 15px 4px 5px; gap: 9px; }
.floor-identity img { width: 45px; height: 45px; object-fit: contain; }
.floor-identity > span { display: flex; flex-direction: column; }
.floor-identity small { color: rgba(255, 255, 255, 0.68); font-size: 0.65rem; }
.floor-identity strong { color: var(--floor-gold); line-height: 1.1; }

.top-actions { justify-self: end; display: flex; align-items: center; gap: 8px; }
.icon-control { width: 48px !important; min-width: 48px; justify-content: center; padding: 7px !important; font-size: 1.25rem; }
.next-control { white-space: nowrap; }

.floor-shell {
  width: min(1260px, calc(100% - 24px));
  min-height: calc(100svh - 150px);
  margin: 0 auto;
  padding: 10px 0 112px;
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.welcome-copy { max-width: 780px; margin: 0 auto 18px; text-align: center; text-shadow: 0 3px 15px rgba(0, 0, 0, 0.78); }
.welcome-copy p { margin: 0 0 2px; color: var(--floor-gold); font-size: clamp(0.72rem, 1.4vw, 0.9rem); font-weight: 900; letter-spacing: 0.14em; text-transform: uppercase; }
.welcome-copy h1 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.25rem, 5.4vw, 4.4rem); line-height: 1; background: linear-gradient(180deg, #fff 3%, #fff3b1 52%, #ffc96f 88%); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 3px 0 rgba(73, 38, 18, 0.38)); }
.welcome-copy > span { display: block; margin-top: 8px; color: rgba(255, 255, 255, 0.78); font-size: clamp(0.82rem, 1.5vw, 1rem); }

.panel_wrap {
  position: relative !important;
  inset: auto !important;
  transform: none !important;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: clamp(13px, 2vw, 22px) !important;
  border: 1px solid rgba(255, 255, 255, 0.27) !important;
  border-radius: 30px !important;
  background: linear-gradient(145deg, rgba(6, 35, 49, 0.82), rgba(15, 25, 49, 0.82)) !important;
  box-shadow: 0 28px 66px rgba(0, 0, 0, 0.45), inset 0 0 38px rgba(255, 255, 255, 0.05) !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.cards { display: grid !important; grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: clamp(11px, 1.5vw, 18px) !important; }

.card {
  min-width: 0;
  min-height: 260px !important;
  position: relative;
  display: flex !important;
  flex-direction: column;
  align-items: center !important;
  justify-content: flex-start;
  gap: 0 !important;
  padding: 19px 14px 15px !important;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.22) !important;
  border-radius: 25px !important;
  color: #fff;
  background: linear-gradient(155deg, rgba(12, 73, 91, 0.92), rgba(10, 26, 50, 0.96)) !important;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.34), inset 0 0 25px rgba(255, 255, 255, 0.06) !important;
  text-align: center;
}

.card::before { inset: 0 !important; border-radius: inherit !important; background: radial-gradient(circle at 50% 20%, rgba(109, 235, 255, 0.28), transparent 50%) !important; opacity: 1 !important; }
.card::after { display: none !important; }
.game-memory { background: linear-gradient(155deg, rgba(29, 100, 87, 0.94), rgba(10, 37, 52, 0.96)) !important; }
.game-squirrel { background: linear-gradient(155deg, rgba(111, 68, 24, 0.94), rgba(45, 37, 29, 0.97)) !important; }
.game-jump { background: linear-gradient(155deg, rgba(77, 39, 112, 0.94), rgba(23, 24, 65, 0.97)) !important; }
.card:hover, .card:focus-visible { transform: translateY(-7px) !important; outline: none; border-color: rgba(255, 238, 169, 0.86) !important; box-shadow: 0 25px 48px rgba(0, 0, 0, 0.42), 0 0 24px rgba(109, 235, 255, 0.28) !important; }

.card_icon { width: 112px !important; height: 112px !important; flex: 0 0 112px !important; display: grid !important; place-items: center; margin: 0 0 12px !important; border-radius: 28px !important; background: rgba(255, 255, 255, 0.12) !important; border: 1px solid rgba(255, 255, 255, 0.24) !important; box-shadow: inset 0 0 22px rgba(255, 255, 255, 0.08) !important; }
.card_icon img { width: 82px !important; height: 82px !important; object-fit: contain; }
.crystal-icon { font-size: 3.6rem !important; }
.card-copy { display: flex; flex-direction: column; align-items: center; }
.card_title { min-height: 43px; display: flex; align-items: center; justify-content: center; margin: 0 !important; font-family: Georgia, serif; font-size: clamp(1.1rem, 2vw, 1.45rem) !important; line-height: 1.05; }
.card_sub { min-height: 35px; display: block; margin: 5px 0 0 !important; color: rgba(255, 255, 255, 0.72) !important; font-size: 0.78rem !important; line-height: 1.35; }
.play-label { min-height: 38px; display: inline-flex; align-items: center; gap: 7px; margin-top: auto; padding: 7px 13px; border: 1px solid rgba(255, 255, 255, 0.29); border-radius: 999px; color: #fff1ac; background: rgba(255, 255, 255, 0.1); font-size: 0.78rem; font-weight: 900; }

.yt_bubble[hidden] { display: none !important; }
.yt_bubble { position: fixed !important; inset: 72px 16px auto auto !important; width: auto !important; height: auto !important; z-index: 5000 !important; background: transparent !important; pointer-events: none; }
.yt_bubble_card { width: 270px !important; position: relative; padding: 18px !important; border: 1px solid rgba(255, 255, 255, 0.3) !important; border-radius: 22px !important; color: #fff; background: rgba(5, 29, 43, 0.95) !important; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5) !important; backdrop-filter: blur(14px); pointer-events: auto; }
.yt_close { position: absolute; top: 7px; right: 8px; width: 34px; height: 34px; border: 1px solid rgba(255, 255, 255, 0.25); border-radius: 50%; color: #fff; background: rgba(255, 255, 255, 0.1); cursor: pointer; font-size: 1.35rem; }
.yt_title { padding-right: 30px; font-weight: 900; }
.yt_hint { margin-top: 3px; color: rgba(255, 255, 255, 0.65); font-size: 0.75rem; }
.yt_choices { display: grid !important; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 13px; }
.yt_choice_btn { min-height: 44px; border: 1px solid rgba(255, 255, 255, 0.25); border-radius: 13px; color: #fff; background: rgba(255, 255, 255, 0.1); cursor: pointer; font-weight: 900; }
.yt_choice_btn.is_active { color: #173342; background: var(--floor-gold); }
#ytIframe { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.floor-bottom { position: fixed; left: 50%; bottom: max(10px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 2200; display: flex; align-items: center; gap: 10px; }
.ui-narration { position: static !important; transform: none !important; min-height: 52px; display: inline-flex; align-items: center; gap: 9px; padding: 5px 16px 5px 6px; border: 1px solid rgba(255, 255, 255, 0.28); border-radius: 999px; color: #fff; background: rgba(4, 27, 40, 0.84); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4); backdrop-filter: blur(12px); cursor: pointer; font-weight: 900; }
.ui-narration:hover, .ui-narration:focus-visible { transform: translateY(-2px) !important; outline: 3px solid rgba(255, 226, 143, 0.55); }
.ui-narration.is-playing { background: rgba(27, 84, 77, 0.92); }
.ui-narration-char { width: 42px; height: 42px; object-fit: contain; }
#global-heart { width: 48px !important; height: 48px !important; }

#game_root { position: fixed; inset: 0; z-index: 9999; display: none; }

.floor-r2 .floor-shell { justify-content: flex-start; padding-top: 12px; }
.floor-r2 .floor-content { display: grid; grid-template-columns: minmax(0, 1fr) 255px; align-items: stretch; gap: 16px; }
.floor-r2 .cards { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
.floor-r2 .card { min-height: 222px !important; padding-top: 14px !important; }
.floor-r2 .card_icon { width: 82px !important; height: 82px !important; flex-basis: 82px !important; border-radius: 22px !important; }
.floor-r2 .card_icon img { width: 60px !important; height: 60px !important; }
.floor-r2 .crystal-icon { font-size: 2.8rem !important; }
.floor-r2 .card_title { min-height: 34px; font-size: 1.12rem !important; }
.floor-r2 .card_sub { min-height: 31px; font-size: 0.72rem !important; }
.floor-r2 .game-catch { background: linear-gradient(155deg, rgba(116, 61, 79, 0.94), rgba(46, 29, 55, 0.97)) !important; }
.floor-r2 .game-path { background: linear-gradient(155deg, rgba(58, 84, 121, 0.94), rgba(25, 35, 63, 0.97)) !important; }

.score_panel {
  position: relative !important;
  inset: auto !important;
  width: auto !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 16px !important;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.26) !important;
  border-radius: 26px !important;
  color: #fff !important;
  background: rgba(5, 27, 42, 0.84) !important;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4) !important;
  backdrop-filter: blur(14px);
}

.current_player_status { padding: 14px; border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 18px; background: rgba(255, 255, 255, 0.08); }
.current_player_status small { display: block; color: rgba(255, 255, 255, 0.62); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em; }
.current_player_status > strong { display: block; margin: 2px 0 10px; color: var(--floor-gold); font-family: Georgia, serif; font-size: 1.35rem; }
.current_player_status span { color: rgba(255, 255, 255, 0.78); font-size: 0.78rem; }
.current_player_status b { color: #fff; font-size: 1.05rem; }
.top_list h2 { margin: 15px 0 8px; color: var(--floor-gold); font-family: Georgia, serif; font-size: 1.12rem; }
.top_list ul { max-height: 275px; margin: 0; padding: 0; overflow-y: auto; list-style: none; }
.top_list li { display: flex; justify-content: space-between; gap: 8px; padding: 6px 8px; border-bottom: 1px solid rgba(255, 255, 255, 0.1); color: rgba(255, 255, 255, 0.78); font-size: 0.73rem; }

.name-modal { position: fixed; inset: 0; z-index: 10000; display: grid; place-items: center; padding: 16px; background: rgba(2, 9, 20, 0.86); backdrop-filter: blur(14px); }
.name-card { width: min(430px, 100%); padding: 27px; border: 2px solid rgba(106, 229, 255, 0.62); border-radius: 28px; color: #fff; background: linear-gradient(145deg, rgba(8, 58, 76, 0.98), rgba(26, 23, 60, 0.98)); box-shadow: 0 30px 90px rgba(0, 0, 0, 0.65), 0 0 32px rgba(84, 215, 255, 0.25); text-align: center; }
.name-card > img { width: 125px; height: 125px; object-fit: contain; filter: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.35)); }
.name-card h2 { margin: 7px 0; font-family: Georgia, serif; font-size: 1.55rem; }
.name-card p { margin: 0 0 16px; color: rgba(255, 255, 255, 0.72); line-height: 1.45; }
.name-card label { display: block; margin-bottom: 6px; color: var(--floor-gold); font-size: 0.75rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.09em; }
.name-card input { width: 100%; min-height: 48px; padding: 10px 14px; border: 1px solid rgba(255, 255, 255, 0.35); border-radius: 14px; color: #fff; background: rgba(255, 255, 255, 0.1); font: inherit; text-align: center; }
.name-card input::placeholder { color: rgba(255, 255, 255, 0.55); }
.name-card input:focus { outline: 3px solid rgba(255, 227, 154, 0.48); }
.name-card button { min-height: 48px; margin-top: 13px; padding: 9px 22px; border: 1px solid rgba(255, 255, 255, 0.34); border-radius: 999px; color: #153444; background: var(--floor-gold); cursor: pointer; font: inherit; font-weight: 900; }

html[data-world="lili"] .score_panel { background: rgba(62, 22, 74, 0.88) !important; }
html[data-world="lili"] .name-card { border-color: rgba(255, 151, 220, 0.68); background: linear-gradient(145deg, rgba(105, 37, 102, 0.98), rgba(40, 25, 78, 0.98)); box-shadow: 0 30px 90px rgba(0, 0, 0, 0.65), 0 0 32px rgba(255, 112, 211, 0.26); }

@media (max-width: 900px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .floor-shell { justify-content: flex-start; padding-top: 24px; }
  .card { min-height: 235px !important; }
  .floor-r2 .floor-content { grid-template-columns: 1fr; }
  .floor-r2 .cards { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .score_panel { display: grid; grid-template-columns: 220px 1fr; gap: 14px; }
  .top_list h2 { margin-top: 0; }
  .top_list ul { max-height: 125px; }
}

@media (max-width: 620px) {
  .floor-topbar, .floor-shell { width: min(100% - 16px, 1260px); }
  .floor-topbar { min-height: 64px; }
  .floor-control strong { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .floor-control { width: 44px !important; min-width: 44px; min-height: 44px; padding: 5px !important; justify-content: center; }
  .floor-identity { min-height: 46px; padding-right: 10px; }
  .floor-identity img { width: 40px; height: 40px; }
  .floor-identity small { font-size: 0.58rem; }
  .top-actions { gap: 5px; }
  .icon-control { width: 42px !important; min-width: 42px; }
  .floor-shell { padding: 11px 0 90px; }
  .welcome-copy { margin-bottom: 12px; }
  .welcome-copy > span { font-size: 0.78rem; }
  .panel_wrap { padding: 9px !important; border-radius: 22px !important; }
  .cards { grid-template-columns: 1fr !important; gap: 9px !important; }
  .card { min-height: 132px !important; display: grid !important; grid-template-columns: 88px minmax(0, 1fr); grid-template-rows: 1fr auto; padding: 10px !important; text-align: left; }
  .floor-r2 .cards { grid-template-columns: 1fr !important; }
  .floor-r2 .card { min-height: 124px !important; }
  .card_icon { width: 80px !important; height: 80px !important; grid-row: 1 / 3; margin: 0 !important; border-radius: 20px !important; }
  .card_icon img { width: 62px !important; height: 62px !important; }
  .crystal-icon { font-size: 2.65rem !important; }
  .card-copy { align-items: flex-start; align-self: end; padding-left: 6px; }
  .card_title { min-height: 0; justify-content: flex-start; font-size: 1.06rem !important; text-align: left; }
  .card_sub { min-height: 0; font-size: 0.7rem !important; }
  .play-label { min-height: 32px; justify-self: start; margin: 5px 0 0 6px; padding: 5px 10px; font-size: 0.7rem; }
  .floor-bottom { bottom: max(7px, env(safe-area-inset-bottom)); }
  .ui-narration { min-height: 47px; padding-right: 12px; }
  .ui-narration-char { width: 37px; height: 37px; }
  .ui-narration-text { font-size: 0.78rem; }
  .yt_bubble { top: 66px !important; right: 8px !important; }
  .score_panel { display: block; padding: 10px !important; border-radius: 20px !important; }
  .top_list { display: none; }
  .current_player_status { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; }
  .current_player_status small { display: none; }
  .current_player_status > strong { margin: 0; font-size: 1rem; }
  .name-card { padding: 20px 16px; border-radius: 23px; }
  .name-card > img { width: 100px; height: 100px; }
}

@media (max-width: 390px) {
  .floor-identity small { display: none; }
  .floor-identity { padding-right: 9px; }
  .top-actions .music-control { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

/* === MW FINAL GLOBAL GLASSMORPHISM PASS === */
.panel_wrap,
.stage {
  background: linear-gradient(145deg, rgba(28, 38, 58, 0.38), rgba(18, 22, 38, 0.26)) !important;
  border-color: rgba(255, 232, 190, 0.30) !important;
  box-shadow: 0 24px 58px rgba(0, 0, 0, 0.28), inset 0 0 34px rgba(255, 255, 255, 0.045) !important;
  backdrop-filter: blur(10px) saturate(1.08) !important;
  -webkit-backdrop-filter: blur(10px) saturate(1.08) !important;
}

.card,
.subject-card {
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.145), rgba(20, 26, 44, 0.265)) !important;
  border-color: rgba(255, 232, 190, 0.28) !important;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.23), inset 0 0 22px rgba(255, 255, 255, 0.045) !important;
  backdrop-filter: blur(8px) saturate(1.10) !important;
  -webkit-backdrop-filter: blur(8px) saturate(1.10) !important;
}

.card:hover,
.card:focus-visible,
.subject-card:hover,
.subject-card:focus-visible {
  background: linear-gradient(155deg, rgba(255, 238, 194, 0.24), rgba(36, 44, 70, 0.36)) !important;
  border-color: rgba(255, 238, 194, 0.72) !important;
  box-shadow: 0 22px 44px rgba(0, 0, 0, 0.28), 0 0 24px rgba(255, 226, 170, 0.16) !important;
}

.card_icon,
.subject-icon {
  background: rgba(10, 14, 24, 0.18) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  box-shadow: inset 0 0 18px rgba(255, 255, 255, 0.045), 0 10px 22px rgba(0, 0, 0, 0.16) !important;
  backdrop-filter: blur(5px) !important;
  -webkit-backdrop-filter: blur(5px) !important;
}

.card_icon img,
.subject-icon img {
  filter: drop-shadow(0 10px 15px rgba(0,0,0,0.35));
}

.card_title,
.subject-copy strong {
  color: #ffe9b8 !important;
  text-shadow: 0 3px 14px rgba(0,0,0,0.42) !important;
}

.card_sub,
.subject-copy small {
  color: rgba(255,255,255,0.76) !important;
}

/* Keep the floating title/header area clean: no card behind it. */
.welcome-copy,
.hero {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
