/* Home-only rules: game pages and existing account screens keep their layout. */
.home-page{--home-nav-height:76px;--home-accent:#1d4ed8;scroll-padding-bottom:calc(var(--home-nav-height) + env(safe-area-inset-bottom) + 20px)}
.home-page .home-main{padding-bottom:calc(var(--home-nav-height) + env(safe-area-inset-bottom) + 36px);min-height:calc(100svh - 90px)}
.home-page .section-label{display:block;font-size:11px;letter-spacing:.12em;font-weight:800;color:#49648e;margin-bottom:6px}
.home-page .home-heading{margin-bottom:22px}.home-page .home-heading h1:focus{outline:none}
.home-page .play-grid{grid-template-columns:repeat(5,minmax(0,1fr));gap:16px}
.home-page .play-grid .game-icon-card{min-width:0;padding:20px 8px;gap:12px}
.home-page .play-grid .game-icon-name{text-align:center;font-size:14px;overflow-wrap:anywhere;line-height:1.45}
.home-page .play-grid .game-icon{width:78px;height:78px;border-radius:22px}
.bottom-nav{position:fixed;bottom:0;left:0;right:0;z-index:30;display:block;background:#fff;border-top:1px solid #dde3ed;padding:0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);box-shadow:0 -4px 18px #1d365208}
.bottom-nav>div{max-width:600px;margin:auto;display:grid;grid-auto-flow:column;grid-auto-columns:1fr}
.bottom-nav a{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;min-height:76px;font-size:12px;font-weight:750;color:#657186;position:relative}
.bottom-nav svg{width:25px;height:25px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.bottom-nav a[aria-current=page]{color:#1d4ed8;background:#f2f6ff}
.bottom-nav a[aria-current=page]:before{content:'';position:absolute;top:0;left:calc(50% - 17px);width:34px;height:3px;background:#1d4ed8;border-radius:0 0 4px 4px}
.home-view{scroll-margin-bottom:100px}.quest-notice{background:#eaf1fe;border:1px solid #d5e1f7;border-radius:16px;padding:18px 20px;margin-bottom:18px;max-width:760px}
.quest-notice strong{font-size:15px;color:#224f9f}.quest-notice p{font-size:13px;color:#48617e;margin:6px 0 0;line-height:1.7}
.quest-list{display:grid;gap:12px;max-width:760px}.quest-card{display:grid;grid-template-columns:44px 1fr auto;gap:14px;align-items:start;padding:20px;border:1px solid #e0e6ef;border-radius:17px;background:white}
.quest-symbol{display:grid;place-items:center;width:44px;height:44px;border-radius:13px;background:#eff3fb;color:#43659d;font-size:13px;font-weight:800}
.quest-card h2{font-size:17px;margin:0}.quest-card p{font-size:13px;color:#637084;margin:5px 0}.quest-card a{display:inline-flex;align-items:center;gap:12px;min-height:44px;font-size:13px;font-weight:750;color:#2454ac}
.quest-tag{font-size:11px;white-space:nowrap;color:#647080;background:#f1f3f7;border-radius:20px;padding:5px 10px}.quest-footnote{font-size:12px;color:#647080;margin:18px 0}
.my-profile{display:flex;align-items:center;gap:16px;padding:22px;border-radius:20px;background:#fff;border:1px solid #e0e6ef;max-width:760px;margin-bottom:20px}.profile-icon{display:grid;place-items:center;flex:0 0 54px;width:54px;height:54px;border-radius:16px;background:#eaf1ff}.profile-icon svg{width:36px;height:36px;fill:none;stroke:#466cb4;stroke-width:2.5;stroke-linecap:round}.my-profile>div{flex:1;min-width:0}.my-profile strong{display:block;font-size:20px;overflow-wrap:anywhere}.my-profile p{font-size:12px;color:#62748a;margin:5px 0}.my-account-action{font-size:13px;font-weight:750;color:#1d4ed8;min-height:44px;display:flex;align-items:center;gap:10px;white-space:nowrap}
.home-page #view-my .cards-home{max-width:760px;margin:0 0 20px}.my-settings{max-width:760px;border:1px solid #e0e6ef;border-radius:16px;background:#fff;margin-bottom:24px;padding:8px 18px}.my-settings button{display:flex;align-items:center;justify-content:space-between;width:100%;border:0;background:transparent;min-height:48px;text-align:left;color:#26415f;font-size:14px;font-weight:750}.my-settings p{font-size:12px;color:#62748a;line-height:1.7}.my-settings #install-status:empty{display:none}
@media(max-width:850px){.home-page .play-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}}
@media(max-width:540px){.home-page .home-main{padding-top:22px}.home-page .play-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.home-page .play-grid .game-icon-card{padding:14px 5px;gap:10px}.home-page .play-grid .game-icon{width:64px;height:64px;border-radius:18px;padding:6px}.home-page .play-grid .game-icon-name{font-size:12px}.home-page .home-heading{margin-bottom:18px}.quest-card{padding:16px 12px;grid-template-columns:36px 1fr auto;gap:10px}.quest-symbol{width:36px;height:36px;border-radius:11px}.quest-card h2{font-size:15px}.quest-tag{font-size:10px;padding:4px 7px}.my-profile{padding:18px 14px;gap:10px;flex-wrap:wrap}.my-profile strong{font-size:18px}.my-account-action{margin-left:auto}.quest-notice{padding:16px}.home-page .header .brand{font-size:17px}}
@media(orientation:landscape) and (max-height:520px){.home-page{--home-nav-height:60px}.bottom-nav a{min-height:60px;flex-direction:row;gap:8px}.bottom-nav svg{width:22px;height:22px}.home-page .play-grid{grid-template-columns:repeat(5,minmax(0,1fr))}.home-page .play-grid .game-icon{width:56px;height:56px}.home-page .play-grid .game-icon-card{padding:12px 6px}}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}}

html{scroll-padding-bottom:calc(96px + env(safe-area-inset-bottom))}

.home-page .play-divider{border:0;border-top:1px solid #d6dde7;margin:24px 0}

/* Story tools stay in their tab; account settings live in MY. */
.home-page .header .wrap{flex-wrap:nowrap;min-height:64px}
.home-page .header .studio-icon{position:relative;display:grid;place-items:center;width:44px;height:44px;flex:none;border:1px solid #d7e2fa;border-radius:14px;color:#1d4ed8;background:#edf3ff;text-decoration:none}
.studio-icon svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.home-page .header .studio-icon:focus-visible{outline:3px solid #1d4ed8;outline-offset:3px}
.home-page .header .studio-icon:active{background:#dce8ff}
#studio-unread{position:absolute;top:-4px;right:-5px;display:grid;place-items:center;min-width:19px;height:19px;padding:0 4px;border-radius:12px;background:#1d4ed8;color:#fff;font-size:10px;font-weight:750;border:2px solid #fff;line-height:1}
@media(max-width:420px){.home-page .header .wrap{gap:8px}.home-page .header .brand{font-size:15px}}

/* The bottom-nav MY view is the four peer-menu landing, not an old profile/card dashboard. */
#view-my .my-menu-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;max-width:760px}
#view-my .my-menu-card{position:relative;display:flex;flex-direction:column;align-items:flex-start;gap:13px;min-width:0;min-height:166px;padding:20px;border:1px solid #dfe6f1;border-radius:18px;background:#fff;box-shadow:0 5px 20px #223d6209;color:#233550}
#view-my .my-menu-card:active{transform:scale(.99)}
#view-my .my-menu-card:focus-visible{outline:3px solid #e8ae48;outline-offset:3px}
#view-my .my-menu-card[hidden]{display:none!important}
#view-my .my-menu-icon{width:46px;height:46px;flex:0 0 46px;border-radius:13px;display:grid;place-items:center;background:#e9f1ff;color:#3263bb}
#view-my .my-menu-icon svg{width:25px;height:25px;stroke:currentColor;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
#view-my .my-menu-admin .my-menu-icon{background:#eef1f8;color:#5367a0}
#view-my .my-menu-body{min-width:0}
#view-my .my-menu-body strong{display:block;font-size:18px;letter-spacing:-.04em;line-height:1.45}
#view-my .my-menu-body small{display:block;font-size:12px;color:#748198;line-height:1.65;margin-top:3px;word-break:keep-all}
#view-my .my-menu-arrow{position:absolute;top:12px;right:17px;color:#6f86b0;font-size:24px}
@media(max-width:560px){
 #view-my .my-menu-grid{grid-template-columns:1fr;gap:12px}
 #view-my .my-menu-card{flex-direction:row;align-items:center;min-height:106px;padding:19px 18px;gap:14px}
 #view-my .my-menu-icon{flex:0 0 46px}
 #view-my .my-menu-body{flex:1}
 #view-my .my-menu-arrow{position:static;flex:0 0 auto;margin-left:auto}
}

#economy-header{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:0;margin-left:auto;color:#224f9f;font-size:12px;white-space:nowrap}
#economy-header strong{font-size:16px;color:#cb3d55;font-variant-numeric:tabular-nums}
#economy-header span{font-size:10px;color:#62799b}
#view-quests .quest-login{display:inline-flex;align-items:center;min-height:44px;border:1px solid #c3d3ed;color:#2454aa;background:#edf3ff;border-radius:9px;padding:8px 14px;font-size:13px;font-weight:750;margin:8px 0 15px}
#view-quests [hidden]{display:none!important}
#view-quests .quest-list{max-width:720px}
#view-quests .quest-row{background:#fff;border:1px solid #dfe7f0;border-radius:13px;padding:16px;display:flex;align-items:center;gap:13px;justify-content:space-between}
#view-quests .quest-row strong{font-size:14px}#view-quests .quest-row p{font-size:12px;color:#6e7e91;margin:4px 0 0}
#view-quests .quest-row button{min-height:44px;min-width:90px;border:0;background:#2355bd;color:white;border-radius:10px;font-size:12px;font-weight:800}
#view-quests .quest-row button:disabled{opacity:.5}
#view-quests .quest-info{font-size:13px;line-height:1.65;color:#697d95;margin:7px 0}
@media(max-width:430px){#economy-header{margin-left:0}#economy-header strong{font-size:13px}#economy-header span{font-size:9px}}

#s7-heart-timer{font-size:10px;color:#607797;font-variant-numeric:tabular-nums;line-height:1.4;white-space:nowrap}
#view-quests .heart-refill-row{border-color:#a9c7ed;background:#f1f7ff}
#view-quests .heart-refill-row button:enabled{background:#1d63b7}
@media(max-width:430px){#s7-heart-timer{font-size:9px}}

/* 60-minute daily budget and five content categories. */
#economy-header{min-width:96px;align-items:flex-end}
#s7-playtime-count{color:#2757a4!important;font-size:13px!important}
#s7-playtime-hint{font-size:10px;color:#74869b;white-space:normal;text-align:right}
.play-categories{display:grid;gap:26px}
.play-category{padding:0 0 20px;border-bottom:1px solid #e0e5ec}
.play-category-heading{display:flex;align-items:center;gap:9px;margin:0 0 14px;font-size:21px;letter-spacing:-.045em}
.play-category-heading .play-category-counter{font-size:11px;color:#7b889c;font-weight:650}
.play-category-note{margin:-8px 0 14px;color:#71839b;font-size:12px}
.play-category .play-grid{margin:0}
@media(max-width:540px){.play-categories{gap:18px}.play-category-heading{font-size:18px}}

#home-tools{display:flex;gap:7px;align-items:center}
#home-tools[hidden]{display:none!important}
#story-request-link{background:#e9f7f2!important;border-color:#cbe8dc!important;color:#197453!important}
@media(max-width:430px){#home-tools{gap:5px}.home-page .header .studio-icon{width:40px;height:40px}}

/* Header account action: always offer a real sign-in button when signed out. */
#economy-header [hidden]{display:none!important}
#s7-header-stats{display:flex;flex-direction:column;align-items:flex-end;gap:2px}
#s7-header-login{display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:8px 13px;border-radius:12px;border:1px solid #a7c1ec;background:#e9f1ff;color:#2054ae;font-size:13px;font-weight:800;text-decoration:none;white-space:nowrap}
#s7-header-login:focus-visible{outline:3px solid #ffbd57;outline-offset:2px}
@media(max-width:430px){#economy-header{min-width:0}#s7-header-login{font-size:12px;padding-inline:10px}}

/* Space series admin entry: visible title instead of an ambiguous studio icon. */
.home-page .header .studio-icon.space-admin-entry{display:inline-flex;align-items:center;justify-content:center;gap:8px;width:auto;height:auto;min-height:44px;padding:9px 12px;font-size:13px;line-height:1.4;font-weight:750;white-space:nowrap}
#story-studio-label[hidden]{display:none!important}
@media(max-width:640px){
 .home-page.space-admin-context .header .wrap{flex-wrap:wrap;gap:8px 12px;padding-top:10px;padding-bottom:10px}
 .home-page.space-admin-context #home-tools{order:3;flex-basis:100%;justify-content:flex-end}
 .home-page.space-admin-context #story-studio-link.space-admin-entry{width:100%;box-sizing:border-box}
 .home-page.space-admin-context #economy-header{margin-left:auto}
}

.game-locked{cursor:not-allowed}.game-locked .game-icon>svg{filter:grayscale(1);opacity:.35}.game-locked .game-icon-name{color:#738094}.game-lock-mark{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;border-radius:inherit;background:#17223b20;color:#26374c;font:700 10px/1.3 system-ui}.game-lock-mark svg{width:24px;height:24px;fill:#f1f5fb;stroke:currentColor;stroke-width:2}.game-locked .game-update-mark{display:none}
