/* v3.2：機身、按鈕、螢幕框改成葡萄紫（下面註解裡寫的「紅色」現在都是紫色）。
   v3.0 試作：掌上機版面（你從三種版面裡選了 2）。
   第三版（你說「上部分都能保留，下面就不要用按鍵」）：保留機身＋螢幕框＋細狀態列＋提示泡泡；
   下面的餵食／睡覺／摸摸、照顧／訓練／對戰改回一般按鈕（深藍＋金主題），十字鍵拿掉；
   換衣間、好友、圖鑑、音效、說明這幾顆小按鈕放到機身右上角（標誌右邊）。只改飼育房（#nursery）的外觀，程式不動。 */
.nursery{position:relative;isolation:isolate;padding:46px 14px 16px;gap:8px;margin:4px 6px 12px;
  border:4px solid #0b0e26!important;border-image:none!important;border-radius:28px 28px 44px 28px;
  background:linear-gradient(160deg,#9a5ad6,#6a2fa8 60%,#4f1f86);box-shadow:inset 0 5px 0 rgba(255,255,255,.18),inset 0 -8px 0 rgba(0,0,0,.28),0 8px 0 #070a1c}
.nursery > *{position:relative}
.hh-logo{position:absolute!important;top:10px;left:22px;height:26px;width:auto;image-rendering:pixelated;filter:drop-shadow(0 2px 0 rgba(0,0,0,.35))}
/* 螢幕框（位置、高度由 handheld.js 量） */
.nursery::before{content:"";position:absolute;z-index:-1;left:8px;right:8px;top:var(--bezel-top,38px);height:var(--bezel-h,60%);border-radius:14px 14px 34px 14px;
  background:#11152f;border:3px solid #0b0e26;box-shadow:inset 0 0 0 3px #1d2350;pointer-events:none}
.nursery > .scene{border:3px solid #0b0e26!important;border-image:none!important;border-radius:4px;margin-inline:4px}
.nursery > .speech{margin-inline:4px}
/* ---- 螢幕上方：一條細狀態列（名字・階段・種類｜愛心、飽足、體力） ---- */
.nursery > .hud{position:static;display:grid;grid-template-columns:minmax(0,1fr);align-items:center;gap:2px 8px;margin:0 4px;padding:5px 8px;
  background:#e9e2c8;color:#1b1430;border:3px solid #0b0e26;border-radius:4px}
.nursery .hud-row{display:contents}
.nursery .face-button{display:none}   /* v3.8 起又顯示（最下面）：點頭像看名片 */
/* 機身右上角的小按鈕：換衣間、好友、圖鑑、音效、說明（測試模式還有選蛋） */
.nursery .hud-mini{position:absolute!important;top:7px;right:16px;display:flex!important;flex-wrap:nowrap;gap:3px}
.nursery .hud-mini > .mini-button{width:36px!important;min-width:0!important;height:32px;min-height:0!important;padding:0;display:grid;place-items:center}
.nursery .hud-mini > .mini-button::before{transform:scale(.85)}
.nursery .hud-mini #back{width:auto;padding:0 6px;font-size:.66rem}
.nursery .hud-mini #open-friends[data-new]::after,.nursery .hud-mini #open-closet[data-new]::after{top:-6px;right:-6px}
.nursery .hud-identity{grid-column:1;flex-wrap:nowrap;gap:4px;min-width:0}
.nursery .hud-identity h2{font-size:.95rem;color:#1b1430!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.nursery .hud-identity #stage{margin:0;font-size:.72rem;color:#4b3f7a!important;white-space:nowrap}
.nursery .rename-button{border:0!important;border-image:none!important;background:none!important;padding:0 2px}
.nursery .hud .species{position:static;flex:0 0 auto;flex-basis:auto;margin:0 0 0 auto;font-size:.66rem;color:#5a4f86!important;text-align:right;white-space:nowrap}
.nursery .hud-identity h2{flex:0 1 auto;min-width:0}
.nursery .hud-status{grid-column:1;flex-direction:row;flex-wrap:nowrap;align-items:center;justify-content:space-between;gap:6px;min-height:0;padding-top:2px;border-top:2px dotted rgba(27,20,48,.25)}
.nursery .hud-status > *{white-space:nowrap;display:flex;flex-wrap:nowrap}
.nursery .hud-status > [hidden]{display:none}
/* ---- 提示（可以進化了、成長方向、通知）：變成房間上方的對話泡泡 ---- */
.nursery .hud :is(.hud-announce,.evo-hint,.lean){position:absolute;z-index:5;left:50%;translate:-50% 0;top:calc(var(--scene-top,120px) + 10px);max-width:84%;
  width:max-content;margin:0;padding:5px 10px;font-size:.76rem;line-height:1.3;color:#1b1430!important;background:#fff8e6;border:3px solid #1b1430;border-radius:10px;
  box-shadow:0 3px 0 rgba(0,0,0,.25);pointer-events:none}
.nursery .hud .lean{top:calc(var(--scene-top,120px) + 46px)}
.nursery .hud .hud-announce{top:calc(var(--scene-top,120px) + 82px)}
.nursery .hud .evo-hint{background:#ffe9a8}
/* 對戰分頁沒有房間場景：進化提示、成長方向不顯示 */
.nursery[data-tab="battle"] .hud :is(.evo-hint,.lean){display:none}
/* v4.0：通知泡泡（沒體力、不想戰鬥、伺服器拒絕）在對戰分頁要看得到：浮在對手列表上方，幾秒後自動收起 */
.nursery[data-tab="battle"] .hud .hud-announce{top:calc(var(--scene-top,120px) + 6px);max-width:90%;z-index:8}
.nursery[data-tab="battle"] .hud .hud-announce[hidden]{display:none}
/* 比較矮的手機：機身上方窄一點 */
@media (max-height:720px){
  .nursery{padding-top:40px;margin-bottom:8px}
  .hh-logo{height:22px;top:9px}
  .nursery .hud-mini{top:5px}
  .nursery .hud-mini > .mini-button{width:32px!important;height:28px}
}
/* 照顧分頁的三顆按鈕固定排成一排（小手機不要換行擠掉房間） */
.nursery .sheet[data-sheet="care"] .actions{flex-wrap:nowrap;gap:6px;margin-top:4px}
.nursery .sheet[data-sheet="care"] .actions > :is(#feed,#sleep,#pet){flex:1 1 0;min-width:0;padding-inline:4px;white-space:nowrap}
/* 窄手機：標誌和右上角小按鈕小一點 */
@media (max-width:380px){
  .hh-logo{height:20px;left:18px}
  .nursery .hud-mini{right:12px;gap:2px}
  .nursery .hud-mini > .mini-button{width:30px!important;height:28px}
}

/* ===== 火焰紅＋可愛按鈕（你選了 3 火焰紅，按鈕要可愛一點）=====
   飼育房裡的按鈕不用像素九宮格圖，改成圓圓的糖果按鈕：粗深色外框、上半部有白色亮光、底下有立體厚度，按下去會往下壓。
   一般按鈕是紅色糖果（白字），重點按鈕（餵食、孵化、開始訓練、挑戰練習戰）和選中的分頁是金黃色糖果（深咖啡字）。 */
.nursery :is(.back,.tab,.confirm,.mini-button){border:3px solid #2c0f4a!important;border-image:none!important;border-radius:16px!important;
  background:linear-gradient(#d9a8ff,#a45ee8 55%,#8240c8)!important;color:#fff!important;text-shadow:0 1px 0 #4a1f7a;font-weight:700;
  box-shadow:inset 0 3px 0 rgba(255,255,255,.55),inset 0 -4px 0 rgba(40,10,90,.25),0 4px 0 #2c0f4a;transition:translate .06s,box-shadow .06s}
.nursery :is(.confirm,.tab[aria-pressed="true"]){background:linear-gradient(#fff1a8,#ffcf4a 55%,#f2a72a)!important;color:#5a2b00!important;text-shadow:0 1px 0 rgba(255,255,255,.6)}
.nursery :is(.back,.tab,.confirm,.mini-button):active:not(:disabled){translate:0 3px;box-shadow:inset 0 3px 0 rgba(255,255,255,.55),inset 0 -2px 0 rgba(40,10,90,.25),0 1px 0 #2c0f4a}
.nursery :is(.back,.tab,.confirm,.mini-button)[aria-disabled="true"],.nursery :is(.back,.tab,.confirm,.mini-button):disabled{filter:saturate(.4) brightness(.9);opacity:.75}
/* 分頁：選中的不再往上跳，改成金色糖果 */
.nursery > .tabs .tab{translate:none;padding:4px 0}
/* 右上角小按鈕：圓形糖果 */
.nursery .hud-mini > .mini-button{border-radius:50%!important;border-width:2px!important;box-shadow:inset 0 2px 0 rgba(255,255,255,.55),0 2px 0 #2c0f4a}
.nursery .hud-mini #back{border-radius:12px!important}
/* 主要按鈕的圖示白底小圓，比較可愛 */
.nursery :is(#feed,#sleep,#pet,#train,#enter-battle)::before{filter:drop-shadow(0 1px 0 rgba(0,0,0,.3))}
/* 螢幕框、對話框跟著機身換成深酒紅 */
.nursery::before{background:#1c0d2e;box-shadow:inset 0 0 0 3px #3a1a5c}
/* 對話框、訓練面板、對手格子：跟著機身換成深酒紅＋金邊（圓角，比較可愛） */
.nursery :is(.speech,.training){border:3px solid #d9b65a!important;border-image:none!important;border-radius:12px!important;background:#2a1442!important;color:#f4eeff}
.nursery .rival-pick{border:3px solid #5a3290!important;border-image:none!important;border-radius:12px!important;background:#2a1442!important;box-shadow:0 3px 0 #12071f}
.nursery .rival-pick[aria-pressed="true"]{border-color:#ffcf4a!important;background:#43206b!important;box-shadow:0 0 0 2px #ffcf4a,0 3px 0 #12071f}
.nursery .rival-pick:disabled{background:#1c0d2e!important}
/* ===== 對齊（你說「要對齊好」）=====
   兩條線：
   1. 螢幕框外緣：標誌左邊、右上角小按鈕右邊、下面兩排按鈕的左右邊，都對齊螢幕框的外緣。
   2. 螢幕裡面：細狀態列、房間、對話框（對戰分頁是選對手清單）左右都對齊同一條線（螢幕框往內 10px）。 */
.nursery{padding-left:8px!important;padding-right:8px!important}
.nursery::before{left:8px!important;right:8px!important}
.hh-logo{left:8px!important}
.nursery .hud-mini{right:8px!important}
.nursery > .hud,.nursery > .scene,.nursery > .speech,.nursery[data-tab="battle"] > .panel{margin-left:10px!important;margin-right:10px!important}
.nursery .sheet[data-sheet="care"] .actions{margin:2px 0 0!important;gap:8px!important}
.nursery > .tabs{padding:0!important;gap:8px!important}
.nursery .sheet[data-sheet="train"]{width:100%}
.nursery .sheet[data-sheet="train"] .training{box-sizing:border-box;width:100%!important;max-width:none!important;margin-left:0!important;margin-right:0!important}
/* 螢幕框下緣和下面的按鈕之間留空，按鈕不要壓到框（照顧、訓練分頁；對戰分頁的清單本來就在框裡） */
.nursery:not([data-tab="battle"]) > .panel{margin-top:14px}
/* 下面兩排按鈕也不要壓到機身外框：左右往內縮，跟螢幕裡的對話框對齊同一條線；機身下方多留一點空，右下角圓角改小一點，按鈕不會卡進圓角 */
.nursery > .panel,.nursery > .tabs{margin-left:10px!important;margin-right:10px!important}
.nursery{padding-bottom:24px!important;border-radius:28px!important}
/* v3.8：狀態列左邊放自己的頭像（點了看訓練師名片），名字、狀態排在右邊 */
.nursery > .hud{grid-template-columns:auto minmax(0,1fr)!important;column-gap:8px}
/* v4.0：頭像做成一張小名片：上面是頭像、下面一條「名片」字條，整個收在狀態列的框裡，不再凸出去 */
.nursery .face-button{display:flex;flex-direction:column;align-items:stretch;grid-column:1;grid-row:1 / span 2;align-self:center;
  width:46px;height:58px;min-width:0!important;min-height:0!important;padding:0!important;box-sizing:border-box;
  border:2px solid #1b1430!important;border-radius:8px!important;background:#fff8e6!important;overflow:hidden;position:relative;
  box-shadow:0 2px 0 rgba(27,20,48,.35)}
.nursery #open-wardrobe #hud-face{display:block;width:42px;height:42px;flex:0 0 42px;border:0;border-radius:0;margin:0;image-rendering:pixelated;background:#fff8e6}
.nursery #open-wardrobe .face-tag{display:block;position:static;translate:none;flex:1 1 auto;margin:0;padding:0;border:0;border-top:2px solid #1b1430;border-radius:0;
  background:#ffcf4a;color:#5a2b00;font-size:.56rem;font-weight:700;line-height:12px;text-align:center;letter-spacing:1px;white-space:nowrap}
.nursery #open-wardrobe:active{translate:0 1px;box-shadow:0 1px 0 rgba(27,20,48,.35)}
.nursery .hud-identity,.nursery .hud-status{grid-column:2!important}
/* v4.6：體力變 6 格，狀態列放不下：雞腿、閃電縮成 12px（原圖 3/4，像素還是整齊），愛心之間的空隙縮小 */
.nursery .hud-status{gap:4px}
.nursery .hud-status .bond-hearts{gap:2px}
.nursery .hud-status .hunger-pip{width:12px;height:12px;background-size:57px 12px;background-position:-45px 0}
.nursery .hud-status .hunger-pip[data-filled="true"]{background-position:0 0}
.nursery .hud-status .stamina-pip{width:12px;height:12px;background-size:57px 12px}
