/* rabbit-game v0.1 — layout + HUD. Vanilla CSS only (AGENTS.md rule 1).
   Colors are PROVISIONAL; real palette arrives via brand-lock → art/style-lock.yaml in v0.2. */
:root {
  --bg: #fdf2f6;            /* provisional kawaii cream-pink */
  --floor: #f7e3ec;         /* provisional deeper floor tone */
  --ink: #4a3b41;           /* provisional soft dark for icon strokes */
  --chip: rgba(255, 255, 255, 0.72);
  --aria: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  overscroll-behavior: none;
  /* iOS/WKWebView polish (2026-10-24): no long-press callouts or selection,
     no semi-transparent tap flash on the fixed HUD controls */
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
#stage { height: 100%; height: 100dvh; /* dvh needs iOS 16.4+; older drops to 100% */ }
#scene {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none; /* pet/feed gestures own this surface */
  cursor: grab;
}

/* --- HUD: edges only; center third stays open --- */
.wordmark {
  position: fixed;
  top: calc(10px + var(--aria));
  left: 14px;
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: rgba(90, 70, 80, 0.55);
  user-select: none;
}

.hud, .dock { position: fixed; z-index: 2; }
.hud-top-right { top: calc(8px + var(--aria)); right: 10px; display: flex; gap: 8px; align-items: center; }

button {
  font: inherit;
  border: 0;
  background: none;
  color: var(--ink);
  cursor: pointer;
}
button:focus-visible {
  outline: 2px solid rgba(240, 130, 160, 0.9);
  outline-offset: 2px;
  border-radius: 12px;
}

/* corner control chips (mute + menu): 44px touch targets (mobile pass 2026-10-24) */
#mute,
#menu-btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: var(--chip);
  backdrop-filter: blur(6px);
  box-shadow: 0 1px 4px rgba(90, 70, 80, 0.12);
}
#menu-btn[aria-expanded="true"] {
  background: rgba(240, 130, 160, 0.22);
}
#mute .icon-sound-off { display: none; }
#mute.is-muted .icon-sound-on { display: none; }
#mute.is-muted .icon-sound-off { display: block; }
.hud .icon { width: 22px; height: 22px; color: var(--ink); }

.dock {
  bottom: calc(12px + var(--safe-bottom));
  right: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
#basket {
  width: 84px;
  height: 66px;
  border-radius: 18px;
  background: var(--chip);
  backdrop-filter: blur(6px);
  box-shadow: 0 2px 8px rgba(90, 70, 80, 0.16);
  display: grid;
  place-items: center;
  transition: transform 0.12s ease; /* reduced-motion users: transform off via media rule */
  touch-action: none;
  user-select: none;
  cursor: grab;
}
#basket:active,
#basket.grabbing { cursor: grabbing; }
#basket.grabbing { transform: scale(0.95); }
#basket .carrot { transition: opacity 0.14s ease; }
#basket.grabbing .c-mid { opacity: 0; } /* the carrot being carried leaves the basket */
#basket svg { width: 70px; height: 61px; pointer-events: none; }

/* floating carrot that follows the pointer during a drag-feed (created by scripts/input.js) */
#drag-ghost {
  position: fixed;
  top: 0;
  left: 0;
  width: 46px;
  height: 38px;
  z-index: 30;
  pointer-events: none;
  filter: drop-shadow(0 3px 4px rgba(90, 70, 80, 0.3));
  will-change: transform;
}
#drag-ghost svg { display: block; width: 100%; height: 100%; }
/* drag-feed ghost: easing + focus states + fed pop (feel pass, ADOPT-20261023) */
#drag-ghost.snapping { transition: transform 0.2s ease-out, opacity 0.2s ease-out; opacity: 0; }
/* returning carrot arrives with a tiny overshoot bounce (IDEA-009 — CSS easeOutBack) */
#drag-ghost.returning { transition: transform 0.24s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.24s ease-out; opacity: 0; }

button:focus-visible {
  outline: 3px solid rgba(240, 130, 160, 0.85);
  outline-offset: 2px;
}

.fed-count.pop { animation: fed-pop 0.32s ease-out; }
@keyframes fed-pop {
  0% { transform: translateY(2px) scale(0.9); }
  45% { transform: translateY(-3px) scale(1.22); }
  100% { transform: none; }
}

.fed-count {
  font-size: 11px;
  font-weight: 500;
  color: rgba(90, 70, 80, 0.6);
  user-select: none;
}

.noscript-note {
  position: fixed;
  inset: auto 12px 12px 12px;
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--chip);
  color: var(--ink);
  font-size: 13px;
}

/* --- Settings menu (v0.2): soft centered card; ESC or backdrop click closes --- */
.menu {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(90, 70, 80, 0.18);
  backdrop-filter: blur(4px);
}
.menu[hidden] { display: none; }
.menu-card {
  width: min(340px, 92vw);
  padding: 18px 20px 16px;
  border-radius: 20px;
  background: var(--chip);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 40px rgba(90, 70, 80, 0.25);
}
.menu-card h2 {
  margin: 0 0 2px;
  font-size: 15px;
  font-weight: 700;
}
.menu-hint {
  margin: 0 0 12px;
  font-size: 11px;
  color: rgba(90, 70, 80, 0.55);
}
.menu-row { border: 0; padding: 0; margin: 0; }
.menu-row legend {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(90, 70, 80, 0.6);
  padding: 0;
  margin-bottom: 8px;
}
.setting-opts { display: flex; gap: 8px; }
.setting-opt {
  flex: 1;
  padding: 10px 8px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.85);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  box-shadow: inset 0 0 0 1.5px rgba(90, 70, 80, 0.14);
  transition: box-shadow 0.12s ease, transform 0.12s ease;
}
.setting-opt small { display: block; font-weight: 400; font-size: 10.5px; color: rgba(90, 70, 80, 0.55); }
.setting-opt[aria-pressed="true"] {
  box-shadow: inset 0 0 0 2px rgba(240, 130, 160, 0.9);
  background: #fff;
}
.setting-opt:active { transform: scale(0.97); }

/* --- speech bubbles (IDEA-002, 2026-10-24): Casey's noises made visible; the mute channel --- */
#bubbles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  overflow: hidden;
}
.bubble {
  position: absolute;
  padding: 4px 10px;
  border-radius: 12px;
  background: var(--chip);
  box-shadow: 0 2px 8px rgba(90, 70, 80, 0.16);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  animation: bubble-float 1.4s ease-out forwards;
}
@keyframes bubble-float {
  0%   { opacity: 0; transform: translate(-50%, 6px) scale(0.8); }
  12%  { opacity: 1; transform: translate(-50%, 0) scale(1); }
  70%  { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -34px) scale(1); }
}
@keyframes bubble-fade {
  0%   { opacity: 0; }
  12%  { opacity: 1; }
  70%  { opacity: 1; }
  100% { opacity: 0; }
}

/* --- clock & calendar (UC-7, 2026-10-24): desk accessories, off by default --- */
#clock-chip {
  position: fixed;
  top: calc(34px + var(--aria));
  left: 14px;
  display: grid;
  gap: 1px;
  padding: 6px 12px 7px;
  border-radius: 14px;
  background: var(--chip);
  backdrop-filter: blur(6px);
  box-shadow: 0 1px 4px rgba(90, 70, 80, 0.12);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.15;
  text-align: left;
}
#clock-chip[hidden] { display: none; }
#clock-time { font-size: 15px; }
#clock-date { font-size: 10.5px; opacity: 0.65; font-weight: 500; }

.calendar {
  position: fixed;
  top: calc(92px + var(--aria));
  left: 14px;
  z-index: 4;
  width: 252px;
  padding: 14px;
  border-radius: 18px;
  background: var(--chip);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 40px rgba(90, 70, 80, 0.25);
}
.calendar[hidden] { display: none; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-title { font-size: 13px; font-weight: 700; }
.cal-head button {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.8);
  font-size: 15px;
  line-height: 1;
}
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-dow { font-size: 9.5px; text-align: center; opacity: 0.55; font-weight: 600; padding: 2px 0; }
.cal-day { text-align: center; font-size: 12px; padding: 5px 0; border-radius: 9px; }
.cal-day.today { background: rgba(240, 130, 160, 0.3); font-weight: 700; }
.cal-day.blank { visibility: hidden; }

/* extras toggle in the settings card (not a .setting-opt: menu.js binds those to the environment picker) */
.extra-opt {
  flex: 1;
  padding: 10px 8px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.85);
}

@media (prefers-reduced-motion: reduce) {
  #basket { transition: none; }
  #basket .carrot { transition: none; }
  #drag-ghost.snapping,
  #drag-ghost.returning { transition: none; }
  .setting-opt { transition: none; }
  .fed-count.pop { animation: none; }
  .bubble { animation: bubble-fade 1.4s ease-out forwards; } /* IDEA-002: content still shows, no float */
}
