@font-face { font-family: 'Fredoka'; src: url('../assets/fonts/fredoka-latin.woff2') format('woff2'); font-weight: 300 700; font-display: swap; }
:root {
  --ink: #3a2a4a; --cream: #fff8ec; --sun: #ffd23f; --sun-d: #e09b00; --grass: #5ccf5c; --grass-d: #2f9e3a;
  --pink: #ff6f91; --sky: #4fa8ff; --sky-d: #2d7fd6; --lav: #b28cff; --shadow: 0 6px 0 rgba(58, 42, 74, 0.18);
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #8fdc6a; color: var(--ink); font-family: 'Fredoka', 'Trebuchet MS', system-ui, sans-serif; }
body { user-select: none; -webkit-user-select: none; touch-action: none; overscroll-behavior: none; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; touch-action: manipulation; }
button:focus-visible { outline: 4px solid var(--sky); outline-offset: 3px; }
.ic { width: 1.4em; height: 1.4em; flex: none; }
.ic.star { color: var(--sun-d); }
#game { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; display: block; }

/* ---------- screens ---------- */
.screen, .overlay, .hud { display: none; }
body[data-screen="home"] #home, body[data-screen="upgrades"] #upgrades, body[data-screen="skins"] #skins,
body[data-screen="stars"] #stars, body[data-screen="settings"] #settings { display: flex; }
body[data-screen="play"] .hud, body[data-screen="pause"] .hud { display: block; }
body[data-screen="pause"] #pause-card, body[data-screen="result"] #result-card, body[data-screen="break"] #break-card { display: flex; }
#name-picker.open { display: flex; }

.screen { position: fixed; inset: 0; flex-direction: column; align-items: center; padding: calc(14px + var(--safe-t)) 16px calc(16px + var(--safe-b)); overflow: hidden; }
#home { justify-content: space-between; background: linear-gradient(180deg, rgba(255, 248, 236, 0.55), rgba(255, 248, 236, 0) 45%, rgba(255, 248, 236, 0) 60%, rgba(255, 248, 236, 0.65)); }
.sub { background: rgba(255, 248, 236, 0.94); justify-content: flex-start; gap: 12px; overflow-y: auto; touch-action: pan-y; }
.topbar { width: 100%; max-width: 560px; display: flex; justify-content: space-between; gap: 8px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px 6px 8px; min-height: 44px; border-radius: 999px; background: #fff; box-shadow: var(--shadow); font-weight: 700; font-size: 22px; }
.logo { margin: 2vh 0 0; display: flex; flex-direction: column; align-items: center; line-height: 0.88; font-size: clamp(52px, 15vw, 96px); font-weight: 700; letter-spacing: 1px; transform: rotate(-3deg); }
.logo span { color: var(--sun); -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; text-shadow: 0 7px 0 var(--ink); }
.logo span + span { color: var(--pink); margin-left: 1.2em; }
.home-pal { width: min(320px, 80vw); height: min(150px, 20vh); flex: 0 1 auto; }
.big-btn { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 64px; min-width: 220px; padding: 10px 28px; border-radius: 26px;
  background: var(--grass); color: #fff; font-size: 28px; font-weight: 700; box-shadow: 0 7px 0 var(--grass-d); text-shadow: 0 2px 0 rgba(0, 0, 0, 0.18); transition: transform 0.08s; }
.big-btn:active { transform: translateY(5px); box-shadow: 0 2px 0 var(--grass-d); }
.big-btn.play { position: relative; flex-direction: row; flex-wrap: wrap; min-width: 260px; min-height: 92px; font-size: 40px; border-radius: 32px; }
.big-btn.play::after { content: ''; position: absolute; inset: -6px; border-radius: 38px; border: 4px solid rgba(255, 255, 255, 0.85); animation: breathe 2.4s ease-in-out infinite; pointer-events: none; }
.big-btn.play small { flex-basis: 100%; text-align: center; font-size: 18px; margin-top: -4px; opacity: 0.95; }
.big-btn.play .ic { width: 1.1em; height: 1.1em; }
@keyframes breathe { 0%, 100% { transform: scale(1); opacity: 0.9; } 50% { transform: scale(1.06); opacity: 0.2; } }
.update-btn { display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 8px 18px; border-radius: 18px; background: var(--sky); color: #fff; font-weight: 700; box-shadow: 0 5px 0 var(--sky-d); }
.update-btn[hidden] { display: none; }
.nav { width: 100%; max-width: 520px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.nav-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 76px; border-radius: 22px; background: #fff; box-shadow: var(--shadow); font-weight: 600; font-size: 17px; }
.nav-btn .ic { width: 34px; height: 34px; }
#nav-upgrades .ic { color: var(--grass); } #nav-skins .ic { color: var(--pink); } #nav-stars .ic { color: var(--sun-d); } #nav-settings .ic { color: var(--sky); }
.nav-btn:active, .round-btn:active, .soft-btn:active { transform: translateY(3px); }

.sub-head { width: 100%; max-width: 560px; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex: none; }
.sub-head h2 { margin: 0; font-size: 34px; }
.spacer { width: 56px; }
.round-btn { width: 56px; height: 56px; border-radius: 50%; background: #fff; box-shadow: var(--shadow); display: grid; place-items: center; }
.round-btn .ic { width: 28px; height: 28px; }
.list { width: 100%; max-width: 560px; display: flex; flex-direction: column; gap: 12px; }
.upgrade { display: grid; grid-template-columns: 64px 1fr auto; align-items: center; gap: 12px; padding: 12px; border-radius: 24px; background: #fff; box-shadow: var(--shadow); }
.upgrade .u-icon { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; background: #eaffe4; color: var(--grass); }
.upgrade[data-upgrade="speed"] .u-icon { background: #e3f1ff; color: var(--sky); }
.upgrade[data-upgrade="earn"] .u-icon { background: #fff6d6; }
.upgrade .u-icon .ic { width: 44px; height: 44px; }
.upgrade h3 { margin: 0; font-size: 22px; line-height: 1.15; }
.upgrade .lvchip { display: inline-block; margin-right: 4px; padding: 1px 8px; border-radius: 10px; background: #f1ebf8; font-size: 14px; font-weight: 700; vertical-align: 1px; white-space: nowrap; }
.upgrade p { margin: 2px 0 0; font-size: 16px; opacity: 0.8; }
.upgrade .lv { display: flex; gap: 3px; margin-top: 4px; flex-wrap: nowrap; max-width: 127px; } /* one row; dots shrink on narrow phones */
.upgrade .lv i { flex: 0 1 10px; min-width: 5px; aspect-ratio: 1; border-radius: 50%; background: #e5dcef; }
.upgrade .lv i.on { background: var(--grass); }
.buy { display: flex; align-items: center; gap: 6px; min-width: 96px; min-height: 56px; padding: 6px 12px; border-radius: 18px; background: var(--sun); box-shadow: 0 5px 0 var(--sun-d); font-weight: 700; font-size: 22px; justify-content: center; }
.buy:disabled { background: #eee6f3; box-shadow: 0 5px 0 #d6cbe0; color: #9a8aa8; cursor: default; }
.buy:not(:disabled):active { transform: translateY(4px); box-shadow: 0 1px 0 var(--sun-d); }
.buy .ic { width: 26px; height: 26px; }

.grid { width: 100%; max-width: 560px; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; padding-bottom: 12px; }
.skin { position: relative; display: flex; flex-direction: column; align-items: center; padding: 8px 8px 10px; min-height: 150px; border-radius: 22px; background: #fff; box-shadow: var(--shadow); font-weight: 600; font-size: 18px; border: 4px solid transparent; }
.skin canvas { width: 100%; height: 82px; }
.skin.selected { border-color: var(--grass); background: #f1ffec; }
.skin.selected::after { content: '\2713'; position: absolute; top: 6px; right: 10px; color: var(--grass); font-size: 24px; font-weight: 700; }
.skin.locked canvas { filter: grayscale(0.4) brightness(0.92); }
.skin .tag { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; padding: 2px 10px; border-radius: 12px; background: #fff3c4; font-weight: 700; }
.skin .tag .ic { width: 20px; height: 20px; }
.skin .tag.unlock { background: #ece5f7; }
.skin.cant .tag { opacity: 0.65; }

.me-card { width: 100%; max-width: 560px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; padding: 12px; border-radius: 22px; background: #fff; box-shadow: var(--shadow); }
.me-best { display: flex; flex-direction: column; gap: 4px; font-size: 18px; }
.me-best span { display: inline-flex; align-items: center; gap: 6px; }
.name-btn { display: flex; flex-direction: column; align-items: center; min-height: 56px; padding: 6px 16px; border-radius: 18px; background: var(--sky); color: #fff; font-weight: 700; font-size: 20px; box-shadow: 0 5px 0 var(--sky-d); }
.name-btn small { font-size: 13px; opacity: 0.9; }
.boards { width: 100%; max-width: 560px; display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 700px) { .boards { grid-template-columns: 1fr 1fr; } }
.board { padding: 10px 14px; border-radius: 22px; background: #fff; box-shadow: var(--shadow); }
.board h3 { margin: 4px 0 8px; display: flex; align-items: center; gap: 6px; font-size: 20px; }
.board-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.board-list li { display: flex; justify-content: space-between; gap: 8px; padding: 6px 10px; border-radius: 12px; background: #faf5ff; font-size: 18px; }
.board-list li.mine { background: #fff3c4; font-weight: 700; }
.board-list li.soft { justify-content: center; background: none; opacity: 0.75; }
.board-list .rank { width: 2em; font-weight: 700; color: var(--lav); }
.board-list .who { flex: 1; }

.toggle { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 12px; min-height: 72px; padding: 10px 16px; border-radius: 22px; background: #fff; box-shadow: var(--shadow); font-size: 24px; font-weight: 600; text-align: left; }
.toggle .ic { width: 36px; height: 36px; color: var(--sky); }
.switch { position: relative; width: 66px; height: 38px; border-radius: 20px; background: #ddd2e8; transition: background 0.15s; }
.switch::after { content: ''; position: absolute; top: 4px; left: 4px; width: 30px; height: 30px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); transition: transform 0.15s; }
.toggle[aria-pressed="true"] .switch { background: var(--grass); }
.toggle[aria-pressed="true"] .switch::after { transform: translateX(28px); }
.about { max-width: 560px; text-align: center; opacity: 0.75; }

/* ---------- overlays ---------- */
.overlay { position: fixed; inset: 0; align-items: center; justify-content: center; padding: 16px; background: rgba(58, 42, 74, 0.35); z-index: 5; }
.card { width: min(400px, 100%); max-height: 100%; overflow-y: auto; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 18px 18px 22px; border-radius: 30px; background: var(--cream); box-shadow: 0 10px 0 rgba(58, 42, 74, 0.25); text-align: center; animation: pop 0.32s cubic-bezier(0.2, 1.6, 0.4, 1); }
.card.wide { width: min(560px, 100%); }
.card h2 { margin: 0; font-size: 38px; }
.card p { margin: 0; font-size: 20px; }
@keyframes pop { from { transform: scale(0.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.soft-btn { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; min-width: 160px; padding: 6px 18px; border-radius: 18px; background: #fff; box-shadow: var(--shadow); font-size: 20px; font-weight: 600; }
.result-pal { width: 250px; height: 125px; }
#result-card .card { position: relative; }
#result-card .card > :not(.confetti) { position: relative; z-index: 1; } /* confetti falls behind the words and the pal */
.new-pal { display: flex; align-items: center; gap: 10px; padding: 6px 16px 6px 6px; border-radius: 22px; background: #fff2c2; box-shadow: 0 4px 0 rgba(224, 155, 0, 0.35); animation: pop 0.45s 0.25s cubic-bezier(0.2, 1.6, 0.4, 1) both; }
.new-pal[hidden] { display: none; }
.new-pal canvas { width: 110px; height: 56px; }
.new-pal > span { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.1; font-size: 20px; }
.new-pal b { color: var(--sun-d); font-size: 15px; letter-spacing: 0.02em; }
/* Confetti on a win: a short shower over the card. */
.confetti { position: absolute; inset: 0; overflow: hidden; pointer-events: none; border-radius: inherit; display: none; }
#result-card.won .confetti { display: block; }
.confetti i { position: absolute; top: -16px; width: 10px; height: 16px; border-radius: 3px; background: #ff6f91; animation: fall 1.8s ease-in forwards; opacity: 0; }
.confetti i:nth-child(3n) { background: var(--sun); } .confetti i:nth-child(3n+1) { background: #4fa8ff; } .confetti i:nth-child(4n) { background: var(--grass); } .confetti i:nth-child(5n) { background: #b28cff; }
.confetti i:nth-child(1) { left: 3%; animation-delay: 0.05s; } .confetti i:nth-child(2) { left: 9%; animation-delay: 0.3s; } .confetti i:nth-child(3) { left: 5%; animation-delay: 0.62s; }
.confetti i:nth-child(4) { left: 11%; animation-delay: 0.4s; } .confetti i:nth-child(5) { left: 2%; animation-delay: 0.9s; } .confetti i:nth-child(6) { left: 8%; animation-delay: 1.1s; }
.confetti i:nth-child(7) { left: 92%; animation-delay: 0.08s; } .confetti i:nth-child(8) { left: 86%; animation-delay: 0.34s; } .confetti i:nth-child(9) { left: 95%; animation-delay: 0.66s; }
.confetti i:nth-child(10) { left: 89%; animation-delay: 0.02s; } .confetti i:nth-child(11) { left: 94%; animation-delay: 0.95s; } .confetti i:nth-child(12) { left: 87%; animation-delay: 1.15s; }
.confetti i:nth-child(13) { left: 6%; animation-delay: 1.35s; } .confetti i:nth-child(14) { left: 91%; animation-delay: 1.4s; }
@keyframes fall { 0% { transform: translateY(0) rotate(0); opacity: 1; } 80% { opacity: 1; } 100% { transform: translateY(640px) rotate(540deg); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .confetti { display: none !important; } .new-pal { animation: none; } }
.grow-note { width: 100%; max-width: 560px; padding: 12px 12px 18px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; }
.grow-note p { margin: 0; font-size: 17px; opacity: 0.75; max-width: 30ch; }
/* Phone: the Grow screen's lower half is a little meadow with your pal in it, not blank space. */
#upgrades .grow-note { flex: 1 0 auto; min-height: 200px; justify-content: center; gap: 10px; border-radius: 28px; padding: 18px 16px 22px;
  background: radial-gradient(ellipse at 50% 45%, #f1fbe6 0%, #ddf3c9 60%, #cdebb5 100%); box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.75), 0 4px 0 rgba(58, 42, 74, 0.08); }
#upgrades .grow-note p { opacity: 0.85; font-weight: 600; }
#grow-pal { width: min(340px, 84vw); height: min(170px, 42vw); }
.next-pal { display: flex; align-items: center; gap: 10px; margin-top: 6px; padding: 6px 18px 6px 8px; border-radius: 22px; background: rgba(255, 255, 255, 0.85); box-shadow: 0 4px 0 rgba(58, 42, 74, 0.08); }
.next-pal[hidden] { display: none; }
.next-pal canvas { width: 120px; height: 60px; }
.next-pal > span { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; font-size: 20px; font-weight: 700; text-align: left; }
.next-pal b { font-size: 14px; color: var(--grass-d); letter-spacing: 0.02em; }
.next-pal small { font-size: 14px; font-weight: 600; opacity: 0.7; }
.vs-face { width: 30px; height: 30px; flex: none; }
@media (max-width: 899px) { .versus .vs-label { display: none; } } /* phones: the two faces say who is who */

.coin-rows { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.coin-rows span { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 12px; background: #fff; font-size: 17px; font-weight: 600; }
.coin-rows .ic { width: 20px; height: 20px; }
.total { font-size: 30px; }
#result-card.won #result-retry, #result-card.lost #result-next { display: none; }
#result-card.lost h2 { color: var(--sky-d); }
#result-card.won h2 { color: var(--grass-d); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.chips button { min-height: 48px; min-width: 48px; padding: 6px 14px; border-radius: 16px; background: #fff; box-shadow: 0 4px 0 rgba(58, 42, 74, 0.15); font-size: 18px; font-weight: 600; }
.chips button.on { background: var(--sun); box-shadow: 0 4px 0 var(--sun-d); }
.name-preview { font-size: 30px !important; font-weight: 700; color: var(--pink); }

/* ---------- play HUD ---------- */
.hud { position: fixed; inset: 0; pointer-events: none; }
.hud-top { position: absolute; top: calc(10px + var(--safe-t)); left: 10px; right: 10px; display: flex; align-items: center; gap: 8px; pointer-events: none; }
.hud-top > * { pointer-events: auto; }
.timer { font-size: 24px; min-width: 88px; color: var(--ink); }
.timer.low { background: #ffe0cc; animation: tick 1s ease-in-out infinite; }
@keyframes tick { 50% { transform: scale(1.08); } }
.timer .ic { color: var(--sky-d); }
.versus { flex: 1; display: flex; align-items: center; gap: 6px; min-width: 0; max-width: 520px; margin: 0 auto; padding: 4px 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.92); box-shadow: var(--shadow); }
.versus b { font-size: 22px; min-width: 1.6em; text-align: center; }
.vs-you, .vs-boss { display: flex; align-items: center; gap: 3px; }
.vs-you b { color: var(--sun-d); } .vs-boss b { color: #7a4fd6; }
.vs-label { font-size: 13px; font-weight: 600; opacity: 0.7; }
.vs-bar { flex: 1; height: 14px; border-radius: 8px; background: #ece5f7; overflow: hidden; min-width: 30px; }
#hud-fill { display: block; height: 100%; width: 10%; border-radius: 8px; background: linear-gradient(90deg, var(--sun), #ff9f43); transition: width 0.2s; }
#hud-fill.full { background: linear-gradient(90deg, var(--grass), #3fd18a); }
.vs-bar { position: relative; }
/* Narrow phones (360 px): a slimmer HUD so the boss face never slides under the pause button. */
@media (max-width: 374px) { .hud-top { gap: 6px; } .timer { min-width: 76px; font-size: 21px; } .versus { gap: 3px; padding: 4px 6px; } .versus b { font-size: 19px; min-width: 0; } .vs-face { width: 24px; height: 24px; } .vs-bar { min-width: 18px; } }
#hud-ready { position: absolute; inset: 0; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff; letter-spacing: 0.04em; opacity: 0; transition: opacity 0.3s; }
#hud-ready.on { opacity: 1; }
.friends { position: absolute; top: calc(76px + var(--safe-t)); left: 50%; transform: translateX(-50%); display: flex; gap: 4px; color: var(--pink); }
.friends .ic { width: 26px; height: 26px; filter: drop-shadow(0 2px 0 #fff); animation: pop 0.4s both; }
.dash { display: none; position: absolute; right: calc(18px + env(safe-area-inset-right, 0px)); bottom: calc(22px + var(--safe-b)); width: 84px; height: 84px; border-radius: 50%; background: var(--sun); box-shadow: 0 7px 0 var(--sun-d); pointer-events: auto; place-items: center; color: #fff; }
.touch .dash { display: grid; }
.dash .ic { width: 44px; height: 44px; color: #ff9f43; }
.dash .cool { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); fill: none; stroke: rgba(58, 42, 74, 0.35); stroke-width: 8; stroke-dasharray: 100; stroke-dashoffset: 100; }
.dash.cooling { background: #ffe9a6; }
.dash:active { transform: translateY(4px); box-shadow: 0 3px 0 var(--sun-d); }
.hint { position: absolute; left: 50%; bottom: calc(26px + var(--safe-b)); transform: translateX(-50%); max-width: calc(100% - 32px); width: max-content; padding: 8px 16px; border-radius: 18px; background: #fff; box-shadow: 0 4px 0 rgba(58, 42, 74, 0.15); font-size: 18px; font-weight: 600; text-align: center; opacity: 0; transition: opacity 0.25s; pointer-events: none; }
.touch .hint { bottom: calc(122px + var(--safe-b)); }
.hint.on { opacity: 1; }
#stick { position: fixed; left: -60px; top: -60px; width: 120px; height: 120px; border-radius: 50%; border: 4px solid rgba(255, 255, 255, 0.75); background: rgba(255, 255, 255, 0.18); pointer-events: none; opacity: 0; transition: opacity 0.12s; z-index: 3; }
#stick.on { opacity: 1; }
#knob { position: absolute; left: 32px; top: 32px; width: 48px; height: 48px; border-radius: 50%; background: rgba(255, 255, 255, 0.92); box-shadow: 0 3px 0 rgba(58, 42, 74, 0.2); }
@media (max-height: 700px) { .logo { font-size: 48px; } .big-btn.play { min-height: 80px; font-size: 34px; } .nav-btn { min-height: 64px; } }
@media (prefers-reduced-motion: reduce) { .big-btn.play::after, .timer.low { animation: none; } }

/* Desktop: a roomier HUD (kept last so it wins over the base rules). */
@media (min-width: 900px) {
  .hud-top { top: 18px; left: 24px; right: 24px; gap: 14px; }
  .timer { font-size: 38px; min-width: 140px; padding: 10px 20px; }
  .timer .ic { width: 40px; height: 40px; }
  .versus { max-width: 720px; padding: 10px 22px; gap: 10px; }
  .versus b { font-size: 40px; }
  .vs-label { font-size: 20px; }
  .vs-bar { height: 22px; border-radius: 12px; }
  .hud-top .round-btn { width: 72px; height: 72px; }
  .hint { font-size: 22px; }
  .vs-face { width: 52px; height: 52px; }
}
/* Snuggle-off and the end banner: the dash button steps aside for the big "Tap!" cheer heart. */
body[data-phase="snuggle"] .dash, body[data-phase="won"] .dash, body[data-phase="lost"] .dash { display: none; }

/* ---------- Desktop / landscape: use the width instead of a stretched phone column ---------- */
@media (min-width: 900px) and (min-aspect-ratio: 5/4) {
  body[data-screen="home"] #home {
    display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); grid-template-rows: auto 1fr 1fr;
    grid-template-areas: "top top" "logo play" "pal nav"; column-gap: 56px; row-gap: 8px; align-items: center; justify-items: center;
    padding: 24px 64px 40px;
    background: linear-gradient(90deg, rgba(255, 248, 236, 0.62), rgba(255, 248, 236, 0.15) 48%, rgba(255, 248, 236, 0.15) 52%, rgba(255, 248, 236, 0.62));
  }
  #home .topbar { grid-area: top; max-width: none; }
  #home .logo { grid-area: logo; align-self: end; margin: 0; font-size: clamp(84px, 8.6vw, 136px); }
  #home .home-pal { grid-area: pal; align-self: start; width: min(560px, 42vw); height: min(270px, 34vh); }
  #home #play-btn { grid-area: play; align-self: end; min-width: min(420px, 34vw); min-height: 128px; font-size: 56px; border-radius: 40px; }
  #home #play-btn small { font-size: 24px; }
  #home .update-btn { position: absolute; top: 24px; left: 50%; transform: translateX(-50%); }
  #home .nav { grid-area: nav; align-self: start; margin-top: 30px; max-width: min(440px, 34vw); grid-template-columns: repeat(2, 1fr); gap: 16px; }
  #home .nav-btn { flex-direction: row; gap: 12px; min-height: 92px; font-size: 24px; border-radius: 26px; }
  #home .nav-btn .ic { width: 40px; height: 40px; }

  .sub { padding: 28px 48px 32px; gap: 20px; }
  .sub-head { max-width: 1120px; }
  .sub-head h2 { font-size: 44px; }
  #upgrade-list { max-width: 1120px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
  #upgrade-list .upgrade { grid-template-columns: 1fr; justify-items: center; text-align: center; padding: 22px 18px; gap: 14px; }
  #upgrade-list .upgrade .u-icon { width: 92px; height: 92px; border-radius: 26px; }
  #upgrade-list .upgrade .u-icon .ic { width: 62px; height: 62px; }
  #upgrade-list .upgrade h3 { font-size: 28px; }
  #upgrade-list .upgrade .buy { width: 100%; }
  .grow-note { max-width: 1120px; flex-direction: row; justify-content: center; gap: 24px; text-align: left; }
  .grow-note p { font-size: 20px; }
  .grid { max-width: 1120px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; }
  .boards, .me-card { max-width: 1120px; }
  #settings .list { max-width: 760px; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

  /* Result and break cards: the pal on the left, words and buttons on the right. */
  #result-card .card, #break-card .card { width: min(780px, 100%); display: grid; grid-template-columns: 300px 1fr; column-gap: 28px; row-gap: 12px; align-items: center; justify-items: center; padding: 26px 30px; }
  #result-card .card > .result-pal, #break-card .card > .result-pal { grid-column: 1; grid-row: 1 / span 7; width: 300px; height: 170px; }
  #result-card .card > :not(.result-pal), #break-card .card > :not(.result-pal) { grid-column: 2; }
  .card h2 { font-size: 46px; }
}
