:root {
  --sky-1: #6F7FE6; --sky-2: #A48BE6; --sky-3: #F4A3C6; --sky-4: #FFD9A6;
  --dusk-1: #3B3F9E; --dusk-2: #7A5BC7; --dusk-3: #E88BB4;
  --day-1: #6CC6F2; --day-2: #BFE9F7; --day-3: #FFF4D6;
  --hill-far: #A9E3C4; --hill-mid: #7FD6A0; --hill-near: #4FC27A; --hill-edge: #C8F27C;
  --gold: #FFD23F; --gold-deep: #FFA41B; --gold-pale: #FFF3B8;
  --ink: #2B2F6B; --white: #FFFFFF; --cream: #FFF9EC;
  --ball-1: #FF8A7A; --ball-2: #FF5D8F;
  --cloud: #B9BEDD; --cloud-dark: #8E94BD; --cloud-ink: #4A4F82;
  --mint: #5EE0B5; --aqua: #62D3F5; --grape: #A77BF3; --coral: #FF7A6B;
  --shadow: rgba(43, 47, 107, 0.28); --glass: rgba(255, 255, 255, 0.86);
  --wall-1: #FFF1D6; --wall-2: #FFE0B8; --floor-1: #F2B880; --floor-2: #E09A5F; --rug-1: #FF9CB6; --rug-2: #FFC2D1;
  --frame: #FFFFFF; --finn-1: #8FE3FF; --finn-2: #3FA9F5; --finn-3: #2C7FD6; --poppy-3: #E0457B; --leaf: #5ED27A; --basket: #D9A066; --basket-dark: #B57F45;
  --night-1: #2E2F7A; --night-2: #6A53B8;
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --font: 'Arial Rounded MT Bold', 'Nunito', 'Quicksand', system-ui, -apple-system, Arial, sans-serif;
}
/* the letters a child is taught to write (one-storey a and g, an l that is not a bar): see fonts/CREDITS.txt */
@font-face { font-family: 'PF Letters'; src: url('fonts/pf-letters.woff') format('woff'); font-weight: 400 900; font-display: block; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--day-1); font-family: var(--font); color: var(--ink);
  -webkit-user-select: none; user-select: none; touch-action: none; overscroll-behavior: none; }
canvas#c { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.outline { position: relative; }
.outline::before { content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 3px;
  background: linear-gradient(135deg, var(--a1, var(--gold)), var(--a2, var(--ball-2)), var(--a3, var(--aqua)));
  -webkit-mask: linear-gradient(var(--white) 0 0) content-box, linear-gradient(var(--white) 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; }
/* the first screen is drawn on the canvas (core/title.js); these sit over it */
#start { position: fixed; inset: 0; z-index: 50; pointer-events: none; }
#start > * { pointer-events: auto; }
#go { position: fixed; border: 0; border-radius: 50%; background: transparent; cursor: pointer; padding: 0; }
#shareBtn { top: calc(env(safe-area-inset-top) + 12px); right: 12px; padding: 12px 14px; display: grid; }
.play { width: 116px; height: 116px; border-radius: 50%; border: 0; cursor: pointer; color: var(--ink);
  background: radial-gradient(circle at 35% 30%, var(--gold-pale), var(--gold) 45%, var(--gold-deep));
  box-shadow: 0 8px 0 var(--gold-deep), 0 16px 30px var(--shadow); display: inline-grid; place-items: center;
  animation: glow 2.4s ease-in-out infinite; transition: transform 0.25s var(--spring); --a1: var(--white); --a2: var(--gold-pale); --a3: var(--white); }
.play:active { transform: translateY(6px) scale(0.93); }
.play svg { width: 46%; height: 46%; margin-left: 8%; }
@keyframes glow { 0%, 100% { box-shadow: 0 8px 0 var(--gold-deep), 0 16px 30px var(--shadow), 0 0 0 0 var(--gold-pale); }
  50% { box-shadow: 0 8px 0 var(--gold-deep), 0 16px 30px var(--shadow), 0 0 0 16px rgba(255, 243, 184, 0); } }
@keyframes arrive { from { transform: translateY(-20px) scale(0.8); opacity: 0; } to { transform: none; opacity: 1; } }
.pill { position: fixed; z-index: 60; border: 0; border-radius: 26px; background: var(--glass); color: var(--ink); font: inherit; font-size: 16px;
  padding: 12px 18px; text-decoration: none; box-shadow: 0 6px 16px var(--shadow); cursor: pointer; transition: transform 0.25s var(--spring); }
.pill:active { transform: scale(0.92); }
#menu { top: calc(env(safe-area-inset-top) + 12px); right: 12px; padding: 12px 14px; display: grid; }
#again { bottom: calc(env(safe-area-inset-bottom) + 20px); left: 50%; margin-left: -58px; display: none; }
#again.on { display: inline-grid; animation: arrive 0.5s var(--spring) both, glow 2.4s 0.5s ease-in-out infinite; }


/* ---- the app ---- */
#hud .pill { display: none; }
#btnHome { top: calc(env(safe-area-inset-top) + 12px); left: 12px; padding: 12px 14px; }
#btnSay { top: calc(env(safe-area-inset-top) + 12px); right: 12px; padding: 6px 14px 6px 16px; grid-auto-flow: column; gap: 8px; align-items: center; }
#btnSay b { font-size: 34px; line-height: 1.1; }
#btnSkip { bottom: calc(env(safe-area-inset-bottom) + 14px); right: 12px; padding: 12px 14px; opacity: 0.55; }
#btnSkip.glow { opacity: 1; animation: glow 2s ease-in-out infinite; }
#btnGrown { bottom: calc(env(safe-area-inset-bottom) + 12px); right: 12px; padding: 9px 13px; font-size: 13px; opacity: 0.75; font-family: system-ui, -apple-system, sans-serif; }
#hud .pill { overflow: hidden; }
#hud .pill > svg, #hud .pill > b { position: relative; }
#hud .ring { position: absolute; inset: 0; border-radius: inherit; background: var(--gold); opacity: 0.5; transform-origin: left; transform: scaleX(0); }
body.in-game #btnHome, body.in-game #btnSay, body.in-game #btnSkip { display: grid; }
body.in-check #btnHome, body.in-check #btnSay { display: grid; }
body.in-room #btnGrown { display: block; }
body.in-sub #btnHome { display: grid; }
#start .ver { position: fixed; left: 12px; bottom: calc(env(safe-area-inset-bottom) + 8px); font-size: 12px; color: var(--white); opacity: 0.8; font-family: system-ui, -apple-system, sans-serif; pointer-events: none; }
#grown { position: fixed; inset: 0; z-index: 80; display: none; background: rgba(43, 47, 107, 0.4); padding: 16px; overflow: auto; -webkit-overflow-scrolling: touch; touch-action: pan-y; }
#grown.on { display: block; }
#grown .card { max-width: 520px; margin: 0 auto; background: var(--cream); border-radius: 26px; padding: 20px; font-family: system-ui, -apple-system, sans-serif; font-size: 16px; line-height: 1.45; color: var(--ink); }
#grown h2 { margin: 0 0 4px; font-family: var(--font); font-size: 24px; }
#grown h3 { margin: 18px 0 6px; font-family: var(--font); font-size: 17px; }
#grown input[type=text] { width: 100%; font: inherit; font-size: 20px; padding: 10px 12px; border-radius: 14px; border: 2px solid var(--cloud); background: var(--white); color: var(--ink); -webkit-user-select: text; user-select: text; }
#grown .row { display: flex; flex-wrap: wrap; gap: 8px; }
#grown .opt, #grown .btn { border: 0; border-radius: 14px; padding: 10px 14px; font: inherit; font-weight: 700; background: var(--white); color: var(--ink); cursor: pointer; box-shadow: 0 2px 0 var(--cloud); }
#grown .opt.on { background: var(--gold); box-shadow: 0 2px 0 var(--gold-deep); }
#grown .btn.go { background: var(--gold); display: block; width: 100%; margin-top: 18px; font-size: 18px; padding: 14px; }
#grown .btn.quiet { background: transparent; box-shadow: none; text-decoration: underline; font-weight: 400; }
#grown .syms { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 6px; }
#grown .sym { background: var(--white); border-radius: 12px; text-align: center; padding: 5px 0 3px; font-family: var(--font); font-size: 22px; }
#grown .sym small { display: block; font-size: 11px; letter-spacing: 1px; color: var(--gold-deep); height: 14px; }
#grown .sym.kept { background: var(--gold-pale); }
#grown .sym.shaky { background: var(--rug-2); }
#grown .sym.shaky small { color: var(--poppy-3); letter-spacing: 0; }
#grown p.note { font-size: 14px; opacity: 0.8; margin: 6px 0 0; }
