/* Cheeky Monkey look: chunky sticker panels over the zoo at sunset.
   Title panel on the left (make your monkey); in game: name and bananas top-left,
   the Escape Plan top-right, map bottom-left, talking at the bottom. */
:root {
  --ink: #2b1d14;
  --ink-soft: #5a4232;
  --card: #fff8ec;
  --card-2: #f7e6cc;
  --monkey: #8a5a35;
  --banana: #ffd23f;
  --maple: #e8632c;
  --gold: #ffc928;
  --leaf: #4f9a32;
  --sky: #9fd8f0;
  --soil: #6b4a32;
  --line: #e7cfa9;
  --display: "Grandstander", "Chalkboard SE", "Comic Sans MS", "Trebuchet MS", system-ui, sans-serif;
  --body: "Atkinson Hyperlegible", "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  --r: 14px;
  --shadow: 4px 4px 0 var(--ink);
  color-scheme: light;
}
[hidden] { display: none !important; }
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: #f2b48a; color: var(--ink); font-family: var(--body); font-size: 15px;
  overflow: hidden; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; touch-action: none;
}
#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; outline: none; }
button { font-family: var(--display); cursor: pointer; color: var(--ink); }
button:focus-visible, input:focus-visible { outline: 3px solid var(--maple); outline-offset: 2px; }
kbd {
  display: inline-block; min-width: 1.6em; padding: 1px 6px; margin: 0 1px;
  border: 2px solid var(--ink); border-bottom-width: 3px; border-radius: 6px;
  background: #fff; font: 700 12px/1.3 var(--body); text-align: center; color: var(--ink);
}
.sticker { background: var(--card); border: 3px solid var(--ink); border-radius: var(--r); box-shadow: var(--shadow); }
.dim { opacity: 0.75; font-size: 13px; }
.yellow { color: #b88a00; font-weight: 900; }

/* ------------------------------------------------ title */
#title {
  position: fixed; inset: 0; display: flex; align-items: stretch;
  background: linear-gradient(90deg, rgba(43, 29, 20, 0.5) 0%, rgba(43, 29, 20, 0.12) 46%, rgba(43, 29, 20, 0) 60%);
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.title-panel {
  width: min(540px, 100%); margin-block: 16px; padding: 16px 22px;
  background: var(--card); border: 3px solid var(--ink); border-radius: 22px; box-shadow: 6px 6px 0 var(--ink);
  overflow-y: auto; max-height: calc(100% - 32px); align-self: center; display: flex; flex-direction: column; gap: 8px;
}
.logo { margin: 0; font-family: var(--display); font-weight: 900; font-size: clamp(42px, 8vw, 62px); line-height: 0.95; display: flex; flex-wrap: wrap; gap: 0 12px; }
.logo span { display: inline-block; paint-order: stroke fill; -webkit-text-stroke: 7px var(--ink); }
.logo .l1 { color: #f08a2b; transform: rotate(-3deg); animation: swing 2.4s ease-in-out infinite; }
.logo .l2 { color: var(--gold); transform: rotate(2deg); animation: swing 2.4s ease-in-out infinite reverse; }
.tagline { margin: 0 0 2px; font-size: 15px; line-height: 1.35; max-width: 52ch; }
.label { margin: 4px 0 0; font: 800 13px var(--display); text-transform: uppercase; letter-spacing: 1.2px; color: var(--ink-soft); }
  padding: 6px 6px 7px; border: 3px solid var(--ink); border-radius: 12px; background: #fff; box-shadow: 3px 3px 0 var(--ink);
  display: flex; flex-direction: column; align-items: center; gap: 2px; font-family: var(--body); min-width: 0;
  transition: transform 0.12s ease, background 0.12s ease;
}
.levels { display: flex; gap: 8px; flex-wrap: wrap; }
.levels button { flex: 1 1 0; min-width: 0; padding: 6px; font-size: 14px; font-weight: 800; border: 3px solid var(--ink); border-radius: 10px; background: #fff; box-shadow: 2px 2px 0 var(--ink); }
.levels button.sel { background: var(--banana); }
.level-info { margin: 0; font-size: 13px; opacity: 0.8; }
.level-info:empty { display: none; }
.level-row { display: flex; flex-direction: column; gap: 6px; }
.play-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
button.big {
  font-size: 21px; font-weight: 900; padding: 8px 18px; border: 3px solid var(--ink); border-radius: 14px;
  background: var(--gold); box-shadow: 4px 4px 0 var(--ink); transition: transform 0.1s ease;
}
button.big:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--ink); }
button.big:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
button.small { font-size: 14px; font-weight: 800; padding: 7px 12px; border: 2px solid var(--ink); border-radius: 10px; background: #fff; }
button.mid { font-size: 16px; font-weight: 900; padding: 9px 12px; border: 3px solid var(--ink); border-radius: 12px; background: var(--sky); box-shadow: 3px 3px 0 var(--ink); }
button.mid.alt { background: #c9ec9f; }
button.mid:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
button:disabled { opacity: 0.45; cursor: not-allowed; }
.menu-btns { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 4px; }
.menu-btns .dim:empty { display: none; }
.menu-btns > .dim { flex-basis: 100%; margin: 0; }
.friends-row, .continue-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
#continueInfo { pointer-events: none; }
.join-box { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.join-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
#joinCode { width: 6.2em; font: 900 28px var(--display); letter-spacing: 0.18em; text-transform: uppercase; text-align: center; padding: 4px 6px; border: 3px solid var(--ink); border-radius: 12px; background: #fff; color: var(--ink); }
.msg { margin: 0; font-weight: 700; color: #b8392a; }
.msg:empty { display: none; }
.lobby { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.code-card { display: flex; flex-direction: column; align-items: flex-start; padding: 10px 16px; align-self: flex-start; background: var(--gold); border: 3px solid var(--ink); border-radius: 16px; box-shadow: 4px 4px 0 var(--ink); }
.code-card .label { margin: 0; color: var(--ink); }
#lobbyCode { font: 900 54px/1 var(--display); letter-spacing: 0.16em; }
.lobby-hint { margin: 0; font-size: 15px; line-height: 1.35; max-width: 46ch; }
.lobby-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.lobby-list li { display: flex; align-items: center; gap: 8px; padding: 6px 8px; background: #fff; border: 2px solid var(--ink); border-radius: 10px; font-weight: 700; font-size: 14px; min-width: 0; }
.lobby-list li.empty { background: transparent; border-style: dashed; font-weight: 400; opacity: 0.7; }
.pdot { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--ink); font: 900 13px var(--display); color: #fff; -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; }
.small-check { display: flex; align-items: center; gap: 7px; font-weight: 700; font-size: 14px; }
.small-check input { width: 18px; height: 18px; accent-color: var(--leaf); }
.how { border-top: 2px dashed var(--line); padding-top: 10px; font-size: 14px; line-height: 1.45; }
.how h3 { margin: 6px 0 4px; font: 800 16px var(--display); }
.how table { border-collapse: collapse; width: 100%; }
.how td { padding: 3px 4px; vertical-align: top; }
.how td:first-child { white-space: nowrap; width: 1%; }
.how p { margin: 8px 0 0; max-width: 62ch; }

/* ------------------------------------------------ make your monkey */
.maker { display: flex; gap: 14px; align-items: center; }
#monkeyCard { flex: none; width: 128px; height: 128px; background: radial-gradient(circle at 50% 60%, #fff3d0, #ffd9a0 70%); border: 3px solid var(--ink); border-radius: 18px; box-shadow: 3px 3px 0 var(--ink); }
.maker-side { flex: 1; display: flex; flex-direction: column; gap: 5px; min-width: 0; }
#monkeyName { width: 100%; font: 900 22px var(--display); padding: 5px 10px; border: 3px solid var(--ink); border-radius: 12px; background: #fff; color: var(--ink); }
.furs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.fur { position: relative; aspect-ratio: 1; border: 3px solid var(--ink); border-radius: 50%; padding: 0; box-shadow: 2px 2px 0 var(--ink); min-width: 0; }
.fur span { position: absolute; left: 50%; bottom: -3px; transform: translate(-50%, 100%); font: 700 10px var(--body); white-space: nowrap; opacity: 0; transition: opacity 0.15s; pointer-events: none; }
.fur:hover span, .fur.sel span { opacity: 1; }
.fur.sel { outline: 4px solid var(--banana); outline-offset: 2px; transform: scale(1.06); }
.furs { margin-bottom: 12px; }
.ages { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ages button { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 8px; font: 900 18px var(--display); border: 3px solid var(--ink); border-radius: 12px; background: #fff; box-shadow: 3px 3px 0 var(--ink); }
.ages button span { font-size: 28px; }
.ages button.sel { background: var(--banana); transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.age-info { margin: 0; padding-left: 20px; font-size: 13.5px; line-height: 1.4; }
.extra-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.extras { display: flex; gap: 6px; flex-wrap: wrap; }
.extras button { width: 40px; height: 40px; font-size: 21px; border: 2px solid var(--ink); border-radius: 10px; background: #fff; padding: 0; }
.extras button.sel { background: var(--banana); box-shadow: 2px 2px 0 var(--ink); }
.lobby-list .swatch { flex: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--ink); }
.lobby-list .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lobby-list .age { flex: none; font-size: 18px; }

/* ------------------------------------------------ HUD */
#hud { position: fixed; inset: 0; pointer-events: none; }
#hud > * { pointer-events: none; }
#topLeft { position: absolute; top: calc(12px + env(safe-area-inset-top, 0px)); left: max(12px, env(safe-area-inset-left, 0px)); display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.chips { display: flex; flex-direction: column; gap: 5px; align-items: flex-start; }
.chip {
  display: flex; align-items: center; gap: 7px; padding: 4px 11px; background: var(--card);
  border: 3px solid var(--ink); border-radius: 999px; box-shadow: 3px 3px 0 var(--ink); font-weight: 700; font-size: 14px; max-width: 320px; white-space: nowrap;
}
#who { font: 800 16px var(--display); border-left-width: 8px; }
.big-chip { font: 900 20px var(--display) !important; padding: 4px 14px !important; }
#bananas.done { background: #c9ec9f; }
#bananas.gold { background: var(--banana); animation: wobble 0.35s ease-in-out infinite; }
#plan { position: absolute; top: calc(12px + env(safe-area-inset-top, 0px)); right: max(12px, env(safe-area-inset-right, 0px)); width: 300px; padding: 9px 12px; font-size: 14px; }
#plan h3 { margin: 0 0 4px; font: 800 17px var(--display); }
.plan-list { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.plan-list li { display: flex; gap: 7px; align-items: flex-start; line-height: 1.25; padding: 2px 4px; border-radius: 6px; font-size: 13px; }
.plan-list li .box { flex: none; width: 17px; height: 17px; margin-top: 1px; border: 2px solid var(--ink); border-radius: 4px; background: #fff; font: 900 12px/13px var(--display); text-align: center; color: var(--leaf); }
.plan-list li.done { opacity: 0.5; }
.plan-list li.done .t { text-decoration: line-through; }
.plan-list li.next { background: var(--banana); font-weight: 700; }
.plan-list li em { font-style: normal; font-weight: 800; color: var(--maple); margin-left: 4px; }
#compass { position: absolute; left: 50%; top: calc(12px + env(safe-area-inset-top, 0px)); transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; font: 900 30px var(--display); color: var(--banana); -webkit-text-stroke: 5px var(--ink); paint-order: stroke fill; line-height: 1; }
#compass .ic { font-size: 26px; -webkit-text-stroke: 0; }
#compass .ar { display: inline-block; font-size: 34px; }
#compass small { font: 800 12px var(--body); -webkit-text-stroke: 3px var(--ink); color: #fff; }
#minimap { position: absolute; left: max(12px, env(safe-area-inset-left, 0px)); bottom: calc(12px + env(safe-area-inset-bottom, 0px)); width: 170px; height: 170px; background: var(--card); border: 3px solid var(--ink); border-radius: 50%; box-shadow: 3px 3px 0 var(--ink); }
#netChip { position: absolute; right: max(12px, env(safe-area-inset-right, 0px)); bottom: calc(12px + env(safe-area-inset-bottom, 0px)); font: 800 13px var(--display); background: var(--banana); }
#prompt {
  position: absolute; left: 50%; bottom: calc(118px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 7px 14px 7px 7px; border-radius: 999px; font-weight: 700; font-size: 17px;
  display: flex; align-items: center; gap: 9px; white-space: nowrap; max-width: calc(100vw - 32px); overflow: hidden; text-overflow: ellipsis;
}
#prompt .key { background: var(--banana); color: var(--ink); font: 900 15px var(--display); border-radius: 999px; min-width: 28px; height: 28px; display: grid; place-items: center; padding: 0 7px; }
#prompt.bad { background: #8a2f22; white-space: normal; text-align: left; border-radius: 18px; max-width: min(620px, calc(100vw - 32px)); }
#subtitle {
  position: absolute; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  width: min(720px, calc(100vw - 32px)); padding: 12px 16px; background: var(--card); border: 3px solid var(--ink); border-radius: 16px; box-shadow: var(--shadow);
  font-size: 18px; line-height: 1.35; display: flex; flex-direction: column; gap: 3px;
}
#subtitle.blocking { pointer-events: auto; cursor: pointer; }
#subWho { font: 800 14px var(--display); text-transform: uppercase; letter-spacing: 1px; align-self: flex-start; padding: 1px 9px; border-radius: 999px; color: #fff; background: #3f7a3a; }
#subWho:empty { display: none; }
#subNext { position: absolute; right: 14px; bottom: 8px; font: 700 12px var(--body); opacity: 0.6; font-style: normal; animation: nudge 1s ease-in-out infinite; }
#toast { position: absolute; left: 50%; top: 22%; transform: translateX(-50%); font: 900 clamp(22px, 4.4vw, 40px) var(--display); color: var(--banana); white-space: nowrap; -webkit-text-stroke: 6px var(--ink); paint-order: stroke fill; text-shadow: 3px 3px 0 var(--ink); max-width: calc(100vw - 24px); text-align: center; }
#toast.bad { color: #ff7a6b; }
#toast.pop { animation: pop 1.8s ease forwards; }
#banner {
  position: absolute; left: 50%; top: calc(64px + env(safe-area-inset-top, 0px)); transform: translateX(-50%);
  background: var(--banana); border: 3px solid var(--ink); border-radius: 16px; box-shadow: var(--shadow); padding: 8px 18px 10px;
  display: flex; flex-direction: column; align-items: center; text-align: center; max-width: min(460px, calc(100vw - 32px));
}
#banner small { font: 800 12px var(--display); text-transform: uppercase; letter-spacing: 1.4px; }
#banner b { font: 900 21px/1.15 var(--display); text-wrap: balance; }
#banner i { font-size: 13px; margin-top: 2px; font-style: normal; }
#banner.pop { animation: drop 3.8s ease forwards; }
#shouts { position: absolute; left: 50%; top: 36%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 6px; }
#shouts div { background: #fff; border: 3px solid var(--ink); border-radius: 14px; padding: 4px 12px; font: 800 17px var(--display); animation: pop2 2.4s ease forwards; }
#timeout { position: absolute; left: 50%; top: 34%; transform: translate(-50%, -50%); text-align: center; font-family: var(--display); color: #fff; -webkit-text-stroke: 6px var(--ink); paint-order: stroke fill; display: flex; flex-direction: column; align-items: center; gap: 4px; width: min(560px, calc(100vw - 32px)); }
#timeout b { font-size: 54px; font-weight: 900; color: var(--banana); animation: bob 1.4s ease-in-out infinite; }
#timeout span { font-size: 20px; font-weight: 800; }
#timeout i { font-style: normal; font-size: 64px; font-weight: 900; }
#help { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(160px + env(safe-area-inset-bottom, 0px)); width: min(640px, calc(100vw - 24px)); text-align: center; padding: 8px 12px; font-size: 14px; line-height: 1.9; }
#skipIntro { position: absolute; left: 50%; transform: translateX(-50%); top: calc(14px + env(safe-area-inset-top, 0px)); pointer-events: auto !important; font-size: 14px; font-weight: 800; padding: 7px 12px; border: 2px solid var(--ink); border-radius: 10px; background: #fff; }
#goNow { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(170px + env(safe-area-inset-bottom, 0px)); pointer-events: auto !important; }
#flash { position: fixed; inset: 0; pointer-events: none; opacity: 0; background: radial-gradient(ellipse at center, rgba(255, 230, 120, 0) 40%, rgba(255, 220, 90, 0.75) 100%); }
#flash.on { animation: flash 0.9s ease; }
#danger { position: fixed; inset: 0; pointer-events: none; opacity: 0; box-shadow: inset 0 0 90px 30px rgba(232, 68, 58, 0.75); transition: opacity 0.2s ease; }
#danger.on { opacity: 1; animation: pulse 0.5s ease-in-out infinite alternate; }
.end-card { width: min(480px, 100%) !important; text-align: center; align-items: center; }
.end-top { font-size: 54px; animation: bob 1.4s ease-in-out infinite; }
.end-card h2 { font-size: 40px !important; color: #f08a2b; -webkit-text-stroke: 5px var(--ink); paint-order: stroke fill; }
.end-stats { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 17px; }

/* ------------------------------------------------ touch */
#touch { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
#touch > * { pointer-events: auto; }
#stick { position: absolute; left: max(24px, env(safe-area-inset-left, 0px)); bottom: calc(24px + env(safe-area-inset-bottom, 0px)); width: 130px; height: 130px; border-radius: 50%; background: rgba(255, 248, 236, 0.35); border: 3px solid rgba(43, 29, 20, 0.6); display: grid; place-items: center; touch-action: none; }
#knob { width: 56px; height: 56px; border-radius: 50%; background: var(--card); border: 3px solid var(--ink); }
.tbtns { position: absolute; right: max(18px, env(safe-area-inset-right, 0px)); bottom: calc(22px + env(safe-area-inset-bottom, 0px)); display: grid; grid-template-columns: repeat(3, 64px); grid-template-rows: repeat(2, 64px); gap: 10px; }
.tbtns button, #t-map, #t-pause { border: 3px solid var(--ink); border-radius: 50%; background: var(--card); box-shadow: 2px 2px 0 var(--ink); font: 900 15px var(--display); touch-action: none; }
#t-peel { grid-column: 1; grid-row: 1; font-size: 26px; } #t-ook { grid-column: 2; grid-row: 1; }
#t-act { grid-column: 3; grid-row: 1; background: var(--banana); font-size: 18px; }
#t-run { grid-column: 1; grid-row: 2; } #t-jump { grid-column: 2 / span 2; grid-row: 2; border-radius: 32px !important; background: #c9ec9f; font-size: 19px; }
#touch button.on { background: var(--sky); transform: translate(2px, 2px); box-shadow: none; }
#t-map { position: absolute; right: max(12px, env(safe-area-inset-right, 0px)); top: calc(250px + env(safe-area-inset-top, 0px)); width: 46px; height: 46px; font-size: 20px; }
#t-pause { position: absolute; right: max(66px, env(safe-area-inset-right, 0px)); top: calc(250px + env(safe-area-inset-top, 0px)); width: 46px; height: 46px; font-size: 16px; }
body.touch #help { display: none; }
body.touch #minimap { width: 120px; height: 120px; bottom: auto; top: calc(120px + env(safe-area-inset-top, 0px)); }
body.touch #prompt, body.touch #subtitle { bottom: calc(176px + env(safe-area-inset-bottom, 0px)); }
body.touch #goNow { bottom: calc(230px + env(safe-area-inset-bottom, 0px)); }
@media (max-width: 1100px) { #banner { top: calc(110px + env(safe-area-inset-top, 0px)); } }

/* ------------------------------------------------ modals */
.modal { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; background: rgba(43, 29, 20, 0.55); padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.modal .card { width: min(460px, 100%); background: var(--card); border: 3px solid var(--ink); border-radius: 20px; box-shadow: 6px 6px 0 var(--ink); padding: 20px 22px; display: flex; flex-direction: column; gap: 12px; max-height: calc(100% - 32px); overflow-y: auto; }
.modal h2 { margin: 0; font: 900 30px var(--display); }
.modal label { display: grid; grid-template-columns: 110px 1fr; align-items: center; gap: 10px; font-weight: 700; }
.modal label.check { display: flex; gap: 9px; font-weight: 600; }
.modal input[type=range] { width: 100%; accent-color: var(--leaf); }
.modal input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--leaf); }
.modal .row { display: flex; gap: 10px; flex-wrap: wrap; }
.map-card { width: min(680px, 100%) !important; align-items: center; padding: 14px !important; }
#bigmap { width: min(640px, calc(100vw - 64px), calc(100vh - 120px)); aspect-ratio: 1; border: 3px solid var(--ink); border-radius: 12px; background: #4b4e55; }
#fade { position: fixed; inset: 0; background: #000; opacity: 0; pointer-events: none; }
#crash { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(420px, calc(100vw - 32px)); background: var(--card); border: 3px solid var(--ink); border-radius: 16px; padding: 16px; }
#crash code { font-size: 12px; opacity: 0.7; word-break: break-word; }

@keyframes pop { 0% { transform: translateX(-50%) scale(0.4); opacity: 0; } 12% { transform: translateX(-50%) scale(1.12); opacity: 1; } 22% { transform: translateX(-50%) scale(1); } 80% { opacity: 1; } 100% { transform: translateX(-50%) translateY(-24px); opacity: 0; } }
@keyframes pop2 { 0% { transform: scale(0.5); opacity: 0; } 10% { transform: scale(1.1); opacity: 1; } 20% { transform: scale(1); } 85% { opacity: 1; } 100% { opacity: 0; } }
@keyframes drop { 0% { transform: translate(-50%, -140%); } 8% { transform: translate(-50%, 6%); } 14% { transform: translate(-50%, 0); } 90% { transform: translate(-50%, 0); opacity: 1; } 100% { transform: translate(-50%, -140%); opacity: 0; } }
@keyframes wobble { 0%, 100% { transform: rotate(-2deg); } 50% { transform: rotate(2deg); } }
@keyframes swing { 0%, 100% { transform: rotate(-4deg) translateY(0); } 50% { transform: rotate(3deg) translateY(-4px); } }
@keyframes nudge { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(3px); } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes heartHit { 0% { transform: scale(1); } 30% { transform: scale(1.6) rotate(-12deg); } 100% { transform: scale(1); } }
@keyframes flash { 0% { opacity: 0; } 15% { opacity: 1; } 100% { opacity: 0; } }
@keyframes pulse { from { box-shadow: inset 0 0 70px 20px rgba(232, 68, 58, 0.55); } to { box-shadow: inset 0 0 110px 40px rgba(232, 68, 58, 0.85); } }


@media (max-width: 720px) {
  #title { background: rgba(43, 29, 20, 0.35); align-items: flex-start; }
  .title-panel { padding: 14px; align-self: flex-start; }
  .lobby-list { grid-template-columns: 1fr; }
  #monkeyCard { width: 96px; height: 96px; }
  #plan { width: min(230px, 52vw); font-size: 12.5px; padding: 7px 9px; }
  #plan h3 { font-size: 14px; }
  .plan-list li { font-size: 12px; }
  .chip { font-size: 12px; padding: 3px 8px; }
  .big-chip { font-size: 17px !important; }
  #subtitle { font-size: 16px; }
  #help { display: none; }
}
/* short screens (phones sideways): keep the middle of the screen clear */
@media (max-height: 520px) {
  #plan { width: min(250px, 40vw); padding: 6px 9px; }
  .plan-list li:not(.next) { display: none; }
  body.touch #t-map { top: auto; bottom: calc(176px + env(safe-area-inset-bottom, 0px)); right: max(240px, env(safe-area-inset-right, 0px)); }
  body.touch #t-pause { top: auto; bottom: calc(176px + env(safe-area-inset-bottom, 0px)); right: max(190px, env(safe-area-inset-right, 0px)); }
  body.touch #prompt, body.touch #subtitle { bottom: calc(66px + env(safe-area-inset-bottom, 0px)); max-width: calc(100vw - 440px); }
  body.touch #subtitle { font-size: 14px; padding: 8px 12px; }
  #banner { top: calc(8px + env(safe-area-inset-top, 0px)); padding: 4px 12px 6px; }
  #banner b { font-size: 16px; }
  body.touch #minimap { width: 96px; height: 96px; top: calc(96px + env(safe-area-inset-top, 0px)); }
  .tbtns { grid-template-columns: repeat(3, 56px); grid-template-rows: repeat(2, 56px); gap: 8px; }
  #timeout b { font-size: 38px; } #timeout i { font-size: 44px; }
  .logo { font-size: 40px; }
  .title-panel .tagline { font-size: 14px; }
}
.touch-only { display: none; }
body.touch .touch-only { display: inline; }
body.touch .desk-only { display: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01s !important; animation-iteration-count: 1 !important; transition: none !important; }
}
