:root {
  --bg: #f0f9e8;
  --ink: #8b5a2b;
  --carrot: #f28c28;
  --leaf: #7cb342;
  --soft: #fffdf7;
  --danger: #ef5350;
  --shadow: 0 6px 16px rgba(100, 70, 30, .1);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; overscroll-behavior: none; -webkit-user-select: none; user-select: none; background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'%3E%3Ccircle cx='20' cy='20' r='2' fill='%2397c96a' opacity='.12'/%3E%3C/svg%3E"); color: var(--ink); font-family: 'Trebuchet MS', Arial, sans-serif; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
.icon { width: 1em; height: 1em; flex: 0 0 auto; vertical-align: -.125em; }
.app { --pt: max(22px, env(safe-area-inset-top)); --pb: max(14px, env(safe-area-inset-bottom)); width: min(100%, 590px); min-height: 100vh; min-height: 100dvh; margin: auto; padding: var(--pt) max(18px, env(safe-area-inset-right)) var(--pb) max(18px, env(safe-area-inset-left)); }
.hidden, .screen.hidden, .modal.hidden { display: none; }

.round-text-btn { border: 0; border-radius: 22px; background: white; color: var(--ink); padding: 16px; font-weight: 800; box-shadow: var(--shadow); cursor: pointer; }
.round-text-btn .icon { margin-right: 8px; }

.menu-screen { display: flex; flex-direction: column; gap: 10px; height: calc(100vh - var(--pt) - var(--pb)); height: calc(100dvh - var(--pt) - var(--pb)); }
.menu-head { display: flex; align-items: center; justify-content: center; gap: 10px; }
.menu-logo { font-size: 46px; line-height: 1; filter: drop-shadow(0 6px 4px rgba(130, 90, 50, .15)); animation: hop 1.8s ease-in-out infinite; }
@keyframes hop { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
.menu-titles { display: flex; flex-direction: column; align-items: flex-start; line-height: 1; }
.menu-head h1 { margin: 0; font-size: 34px; letter-spacing: 3px; color: var(--carrot); }
.menu-titles small { margin-top: 3px; font-size: 13px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; opacity: .7; }
.menu-body { flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: flex-start; gap: 14px; padding-top: min(5vh, 36px); }

.continue-btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 16px; border: 0; border-radius: 22px; background: var(--carrot); color: #fff; font-size: 20px; font-weight: 800; box-shadow: var(--shadow); cursor: pointer; }
.continue-btn .icon { font-size: 22px; }
.continue-btn:active { transform: scale(.98); }

.chapter-bar { display: flex; align-items: center; gap: 8px; }
.chap-arrow { flex: 0 0 auto; width: 44px; height: 44px; border: 0; border-radius: 50%; background: white; color: var(--ink); box-shadow: var(--shadow); font-size: 20px; cursor: pointer; display: grid; place-items: center; }
.chap-arrow:disabled { opacity: .35; cursor: default; }
.chap-arrow .icon.flip { transform: scaleX(-1); }
.chap-info { flex: 1; min-width: 0; text-align: center; display: flex; flex-direction: column; gap: 2px; }
.chap-info b { font-size: 18px; }
.chap-info small { font-size: 13px; font-weight: 700; opacity: .75; }

.level-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; padding: 4px; width: 100%; max-width: 468px; margin: 0 auto; max-height: 100%; overflow-y: auto; touch-action: pan-y; }
.level-grid.slide-next { animation: slide-next .22s ease-out; }
.level-grid.slide-prev { animation: slide-prev .22s ease-out; }
@keyframes slide-next { from { transform: translateX(36px); opacity: 0; } }
@keyframes slide-prev { from { transform: translateX(-36px); opacity: 0; } }
.tile { aspect-ratio: 1; padding: 0; border: 0; border-radius: 16px; background: white; color: var(--ink); box-shadow: var(--shadow); font-size: 20px; font-weight: 900; line-height: 1.1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; cursor: pointer; }
.tile .icon { font-size: 18px; }
.tile .tile-stars { display: flex; gap: 1px; font-size: 12px; min-height: 12px; }
.tile.done { background: #e4f3cd; }
.tile.current { background: #fff0d4; box-shadow: 0 0 0 3px var(--carrot), var(--shadow); }
.tile.locked { background: #f1ebe0; box-shadow: none; opacity: .5; cursor: not-allowed; color: #8a7360; }
.tile:not(.locked):active { transform: scale(.95); }
.chap-dots { display: flex; justify-content: center; align-items: center; gap: 6px; min-height: 8px; }
.chap-dots span { width: 8px; height: 8px; border-radius: 4px; background: rgba(139, 90, 43, .25); transition: width .2s, background .2s; }
.chap-dots span.on { width: 20px; background: var(--carrot); }

.menu-bar { display: flex; gap: 6px; padding-top: 8px; border-top: 1.5px solid rgba(139, 90, 43, .15); }
.bar-btn { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 3px; padding: 8px 4px; border: 0; border-radius: 14px; background: transparent; color: var(--ink); font-size: 12.5px; font-weight: 800; line-height: 1.1; text-align: center; cursor: pointer; }
.bar-btn .icon { font-size: 26px; }
.bar-btn:hover { background: #fff3e0; }
.bar-btn:focus-visible, .tile:focus-visible, .continue-btn:focus-visible, .chap-arrow:focus-visible { outline: 3px solid var(--carrot); outline-offset: 2px; }

.topbar { display: grid; grid-template-columns: 58px 1fr 1fr 1fr 58px; align-items: center; gap: 6px; min-height: 120px; }
.circle-btn { width: 54px; height: 54px; border: 0; border-radius: 50%; background: white; color: var(--ink); box-shadow: var(--shadow); font-size: 35px; font-weight: 900; cursor: pointer; display: grid; place-items: center; line-height: 1; }
.circle-btn:hover { background: #fff3e0; }
.circle-btn .icon { width: 58%; height: 58%; }
.top-stat { text-align: center; display: flex; flex-direction: column; justify-content: center; line-height: 1.05; }
.top-stat span { font-size: clamp(16px, 4.6vw, 27px); white-space: nowrap; }
.top-stat strong { font-size: clamp(22px, 5.3vw, 31px); color: var(--carrot); }
.game-screen { position: relative; padding-top: 14px; }
.bunny-ears { font-size: 28px; position: absolute; top: -6px; left: 50%; transform: translateX(-50%); }

.progress-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 16px; margin: 3px 16px 12px; position: relative; }
.carrot-progress, .hearts { height: 62px; border-radius: 31px; background: white; box-shadow: var(--shadow); display: flex; align-items: center; padding: 5px 14px; }
.carrot-progress { justify-content: space-around; gap: 2px; overflow: hidden; }
.progress-carrot { flex: 1 1 0; min-width: 0; max-width: 46px; width: auto; height: auto; aspect-ratio: 1; filter: grayscale(1); opacity: .16; }
.progress-carrot.done { filter: none; opacity: 1; animation: bounce .4s ease; }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
.hearts { justify-content: center; gap: 5px; font-size: 36px; }

.rules-strip { background: white; border-radius: 18px; padding: 11px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; box-shadow: var(--shadow); margin-bottom: 36px; }
.rule-card { min-width: 0; border-radius: 12px; background: #fff4e0; padding: 8px 5px; display: flex; align-items: center; justify-content: center; gap: 7px; color: var(--ink); font-size: clamp(11px, 2.8vw, 16px); line-height: 1.18; }

.board-shell { background: white; border-radius: 20px; padding: 10px; box-shadow: var(--shadow); }
.board { display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 4px; width: 100%; user-select: none; touch-action: none; }
.cell { touch-action: manipulation; -webkit-touch-callout: none; aspect-ratio: 1; border-radius: 8px; background: var(--cell-bg); position: relative; display: grid; place-items: center; cursor: pointer; transition: transform .08s, filter .12s; }
.cell:active, .cell.pressed { transform: scale(.93); }
.cell.pop .icon { animation: xpop .28s ease-out; }
@keyframes xpop { 0% { transform: scale(.2); opacity: 0; } 65% { transform: scale(1.25); opacity: 1; } 100% { transform: scale(1); } }
.cell:focus-visible { outline: 4px solid rgba(255,255,255,.95); outline-offset: -5px; }
.c0 { --cell-bg: #ffcc80; }
.c1 { --cell-bg: #90caf9; }
.c2 { --cell-bg: #a5d6a7; }
.c3 { --cell-bg: #f48fb1; }
.c4 { --cell-bg: #b39ddb; }
.c5 { --cell-bg: #fff59d; }
.c6 { --cell-bg: #80cbc4; }
.c7 { --cell-bg: #ff9e80; }
.c8 { --cell-bg: #b0bec5; }
.c9 { --cell-bg: #bcaaa4; }
.cell .icon { width: 68%; height: 68%; pointer-events: none; filter: drop-shadow(0 2px 1px rgba(0,0,0,.18)); }
.cell.carrot .icon { width: 84%; height: 84%; }
.cell.locked-x .icon { opacity: .72; }
.cell.locked-x { cursor: not-allowed; filter: saturate(.65); }
.cell { transition: transform .08s, filter .12s, opacity .2s; }
.board.focus .cell:not(.hl) { opacity: .4; filter: grayscale(.75); }
.cell.hl-a { box-shadow: inset 0 0 0 4px #fff; }
.cell.hl-b { box-shadow: inset 0 0 0 4px #7a4a12; }
.cell.hl-a.hl-b { box-shadow: inset 0 0 0 4px #fff, inset 0 0 0 8px #7a4a12; }
.cell.hl-c { box-shadow: inset 0 0 0 4px #e53935; animation: hlpulse 1s ease-in-out infinite; }
.cell.hl-c.hl-a { box-shadow: inset 0 0 0 4px #e53935, inset 0 0 0 8px #fff; }
.cell.hl-c.hl-b { box-shadow: inset 0 0 0 4px #e53935, inset 0 0 0 8px #7a4a12; }
@keyframes hlpulse { 50% { transform: scale(.94); } }
.cell.error { animation: shake .25s 2; filter: saturate(1.4); box-shadow: inset 0 0 0 4px var(--danger); }
@keyframes shake { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }

.status { text-align: center; min-height: 25px; margin-top: 8px; font-weight: 700; font-size: 13px; color: var(--leaf); }
.bottom-tools { display: flex; justify-content: center; gap: clamp(24px, 11vw, 68px); margin-top: 22px; }
.tool-button { position: relative; width: 80px; border: 0; background: transparent; color: var(--ink); cursor: pointer; }
.tool-button > span { margin: auto; width: 70px; height: 70px; border-radius: 50%; background: white; box-shadow: var(--shadow); display: grid; place-items: center; font-size: 42px; }
.tool-button > span .icon { width: 72%; height: 72%; }
.tool-button:hover > span { background: #fff3e0; }
.tool-button:focus-visible > span { outline: 3px solid var(--carrot); outline-offset: 2px; }
.tool-button.empty > span { opacity: .5; }
.tool-button.empty i { background: #b9a48d; }
.tool-button b { display: block; margin-top: 5px; font-size: 13px; }
.tool-button i { position: absolute; right: 0; top: -5px; min-width: 28px; height: 28px; padding: 2px 7px; border-radius: 16px; background: var(--carrot); color: white; font-style: normal; font-weight: 900; font-size: 18px; }
.solver-panel { position: sticky; bottom: max(8px, env(safe-area-inset-bottom)); z-index: 5; margin-top: 12px; padding: 14px 16px; border-radius: 20px; background: #fff; box-shadow: 0 8px 24px rgba(100, 70, 30, .22); }
.solver-step { font-size: 12px; font-weight: 900; letter-spacing: .5px; text-transform: uppercase; color: var(--carrot); }
.solver-text { margin: 6px 0 12px; font-size: 15px; font-weight: 700; line-height: 1.35; min-height: 4.05em; }
.solver-buttons { display: flex; gap: 10px; justify-content: flex-end; }
.solver-buttons .round-text-btn { padding: 12px 18px; box-shadow: none; background: #f6efe4; }
.solver-buttons .round-text-btn.primary { flex: 1; background: var(--carrot); color: #fff; font-size: 17px; }
.solver-buttons .round-text-btn:disabled { opacity: .5; cursor: default; }
.solving .bottom-tools, .solving .status, .solving .rules-strip,
.tutoring .bottom-tools, .tutoring .status, .tutoring .rules-strip { display: none; }
.solving .progress-row, .tutoring .progress-row { margin-bottom: 14px; }
.tutorial-panel .solver-text { min-height: 6.1em; }
.tutorial-panel .solver-buttons .round-text-btn.hidden { display: none; }

.modal { position: fixed; inset: 0; background: rgba(80, 120, 70, .25); backdrop-filter: blur(3px); display: grid; place-items: center; z-index: 100; padding: 20px; }
.modal-box { width: min(100%, 390px); background: var(--soft); border-radius: 25px; padding: 28px; box-shadow: 0 15px 45px rgba(90, 70, 30, .2); }
.modal-box h2 { margin: 0 0 15px; font-size: 28px; color: var(--carrot); }
.modal-box p { font-size: 17px; }
.modal-box li { margin-bottom: 10px; line-height: 1.35; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }
.modal-box { max-height: 92vh; max-height: 92dvh; overflow-y: auto; }
.settings-box h2 { text-align: center; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 0; border-bottom: 1px solid #f1e6d3; font-weight: 800; font-size: 18px; line-height: 1.2; }
.setting-row small { display: block; margin-top: 3px; font-size: 12.5px; font-weight: 700; opacity: .7; }
.switch { position: relative; flex: 0 0 auto; width: 66px; height: 34px; padding: 0; border: 0; border-radius: 17px; background: #d5c7b3; cursor: pointer; transition: background .15s; }
.switch::before { content: "OFF"; position: absolute; top: 50%; right: 10px; transform: translateY(-50%); color: #fff; font-size: 11px; font-weight: 900; letter-spacing: .5px; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 28px; height: 28px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(90, 60, 20, .3); transition: transform .15s; }
.switch[aria-checked="true"] { background: var(--leaf); }
.switch[aria-checked="true"]::before { content: "ON"; right: auto; left: 11px; }
.switch[aria-checked="true"]::after { transform: translateX(32px); }
.switch:focus-visible { outline: 3px solid var(--carrot); outline-offset: 2px; }
.settings-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
.settings-actions .round-text-btn { width: 100%; }
.modal-stars { display: flex; justify-content: center; gap: 6px; margin-bottom: 10px; }
.modal-stars:empty { display: none; }
.modal-stars .icon { width: 38px; height: 38px; }
.completion-anim { display: none; text-align: center; font-size: 76px; margin-bottom: 10px; }
.modal-box.bonus .completion-anim { display: block; }
.happy-bunny { display: inline-block; animation: happy-hop 1s ease-in-out infinite; }
@keyframes happy-hop { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

@media (max-width: 480px) {
  .app { --pt: max(10px, env(safe-area-inset-top)); --pb: max(10px, env(safe-area-inset-bottom)); padding-left: max(8px, env(safe-area-inset-left)); padding-right: max(8px, env(safe-area-inset-right)); }
  .topbar { grid-template-columns: 47px 1fr 1.15fr 1fr 47px; min-height: 98px; }
  .circle-btn { width: 45px; height: 45px; font-size: 30px; }
  .progress-row { margin-inline: 7px; gap: 8px; }
  .carrot-progress, .hearts { height: 56px; border-radius: 28px; }
  .hearts { gap: 3px; padding-inline: 10px; font-size: 30px; }
  .carrot-progress { padding-inline: 7px; }
  .rules-strip { gap: 4px; padding: 8px; margin-bottom: 22px; }
  .rule-card { gap: 3px; padding: 6px 2px; }
  .board-shell { padding: 7px; border-radius: 15px; }
  .board { gap: 3px; }
  .bottom-tools { margin-top: 13px; }
  .tool-button > span { width: 59px; height: 59px; font-size: 35px; }
}

/* Tela de abertura com o logo da AR Games */
.splash { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'%3E%3Ccircle cx='20' cy='20' r='2' fill='%2397c96a' opacity='.12'/%3E%3C/svg%3E"); cursor: pointer; transition: opacity .45s ease; }
.splash.leaving { opacity: 0; pointer-events: none; }
.splash-logo { width: min(68vw, 300px); height: auto; overflow: visible; }
.sp-badge { transform-box: fill-box; transform-origin: center; animation: sp-pop .7s cubic-bezier(.3, 1.5, .5, 1) both; }
.sp-leaves { animation: sp-sprout .5s .45s ease-out both; }
.sp-draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: sp-draw .7s .55s ease-out forwards; }
.sp-draw-2 { animation-delay: .95s; }
.sp-games { animation: sp-rise .6s 1.35s ease-out both; }
@keyframes sp-pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes sp-sprout { from { opacity: 0; transform: translate(160px, 22px) scale(.3); } to { opacity: 1; transform: translate(160px, 12px) scale(1); } }
@keyframes sp-draw { to { stroke-dashoffset: 0; } }
@keyframes sp-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .sp-badge, .sp-leaves, .sp-games { animation: none; }
  .sp-draw { animation: none; stroke-dashoffset: 0; }
}

/* Ovo de chocolate escondido (desafio extra) */
.cell.choco::after { content: ""; position: absolute; right: 1px; bottom: 1px; width: 46%; height: 46%; pointer-events: none; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2C8 2 4.600 8 4.600 13.400C4.600 18.200 8 22 12 22C16 22 19.400 18.200 19.400 13.400C19.400 8 16 2 12 2Z' fill='%237b4a2b'/%3E%3Cpath d='M5.100 12.500l2.300-2.300l2.300 2.300l2.300-2.300l2.300 2.300l2.300-2.300l2.100 2.100' stroke='%23f5b301' stroke-width='1.700' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3Ccircle cx='8.500' cy='17' r='1' fill='%23f5b301'/%3E%3Ccircle cx='12' cy='18.200' r='1' fill='%23f5b301'/%3E%3Ccircle cx='15.500' cy='17' r='1' fill='%23f5b301'/%3E%3Ccircle cx='12' cy='6.800' r='1' fill='%23f5b301'/%3E%3C/svg%3E") center / contain no-repeat; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .3)); animation: choco-pop .5s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes choco-pop { from { transform: scale(.2) rotate(-25deg); opacity: 0; } }
.chap-choco { display: inline-block; margin-left: 4px; font-size: 20px; line-height: 1; vertical-align: -3px; }
.chap-choco:not(.found) { filter: grayscale(1); opacity: .38; }
.toast { position: fixed; top: max(12px, env(safe-area-inset-top)); left: 50%; z-index: 250; display: flex; align-items: center; gap: 10px; width: max-content; max-width: min(92vw, 420px); padding: 12px 18px; border-radius: 22px; background: #fff; color: var(--ink); font-weight: 800; font-size: 15px; line-height: 1.25; box-shadow: 0 10px 28px rgba(100, 70, 30, .3); transform: translateX(-50%); animation: toast-in .35s cubic-bezier(.3, 1.4, .5, 1); }
.toast .icon { font-size: 30px; }
.toast.hidden { display: none; }
@keyframes toast-in { from { transform: translate(-50%, -30px); opacity: 0; } }

/* Como jogar: título e botão fixos, só o texto rola */
.help-box { display: flex; flex-direction: column; gap: 14px; overflow: hidden; }
.help-box h2 { margin: 0; }
.help-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding-right: 6px; }
.help-body h3 { margin: 16px 0 6px; font-size: 14px; letter-spacing: .8px; text-transform: uppercase; color: var(--carrot); }
.help-body h3:first-child { margin-top: 0; }
.help-body p { margin: 0; font-size: 16px; line-height: 1.4; }
.help-body ul { margin: 0; padding-left: 20px; }
.help-body li { margin-bottom: 8px; font-size: 16px; line-height: 1.4; }
.help-box .round-text-btn { width: 100%; flex: 0 0 auto; }
.help-choco { margin-top: 16px; padding: 12px 14px 4px; border-radius: 16px; background: #fff0d4; }
.help-choco h3 { margin-top: 0; display: flex; align-items: center; gap: 8px; }
.help-choco h3 .icon { font-size: 22px; }
.help-box { padding: 22px 22px 20px; gap: 12px; }
.help-body h3 { margin: 12px 0 4px; }
.help-body li { margin-bottom: 5px; font-size: 15px; line-height: 1.35; }
.help-choco { margin-top: 12px; padding: 10px 14px 2px; }
.help-goal { font-size: 18px !important; font-weight: 800; }

/* Anúncios, privacidade e modo desenvolvedor */
#modal { z-index: 150; }
#privacy { z-index: 120; }
#consent { z-index: 350; }
.modal-actions { flex-wrap: wrap; }
.modal-actions .round-text-btn { flex: 1 1 auto; }
.tool-button.video i { background: var(--leaf); display: grid; place-items: center; padding: 0; }
.tool-button.video i .icon { font-size: 13px; }
.ad-overlay { position: fixed; inset: 0; z-index: 400; display: flex; flex-direction: column; gap: 14px; padding: max(18px, env(safe-area-inset-top)) 20px max(18px, env(safe-area-inset-bottom)); background: #2b1d10; color: #fff; }
.ad-top { display: flex; align-items: center; justify-content: space-between; font-weight: 800; }
.ad-tag { padding: 4px 10px; border-radius: 8px; background: #f5b301; color: #4a2c00; font-size: 13px; letter-spacing: .6px; text-transform: uppercase; }
.ad-count { font-size: 15px; }
.ad-body { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; border-radius: 22px; background: #3d2a18; text-align: center; padding: 20px; }
.ad-body b { font-size: 22px; }
.ad-body small { font-size: 14px; opacity: .75; }
.ad-bars { display: flex; align-items: flex-end; gap: 6px; height: 56px; }
.ad-bars i { width: 10px; height: 100%; border-radius: 5px; background: #f28c28; transform-origin: bottom; animation: ad-bar 1s ease-in-out infinite; }
.ad-bars i:nth-child(2) { animation-delay: .15s; } .ad-bars i:nth-child(3) { animation-delay: .3s; }
.ad-bars i:nth-child(4) { animation-delay: .45s; } .ad-bars i:nth-child(5) { animation-delay: .6s; }
@keyframes ad-bar { 0%, 100% { transform: scaleY(.3); } 50% { transform: scaleY(1); } }
.ad-note { margin: 0; text-align: center; font-weight: 700; }
.ad-actions { display: flex; gap: 10px; }
.ad-actions .round-text-btn { flex: 1; }
.ad-actions .round-text-btn:disabled { opacity: .45; cursor: default; }
.dev-ads { margin-top: 6px; padding-top: 4px; border-top: 2px dashed #e6d6bd; }
.dev-ads .round-text-btn { width: 100%; margin-top: 10px; }
.dev-note { margin: 8px 0 0; font-size: 13px; font-weight: 700; opacity: .75; }
.stepper { display: flex; align-items: center; gap: 8px; }
.stepper button { width: 38px; height: 38px; border: 0; border-radius: 50%; background: #f6efe4; color: var(--ink); font-size: 22px; font-weight: 900; cursor: pointer; }
.stepper b { min-width: 34px; text-align: center; font-size: 18px; }
.priv-actions { display: flex; flex-direction: column; gap: 8px; margin: 8px 0; }
.priv-actions .round-text-btn { width: 100%; }
.round-text-btn.danger { color: #c62828; }
.priv-note, .consent-small { font-size: 13px !important; font-weight: 700; opacity: .8; line-height: 1.35; }
.priv-links { font-size: 15px; }
.priv-links a, .consent-small a { color: #b5651d; }

/* Comemoração de capítulo e ferramentas de desenvolvedor do menu */
.party { position: fixed; inset: 0; z-index: 340; display: grid; place-items: center; padding: 20px; background: rgba(60, 100, 50, .4); backdrop-filter: blur(3px); overflow: hidden; }
.party.hidden { display: none; }
.confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.confetti i { position: absolute; top: -20px; border-radius: 2px; opacity: .95; animation: confetti-fall 3s linear infinite; }
@keyframes confetti-fall { from { transform: translateY(-4vh) rotate(0deg); } to { transform: translateY(112vh) rotate(720deg); } }
.party-card { position: relative; width: min(100%, 380px); padding: 26px 24px 22px; border-radius: 28px; background: var(--soft); text-align: center; box-shadow: 0 18px 50px rgba(90, 70, 30, .3); animation: party-pop .6s cubic-bezier(.3, 1.5, .5, 1); }
@keyframes party-pop { from { transform: scale(.6); opacity: 0; } }
.party-bunny { font-size: 84px; line-height: 1; animation: happy-hop 1s ease-in-out infinite; }
.party-card h2 { margin: 6px 0 4px; font-size: 28px; color: var(--carrot); }
.party-card p { margin: 0; font-size: 16px; font-weight: 700; }
.party-reward { margin: 18px 0 18px; padding: 14px 12px 12px; border-radius: 20px; background: #fff0d4; }
.party-help { position: relative; display: inline-block; }
.party-help-btn { position: relative; display: grid; place-items: center; width: 74px; height: 74px; border-radius: 50%; background: #fff; box-shadow: var(--shadow); font-size: 50px; }
.party-help-btn i { position: absolute; right: -6px; top: -6px; min-width: 30px; height: 30px; padding: 3px 8px; border-radius: 16px; background: var(--carrot); color: #fff; font-style: normal; font-weight: 900; font-size: 19px; line-height: 24px; }
.party-help-btn i.tick { animation: count-pop .4s cubic-bezier(.3, 1.8, .5, 1); }
@keyframes count-pop { 0% { transform: scale(1); } 40% { transform: scale(1.5); } 100% { transform: scale(1); } }
.party-plus { position: absolute; left: 78%; top: -4px; font-size: 34px; color: var(--leaf); text-shadow: 0 2px 0 #fff, 0 0 8px #fff; opacity: 0; pointer-events: none; }
.party-plus.go { animation: plus-float 1.5s ease-out forwards; }
@keyframes plus-float { 0% { opacity: 0; transform: translateY(16px) scale(.5); } 25% { opacity: 1; transform: translateY(-4px) scale(1.35); } 100% { opacity: 0; transform: translateY(-58px) scale(1); } }
.party-reward p { margin-top: 10px; font-size: 15px; }
.party-card .round-text-btn { width: 100%; }
.party-egg { display: flex; align-items: center; gap: 12px; margin: -6px 0 18px; padding: 10px 14px; border-radius: 18px; background: #f3ebdd; text-align: left; }
.party-egg .icon { flex: 0 0 auto; font-size: 38px; filter: grayscale(1); opacity: .4; }
.party-egg b { display: block; font-size: 16px; }
.party-egg span { display: block; margin-top: 2px; font-size: 13px; font-weight: 700; line-height: 1.3; opacity: .8; }
.party-egg.found { background: #e6f2d8; }
.party-egg.found .icon { filter: none; opacity: 1; animation: egg-pop .7s .6s cubic-bezier(.3, 1.6, .5, 1) both; }
@keyframes egg-pop { from { transform: scale(.3) rotate(-25deg); opacity: 0; } }
.menu-dev { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.menu-dev p { flex: 1 0 100%; margin: 2px 0 0; text-align: center; font-size: 12px; font-weight: 700; opacity: .7; }
.menu-dev.hidden { display: none; }
.dev-chip { padding: 8px 14px; border: 2px dashed #c9a56a; border-radius: 14px; background: #fff8ea; color: var(--ink); font-weight: 800; font-size: 13px; cursor: pointer; }
@media (prefers-reduced-motion: reduce) {
  .confetti i, .party-bunny, .party-card, .party-egg.found .icon { animation: none; }
}

/* Entrada do tabuleiro (do canto inferior esquerdo para o superior direito) */
.board.entering .cell { animation: cell-in .34s cubic-bezier(.3, 1.5, .5, 1) backwards; animation-delay: var(--d, 0ms); }
@keyframes cell-in { from { transform: scale(.2); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .board.entering .cell { animation: none; } }

/* Modo desenvolvedor: pergunta após concluir um jogo e banco de dados */
#devq { z-index: 330; }
.devq-tag { margin: 0 0 6px; font-size: 12px; font-weight: 900; letter-spacing: 1px; text-transform: uppercase; color: #8a7360; }
.devq-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.devq-actions .round-text-btn { width: 100%; font-size: 18px; }
.devq-actions.row { flex-direction: row; }
.devq-actions.row .round-text-btn { flex: 1; }
.devq-actions .round-text-btn.yes { background: #fde3e0; color: #b3261e; }
.dev-db { margin: 10px 0 4px; padding: 10px 12px; border-radius: 16px; background: #fff8ea; }
.dev-db p { margin: 4px 0 8px; font-size: 13px; font-weight: 700; line-height: 1.35; }
.dev-db .round-text-btn { width: 100%; margin-top: 0; padding: 12px; }
.setting-row.hidden { display: none; }
.tutorial-panel .solver-buttons { min-height: 46px; }

/* Chave do modo desenvolvedor (abre segurando o título KAROTTO por 3 s, só em servidor protegido) */
.menu-head { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.devkey-input { width: 100%; box-sizing: border-box; margin-top: 12px; padding: 14px; border: 2px solid #ead9bf; border-radius: 14px; background: #fffaf0; color: var(--ink); font: inherit; font-size: 16px; font-weight: 700; }
.devkey-input:focus { outline: 3px solid var(--carrot); outline-offset: 1px; }
#devkey { z-index: 335; }
#devkey-msg.error { color: #b3261e; font-weight: 800; }
.devq-actions .round-text-btn.primary { background: var(--carrot); color: #fff; }
/* Celebração em telas baixas (por exemplo 320×568): compacta para o botão Continuar caber */
@media (max-height: 640px) {
  .party-card { padding: 16px 20px 14px; }
  .party-bunny { font-size: 54px; }
  .party-card h2 { margin: 4px 0 2px; font-size: 24px; }
  .party-card p { font-size: 15px; }
  .party-reward { margin: 10px 0 12px; padding: 8px 10px; }
  .party-help-btn { width: 58px; height: 58px; font-size: 38px; }
  .party-reward p { margin-top: 6px; font-size: 14px; }
  .party-egg { margin: 0 0 12px; padding: 8px 12px; }
}
