/* Sổ của Mầm dùng chung màu mực và giấy của giao diện đảo. */
#ob-root button { min-width: 45px; min-height: 45px; }
#ob-backdrop { grid-template-columns: minmax(0, 1fr); }
#ob-modal, #ob-modal-body, .ob-acc-hero-info { min-width: 0; }
#ob-modal { max-width: 100%; }
#ob-pane-account :is(.ob-lead, .ob-acc-hero-info, .ob-msg) { overflow-wrap: anywhere; }
#ob-root :focus-visible { outline: 3px solid #176864; outline-offset: 2px; }
body:has(#modal-backdrop.is-open, dialog[open]) :is(#ob-guide-layer, #ob-hud, #ob-link-invite, #gd-celebration),
body:has(#ui.is-peek) :is(#ob-guide-layer, #ob-hud, #ob-link-invite),
#ob-root:has(#ob-backdrop.is-open) :is(#ob-hud, #ob-link-invite),
#ob-root:has(#ob-splash:not(.ob-hidden)) #ob-link-invite { display: none; }
#ob-guide-layer { inset: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); }
#ob-guide-bubble {
  width: min(326px, 100%); max-height: 100%; overflow-y: auto; overscroll-behavior: contain;
  padding: 10px 12px; gap: 6px; border: 1px solid #ba9357; border-radius: 17px; border-image: none;
  background: #fff6de; box-shadow: inset 0 0 0 3px #f5e4b8, 0 4px 12px #402b1642;
  filter: none; transition: none; animation: none;
}
.gd-message { display: grid; grid-template-columns: 48px minmax(0, 1fr); align-items: center; gap: 9px; }
.gd-face {
  position: relative; width: 48px; aspect-ratio: 1; overflow: hidden; isolation: isolate;
  border: 2px solid #bba364; border-radius: 50%; background: radial-gradient(circle at 60% 26%, #fff4c8, #94c9a2);
}
.gd-face:has(img[hidden])::before { content: '🐻'; position: absolute; inset: 0; display: grid; place-items: center; font-size: 28px; z-index: -1; }
.gd-face img { display: block; width: 100%; height: 100%; object-fit: cover; }
.gd-face img[hidden] { display: none; }
.gd-speaker, .gd-ch-progress, .gd-preview small { color: #236657; font-size: 12px; font-weight: 800; }
#ob-guide-title { line-height: 1.2; margin: 2px 0; color: #422c16; }
#ob-guide-text { line-height: 1.32; color: #57432b; }
.gd-dots { display: inline-flex; gap: 4px; }
.gd-dots i { background: #d3c099; border-radius: 50%; width: 6px; height: 6px; }
.gd-dots .gd-filled { background: #377564; }
#ob-guide-spot { z-index: 1; transition: none; border-radius: 12px; }
#ob-guide-spot::after { content: '▼'; position: absolute; top: -23px; left: calc(50% - 8px); color: #ffe570; font: bold 20px/1 system-ui; text-shadow: 0 1px 3px #45331b; }
#ob-guide-spot.gd-below::after { content: '▲'; top: auto; bottom: -21px; }
#ob-guide-spot.gd-noarrow::after { content: none; }
#ui .gd-panel-target { position: relative; outline: 3px solid #f2b738; outline-offset: 2px; }
#ui .gd-panel-target::before { content: '▸'; position: absolute; right: calc(100% + 5px); color: #8a5b13; pointer-events: none; }
#ob-guide-bubble .ob-guide-foot { margin-top: 0; gap: 6px 8px; }
#ob-guide-bubble .ob-btn { padding-inline: 10px; }
#ob-guide-bubble .ob-inline-confirm { flex-wrap: wrap; }
.gd-do-it {
  margin: 0; flex: 1 1 0; min-width: 0;   /* chung hàng với nút Bỏ qua để bong bóng không cao thêm, che mất pet */
  display: flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: 11px;
  border: 1px dashed #b89152; background: #f8e9be; color: #1f5c4f;
  font-size: clamp(11.5px, calc(1.25vw / var(--ui-zoom, 1)), 13px);
  font-weight: 800; line-height: 1.25;
  white-space: normal; text-wrap: balance;
  pointer-events: none; cursor: default;
}
.gd-do-it .gd-hand { flex: none; font-size: 1.08em; line-height: 1; }
.gd-do-it .gd-do-it-txt { min-width: 0; }
#ob-ng-text { white-space: normal; overflow-wrap: anywhere; -webkit-line-clamp: 2; }
.gd-go { margin-inline-start: auto; flex: none; color: #235f53; font-size: 13px; }
.gd-preview { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 10px; border-style: dashed; }
.gd-preview .ob-chapter-art { filter: saturate(.33); opacity: .65; }
.gd-preview h3, .gd-preview p { margin: 3px 0; }
#ob-pane-event button { margin: 4px; }
#gd-celebration {
  position: fixed; z-index: 82; pointer-events: none; left: 50%; top: max(15%, env(safe-area-inset-top));
  transform: translateX(-50%); width: max-content; max-width: min(88%, 400px); border: 2px solid #dfbe74;
  border-radius: 15px; background: #184f48; color: #fff5d8; box-shadow: 0 6px 22px #2b281d42;
  display: flex; align-items: center; gap: 12px; padding: 12px 18px; animation: gd-arrive .3s ease-out;
}
#gd-celebration > span { color: #ffd86a; font-size: 30px; }
#gd-celebration .ob-chapter-art { width: clamp(76px, calc(20vw / var(--ui-zoom, 1)), 138px); }
#gd-celebration strong, #gd-celebration small { display: block; }
#gd-celebration strong { font-size: clamp(17px, calc(2vw / var(--ui-zoom, 1)), 24px); }
@keyframes gd-arrive { from { opacity: 0; transform: translate(-50%, -10px); } to { opacity: 1; transform: translate(-50%, 0); } }
@media (max-width: 480px) {
  #ob-next-goal { max-width: min(265px, 100%); gap: 5px; }
  #ob-hud .ob-hud-row { gap: 3px; }
  #ob-guide-bubble { width: min(292px, 100%); }
  .gd-do-it { font-size: 11.5px; padding: 5px 8px; gap: 5px; }
}
@media (max-height: 460px) {
  #ob-guide-bubble { width: min(270px, 100%); padding: 6px 9px; gap: 3px; }
  .gd-message { grid-template-columns: 38px minmax(0,1fr); gap: 6px; }
  .gd-face { width: 38px; }
  .gd-do-it { font-size: 11px; padding: 4px 7px; gap: 4px; }
  #gd-celebration { top: max(6px, env(safe-area-inset-top)); padding: 6px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  #gd-celebration, #ob-guide-spot .ob-spot-ring { animation: none; }
}

/* Khi bong bóng hướng dẫn đang hiện, thẻ "Mục tiêu kế tiếp" của cùng bước đó nhắc lại đúng việc ấy: ẩn đi để bớt một lớp che đảo. */
body:has(#ob-guide-layer:not(.ob-hidden)) #ob-next-goal[data-kind="guide"] { display: none; }
/* Nút cạnh ô nhập tên ("Gợi ý") không xuống dòng. */
.ob-input-row .ob-btn { white-space: nowrap; flex-shrink: 0; }
/* Đang ở các bước hướng dẫn thì chưa báo trứng lạ: người mới chỉ nên thấy một việc tại một lúc. */
body:has(#ob-guide-layer:not(.ob-hidden)) #wild-egg-banner { display: none; }
