* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #2b1650; user-select: none; -webkit-user-select: none;
  font-family: "Arial Rounded MT Bold", "Nunito", "Trebuchet MS", sans-serif; }
/* Fixed 960x540 stage (the original's landscape board size), scaled to fit the window. */
#stage { position: absolute; left: 50%; top: 50%; width: 960px; height: 540px; transform-origin: 0 0; overflow: hidden; touch-action: none; }
.screen { position: absolute; inset: 0; }
.hidden { display: none !important; }

.purple { background-color: #9b68ec;
  background-image: radial-gradient(circle at 20px 20px, rgba(60,20,120,.22) 0 7px, transparent 8px),
    radial-gradient(circle at 60px 64px, rgba(60,20,120,.16) 0 5px, transparent 6px),
    linear-gradient(45deg, transparent 46%, rgba(60,20,120,.14) 47% 53%, transparent 54%);
  background-size: 90px 90px, 90px 90px, 45px 45px; }

/* buttons */
button { font: inherit; cursor: pointer; }
.round { position: absolute; width: 72px; height: 72px; border-radius: 50%; border: 4px solid #fff; padding: 14px;
  box-shadow: 0 5px 0 rgba(0,0,0,.25), inset 0 -6px 0 rgba(0,0,0,.18); transition: transform .12s; }
.round:active, .round.press { transform: scale(.88); }
.round svg { width: 100%; height: 100%; fill: #fff; stroke: #fff; stroke-width: 0; }
.round svg path[d^="M6 6l12"] , .round svg path[d^="M15 5"], .round svg path[d^="M9 5"] { fill: none; stroke-width: 3.4; stroke-linecap: round; stroke-linejoin: round; }
.green { background: #34c24a; } .red { background: #ff4b4b; } .blue { background: #22a5ff; } .orange { background: #ff9a1f; }
.yellow { background: #ffcf1f; } .pink { background: #ff5fa8; } .purpleBtn { background: #8b4ce0; }
.big { width: 130px; height: 130px; padding: 26px; border-width: 6px; }
.big2 { width: 110px; height: 110px; padding: 22px; }
.small { width: 60px; height: 60px; padding: 11px; }
.close { right: 12px; top: 6px; }
.dim { opacity: .5; }

/* menu */
#menu { background: repeating-linear-gradient(180deg, #d66fa5 0 64px, #e8566a 64px 128px, #ef8a4a 128px 192px,
  #e8c04a 192px 256px, #9cc94a 256px 320px, #59b85a 320px 384px, #4a9fd9 384px 448px, #3a7bd0 448px 540px); }
.sheet { position: absolute; left: 105px; top: 40px; width: 780px; height: 470px; background: #fff; border-radius: 24px;
  transform: rotate(-2deg); box-shadow: 0 10px 0 rgba(0,0,0,.18); }
.rings { position: absolute; left: 60px; right: 60px; overflow: hidden; top: -14px; height: 34px;
  background: radial-gradient(circle at 50% 70%, #9c5ad6 0 9px, transparent 10px) 0 0 / 36px 34px repeat-x; }
.rings::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, #ccc 0 3px, transparent 3px) 16px 0 / 36px 22px repeat-x; }
.title { position: absolute; right: 70px; top: 40px; margin: 0; font-size: 74px; line-height: .95; text-align: center;
  letter-spacing: 1px; -webkit-text-stroke: 3px #6b2a14; paint-order: stroke fill; }
.title span:nth-child(8n+1) { color: #ff4d3a; } .title span:nth-child(8n+2) { color: #ff4fa0; } .title span:nth-child(8n+3) { color: #ff9a1f; }
.title span:nth-child(8n+4) { color: #36c24a; } .title span:nth-child(8n+5) { color: #22a5ff; } .title span:nth-child(8n+6) { color: #8b4ce0; }
.title span:nth-child(8n+7) { color: #ffcf1f; } .title span:nth-child(8n+8) { color: #ff4d3a; }
.title small { font-size: 66px; color: #ffe51f; }
.balloons { position: absolute; left: 70px; top: 90px; width: 380px; height: 330px; }
.balloons b { position: absolute; width: 150px; height: 160px; border-radius: 50%; border: 5px solid #222;
  background: radial-gradient(circle at 35% 30%, #fff 0 12px, var(--c) 14px); color: var(--c); font-size: 90px; text-align: center; line-height: 160px;
  -webkit-text-stroke: 3px #222; filter: saturate(1.1); }
.balloons b:nth-child(1) { left: 0; top: 120px; color: #ffe51f; } .balloons b:nth-child(2) { left: 105px; top: 20px; color: #ff3d3d; }
.balloons b:nth-child(3) { left: 215px; top: 95px; color: #8b4ce0; }
.balloons b::after { content: ""; position: absolute; left: 72px; top: 160px; width: 3px; height: 90px; background: #222; }
#btnPlay { left: 610px; top: 300px; } #btnAlbum { left: 770px; top: 330px; } #btnSound { left: 20px; top: 460px; }

/* banners, rows, grids */
.banner { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); padding: 10px 46px; background: #ffcf1f; color: #6b2a14;
  font-size: 34px; border-radius: 40px; border: 5px solid #fff; box-shadow: 0 5px 0 rgba(0,0,0,.25); white-space: nowrap; }
.row { position: absolute; left: 0; right: 0; top: 100px; height: 420px; display: flex; gap: 34px; padding: 10px 110px;
  overflow-x: auto; scroll-behavior: smooth; scrollbar-width: none; }
.row::-webkit-scrollbar { display: none; }
.book { flex: 0 0 240px; height: 380px; position: relative; border-radius: 26px; background: var(--c); border: none; padding: 0;
  box-shadow: inset 0 -16px 0 rgba(0,0,0,.18), 0 8px 0 rgba(0,0,0,.2); }
.book::before { content: ""; position: absolute; left: 22px; right: 22px; top: -12px; height: 32px;
  background: linear-gradient(90deg, transparent 6px, #9aa0a8 6px 16px, transparent 16px) 0 0 / 22px 32px repeat-x; border-radius: 6px; }
.book .inner { position: absolute; left: 16px; right: 16px; top: 34px; height: 236px; background: #fff; border-radius: 18px; overflow: hidden; display: grid; place-items: center; }
.book .inner canvas { width: 100%; }
.book .name { position: absolute; left: 0; right: 0; bottom: 34px; color: #fff; font-size: 30px; -webkit-text-stroke: 1px rgba(0,0,0,.25); }
.arrow { top: 270px; width: 62px; height: 62px; padding: 10px; background: #ffcf1f; }
.arrow.left { left: 22px; } .arrow.right { right: 22px; }
.grid { position: absolute; left: 70px; right: 70px; top: 96px; bottom: 16px; display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 20px 40px; justify-items: center; overflow-y: auto; scrollbar-width: none; }
.thumb { width: 333px; height: 196px; background: #fff; border-radius: 16px; border: 5px solid #fff; padding: 0; overflow: hidden;
  box-shadow: 0 6px 0 rgba(0,0,0,.25); }
.thumb canvas, .thumb img { width: 100%; height: 100%; display: block; }
.album { grid-template-columns: repeat(3, 1fr); }
.album .thumb { width: 240px; height: 141px; }
.empty { position: absolute; top: 230px; width: 100%; text-align: center; color: #fff; font-size: 28px; line-height: 1.5; }

/* activities */
.acts { position: absolute; left: 40px; right: 40px; top: 96px; bottom: 14px; display: flex; flex-direction: column; gap: 16px; overflow-x: auto; scrollbar-width: none; }
.acts > div { display: flex; gap: 18px; }
.acts button { flex: 0 0 190px; height: 128px; border-radius: 24px; border: 6px solid #fff; background: var(--c); color: #fff; font-size: 22px;
  box-shadow: 0 6px 0 rgba(0,0,0,.25), inset 0 -10px 0 rgba(0,0,0,.18); -webkit-text-stroke: 1px rgba(0,0,0,.25); }
.acts button span { display: block; font-size: 56px; line-height: 1.15; -webkit-text-stroke: 0; }
.acts button:active { transform: scale(.94); }
#playClose.left { left: 12px; right: auto; }
#playCanvas { position: absolute; inset: 0; touch-action: none; }

/* board */
#board.neon .paper { background: #06051a; }
#board.neon #lines { display: none; }
.paper { position: absolute; left: 108px; top: 12px; width: 750px; height: 478px; background: #fff; border-radius: 24px; box-shadow: 0 8px 0 rgba(0,0,0,.25); }
.paper .rings { left: 55px; right: 55px; top: 2px; }
#area { position: absolute; left: 5px; top: 33px; width: 740px; height: 435px; }
#area canvas { position: absolute; inset: 0; }
#live { pointer-events: none; }
#lines { pointer-events: none; }
#stamps { position: absolute; inset: 0; }
#board::before { content: ""; position: absolute; left: 0; top: 0; width: 96px; height: 540px; background: #b8917a; border-right: 5px solid #8a6a58; }
#palette { position: absolute; left: 0; top: 85px; width: 92px; height: 352px; background: #fdf0c9; border: 5px solid #6b4a5e; border-left: 0;
  border-radius: 0 16px 16px 0; overflow: hidden; touch-action: none; }
#paletteInner { position: absolute; left: 0; top: 2px; width: 100%; transition: top .25s; }
.swatch { position: absolute; left: -60px; width: 140px; height: 39px; transition: left .15s; cursor: pointer; }
.swatch.sel { left: -35px; }
#btnTools { left: 10px; top: 6px; padding: 8px; }
#btnTools canvas { width: 100%; height: 100%; }
#btnEraser { left: 10px; top: 454px; }
#btnEraser.sel, #btnTools.sel { box-shadow: 0 0 0 5px #ffe51f, 0 5px 0 rgba(0,0,0,.25); }
.side .round { left: 874px; } #btnClose { top: 6px; } #btnStamp { top: 130px; } #btnUndo { top: 233px; } #btnTrash { top: 336px; } #btnPhoto { top: 439px; }
.pop { position: absolute; left: 92px; top: 6px; display: flex; gap: 10px; padding: 10px; background: #fdf0c9; border: 5px solid #6b4a5e; border-radius: 20px; z-index: 5; }
.pop button { width: 150px; height: 60px; border: 3px solid #e3cfa0; border-radius: 14px; background: #fff; padding: 4px; }
.pop button.sel { border-color: #34c24a; background: #eaffea; }
.pop canvas { width: 100%; height: 100%; }
.stamp { position: absolute; transform: translate(-50%, -50%) scale(var(--s, .5)); font-size: 150px; line-height: 1; cursor: grab;
  transition: transform .15s cubic-bezier(.3,1.6,.5,1), opacity .15s; touch-action: none; }
.stamp.gone { transform: translate(-50%, -50%) scale(.15); opacity: .1; }
.hint { position: absolute; left: 50%; bottom: 4px; transform: translateX(-50%); background: rgba(0,0,0,.55); color: #fff; padding: 6px 18px; border-radius: 20px; font-size: 18px; }

/* modals */
.modal { position: absolute; inset: 0; background: rgba(40,10,80,.55); display: grid; place-items: center; z-index: 10; }
.card { position: relative; width: 470px; min-height: 260px; background: #fdf0c9; border: 6px solid #fff; border-radius: 30px; padding: 30px; box-shadow: 0 10px 0 rgba(0,0,0,.25);
  animation: popIn .35s cubic-bezier(.3,1.5,.5,1); }
.card.wide { width: 900px; height: 500px; padding: 18px; }
.card .close { right: -14px; top: -18px; }
@keyframes popIn { from { transform: scale(.1); } }
.ask { font-size: 34px; color: #6b2a14; text-align: center; margin: 10px 0 30px; }
.yesno { display: flex; justify-content: center; gap: 90px; }
.yesno .round { position: static; width: 96px; height: 96px; padding: 20px; }
.cats { display: flex; gap: 12px; justify-content: center; margin-top: 6px; }
.cats button { width: 96px; height: 80px; font-size: 48px; border-radius: 18px; border: 4px solid #e3cfa0; background: #fff; }
.cats button.sel { border-color: #ff9a1f; background: #fff3d6; }
.stampGrid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; margin-top: 18px; height: 360px; overflow-y: auto; scrollbar-width: none; }
.stampGrid button { height: 100px; font-size: 64px; border: none; border-radius: 18px; background: #fff; box-shadow: 0 4px 0 #e3cfa0; }
.photoBox { position: relative; width: 760px; height: 480px; background: #fff; border-radius: 26px; border: 8px solid #ffcf1f; animation: popIn .45s cubic-bezier(.3,1.4,.5,1); }
.photoBox img { position: absolute; left: 20px; top: 22px; width: 600px; height: 353px; border-radius: 10px; box-shadow: 0 0 0 4px #eee; }
.photoBox .close { right: -20px; top: -22px; }
.photoBox .big2 { left: 636px; }
#btnShare, #btnViewSave { top: 70px; } #btnSave, #btnViewDel { top: 240px; }
.tick { position: absolute; left: 20px; bottom: 26px; width: 600px; text-align: center; color: #2fb34a; font-size: 34px; }
.crumb { position: absolute; border-radius: 50%; background: rgb(0,100,100); opacity: .3; transform: translate(-50%,-50%); pointer-events: none;
  animation: crumb .3s ease-out forwards; }
@keyframes crumb { to { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1.3); } }
