.home-body { height: auto; min-height: 100%; overflow-y: auto; }
.home { max-width: 1240px; margin: 0 auto; padding: max(20px, env(safe-area-inset-top)) 28px 40px; display: flex; flex-direction: column; gap: 18px; }
.home .top { height: 64px; }
.home .brand { border-right: none; }
.brand-name.big { font-size: 24px; }
.home .pill { display: inline-flex; align-items: center; text-decoration: none; color: var(--text); }
.notice { padding: 12px 16px; border-radius: 16px; background: #3A2E12; border: 2px solid var(--sun); color: #F2E6C4; font-size: 15px; font-weight: 700; }
.notice.bad { background: var(--danger-bg); border-color: #F2A98A; color: var(--danger); }
.hello { margin: 4px 0 0; font-family: 'Fredoka', sans-serif; font-weight: 600; font-size: 36px; line-height: 1.15; }
.home-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 24px; }
.col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: 16px 18px; }
.module { display: flex; gap: 18px; align-items: center; padding: 12px 18px 12px 12px; }
.module-art { width: 140px; height: 112px; flex-shrink: 0; border-radius: 16px; background: #fff; display: flex; align-items: center; justify-content: center; }
.module-words { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.module-words h3 { margin: 0; font-family: 'Fredoka', sans-serif; font-weight: 600; font-size: 23px; }
.module-words p { margin: 0; color: var(--text2); font-size: 15px; }
.soon { align-self: flex-start; margin-top: 6px; height: 28px; padding: 0 12px; border-radius: 14px; background: var(--chip); color: var(--sun); font-size: 13px; font-weight: 800; display: inline-flex; align-items: center; }
.sandbox-card { display: flex; flex-direction: column; gap: 12px; }
.lead { margin: 0; font-family: 'Fredoka', sans-serif; font-weight: 500; font-size: 20px; line-height: 1.3; }
.big-btn { height: 58px; border-radius: 29px; background: var(--sun); color: var(--bg); font-size: 18px; font-weight: 800; text-decoration: none; display: flex; align-items: center; justify-content: center; gap: 10px; }
.continue { align-self: center; height: 44px; display: flex; align-items: center; font-size: 15px; font-weight: 800; }
.account-card { display: flex; flex-direction: column; gap: 10px; }
.account-card h3 { margin: 0; font-size: 13px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.acct-row { display: flex; align-items: center; gap: 12px; }
.acct-row .initial { width: 48px; height: 48px; border-radius: 24px; background: var(--sun); color: var(--bg); display: flex; align-items: center; justify-content: center; font-family: 'Fredoka', sans-serif; font-weight: 600; font-size: 22px; flex-shrink: 0; }
.acct-row .who { display: flex; flex-direction: column; min-width: 0; }
.acct-row .who b { font-size: 18px; }
.acct-row .who small { color: var(--muted); font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.mine { display: flex; flex-direction: column; gap: 12px; }
.mine-head { display: flex; align-items: baseline; gap: 12px; }
.mine-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.anim-card { display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 8px; }
.anim-card img { width: 100%; aspect-ratio: 800 / 560; border-radius: 12px; background: #fff; display: block; object-fit: cover; }
.anim-card b { font-size: 16px; padding: 0 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.anim-card small { font-size: 13px; color: var(--muted); font-weight: 700; padding: 0 4px 4px; }
.anim-card.device { border-style: dashed; }
.empty-mine { padding: 22px; border: 2px dashed var(--line2); border-radius: 18px; color: var(--muted); font-size: 15px; font-weight: 700; text-align: center; }
@media (max-width: 860px) {
  .home-grid { grid-template-columns: 1fr; }
  .hello { font-size: 28px; }
  .home .pill[href] { display: none; }
}
@media (max-width: 520px) {
  .home { padding: 14px; }
  .module-art { width: 100px; height: 84px; }
  .module-art svg { width: 96px; height: 82px; }
}

/* Home always shows the app name, even on small screens */
.home .brand-words { display: flex; }
@media (max-width: 420px) { .brand-name.big { font-size: 19px; } .home .brand img { width: 32px; height: 32px; } }

.module-link { text-decoration: none; color: var(--text); border: 2px solid var(--sun); }
.module-link:hover { background: var(--panel2); }
.go-btn { align-self: flex-start; margin-top: 6px; height: 40px; padding: 0 18px; border-radius: 20px; background: var(--sun); color: var(--bg); font-size: 15px; font-weight: 800; display: inline-flex; align-items: center; }

/* Challenges and community */
.ch-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.ch-card.month canvas { width: 100%; aspect-ratio: 800 / 560; border-radius: 14px; display: block; margin-top: 8px; }
.ch-card { display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: var(--text); }
.ch-card h3 { margin: 0; font-family: 'Fredoka', sans-serif; font-weight: 600; font-size: 26px; }
.ch-card p { margin: 0; font-weight: 600; color: var(--text2); }
.ch-card.month { background: linear-gradient(120deg, #3A2614, var(--panel) 70%); }
.ch-card.month .big-btn { align-self: flex-start; margin-top: 6px; padding: 0 28px; }
.ch-card.course canvas { width: 100%; aspect-ratio: 800 / 560; border-radius: 14px; display: block; }
.ch-card.course:hover, .ch-card.course:focus-visible { border-color: var(--sun); }
.ch-kicker { font-size: 13px; font-weight: 900; letter-spacing: 0.1em; text-transform: uppercase; color: var(--sun); }
.comm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; align-items: start; }
.comm-card { display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 18px; background: var(--panel); border: 2px solid var(--line); }
.comm-card canvas { width: 100%; aspect-ratio: 320 / 224; border-radius: 10px; display: block; }
.comm-words { display: flex; flex-direction: column; gap: 2px; }
.comm-words b { font-size: 15px; font-weight: 800; }
.comm-words span { font-size: 13px; font-weight: 700; color: var(--muted); }
.comm-words .pick { font-style: normal; color: var(--sun); }
.comm-soon { justify-content: center; border-style: dashed; gap: 6px; padding: 16px; }
.comm-soon b { font-size: 16px; font-weight: 800; }
.comm-soon span { font-size: 14px; font-weight: 600; color: var(--muted); }
@media (max-width: 760px) { .ch-grid { grid-template-columns: 1fr; } }
html.look-desk .ch-card.month { background: linear-gradient(120deg, #5A3A20, #3A281A 70%); }
html.look-desk .comm-card canvas, html.look-desk .ch-card.course canvas { border-radius: 4px; box-shadow: 0 3px 8px rgba(0,0,0,0.4); }
.see-all { margin-left: auto; font-size: 14px; font-weight: 800; color: var(--sun); }
a.comm-card { text-decoration: none; color: var(--text); }
.comm-card { position: relative; }
.comm-open { display: flex; flex-direction: column; gap: 8px; text-align: left; color: inherit; padding: 0; }
.heart { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 18px; border: 2px solid var(--line2); color: var(--muted); font-weight: 800; font-size: 15px; align-self: flex-start; }
.heart svg { fill: none; stroke: currentColor; stroke-width: 2.2; }
.heart[aria-pressed="true"] { color: #FF6B8A; border-color: #FF6B8A; }
.heart[aria-pressed="true"] svg { fill: currentColor; }
.viewer-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.loves { color: #FF6B8A; font-weight: 800; }
.anim-card canvas { width: 100%; aspect-ratio: 320 / 224; border-radius: 12px; display: block; background: #fff; }

/* Top of home after the intro: your animations, with a small challenge tile and what's next beside them */
.home-top { display: grid; grid-template-columns: 1.5fr 1fr; gap: 24px; align-items: start; } /* same columns as the cards below */
.home-top-main .mine-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.home-top-side { display: flex; flex-direction: column; gap: 14px; }
.ch-tile { display: flex; gap: 12px; padding: 12px; text-decoration: none; color: var(--text); background: linear-gradient(120deg, #3A2614, var(--panel) 75%); }
.ch-tile canvas { width: 104px; height: 73px; border-radius: 10px; flex-shrink: 0; background: #fff; }
.ch-tile-words { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ch-tile-words .ch-kicker { font-size: 11px; }
.ch-tile-words b { font-family: 'Fredoka', sans-serif; font-weight: 600; font-size: 19px; }
.ch-tile-words .small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile-go { margin-top: 4px; font-size: 14px; font-weight: 800; color: var(--sun); }
.up-next { display: flex; flex-direction: column; gap: 6px; padding: 14px; }
.up-next .kicker { margin: 0 0 2px; }
.next-row { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 14px; text-decoration: none; color: var(--text); }
a.next-row:hover { background: var(--panel2); }
.next-row.soon { opacity: 0.6; }
.next-num { width: 32px; height: 32px; flex-shrink: 0; border-radius: 16px; background: var(--chip); display: flex; align-items: center; justify-content: center; font-family: 'Fredoka', sans-serif; font-weight: 600; }
.next-words { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.next-words b { font-size: 15px; }
.next-words small { font-size: 12px; font-weight: 700; color: var(--muted); }
.next-go { flex-shrink: 0; font-size: 13px; font-weight: 800; color: var(--sun); display: flex; align-items: center; }
.up-next .see-all { align-self: flex-end; margin: 2px 4px 0; }
@media (max-width: 860px) { .home-top { grid-template-columns: 1fr; } }

/* My animations: one row that scrolls sideways */
#mineGrid { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: 8px; scrollbar-width: thin; }
#mineGrid .anim-card { position: relative; flex: 0 0 200px; scroll-snap-align: start; }
.anim-open { display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: var(--text); min-width: 0; }
.anim-open b { font-size: 16px; padding: 0 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.anim-open small { font-size: 13px; color: var(--muted); font-weight: 700; padding: 0 4px 4px; }
.anim-menu { position: absolute; top: 14px; right: 14px; width: 36px; height: 36px; border-radius: 18px; background: rgba(18,19,24,0.75); color: #fff; display: flex; align-items: center; justify-content: center; }
.new-card { justify-content: center; align-items: center; text-align: center; background: var(--sun) !important; border: none !important; color: #121318 !important; min-height: 200px; }
.new-card .new-plus { width: 64px; height: 64px; border-radius: 32px; background: rgba(18,19,24,0.12); display: flex; align-items: center; justify-content: center; font-size: 40px; font-weight: 600; line-height: 1; }
.new-card b { color: #121318; }
.new-card small { color: rgba(18,19,24,0.7) !important; }
.anim-pop .menu-list { display: flex; flex-direction: column; gap: 6px; }
@media (max-width: 640px) { #mineGrid .anim-card { flex-basis: 160px; } }
.home-top-main, .home-top-main .mine, .mine { min-width: 0; }
#mineGrid { max-width: 100%; }
/* Artist-made art for the monthly challenge (from the Curriculum studio) */
.ch-card.month img.ch-art { width: 100%; aspect-ratio: 800 / 560; object-fit: cover; border-radius: 14px; display: block; margin-top: 8px; background: #fff; }
.ch-tile img.ch-art { width: 104px; height: 73px; object-fit: cover; border-radius: 10px; flex-shrink: 0; background: #fff; }
.home-top-main > .col { margin-top: 18px; }
.home-top-side > .col { display: flex; flex-direction: column; gap: 12px; }
.home-grid[hidden] { display: none; }

/* Fun, vibrant titles: the greeting in a gold-to-purple sweep, section titles in bright purple with a gold spark */
.hello { width: fit-content; max-width: 100%; font-weight: 600; background: linear-gradient(95deg, #FFC93C 0%, #FF9F4A 38%, #B07BFF 72%, #8E6BFF 100%); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; }
.home-grid h2.kicker, .home-top h2.kicker, .mine h2.kicker, .up-next h2.kicker, #chTile h2.kicker { display: inline-flex; align-items: center; gap: 10px; font-family: 'Fredoka', sans-serif; font-weight: 600; font-size: 24px; line-height: 1.2; letter-spacing: 0.01em; text-transform: none; color: #A98FFF; }
.home-grid h2.kicker::before, .home-top h2.kicker::before, .mine h2.kicker::before, .up-next h2.kicker::before, #chTile h2.kicker::before { content: ''; flex-shrink: 0; width: 12px; height: 12px; border-radius: 3px; background: #FFC93C; transform: rotate(45deg); box-shadow: 0 0 10px rgba(255, 201, 60, 0.55); }
@media (max-width: 700px) { .home-grid h2.kicker, .home-top h2.kicker, .mine h2.kicker, .up-next h2.kicker, #chTile h2.kicker { font-size: 21px; } }

/* The monthly challenge tile: its title lines up with My animations, so the two boxes start level */
#chTile { display: flex; flex-direction: column; gap: 12px; }
.ch-tile { border: 2px solid rgba(255, 201, 60, 0.55); box-shadow: 0 0 0 1px rgba(169, 143, 255, 0.25), 0 8px 24px rgba(123, 97, 255, 0.18); }
.ch-tile-words b { width: fit-content; max-width: 100%; font-size: 22px; line-height: 1.15; background: linear-gradient(95deg, #FFC93C 0%, #FF9F4A 45%, #B07BFF 100%); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; }
.ch-tile-words .ch-kicker { font-size: 12px; }
