/* Home only: the real game pages keep their existing layout and colours. */
body[data-site-home]{
  --home-safe-top:env(safe-area-inset-top,0px);
  --home-safe-right:env(safe-area-inset-right,0px);
  --home-safe-bottom:env(safe-area-inset-bottom,0px);
  --home-safe-left:env(safe-area-inset-left,0px);
}
body[data-site-home].classic-beach.cozy-room{background:#fff!important;background-image:none!important;color:#173b56}
body[data-site-home].cozy-room>.app-shell{background:transparent!important;background-image:none!important;min-height:100vh;min-height:100dvh}
body[data-site-home]>.bingo-color-world{background:#fff!important}
body[data-site-home]>.bingo-color-world::before,
body[data-site-home]>.bingo-color-world::after,
body[data-site-home] .bingo-world-orbit{display:none!important}
body[data-site-home] .bingo-world-ball{filter:drop-shadow(0 10px 12px #24476026)}
body[data-site-home] .bingo-world-spark{text-shadow:none;opacity:.7}

/* Override the old 70px mascot header, including its stronger mobile selector. */
body[data-site-home] .topbar,
body[data-site-home] .topbar.classic-mascot-header{
  position:relative!important;top:auto!important;z-index:30;
  display:flex;flex-wrap:wrap;align-items:center!important;justify-content:space-between;
  width:100%;height:auto!important;min-height:0;gap:12px!important;
  padding:calc(var(--home-safe-top) + 10px) max(16px,var(--home-safe-right),calc((100vw - 1160px)/2)) 10px max(16px,var(--home-safe-left),calc((100vw - 1160px)/2))!important;
  overflow:visible;background:#fffffff2!important;border:0!important;box-shadow:none!important;backdrop-filter:none!important;
}
body[data-site-home] .topbar>.brand,
body[data-site-home] .topbar>.classic-mascot-brand{
  position:relative!important;left:auto!important;top:auto!important;display:block!important;
  width:150px!important;height:104px!important;flex:0 0 150px!important;margin:0;overflow:visible;
}
body[data-site-home] .topbar .classic-mascot-brand .approved-logo{left:0;top:42px;width:104px!important;max-width:100%}
body[data-site-home] .topbar .classic-lion-mascot{left:48px;top:0;width:96px;height:96px}
body[data-site-home] .topbar>.season-pill{display:none!important}
body[data-site-home] .topbar>.top-actions,
body[data-site-home] .topbar>.top-actions.has-world-ranking{
  position:relative;display:flex;flex:1 1 560px;flex-wrap:wrap;align-items:center;justify-content:flex-end;
  width:auto;max-width:none;min-width:0;min-height:60px;margin:0;padding:8px!important;gap:7px!important;
  border-radius:24px;overflow:visible;
}
body[data-site-home] .topbar>.top-actions>button,
body[data-site-home] .topbar>.top-actions.has-world-ranking>button,
body[data-site-home] .topbar>.top-actions>.home-bank-trigger{
  grid-column:auto!important;grid-row:auto!important;flex:0 1 auto;
  min-width:44px!important;min-height:44px!important;height:44px!important;max-width:100%;margin:0;
}
body[data-site-home] .topbar>.top-actions>.friends-toolbar-trigger{padding:6px 10px;font:850 12px/1.15 Nunito,Arial,sans-serif}
body[data-site-home] .topbar>.top-actions>.home-world-ranking-open{flex-basis:80px;width:80px;padding:2px 5px!important;gap:0;font-size:10px;line-height:12px}
body[data-site-home] .topbar .home-world-ranking-icon{width:32px;height:26px;flex:none}
body[data-site-home] .topbar>.top-actions>.classic-xp-bank.home-bank-trigger{flex:0 1 auto;gap:0;padding:0 5px 0 0!important;border-radius:14px}
body[data-site-home] .topbar .classic-bank-art.home-bank-art,
body[data-site-home] .topbar .has-world-ranking .classic-bank-art.home-bank-art{display:block!important;width:42px!important;height:42px!important;flex:0 0 42px;margin-right:-10px}
body[data-site-home] .topbar .classic-xp-bank.home-bank-trigger .classic-bank-count{min-width:0;max-width:100%;padding:4px 7px 4px 11px}
body[data-site-home] .topbar .classic-xp-bank.home-bank-trigger .classic-bank-count b{font-size:16px;line-height:18px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
body[data-site-home] .topbar .classic-xp-bank.home-bank-trigger .classic-bank-count small{font-size:8px;line-height:10px}
body[data-site-home] .topbar>.top-actions>.account-access{white-space:normal;overflow-wrap:anywhere;text-align:center}

/* Keep the existing theme cards and Friends component, on a legible white page. */
body[data-site-home].has-theme-portfolio .page-wrap{
  max-width:1160px!important;margin-inline:auto!important;
  padding:16px max(16px,var(--home-safe-right)) max(24px,var(--home-safe-bottom)) max(16px,var(--home-safe-left))!important;
}
body[data-site-home] .theme-portfolio{color:#173b56;padding-top:0}
body[data-site-home] .theme-portfolio-heading{margin-bottom:14px}
body[data-site-home] .theme-portfolio-heading>span{color:#17649b}
body[data-site-home] .theme-portfolio-heading h1{color:#173b56}
body[data-site-home] .theme-portfolio-heading p,
body[data-site-home] .theme-portfolio-gesture{color:#506e84}
body[data-site-home] .theme-portfolio-gesture>span{color:#1d7caf}
body[data-site-home] .theme-portfolio-rail{padding:12px 0 20px}
body[data-site-home] .page-wrap>footer{color:#577186;border-top-color:#dbe7ef;gap:10px;flex-wrap:wrap}
body[data-site-home] .page-wrap>footer a{color:#23658d}

@media(max-width:980px){
  body[data-site-home] .topbar,
  body[data-site-home] .topbar.classic-mascot-header{display:grid;grid-template-columns:112px minmax(0,1fr);gap:10px!important;align-items:center!important}
  body[data-site-home] .topbar>.brand,
  body[data-site-home] .topbar>.classic-mascot-brand{width:112px!important;height:100px!important;flex-basis:auto!important}
  body[data-site-home] .topbar .classic-mascot-brand .approved-logo{top:36px;width:88px!important}
  body[data-site-home] .topbar .classic-lion-mascot{left:28px;top:0;width:82px;height:82px}
  body[data-site-home] .topbar>.top-actions,
  body[data-site-home] .topbar>.top-actions.has-world-ranking{
    display:grid;grid-template-columns:repeat(3,minmax(0,1fr));grid-auto-rows:minmax(44px,auto);align-items:stretch;
    width:100%;min-height:0;margin:0;padding:6px!important;gap:6px!important;border-radius:21px;
  }
  body[data-site-home] .topbar>.top-actions>button,
  body[data-site-home] .topbar>.top-actions.has-world-ranking>button,
  body[data-site-home] .topbar>.top-actions>.home-bank-trigger{
    grid-column:auto!important;grid-row:auto!important;flex:none;display:flex!important;align-items:center;justify-content:center;
    width:100%!important;min-width:44px!important;max-width:100%;min-height:44px!important;height:auto!important;padding:3px 5px!important;font-size:11px;
  }
  body[data-site-home] .topbar>.top-actions>.home-world-ranking-open{flex-direction:column;gap:0;font-size:9px;line-height:11px}
  body[data-site-home] .topbar .home-world-ranking-icon{width:30px;height:25px}
  body[data-site-home] .topbar>.top-actions>.classic-xp-bank.home-bank-trigger{padding:0 3px 0 0!important}
  body[data-site-home] .topbar .classic-bank-art.home-bank-art,
  body[data-site-home] .topbar .has-world-ranking .classic-bank-art.home-bank-art{width:32px!important;height:38px!important;flex-basis:32px}
  body[data-site-home] .topbar .classic-xp-bank.home-bank-trigger .classic-bank-count{padding:4px 4px 4px 9px}
  body[data-site-home] .topbar .classic-xp-bank.home-bank-trigger .classic-bank-count b{font-size:14px;line-height:16px}
  body[data-site-home] .topbar .profile-chip-name{position:absolute;width:1px;height:1px;margin:-1px;padding:0;border:0;overflow:hidden;clip:rect(0,0,0,0);clip-path:inset(50%);white-space:nowrap}
  body[data-site-home] .topbar .profile-chip .chevron{display:none!important}
}
@media(max-width:599px){
  body[data-site-home] .topbar,
  body[data-site-home] .topbar.classic-mascot-header{
    grid-template-columns:88px minmax(0,1fr);gap:8px!important;
    padding:calc(var(--home-safe-top) + 10px) max(12px,var(--home-safe-right)) 8px max(12px,var(--home-safe-left))!important;
  }
  body[data-site-home] .topbar>.brand,
  body[data-site-home] .topbar>.classic-mascot-brand{width:88px!important;height:92px!important}
  body[data-site-home] .topbar .classic-mascot-brand .approved-logo{top:35px;width:76px!important}
  body[data-site-home] .topbar .classic-lion-mascot{left:18px;width:68px;height:68px}
  body[data-site-home] .topbar>.top-actions,
  body[data-site-home] .topbar>.top-actions.has-world-ranking{padding:5px!important;gap:4px!important}
  body[data-site-home] .topbar>.top-actions>.account-access,
  body[data-site-home] .topbar>.top-actions.has-world-ranking>.account-access{font-size:clamp(9px,2.55vw,10px)!important;line-height:12px;overflow-wrap:normal;word-break:normal;hyphens:none}
  body[data-site-home] .topbar>.top-actions>.friends-toolbar-trigger{font-size:11px}
  body[data-site-home].has-theme-portfolio .page-wrap{padding-top:12px!important;padding-inline:max(12px,var(--home-safe-left)) max(12px,var(--home-safe-right))!important}
  body[data-site-home] .theme-portfolio-heading{padding-inline:0}
  body[data-site-home] .theme-portfolio-heading h1{font-size:29px}
  body[data-site-home] .theme-portfolio-heading p{font-size:13px}
  body[data-site-home] .bingo-world-ball{opacity:.62}
}
@media(max-width:359px){
  body[data-site-home] .topbar,
  body[data-site-home] .topbar.classic-mascot-header{grid-template-columns:68px minmax(0,1fr);gap:6px!important}
  body[data-site-home] .topbar>.brand,
  body[data-site-home] .topbar>.classic-mascot-brand{width:68px!important;height:86px!important}
  body[data-site-home] .topbar .classic-mascot-brand .approved-logo{top:34px;width:65px!important}
  body[data-site-home] .topbar .classic-lion-mascot{left:8px;width:58px;height:58px}
  body[data-site-home] .topbar .classic-bank-art.home-bank-art,
  body[data-site-home] .topbar .has-world-ranking .classic-bank-art.home-bank-art{width:24px!important;height:34px!important;flex-basis:24px;margin-right:-8px}
  body[data-site-home] .topbar .classic-xp-bank.home-bank-trigger .classic-bank-count{padding-left:7px;padding-right:2px}
  body[data-site-home] .topbar .classic-xp-bank.home-bank-trigger .classic-bank-count b{font-size:12px}
  body[data-site-home] .topbar>.top-actions.has-world-ranking>.account-access{padding-inline:2px!important}
}
@media(orientation:landscape) and (max-height:500px) and (min-width:700px){
  body[data-site-home] .topbar,
  body[data-site-home] .topbar.classic-mascot-header{grid-template-columns:88px minmax(0,1fr);gap:8px!important;padding-top:calc(var(--home-safe-top) + 8px)!important;padding-bottom:6px!important}
  body[data-site-home] .topbar>.brand,
  body[data-site-home] .topbar>.classic-mascot-brand{width:88px!important;height:80px!important}
  body[data-site-home] .topbar .classic-mascot-brand .approved-logo{top:29px;width:72px!important}
  body[data-site-home] .topbar .classic-lion-mascot{left:22px;width:62px;height:62px}
  body[data-site-home] .topbar>.top-actions,
  body[data-site-home] .topbar>.top-actions.has-world-ranking{grid-template-columns:repeat(6,minmax(0,1fr));gap:5px!important;padding:5px!important}
  body[data-site-home] .topbar>.top-actions>.account-access{font-size:10px;line-height:12px}
  body[data-site-home].has-theme-portfolio .page-wrap{padding-top:8px!important}
}
