@font-face { font-family: "Nunito"; font-style: normal; font-weight: 400; font-display: swap; src: url("../assets/fonts/nunito-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Nunito"; font-style: normal; font-weight: 600; font-display: swap; src: url("../assets/fonts/nunito-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Nunito"; font-style: normal; font-weight: 700; font-display: swap; src: url("../assets/fonts/nunito-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Nunito"; font-style: normal; font-weight: 800; font-display: swap; src: url("../assets/fonts/nunito-latin-800-normal.woff2") format("woff2"); }
@font-face { font-family: "Nunito"; font-style: normal; font-weight: 900; font-display: swap; src: url("../assets/fonts/nunito-latin-900-normal.woff2") format("woff2"); }

:root {
  --blue: #3d6fb4;
  --blue-d: #2b4f85;
  --blue-l: #dcebfb;
  --sky: #7fbdf0;
  --cream: #fff8ea;
  --cream-d: #f1e3c8;
  --ink: #2c3e5a;
  --ink-soft: #5c6c85;
  --orange: #f0913a;
  --green: #6cc04a;
  --yellow: #f6c644;
  --terra: #d9825e;
  --glass: rgba(26, 44, 74, 0.56);
  --radius: 20px;
  --shadow: 0 10px 30px rgba(24, 44, 80, 0.22);
  --font: "Nunito", ui-rounded, "SF Pro Rounded", "Varela Round", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; overflow: hidden; background: #bfe2fb;
  font-family: var(--font); color: var(--ink);
  -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none; touch-action: none;
}
canvas#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; outline: none; }
#ui { position: fixed; inset: 0; pointer-events: none; overflow: hidden; overflow: clip; }
.hidden { display: none !important; }
kbd {
  display: inline-block; min-width: 1.7em; padding: 0.12em 0.5em; margin: 0 0.12em;
  font: 800 0.82em var(--font); text-align: center; color: var(--ink);
  background: #fff; border-radius: 7px; box-shadow: 0 2px 0 rgba(30, 50, 90, 0.28);
}
.ico { width: 1.2em; height: 1.2em; fill: currentColor; flex: none; }
.ico.big { width: 2.6em; height: 2.6em; color: var(--blue); }
.ico.huge { width: 4.2em; height: 4.2em; }
.c-paw { color: #ffffff; } .c-bolt { color: var(--yellow); } .c-smile { color: #ffc93c; } .c-star { color: var(--yellow); }
.c-gem { color: #8fe3ff; } .c-sun { color: #ffc93c; } .c-sand { color: #f2d7a0; }

/* ------------------------------------------------------------------ panels */
.panel { background: var(--cream); border-radius: var(--radius); box-shadow: var(--shadow); }
.screen {
  position: absolute; inset: 0; display: none; align-items: center; justify-content: center;
  pointer-events: auto; padding: 20px; overflow: auto;
}
.screen.show { display: flex; animation: fadeIn 0.25s ease both; }
#screen-settings, #screen-help, #screen-pause, #screen-cats, #confirm, #celebrate, #fatal {
  background: rgba(30, 52, 92, 0.34); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px);
}
#confirm, #celebrate, #fatal { z-index: 40; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: translateY(14px) scale(0.97); } to { opacity: 1; transform: none; } }

.card { width: min(560px, 100%); padding: 26px 28px 24px; animation: popIn 0.3s cubic-bezier(.2,.9,.3,1.2) both; border: 3px solid #fff; max-height: 100%; overflow: auto; }
.card.wide { width: min(980px, 100%); }
.card.narrow { width: min(420px, 100%); }
.card.center { text-align: center; }
.card h2 { margin: 0 0 16px; font-size: 1.55rem; font-weight: 900; color: var(--blue-d); display: flex; align-items: center; gap: 10px; }
.card.center h2 { justify-content: center; }
.card p { margin: 0 0 14px; line-height: 1.5; color: var(--ink-soft); font-weight: 600; }
.note { font-size: 0.88rem; }
.row { display: flex; gap: 12px; align-items: center; margin-top: 18px; flex-wrap: wrap; }
.row.end { justify-content: flex-end; } .row.center { justify-content: center; }
.grow { flex: 1; }

.btn {
  pointer-events: auto; appearance: none; border: 0; cursor: pointer;
  font: 800 1.02rem var(--font); color: var(--blue-d); background: #fff;
  padding: 12px 22px; border-radius: 999px; min-width: 150px;
  box-shadow: 0 4px 0 #cdd9ea, 0 8px 18px rgba(30, 60, 110, 0.16);
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s;
}
.btn:hover, .btn:focus-visible { transform: translateY(-2px); background: #f4f9ff; outline: none; box-shadow: 0 6px 0 #cdd9ea, 0 12px 22px rgba(30, 60, 110, 0.2); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #cdd9ea; }
.btn.primary { background: linear-gradient(#5b93dc, #3d6fb4); color: #fff; box-shadow: 0 4px 0 #2b4f85, 0 8px 18px rgba(30, 60, 110, 0.25); }
.btn.primary:hover, .btn.primary:focus-visible { background: linear-gradient(#6aa1e8, #447bc6); box-shadow: 0 6px 0 #2b4f85, 0 12px 22px rgba(30, 60, 110, 0.3); }
.btn.primary:active { box-shadow: 0 1px 0 #2b4f85; }
.btn.danger { color: #b5483a; min-width: 0; }

/* ------------------------------------------------------------------- title */
#screen-title { align-items: stretch; justify-content: flex-start; padding: 0; background: linear-gradient(100deg, rgba(60, 120, 200, 0.42) 0%, rgba(60, 120, 200, 0.16) 38%, rgba(0, 0, 0, 0) 62%); }
.title-wrap { display: flex; flex-direction: column; justify-content: center; padding: clamp(18px, 5vh, 60px) clamp(22px, 6vw, 90px); gap: clamp(8px, 1.6vh, 16px); max-height: 100%; }
.logo { position: relative; display: inline-flex; align-items: flex-end; width: max-content; filter: drop-shadow(0 8px 0 rgba(30, 60, 110, 0.35)) drop-shadow(0 16px 24px rgba(20, 40, 80, 0.35)); }
.logo span {
  font: 900 clamp(46px, 9.5vw, 118px)/0.95 "Arial Rounded MT Bold", "Baloo 2", "Segoe UI Black", "Arial Black", var(--font);
  letter-spacing: 0.01em; color: #fff; -webkit-text-stroke: clamp(7px, 1.3vw, 16px) var(--blue); paint-order: stroke fill;
  padding: 0.18em 0.1em 0.05em;
}
.logo-paw { position: absolute; left: 50%; top: -0.2em; width: clamp(34px, 6vw, 76px); height: clamp(34px, 6vw, 76px); transform: translate(-50%, -38%) rotate(-8deg); fill: #fff; stroke: var(--blue); stroke-width: 2.6px; paint-order: stroke; }
.logo.small span { font-size: clamp(40px, 8vw, 84px); }
/* two-line title logo ("ANABUL / TOWN"): also scale with window height */
.title-wrap .logo { margin-top: clamp(14px, 4vh, 44px); }
.title-wrap .logo span { font-size: clamp(38px, min(8.5vw, 9.5vh), 112px); line-height: 0.9; }
.subtitle { font: 800 clamp(16px, 2.3vw, 28px) var(--font); color: #fff; background: var(--blue); width: max-content; max-width: 100%; padding: 0.3em 1em; border-radius: 999px; transform: rotate(-2deg); box-shadow: 0 5px 0 var(--blue-d); margin-left: 0.6em; }
.tagline { font: italic 800 clamp(18px, 2.6vw, 34px)/1.15 var(--font); color: #fff; text-shadow: 0 2px 0 rgba(30, 60, 110, 0.55), 0 6px 18px rgba(20, 40, 80, 0.5); transform: rotate(-4deg); margin: clamp(6px, 2vh, 22px) 0 clamp(6px, 2vh, 18px) 0.8em; }
.menu { display: flex; flex-direction: column; gap: 12px; width: min(300px, 80vw); }
.menu.tight { width: 100%; }
.menu .btn { width: 100%; font-size: 1.1rem; padding: 13px 22px; }
.title-cat { font-weight: 800; color: #fff; text-shadow: 0 2px 6px rgba(20, 40, 80, 0.6); margin-top: 4px; font-size: 0.98rem; }
.foot { position: absolute; right: 18px; bottom: 12px; font-weight: 700; font-size: 0.82rem; color: #fff; text-shadow: 0 1px 4px rgba(20, 40, 80, 0.7); }

/* ----------------------------------------------------------------- loading */
#screen-loading { flex-direction: column; gap: 18px; background: linear-gradient(#8ecbf7, #cfeaff); }
.loadbar { width: min(340px, 70vw); height: 14px; border-radius: 99px; background: rgba(255, 255, 255, 0.6); overflow: hidden; box-shadow: inset 0 2px 4px rgba(30, 60, 110, 0.2); }
.loadbar i { display: block; height: 100%; width: 8%; background: linear-gradient(90deg, #f6c644, #f0913a); border-radius: 99px; transition: width 0.35s ease; }
#loadtext { margin: 0; font-weight: 800; color: var(--blue-d); }

/* -------------------------------------------------------------------- cats */
.cats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.cat {
  pointer-events: auto; cursor: pointer; border: 3px solid transparent; background: linear-gradient(#f3f8ff, #e2eefb);
  border-radius: 18px; padding: 8px 6px 10px; text-align: center; transition: transform 0.14s, border-color 0.14s, box-shadow 0.14s;
  font-family: var(--font); color: var(--ink); position: relative;
}
.cat:hover, .cat:focus-visible { transform: translateY(-4px); outline: none; box-shadow: 0 10px 18px rgba(30, 60, 110, 0.18); }
.cat.sel { border-color: var(--sky); background: linear-gradient(#ffffff, #d8ecff); box-shadow: 0 0 0 4px rgba(127, 189, 240, 0.35), 0 10px 18px rgba(30, 60, 110, 0.2); }
.cat.sel::after { content: ""; position: absolute; top: 8px; left: 8px; width: 22px; height: 22px; border-radius: 50%; background: var(--orange) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M9.500 17.200 4.300 12l-1.800 1.800 7 7L21.500 8.800 19.700 7z'/%3E%3C/svg%3E") center/70% no-repeat; }
.cat img, .cat .swatch { width: 100%; aspect-ratio: 300/340; object-fit: contain; display: block; pointer-events: none; }
.cat .swatch { border-radius: 50%; width: 70%; aspect-ratio: 1; margin: 18% auto; }
.cat b { display: block; font-size: 0.9rem; font-weight: 900; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat span { display: block; font-size: 0.76rem; font-weight: 700; color: var(--ink-soft); }
.collars { display: flex; align-items: center; gap: 14px; margin-top: 16px; font-weight: 800; color: var(--ink-soft); }
#collar-list { display: flex; gap: 10px; flex-wrap: wrap; }
.collar { pointer-events: auto; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; border: 3px solid transparent; background: #fff; border-radius: 99px; padding: 5px 14px 5px 6px; font: 800 0.88rem var(--font); color: var(--ink); box-shadow: 0 2px 0 #cdd9ea; }
.collar i { width: 22px; height: 22px; border-radius: 50%; display: block; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.15); }
.collar.sel { border-color: var(--sky); }
.collar.locked { opacity: 0.55; cursor: not-allowed; }

/* ---------------------------------------------------------------- settings */
.field { display: grid; grid-template-columns: 1fr 1.25fr 3.2em; align-items: center; gap: 12px; padding: 9px 0; font-weight: 800; pointer-events: auto; }
.field output { text-align: right; color: var(--blue); font-variant-numeric: tabular-nums; }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 10px; border-radius: 99px; background: var(--blue-l); outline: none; cursor: pointer; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; border-radius: 50%; background: var(--blue); border: 4px solid #fff; box-shadow: 0 2px 6px rgba(30, 60, 110, 0.4); }
input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--blue); border: 4px solid #fff; box-shadow: 0 2px 6px rgba(30, 60, 110, 0.4); }
.field.check { grid-template-columns: 1fr auto; cursor: pointer; }
.field.check input { position: absolute; opacity: 0; pointer-events: none; }
.field.check i { width: 52px; height: 30px; border-radius: 99px; background: #cfd9e8; position: relative; transition: background 0.15s; }
.field.check i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25); transition: transform 0.15s; }
.field.check input:checked + i { background: var(--green); }
.field.check input:checked + i::after { transform: translateX(22px); }
.field.check input:focus-visible + i { outline: 3px solid var(--sky); }

.field.seg { grid-template-columns: 1fr auto; }
.seg-btns { display: inline-flex; background: var(--blue-l); border-radius: 99px; padding: 3px; gap: 2px; }
.seg-btns button { pointer-events: auto; cursor: pointer; border: 0; background: transparent; font: 800 0.85rem var(--font); color: var(--blue-d); padding: 6px 12px; border-radius: 99px; }
.seg-btns button:hover { background: rgba(255, 255, 255, 0.6); }
.seg-btns button.sel { background: var(--blue); color: #fff; box-shadow: 0 2px 6px rgba(30, 60, 110, 0.3); }
.quality-note { margin: -2px 0 0; font-size: 0.8rem; min-height: 1em; }

/* -------------------------------------------------------------------- help */
.keys { display: grid; gap: 8px; margin-bottom: 14px; }
.keys > div { display: grid; grid-template-columns: 9.5em 5.5em 1fr; align-items: center; background: #fff; border-radius: 12px; padding: 7px 12px; }
.keys kbd { background: var(--blue-l); box-shadow: 0 2px 0 #b9cfee; }
.keys em { font-style: normal; font-weight: 700; color: var(--ink-soft); }

.pause-cat, .title-cat-img { text-align: center; }
.pause-cat img { height: 120px; display: block; margin: -6px auto 8px; }
.reward { display: flex; align-items: center; gap: 14px; background: #fff; border-radius: 16px; padding: 12px 16px; text-align: left; margin: 6px 0; }
.reward i { width: 44px; height: 44px; border-radius: 50%; border: 8px solid var(--yellow); background: transparent; flex: none; box-shadow: 0 3px 0 rgba(0, 0, 0, 0.12); }
.reward b { display: block; color: var(--blue-d); } .reward span { font-weight: 700; color: var(--ink-soft); }
.confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; border-radius: var(--radius); }
.confetti i { position: absolute; top: -12px; width: 9px; height: 14px; border-radius: 3px; animation: fall 2.6s linear infinite; }
@keyframes fall { to { transform: translateY(560px) rotate(540deg); } }
#celebrate .card { position: relative; }

/* --------------------------------------------------------------------- HUD */
#hud { position: absolute; inset: 0; font-weight: 800; color: #fff; }
#hud.off > *:not(#prompt):not(#bubble):not(#toasts) { opacity: 0; }
.hud-left { position: absolute; left: 16px; top: 16px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; transition: opacity 0.2s; }
#hud .panel { background: var(--glass); color: #fff; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); box-shadow: 0 6px 18px rgba(10, 24, 50, 0.22); border-radius: 18px; }
.needs { padding: 12px 16px; display: grid; gap: 9px; min-width: 216px; }
.need { display: grid; grid-template-columns: 22px 5.1em 1fr; align-items: center; gap: 9px; font-size: 0.92rem; }
.need .ico { width: 22px; height: 22px; }
.bar { height: 9px; border-radius: 99px; background: rgba(255, 255, 255, 0.24); overflow: hidden; }
.bar i { display: block; height: 100%; width: 50%; border-radius: 99px; background: var(--green); transition: width 0.35s ease, background 0.35s; }
.bar i.mid { background: var(--yellow); } .bar i.low { background: #f08a4a; }
.need.pulse .ico { animation: pulse 0.5s ease; }
@keyframes pulse { 40% { transform: scale(1.45); } }
.pill { padding: 7px 14px; display: flex; align-items: center; gap: 7px; font-size: 0.9rem; }
.pill b { font-size: 1.05rem; } .pill span { opacity: 0.85; font-weight: 700; }
.pill.bump { animation: pulse 0.45s ease; }
.objectives { padding: 11px 15px 12px; max-width: 290px; font-size: 0.86rem; }
.obj-title { display: flex; align-items: center; gap: 7px; color: #ffe2a8; margin-bottom: 7px; font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase; }
#obj-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
#obj-list li { display: grid; grid-template-columns: 18px 1fr; gap: 8px; align-items: start; opacity: 0.75; font-weight: 700; }
#obj-list li::before { content: ""; width: 14px; height: 14px; margin-top: 2px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.7); }
#obj-list li.cur { opacity: 1; font-weight: 800; }
#obj-list li.cur::before { border-color: var(--yellow); box-shadow: 0 0 0 3px rgba(246, 198, 68, 0.3); }
#obj-list li.done { opacity: 0.6; text-decoration: line-through; text-decoration-color: rgba(255, 255, 255, 0.5); }
#obj-list li.done::before { background: var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M9.500 17.200 4.300 12l-1.800 1.800 7 7L21.500 8.800 19.700 7z'/%3E%3C/svg%3E") center/85% no-repeat; border-color: var(--green); }

.hud-right { position: absolute; right: 16px; top: 14px; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; transition: opacity 0.2s; }
.clock { display: flex; align-items: center; gap: 9px; text-shadow: 0 2px 6px rgba(10, 24, 50, 0.55); }
.clock .ico { width: 36px; height: 36px; filter: drop-shadow(0 2px 4px rgba(10, 24, 50, 0.4)); }
.clock b { display: block; font-size: 1.45rem; line-height: 1; font-variant-numeric: tabular-nums; }
.clock span { font-size: 0.8rem; font-weight: 700; opacity: 0.95; }
.minimap { width: 126px; height: 126px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, 0.92); overflow: hidden; box-shadow: 0 6px 16px rgba(10, 24, 50, 0.3); background: #8ccf6a; }
.minimap canvas { width: 100%; height: 100%; display: block; }
.zone-chip { display: flex; align-items: center; gap: 6px; font-size: 0.85rem; background: var(--glass); padding: 5px 12px 5px 9px; border-radius: 99px; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }

#crosshair { position: absolute; left: 50%; top: 50%; width: 5px; height: 5px; margin: -2.5px; border-radius: 50%; background: rgba(255, 255, 255, 0.75); box-shadow: 0 0 0 1.5px rgba(20, 40, 80, 0.25); }
#prompt { position: absolute; left: 50%; bottom: 17%; transform: translateX(-50%); display: flex; align-items: center; gap: 9px; background: var(--glass); padding: 9px 18px 9px 10px; border-radius: 99px; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); font-size: 1.05rem; transition: opacity 0.15s, transform 0.15s; white-space: nowrap; }
#prompt kbd { font-size: 0.95rem; padding: 0.2em 0.6em; }
#prompt span { font-weight: 700; opacity: 0.8; font-size: 0.86rem; }
#prompt em { font-style: normal; display: flex; align-items: center; gap: 6px; margin-left: 8px; padding-left: 12px; border-left: 2px solid rgba(255, 255, 255, 0.3); }
#prompt em.hide { display: none; }
#prompt em kbd { background: #ffe2a8; }
#prompt.hide, #bubble.hide, #firsthint.hide { opacity: 0; transform: translateX(-50%) translateY(8px); pointer-events: none; }
#bubble { position: absolute; left: 50%; bottom: 25.5%; transform: translateX(-50%); max-width: min(560px, 86vw); background: #fff; color: var(--ink); padding: 12px 20px; border-radius: 22px; box-shadow: var(--shadow); font-weight: 700; line-height: 1.4; text-align: center; transition: opacity 0.2s, transform 0.2s; }
#bubble::after { content: ""; position: absolute; left: 50%; bottom: -9px; width: 20px; height: 20px; background: #fff; transform: translateX(-50%) rotate(45deg); border-radius: 4px; }
#bubble b { color: var(--blue); margin-right: 6px; }
#bubble b:empty { display: none; }
#toasts { position: absolute; left: 50%; top: 18px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; width: max-content; max-width: 92vw; }
.toast { display: flex; align-items: center; gap: 9px; background: var(--glass); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); padding: 9px 18px 9px 13px; border-radius: 99px; font-size: 0.98rem; animation: toastIn 0.3s cubic-bezier(.2,.9,.3,1.3) both; box-shadow: 0 6px 16px rgba(10, 24, 50, 0.22); }
.toast.out { animation: toastOut 0.35s ease forwards; }
.toast .ico { color: var(--yellow); width: 1.25em; height: 1.25em; }
.toast.zone { font-size: 1.15rem; padding: 10px 22px 10px 15px; } .toast.zone .ico { color: #fff; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-12px) scale(0.92); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-10px); } }

.hud-bl { position: absolute; left: 16px; bottom: 16px; display: flex; align-items: center; gap: 10px; transition: opacity 0.2s; }
.avatar { width: 46px; height: 46px; border-radius: 50%; background: #fff center 12%/190% no-repeat; border: 3px solid #fff; box-shadow: 0 4px 10px rgba(10, 24, 50, 0.3); }
.stamina { width: 96px; height: 8px; border-radius: 99px; background: rgba(255, 255, 255, 0.35); overflow: hidden; box-shadow: 0 2px 6px rgba(10, 24, 50, 0.25); }
.stamina i { display: block; height: 100%; width: 100%; background: #fff; border-radius: 99px; }
.stamina i.low { background: #f08a4a; }
.hud-br { position: absolute; right: 16px; bottom: 14px; display: flex; gap: 14px; transition: opacity 0.2s; text-shadow: 0 2px 6px rgba(10, 24, 50, 0.6); }
.hud-br div { display: flex; flex-direction: column; align-items: center; gap: 5px; font-size: 0.78rem; }
#firsthint { position: absolute; left: 50%; bottom: 5%; transform: translateX(-50%); background: var(--glass); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); padding: 12px 20px; border-radius: 18px; text-align: center; display: grid; gap: 6px; transition: opacity 0.4s, transform 0.4s; max-width: 92vw; }
#firsthint b { color: #ffe2a8; } #firsthint span { font-weight: 700; font-size: 0.9rem; line-height: 1.9; }

#capture { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(30, 52, 92, 0.22); pointer-events: none; }
.capture-card { padding: 20px 28px; text-align: center; display: grid; gap: 6px; justify-items: center; border: 3px solid #fff; }
.capture-card b { font-size: 1.25rem; color: var(--blue-d); } .capture-card span { font-weight: 700; color: var(--ink-soft); font-size: 0.92rem; }

/* sleep eyelids, box peek frame, fades */
.lid { position: absolute; left: 0; right: 0; height: 52%; background: #1a1422; transition: transform 1.1s cubic-bezier(.6,0,.4,1); z-index: 5; }
#lid-top { top: 0; transform: translateY(-101%); }
#lid-bottom { bottom: 0; transform: translateY(101%); }
#ui.asleep #lid-top, #ui.asleep #lid-bottom { transform: none; }
#ui.cozy #lid-top { transform: translateY(-80%); }
#ui.cozy #lid-bottom { transform: translateY(80%); }
#zzz { position: absolute; left: 50%; top: 44%; transform: translateX(-50%); font: 900 3rem var(--font); color: #cfe0ff; opacity: 0; transition: opacity 0.6s 0.6s; z-index: 6; letter-spacing: 0.1em; }
#ui.asleep #zzz { opacity: 1; animation: float 2.4s ease-in-out infinite; }
@keyframes float { 50% { transform: translateX(-50%) translateY(-12px); } }
#boxframe { position: absolute; inset: -2px; opacity: 0; transition: opacity 0.5s; z-index: 4;
  background:
    radial-gradient(ellipse 62% 58% at 50% 54%, rgba(0,0,0,0) 62%, rgba(46, 30, 14, 0.9) 100%),
    linear-gradient(#8a6a3c, #8a6a3c) top/100% 13% no-repeat,
    linear-gradient(#7a5c32, #7a5c32) bottom/100% 9% no-repeat,
    linear-gradient(#93713f, #93713f) left/9% 100% no-repeat,
    linear-gradient(#93713f, #93713f) right/9% 100% no-repeat; }
#ui.inbox #boxframe { opacity: 1; }
#fade { position: absolute; inset: 0; background: #fff8ea; opacity: 0; transition: opacity 0.45s; z-index: 30; }
#fade.on { opacity: 1; }

/* --------------------------------------------------------------- yowl-off */
#standoff { position: absolute; left: 50%; bottom: 12%; transform: translateX(-50%); width: min(460px, 90vw); background: rgba(40, 24, 34, 0.72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); border-radius: 20px; padding: 12px 18px 14px; box-shadow: 0 8px 22px rgba(10, 24, 50, 0.3); text-align: center; }
.so-title { font-size: 0.85rem; letter-spacing: 0.08em; text-transform: uppercase; color: #ffd0a0; }
.so-title b { color: #fff; }
.so-score { display: flex; justify-content: space-between; align-items: center; margin: 6px 0 8px; font-size: 1rem; }
.so-score b { font-size: 1.4rem; color: #ffe2a8; }
.so-round { font-size: 0.8rem; opacity: 0.8; }
.so-meters { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 9px; }
.so-meter { height: 9px; border-radius: 99px; background: rgba(255, 255, 255, 0.18); overflow: hidden; }
.so-meter i { display: block; height: 100%; width: 0; border-radius: 99px; transition: width 0.15s; }
.so-meter.you i { background: linear-gradient(90deg, #f6c644, #f0913a); }
.so-meter.them { transform: scaleX(-1); }
.so-meter.them i { background: linear-gradient(90deg, #b38dd9, #e8607a); }
.so-bar { position: relative; height: 22px; border-radius: 99px; background: rgba(255, 255, 255, 0.16); overflow: hidden; }
.so-zone { position: absolute; top: 0; bottom: 0; background: rgba(108, 192, 74, 0.75); }
.so-marker { position: absolute; top: -2px; bottom: -2px; width: 6px; margin-left: -3px; border-radius: 3px; background: #fff; box-shadow: 0 0 8px rgba(255, 255, 255, 0.9); }
.so-msg { margin-top: 8px; font-size: 0.95rem; min-height: 1.3em; }
#standoff[data-phase='result'] .so-msg { color: #ffe2a8; font-size: 1.1rem; }

/* -------------------------------------------------------------------- map */
.map-card { width: min(1000px, 100%); }
.map-wrap { border-radius: 16px; overflow: hidden; background: #8fcf68; box-shadow: inset 0 0 0 3px #fff; }
#bigmap { display: block; margin: 0 auto; width: auto; height: auto; max-width: 100%; max-height: 64vh; }
.map-wrap { display: flex; justify-content: center; background: #7fb85a; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 10px; font-weight: 700; font-size: 0.85rem; color: var(--ink-soft); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; box-shadow: 0 0 0 2px #fff; }
.dot { flex: none; }
.dot.d-you { background: #2b4f85; } .dot.d-cat { background: #4f9fe0; } .dot.d-human { background: #e8607a; }
.dot.d-sand { background: #e2c27a; } .dot.d-mark { background: #f0913a; } .dot.d-goal { background: #ffd23f; }

/* ------------------------------------------------------------------- touch */
#touch { position: absolute; inset: 0; z-index: 3; }
#stick { position: absolute; left: 26px; bottom: 84px; width: 124px; height: 124px; border-radius: 50%; background: rgba(255, 255, 255, 0.22); border: 2px solid rgba(255, 255, 255, 0.6); pointer-events: auto; touch-action: none; }
#stick-knob { position: absolute; left: 50%; top: 50%; width: 54px; height: 54px; margin: -27px; border-radius: 50%; background: rgba(255, 255, 255, 0.85); box-shadow: 0 4px 10px rgba(10, 24, 50, 0.3); }
.tbtns { position: absolute; right: 18px; bottom: 80px; display: grid; grid-template-columns: repeat(2, auto); gap: 12px; justify-items: end; align-items: end; }
.tbtn { pointer-events: auto; touch-action: none; border: 2px solid rgba(255, 255, 255, 0.7); background: rgba(26, 44, 74, 0.5); color: #fff; font: 800 0.9rem var(--font); width: 62px; height: 62px; border-radius: 50%; display: grid; place-items: center; }
.tbtn.big { width: 78px; height: 78px; font-size: 1.05rem; background: rgba(61, 111, 180, 0.7); }
.tbtn.on, .tbtn:active { background: rgba(240, 145, 58, 0.85); }
#t-pause { position: absolute; right: 18px; top: 212px; width: 46px; height: 46px; }
#t-map { position: absolute; right: 72px; top: 212px; width: 46px; height: 46px; }
.tbtns { grid-template-columns: repeat(3, auto); }
body.touch .hud-br, body.touch #crosshair { display: none; }
body.touch #prompt kbd { display: none; }
body.touch #prompt { padding-left: 18px; bottom: 37%; }
body.touch #bubble { bottom: 45%; }
body.touch #firsthint { display: none; }
body.touch .hud-bl { bottom: 12px; }

/* --------------------------------------------------------------- responsive */
@media (max-width: 900px) {
  .cats { grid-template-columns: repeat(3, 1fr); }
  .objectives { max-width: 230px; }
}
@media (max-width: 720px), (max-height: 560px) {
  #t-pause, #t-map { top: 204px; }
  .needs { min-width: 0; padding: 9px 12px; gap: 6px; }
  .need { grid-template-columns: 18px 4.6em 62px; font-size: 0.8rem; }
  .need .ico { width: 18px; height: 18px; }
  .minimap { width: 92px; height: 92px; }
  .clock b { font-size: 1.15rem; } .clock .ico { width: 28px; height: 28px; }
  .objectives { font-size: 0.78rem; padding: 8px 11px; max-width: 200px; }
  .hud-br { display: none; }
  .card { padding: 18px 18px 16px; } .card h2 { font-size: 1.25rem; margin-bottom: 10px; }
  .btn { padding: 10px 18px; min-width: 120px; font-size: 0.95rem; }
  .menu { gap: 9px; } .menu .btn { padding: 10px 18px; font-size: 1rem; }
  .field { grid-template-columns: 1fr 1fr 2.8em; padding: 6px 0; font-size: 0.9rem; }
  .keys > div { grid-template-columns: 7.5em 1fr; font-size: 0.85rem; padding: 5px 9px; }
  .foot { display: none; }
}
@media (max-width: 560px) {
  #stick { left: 14px; width: 112px; height: 112px; }
  .tbtns { right: 12px; gap: 9px; }
  .tbtn { width: 52px; height: 52px; font-size: 0.8rem; }
  .tbtn.big { width: 64px; height: 64px; font-size: 0.95rem; }
  #toasts { top: 262px; }
  .toast { font-size: 0.86rem; padding: 7px 14px 7px 10px; }
  .toast.zone { font-size: 0.98rem; }
  .objectives #obj-list li:not(.cur) { display: none; }
}
@media (max-height: 560px) {
  #t-pause { top: 160px; right: 120px; }
  #t-map { top: 160px; right: 174px; }
  .objectives #obj-list li:not(.cur) { display: none; }
  .tagline { display: none; }
  .cats { grid-template-columns: repeat(6, 1fr); gap: 8px; }
  .cat img { max-height: 24vh; }
  .cat span { display: none; }
  .collars { margin-top: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .screen.show, .card, .toast { animation: none; }
}

/* ================================================================ v0.4 menus */
.menu .btn.hidden, .continue-info.hidden { display: none; }
.continue-info { margin: -6px 0 2px 14px; font-weight: 800; font-size: 0.88rem; color: #fff; text-shadow: 0 1px 4px rgba(20, 40, 80, 0.7); }
.btn.small { min-width: 0; padding: 8px 16px; font-size: 0.9rem; }
.btn:disabled { opacity: 0.45; cursor: default; transform: none; }
#screen-title .menu .btn { backdrop-filter: blur(4px); }
.foot { opacity: 0.9; }

/* save slots */
.slots-card { width: min(760px, 100%); }
.slots { display: grid; gap: 12px; }
.slot { display: grid; grid-template-columns: 92px 1fr auto; align-items: center; gap: 16px; background: linear-gradient(#ffffff, #eef5ff); border-radius: 18px; padding: 10px 16px 10px 10px; border: 2px solid #fff; box-shadow: 0 4px 14px rgba(30, 60, 110, 0.12); }
.slot img { width: 92px; height: 104px; object-fit: contain; background: var(--blue-l); border-radius: 14px; }
.slot-empty-icon { width: 92px; height: 104px; display: grid; place-items: center; background: #e9eef6; border-radius: 14px; color: #b7c4d8; }
.slot-empty-icon .ico { width: 40px; height: 40px; }
.slot-body { display: grid; gap: 2px; font-weight: 700; color: var(--ink-soft); font-size: 0.9rem; }
.slot-body b { color: var(--blue); font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase; }
.slot-big { font-size: 1.12rem; font-weight: 900; color: var(--ink); }
.slot-meta { font-size: 0.8rem; opacity: 0.8; }
.slot.empty .slot-big { color: #9aa8bd; }
.slot-actions { display: grid; gap: 8px; }

/* tabbed settings */
.settings-card { width: min(720px, 100%); display: flex; flex-direction: column; max-height: min(92vh, 860px); }
.tabs { display: flex; gap: 6px; background: var(--blue-l); border-radius: 999px; padding: 4px; margin-bottom: 12px; flex-wrap: wrap; }
.tab { pointer-events: auto; cursor: pointer; flex: 1; border: 0; background: transparent; font: 800 0.92rem var(--font); color: var(--blue-d); padding: 9px 12px; border-radius: 999px; white-space: nowrap; }
.tab:hover { background: rgba(255, 255, 255, 0.6); }
.tab.sel { background: var(--blue); color: #fff; box-shadow: 0 3px 8px rgba(30, 60, 110, 0.3); }
.tab-panel { overflow: auto; padding: 2px 6px 4px 2px; min-height: 240px; flex: 1; }
.srow { display: grid; grid-template-columns: minmax(150px, 1fr) auto; align-items: center; gap: 14px; padding: 9px 4px; border-bottom: 1px solid rgba(44, 62, 90, 0.08); font-weight: 800; }
.srow.slider { grid-template-columns: minmax(150px, 1fr) minmax(140px, 1.2fr) 4em; }
.srow output { text-align: right; color: var(--blue); font-variant-numeric: tabular-nums; }
.srow.heading { display: block; border: 0; padding: 14px 4px 4px; }
.srow.heading h3 { margin: 0; font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--blue); }
.srow.note { display: block; font-size: 0.82rem; font-weight: 700; color: var(--ink-soft); border: 0; padding: 2px 4px 6px; }
.srow.button { display: flex; justify-content: flex-start; border: 0; }
.srow.choice .snote { grid-column: 1 / -1; font-style: normal; font-size: 0.8rem; color: var(--ink-soft); margin-top: -4px; }
.seg-btns.wide { flex-wrap: wrap; }
.switch { pointer-events: auto; cursor: pointer; border: 0; width: 54px; height: 30px; border-radius: 99px; background: #cfd9e8; position: relative; transition: background 0.15s; }
.switch i { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25); transition: transform 0.15s; }
.switch.on { background: var(--green); }
.switch.on i { transform: translateX(24px); }
.keybtn { pointer-events: auto; cursor: pointer; min-width: 92px; border: 2px solid #cfd9e8; background: #fff; border-radius: 10px; padding: 6px 12px; font: 900 0.95rem var(--font); color: var(--ink); box-shadow: 0 2px 0 #cfd9e8; }
.keybtn:hover { border-color: var(--sky); }
.keybtn.listening { border-color: var(--orange); color: var(--orange); animation: pulse 0.9s ease infinite; }
.srow.padmap { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 14px; border: 0; }
.srow.padmap div { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--ink-soft); font-size: 0.88rem; }
kbd.pad { border-radius: 999px; min-width: 2em; background: #2c3e5a; color: #fff; box-shadow: 0 2px 0 #10213a; }

/* credits */
.credits-card { width: min(560px, 100%); text-align: center; }
.credits h3 { margin: 18px 0 8px; font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--blue); }
.credits ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.credits li { background: #fff; border-radius: 12px; padding: 8px 12px; font-weight: 700; color: var(--ink-soft); }
.credits li b { color: var(--ink); margin-right: 6px; }
.credit-logo { font: 900 2.2rem var(--font); color: #fff; -webkit-text-stroke: 7px var(--blue); paint-order: stroke fill; letter-spacing: 0.02em; }
.credit-role { margin: 2px 0 0 !important; }
.pause-info { text-align: center; font-weight: 700; font-size: 0.85rem; color: var(--ink-soft); margin: -6px 0 10px; }

/* controller navigation focus ring */
body.padnav .btn:focus, body.padnav .tab:focus, body.padnav .switch:focus, body.padnav .keybtn:focus, body.padnav .seg-btns button:focus,
body.padnav .cat:focus, body.padnav .collar:focus, body.padnav input[type="range"]:focus {
  outline: 4px solid #f6c644; outline-offset: 3px;
}
body.padnav .cat:focus { transform: translateY(-4px); }
body.pad #capture { display: none; }

/* high-contrast HUD */
body.hc #hud .panel, body.hc .zone-chip, body.hc #prompt, body.hc .toast { background: rgba(8, 14, 28, 0.88); }
body.hc .bar { background: rgba(255, 255, 255, 0.4); }
body.hc .bar i { background: #3ee07a; } body.hc .bar i.mid { background: #ffd400; } body.hc .bar i.low { background: #ff5d3a; }
body.hc #bubble { background: #fff; color: #000; box-shadow: 0 0 0 3px #000; }
body.hc #hud { text-shadow: 0 1px 2px #000; }
