/* Nhà Hàng 57 – giao diện (mobile-first). Màn chơi chiếm toàn màn hình, các thanh công cụ nhỏ gọn để không che nhà hàng. */
.nh-page { font-family: 'Be Vietnam Pro', system-ui, sans-serif; }

/* ---------- trang chính ---------- */
.nh-home { max-width: 760px; padding-bottom: 40px; }
.nh-hero { display: flex; gap: 16px; align-items: center; margin: 10px 0 18px; }
.nh-hero h1 { margin: 0 0 4px; font-size: 1.9rem; font-weight: 900; color: #7c2d12; }
.nh-hero p { margin: 0; color: #6b4a33; }
.nh-hero-img { flex: none; width: 132px; height: auto; filter: drop-shadow(0 6px 10px rgba(124,45,18,.18)); }
.nh-card { background: #fffaf3; border: 2px solid #f3e1c8; border-radius: 20px; padding: 18px; margin-bottom: 16px; box-shadow: 0 6px 18px rgba(124,45,18,.07); }
.nh-card h2 { margin: 0 0 6px; font-size: 1.2rem; font-weight: 900; color: #7c2d12; }
.nh-muted { color: #8a6a52; margin: 0 0 12px; }
.nh-create label { display: block; font-weight: 800; margin: 6px 0; color: #5b3a1c; }
.nh-create input { width: 100%; box-sizing: border-box; padding: 12px 14px; border: 2px solid #f0d9b9; border-radius: 14px; font: inherit; font-size: 1rem; margin-bottom: 12px; background: #fff; }
.nh-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.nh-list a { display: flex; flex-direction: column; padding: 10px 14px; border-radius: 14px; background: #fff; border: 2px solid #f6e7d3; text-decoration: none; color: #3b2a1a; }
.nh-list a:hover { border-color: #f0a35c; }
.nh-list b { font-weight: 800; }
.nh-list span { font-size: .85rem; color: #8a6a52; }
@media (max-width: 520px) { .nh-hero-img { width: 92px; } .nh-hero h1 { font-size: 1.5rem; } }

/* ---------- màn chơi ---------- */
.nh-play { overflow: hidden; overscroll-behavior: none; }
.nh-play .langbar, .nh-play .app-footer, .nh-play .backdrop-art { display: none !important; }
.nh-app { position: fixed; inset: 0; background: #d9f0ff; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
#nhCv { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; display: block; cursor: grab; }
.nh-building #nhCv { cursor: crosshair; }

.nh-hud { position: absolute; top: 0; left: 0; right: 0; z-index: 5; display: flex; align-items: center; gap: 8px; padding: calc(8px + env(safe-area-inset-top)) 10px 8px; pointer-events: none; flex-wrap: wrap; }
.nh-hud > * { pointer-events: auto; }
.nh-title { display: flex; flex-direction: column; min-width: 0; background: rgba(255,250,243,.92); border-radius: 14px; padding: 5px 12px; box-shadow: 0 3px 10px rgba(80,40,10,.12); max-width: 46vw; }
.nh-title b { font-weight: 900; color: #7c2d12; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 1rem; }
.nh-title small { color: #8a6a52; font-size: .72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nh-stats { display: flex; gap: 6px; margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
.nh-stat { display: inline-flex; align-items: center; gap: 4px; padding: 5px 10px 5px 7px; background: rgba(255,250,243,.94); border-radius: 999px; font-weight: 900; color: #5b3a1c; box-shadow: 0 3px 10px rgba(80,40,10,.12); font-size: .9rem; position: relative; }
.nh-stat i { font-style: normal; }
.nh-stat.is-bump { animation: nhBump .35s ease-out; }
@keyframes nhBump { 40% { transform: scale(1.15); } }
.nh-lv { padding-bottom: 8px; }
.nh-xp { position: absolute; left: 10px; right: 10px; bottom: 3px; height: 4px; border-radius: 4px; background: #f3e1c8; overflow: hidden; }
.nh-xp span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #facc15, #f59e0b); }
.nh-ib { width: 44px; height: 44px; border: none; border-radius: 14px; background: rgba(255,250,243,.95); color: #7c2d12; font: 800 1.25rem/1 'Be Vietnam Pro', system-ui; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 3px 10px rgba(80,40,10,.15); cursor: pointer; text-decoration: none; }
.nh-ib:active { transform: scale(.94); }
.nh-side { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); z-index: 5; display: flex; flex-direction: column; gap: 8px; }
.nh-building .nh-side { top: auto; bottom: auto; top: 120px; transform: none; }
.nh-build-btn { position: absolute; right: 12px; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 6; border: none; border-radius: 20px; padding: 14px 20px; font: 900 1.05rem 'Be Vietnam Pro', system-ui; color: #fff; background: linear-gradient(#fb923c, #ea580c); box-shadow: 0 5px 0 #9a3412, 0 8px 18px rgba(154,52,18,.35); cursor: pointer; min-height: 52px; }
.nh-build-btn:active { transform: translateY(3px); box-shadow: 0 2px 0 #9a3412; }

/* ---------- chế độ xây dựng ---------- */
.nh-btop { position: absolute; left: 50%; transform: translateX(-50%); top: calc(62px + env(safe-area-inset-top)); z-index: 6; display: flex; align-items: center; gap: 6px; padding: 6px; border-radius: 16px; background: rgba(255,250,243,.96); box-shadow: 0 4px 14px rgba(80,40,10,.18); max-width: calc(100vw - 20px); }
.nh-tb { min-height: 42px; padding: 0 12px; border: 2px solid #f0d9b9; border-radius: 12px; background: #fff; font: 800 .9rem 'Be Vietnam Pro', system-ui; color: #5b3a1c; cursor: pointer; white-space: nowrap; }
.nh-tb:disabled { opacity: .4; cursor: default; }
.nh-tb.nh-done { background: linear-gradient(#4ade80, #16a34a); color: #fff; border-color: #15803d; }
.nh-save { font-size: .75rem; font-weight: 800; color: #16a34a; min-width: 62px; text-align: center; }
.nh-save[data-s="saving"], .nh-save[data-s="pending"] { color: #b45309; }
.nh-save[data-s="error"] { color: #dc2626; }
@media (max-width: 460px) { .nh-tb span { display: none; } .nh-tb { min-width: 46px; font-size: 1.1rem; } }

.nh-drawer { position: absolute; left: 0; right: 0; bottom: 0; z-index: 7; background: #fffaf3; border-radius: 22px 22px 0 0; box-shadow: 0 -6px 22px rgba(80,40,10,.2); padding: 4px 10px calc(10px + env(safe-area-inset-bottom)); max-height: 40vh; display: flex; flex-direction: column; }
.nh-drawer.is-min .nh-items, .nh-drawer.is-min .nh-cats { display: none; }
.nh-handle { align-self: center; width: 70px; height: 22px; border: none; background: none; cursor: pointer; padding: 0; display: flex; align-items: center; justify-content: center; }
.nh-handle span { width: 44px; height: 5px; border-radius: 4px; background: #e8cfae; }
.nh-tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 6px; }
.nh-tabs button { flex: 1 0 auto; min-height: 42px; border: 2px solid #f0d9b9; border-radius: 12px; background: #fff; font: 800 .9rem 'Be Vietnam Pro', system-ui; color: #6b4a33; padding: 0 12px; cursor: pointer; }
.nh-tabs button[aria-selected="true"] { background: #fff1de; border-color: #f08c3c; color: #9a3412; }
.nh-cats { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 6px; }
.nh-chip { flex: none; min-height: 36px; border: none; border-radius: 999px; padding: 0 12px; background: #f6e7d3; font: 800 .82rem 'Be Vietnam Pro', system-ui; color: #6b4a33; cursor: pointer; }
.nh-chip[aria-pressed="true"] { background: #f08c3c; color: #fff; }
.nh-items { display: grid; grid-auto-flow: column; grid-auto-columns: 112px; grid-template-rows: 1fr; gap: 8px; overflow-x: auto; overflow-y: hidden; padding: 2px 2px 6px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
.nh-card { position: relative; scroll-snap-align: start; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 6px; border: 2px solid #f3e1c8; border-radius: 16px; background: #fff; font: inherit; color: #3b2a1a; cursor: pointer; text-align: center; min-height: 150px; }
.nh-card img { width: 64px; height: 64px; object-fit: contain; }
.nh-card b { font-size: .78rem; font-weight: 800; line-height: 1.15; }
.nh-card small { font-size: .7rem; color: #8a6a52; }
.nh-price { font-weight: 900; font-size: .82rem; color: #b45309; }
.nh-owned { font-weight: 800; font-size: .74rem; color: #15803d; }
.nh-count { font-weight: 900; color: #2563eb; }
.nh-card.is-lock { filter: grayscale(.85); opacity: .7; }
.nh-card.is-poor .nh-price { color: #dc2626; }
.nh-card.is-cur { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.2); }
.nh-lock { position: absolute; top: 6px; right: 6px; font-style: normal; font-size: .66rem; font-weight: 900; background: #374151; color: #fff; border-radius: 8px; padding: 2px 5px; }
.nh-empty { grid-column: 1 / -1; margin: 10px; color: #8a6a52; font-size: .9rem; white-space: normal; width: min(80vw, 520px); }
@media (min-width: 900px) { .nh-drawer { left: 50%; right: auto; transform: translateX(-50%); width: min(980px, 96vw); } .nh-items { grid-auto-columns: 124px; } }

.nh-bar { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 8; display: flex; align-items: center; gap: 6px; padding: 8px; border-radius: 20px; background: rgba(255,250,243,.97); box-shadow: 0 6px 22px rgba(80,40,10,.25); max-width: calc(100vw - 16px); }
#nhDrawer:not([hidden]) ~ .nh-bar { bottom: calc(96px + env(safe-area-inset-bottom)); }
.nh-bar-t { display: flex; flex-direction: column; min-width: 0; max-width: 220px; padding: 0 6px; }
.nh-bar-t b { font-weight: 900; color: #7c2d12; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nh-bar-t small { font-size: .72rem; color: #8a6a52; line-height: 1.2; }
.nh-bar-t em { font-style: normal; font-size: .72rem; color: #dc2626; font-weight: 800; }
.nh-bar-t em:empty { display: none; }
.nh-rb { flex: none; width: 58px; height: 58px; border: none; border-radius: 16px; background: #fff1de; color: #7c2d12; font: 900 1.35rem/1 'Be Vietnam Pro', system-ui; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; cursor: pointer; box-shadow: 0 3px 0 #e8cfae; }
.nh-rb span { font-size: .62rem; font-weight: 800; }
.nh-rb:disabled { opacity: .4; cursor: default; }
.nh-rb:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 #e8cfae; }
.nh-rb.is-ok { background: linear-gradient(#4ade80, #16a34a); color: #fff; box-shadow: 0 3px 0 #15803d; }
.nh-rb.is-no { background: #fee2e2; color: #b91c1c; box-shadow: 0 3px 0 #fecaca; }
.nh-rb.is-sell { background: #fef3c7; color: #92400e; box-shadow: 0 3px 0 #fde68a; }
.nh-rb.is-sell.is-arm { background: #f59e0b; color: #fff; width: auto; padding: 0 10px; }
@media (max-width: 520px) { .nh-bar-t { display: none; } .nh-rb { width: 54px; height: 54px; } #nhGhostBar .nh-bar-t, #nhPaintBar .nh-bar-t { display: flex; max-width: 34vw; } }

.nh-info { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 8; display: flex; gap: 10px; align-items: center; padding: 10px 40px 10px 10px; border-radius: 18px; background: rgba(255,250,243,.97); box-shadow: 0 6px 22px rgba(80,40,10,.25); width: min(420px, calc(100vw - 20px)); box-sizing: border-box; }
.nh-info img { flex: none; width: 72px; height: 72px; }
.nh-info b { font-weight: 900; color: #7c2d12; }
.nh-info p { margin: 2px 0; font-size: .82rem; color: #5b3a1c; }
.nh-info small { font-size: .74rem; color: #8a6a52; }
.nh-x { position: absolute; top: 6px; right: 6px; width: 32px; height: 32px; border: none; border-radius: 10px; background: #fee2e2; color: #b91c1c; font-weight: 900; cursor: pointer; }

.nh-modal { position: absolute; inset: 0; z-index: 20; background: rgba(40,20,5,.35); display: flex; align-items: center; justify-content: center; padding: 16px; }
.nh-modal-box { width: min(400px, 100%); max-height: 100%; overflow-y: auto; overscroll-behavior: contain; background: #fffaf3; border-radius: 22px; padding: 18px; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.nh-modal-box h2 { margin: 0 0 12px; font-size: 1.15rem; font-weight: 900; color: #7c2d12; }
.nh-modal-box p { margin: 0 0 14px; color: #3b2a1a; }
.nh-modal-box label { font-weight: 800; color: #5b3a1c; display: block; margin-bottom: 6px; }
.nh-row { display: flex; gap: 8px; justify-content: flex-end; margin-bottom: 12px; }
.nh-row input { flex: 1; min-width: 0; padding: 10px 12px; border: 2px solid #f0d9b9; border-radius: 12px; font: inherit; }
.nh-check { display: flex !important; gap: 8px; align-items: center; margin: 6px 0 14px; font-weight: 700 !important; }
.nh-check input { width: 22px; height: 22px; }

.nh-toast { position: absolute; left: 50%; transform: translateX(-50%); top: calc(120px + env(safe-area-inset-top)); z-index: 30; display: flex; flex-direction: column; gap: 6px; align-items: center; pointer-events: none; width: min(440px, 92vw); }
.nh-t { background: rgba(40,25,12,.88); color: #fff; font-weight: 700; font-size: .88rem; padding: 9px 14px; border-radius: 14px; text-align: center; animation: nhIn .2s ease-out; transition: opacity .35s; }
.nh-t.is-out { opacity: 0; }
@keyframes nhIn { from { opacity: 0; transform: translateY(-8px); } }
.nh-loading { position: absolute; inset: 0; z-index: 40; display: flex; flex-direction: column; gap: 14px; align-items: center; justify-content: center; background: #fff4e3; color: #7c2d12; font-weight: 800; text-align: center; padding: 20px; }
.nh-spin { width: 46px; height: 46px; border: 5px solid #fde3c3; border-top-color: #f08c3c; border-radius: 50%; animation: nhSpin .8s linear infinite; }
@keyframes nhSpin { to { transform: rotate(360deg); } }

@media (max-width: 520px) {
  .nh-stats { width: 100%; justify-content: flex-start; margin-left: 52px; margin-top: -2px; }
  .nh-title { max-width: calc(100vw - 80px); }
  .nh-stat { font-size: .8rem; padding: 4px 8px 4px 6px; }
  .nh-btop { top: calc(98px + env(safe-area-inset-top)); }
  .nh-side { top: auto; transform: none; bottom: calc(84px + env(safe-area-inset-bottom)); gap: 6px; }
  .nh-side .nh-ib { width: 40px; height: 40px; font-size: 1.1rem; }
  .nh-building .nh-side { display: none; }
}
@media (max-height: 480px) and (orientation: landscape) {
  .nh-drawer { max-height: 52vh; }
  .nh-card { min-height: 122px; }
  .nh-card img { width: 48px; height: 48px; }
  .nh-btop { left: 64px; right: auto; transform: none; top: calc(8px + env(safe-area-inset-top)); }
  .nh-building .nh-title { display: none; }
  .nh-tb span { display: none; } .nh-tb { min-width: 46px; font-size: 1.1rem; }
  .nh-building .nh-side { display: none; }
  .nh-side { top: 64px; transform: none; gap: 6px; } .nh-side .nh-ib { width: 40px; height: 40px; }
}

/* ---------- Phase 2: mở cửa, nhắc việc, nhân viên ---------- */
.nh-hudrow { flex-basis: 100%; display: flex; gap: 8px; align-items: center; padding-left: 52px; pointer-events: none; }
.nh-hudrow > * { pointer-events: auto; }
.nh-open { display: inline-flex; align-items: center; gap: 6px; border: none; border-radius: 999px; padding: 6px 12px 6px 8px; font: 800 .8rem 'Be Vietnam Pro', system-ui; color: #166534; background: rgba(220,252,231,.95); box-shadow: 0 3px 10px rgba(80,40,10,.12); cursor: pointer; }
.nh-open i { width: 10px; height: 10px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.25); }
.nh-open.is-closed { color: #991b1b; background: rgba(254,226,226,.95); }
.nh-open.is-closed i { background: #ef4444; box-shadow: 0 0 0 3px rgba(239,68,68,.25); }
.nh-open[hidden], .nh-hint[hidden] { display: none; }
.nh-hint { margin: 0; padding: 5px 12px; border-radius: 12px; background: rgba(254,243,199,.96); color: #92400e; font-weight: 800; font-size: .78rem; box-shadow: 0 3px 10px rgba(80,40,10,.12); }
.nh-building .nh-hudrow { display: none; }
.nh-staff-box { width: min(560px, 100%); max-height: 88vh; display: flex; flex-direction: column; }
.nh-staff-box h2 small { font-size: .85rem; color: #8a6a52; }
.nh-st-list { list-style: none; margin: 0 0 8px; padding: 0; overflow-y: auto; display: grid; gap: 8px; }
.nh-st { display: flex; gap: 10px; align-items: flex-start; background: #fff; border: 2px solid #f3e1c8; border-radius: 16px; padding: 8px; }
.nh-st img { flex: none; width: 72px; height: 72px; background: #fef3e2; border-radius: 14px; }
.nh-st-b { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.nh-st-name { font: 800 .95rem 'Be Vietnam Pro', system-ui; color: #7c2d12; border: 2px solid transparent; border-radius: 8px; padding: 1px 4px; background: #fffaf3; width: 100%; box-sizing: border-box; }
.nh-st-name:focus { border-color: #f0a35c; outline: none; }
.nh-st-role { font-size: .78rem; font-weight: 800; color: #5b3a1c; }
.nh-st-k { font-size: .76rem; color: #6b4a33; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.nh-st-k em { font-style: normal; font-weight: 800; }
.nh-bar2 { display: inline-block; flex: 1; min-width: 60px; min-height: 7px; max-width: 200px; height: 7px; border-radius: 6px; background: #f3e1c8; overflow: hidden; vertical-align: middle; }
.nh-bar2 i { display: block; height: 100%; background: linear-gradient(90deg, #4ade80, #16a34a); }
.nh-st-act { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 3px; }
.nh-st-act button { min-height: 34px; border: 2px solid #f0d9b9; border-radius: 10px; background: #fff; font: 800 .75rem 'Be Vietnam Pro', system-ui; color: #5b3a1c; padding: 0 9px; cursor: pointer; }
.nh-st-act button.is-no { color: #b91c1c; border-color: #fecaca; }
.nh-hires { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.nh-hire { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border: 2px solid #f3e1c8; border-radius: 14px; background: #fff; font: inherit; cursor: pointer; min-height: 76px; }
.nh-hire span { font-size: 1.5rem; }
.nh-hire b { font-size: .8rem; color: #7c2d12; }
.nh-hire small { font-weight: 800; color: #b45309; }
.nh-hire:disabled { opacity: .45; cursor: default; }
@media (max-width: 520px) { .nh-hudrow { padding-left: 0; } }

/* ---------- Phase 3: bếp (thực đơn, chợ, kho, câu đố) ---------- */
.nh-dock { position: absolute; left: 12px; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 6; display: flex; gap: 8px; }
.nh-dock[hidden], .nh-dk[hidden] { display: none; }
.nh-dk { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-width: 64px; min-height: 56px; padding: 6px 8px; border: none; border-radius: 18px; background: rgba(255,250,243,.97); color: #7c2d12; font: 800 .74rem 'Be Vietnam Pro', system-ui; box-shadow: 0 4px 0 #e7c9a3, 0 6px 14px rgba(80,40,10,.18); cursor: pointer; }
.nh-dk i { font-style: normal; font-size: 1.4rem; line-height: 1; }
.nh-dk:active { transform: translateY(3px); box-shadow: 0 1px 0 #e7c9a3; }
.nh-dk.is-quiz { background: linear-gradient(#fef08a, #facc15); color: #713f12; box-shadow: 0 4px 0 #ca8a04, 0 6px 14px rgba(161,98,7,.3); animation: nhPulse 1.6s ease-in-out infinite; }
@keyframes nhPulse { 50% { transform: scale(1.06); } }
.nh-kit-box { width: min(620px, 100%); max-height: 90vh; display: flex; flex-direction: column; }
.nh-kit-box .nh-tabs { flex: none; }
.nh-k-cats { flex: none; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px 0 8px; }
.nh-k-cats[hidden] { display: none; }
.nh-k-cats button { flex: 1 0 auto; min-height: 38px; border: 2px solid #f0d9b9; border-radius: 999px; background: #fff; font: 800 .82rem 'Be Vietnam Pro', system-ui; color: #6b4a33; padding: 0 12px; cursor: pointer; }
.nh-k-cats button[aria-selected="true"] { background: #7c2d12; border-color: #7c2d12; color: #fff; }
.nh-k-cats small { opacity: .75; font-weight: 700; }
.nh-k-body { flex: 1 1 auto; overflow-y: auto; min-height: 120px; margin-bottom: 10px; overscroll-behavior: contain; }
.nh-k-note { font-size: .8rem; color: #8a6a52 !important; margin: 0 0 8px !important; }
.nh-k-clock { display: inline-block; font-weight: 800; color: #9a3412; }
.nh-k-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.nh-k-dish, .nh-k-ing { display: flex; gap: 10px; align-items: flex-start; background: #fff; border: 2px solid #f3e1c8; border-radius: 16px; padding: 8px; }
.nh-k-dish.is-menu { border-color: #86efac; background: #f7fff9; }
.nh-k-dish.is-locked { opacity: .6; }
.nh-k-dish > img { flex: none; width: 64px; height: 64px; background: radial-gradient(circle at 50% 60%, #fff7e8, #fde9cc); border-radius: 14px; }
.nh-k-ing > img { flex: none; width: 48px; height: 48px; background: #fef6ea; border-radius: 12px; }
.nh-k-ing { align-items: center; }
.nh-k-b { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.nh-k-b > b { color: #3b2a1a; font-size: .95rem; }
.nh-k-meta { font-size: .78rem; color: #6b4a33; font-weight: 700; }
.nh-k-meta em { font-style: normal; padding: 1px 7px; border-radius: 999px; background: #f3e8d9; margin-right: 4px; }
.nh-k-meta em.t1 { background: #dbeafe; color: #1e40af; }
.nh-k-meta em.t2 { background: #fef3c7; color: #92400e; }
.nh-k-meta em.t3 { background: linear-gradient(90deg, #fde68a, #fbcfe8); color: #7c2d12; }
.nh-k-use { color: #8a6a52; font-size: .72rem; }
.nh-k-ings { display: flex; flex-wrap: wrap; gap: 4px; }
.nh-k-ings span { display: inline-flex; align-items: center; gap: 2px; padding: 2px 6px 2px 2px; border-radius: 10px; background: #f0fdf4; border: 1px solid #bbf7d0; font-size: .74rem; }
.nh-k-ings span.no { background: #fef2f2; border-color: #fecaca; }
.nh-k-ings span.no b { color: #b91c1c; }
.nh-k-ings span.ok b { color: #15803d; }
.nh-k-ings img { width: 28px; height: 28px; }
.nh-k-act { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.nh-k-act.v { flex: none; flex-direction: column; margin: 0; }
.nh-k-btn { min-height: 38px; border: 2px solid #f0d9b9; border-radius: 12px; background: #fff; font: 800 .8rem 'Be Vietnam Pro', system-ui; color: #6b4a33; padding: 0 10px; cursor: pointer; white-space: nowrap; }
.nh-k-btn small { font-weight: 700; opacity: .8; }
.nh-k-btn:disabled { opacity: .45; cursor: default; }
.nh-k-btn.is-learn, .nh-k-btn.is-buy { background: linear-gradient(#fb923c, #ea580c); color: #fff; border-color: #c2410c; }
.nh-k-btn.is-up { background: linear-gradient(#60a5fa, #2563eb); color: #fff; border-color: #1d4ed8; }
.nh-k-btn.is-on { background: #dcfce7; border-color: #86efac; color: #166534; }
.nh-k-btn.is-sell { color: #b45309; }
.nh-k-lock { font-size: .8rem; font-weight: 800; color: #8a6a52; }
.nh-k-refresh { margin-top: 10px; }
.nh-stars { color: #f59e0b; font-size: .8rem; letter-spacing: 1px; }
.nh-stars i { font-style: normal; color: #e5d5bf; }
.nh-qty { color: #9a3412; font-weight: 900; }
.nh-quiz-opts { display: grid; gap: 8px; margin-bottom: 10px; }
.nh-quiz-opts button { min-height: 46px; border: 2px solid #f0d9b9; border-radius: 14px; background: #fff; font: 700 .92rem 'Be Vietnam Pro', system-ui; color: #3b2a1a; text-align: left; padding: 8px 12px; cursor: pointer; }
.nh-quiz-opts button.is-pick { border-color: #f08c3c; }
.nh-quiz-opts button.is-ok { background: #dcfce7; border-color: #22c55e; color: #14532d; }
.nh-quiz-opts button.is-no { background: #fee2e2; border-color: #ef4444; color: #7f1d1d; }
.nh-quiz-opts button:disabled { cursor: default; }
.nh-quiz-res { font-weight: 800; border-radius: 14px; padding: 10px 12px; }
.nh-quiz-res[hidden] { display: none; }
.nh-quiz-res.is-ok { background: #f0fdf4; color: #166534; }
.nh-quiz-res.is-no { background: #fff7ed; color: #9a3412; }
.nh-quiz-res span { display: inline-flex; align-items: center; gap: 3px; margin-right: 6px; }
.nh-building .nh-dock { display: none; }
@media (max-width: 520px) {
  .nh-dk { min-width: 56px; min-height: 52px; font-size: .68rem; padding: 4px 6px; }
  .nh-dk i { font-size: 1.25rem; }
  .nh-kit-box { padding: 14px 12px; max-height: 92vh; }
  .nh-k-dish > img { width: 56px; height: 56px; }
  .nh-k-btn { min-height: 36px; font-size: .76rem; padding: 0 8px; }
}
@media (max-height: 480px) and (orientation: landscape) {
  .nh-kit-box { max-height: 96vh; padding: 10px 14px; }
  .nh-kit-box h2 { display: none; }
}

/* ---------- Phase 4: cho nhân viên ăn, thu nhập vắng mặt, bảng xếp hạng ---------- */
.nh-st-feed { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.nh-st-feed button { min-height: 34px; border: 2px solid #bbf7d0; border-radius: 10px; background: #f0fdf4; font: 800 .8rem "Be Vietnam Pro", system-ui; color: #166534; padding: 0 6px; cursor: pointer; }
.nh-st-feed button small { font-weight: 700; font-size: .7rem; }
.nh-st-feed button:disabled { opacity: .45; cursor: default; }
.nh-off-box { text-align: center; }
.nh-off-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.nh-off-grid span { display: flex; flex-direction: column; align-items: center; gap: 2px; background: #fff; border: 2px solid #f3e1c8; border-radius: 16px; padding: 10px 4px; }
.nh-off-grid i { font-style: normal; font-size: 1.6rem; }
.nh-off-grid b { font-size: 1.25rem; font-weight: 900; color: #7c2d12; }
.nh-off-grid small { font-size: .72rem; color: #8a6a52; font-weight: 700; }
.nh-off-note { font-size: .86rem; font-weight: 700; color: #6b4a33 !important; background: #fff7ed; border-radius: 12px; padding: 8px 10px; text-align: left; }
.nh-rank a { display: grid; grid-template-columns: 34px 1fr; column-gap: 8px; align-items: center; }
.nh-rank b, .nh-rank span { grid-column: 2; }
.nh-rk { grid-row: 1 / span 2; grid-column: 1; font-style: normal; font-weight: 900; font-size: 1.15rem; text-align: center; color: #9a3412; }

/* =====================================================================
 * 0.5 – Giao diện kiểu "phố nhà hàng": HUD xu / thanh XP mũ đầu bếp / độ nổi tiếng,
 * bảng công cụ trắng ở giữa đáy màn hình + thẻ nhân viên, biển mở / đóng cửa, nút thưởng,
 * ngăn trang trí dạng lưới thẻ xám + ô máy tính tiền để bán, nút xoay nổi.
 * ===================================================================== */
.nh-play .nh-app { background: #a5d66b; }
.rc-hud { display: grid; grid-template-columns: auto auto 1fr auto; align-items: center; gap: 8px; }
.rc-hud .nh-hudrow { grid-column: 1 / -1; padding-left: 0; }
.rc-back { width: 40px; height: 40px; }
.rc-money { display: flex; gap: 6px; align-items: center; }
.rc-hud .nh-stat { background: rgba(255,255,255,.96); border: 2px solid #d9dfe5; color: #26323d; box-shadow: 0 3px 0 rgba(0,0,0,.08); padding: 4px 12px 4px 6px; font-size: .95rem; }
.rc-hud .nh-stat[hidden] { display: none; }
.rc-coin { display: inline-block; width: 22px; height: 22px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff6c2 0 18%, #ffd34d 19% 60%, #e0a21c 61%); border: 2px solid #a86f0c; box-shadow: inset 0 -2px 0 rgba(0,0,0,.12); }
.rc-xp { justify-self: center; position: relative; display: flex; align-items: center; width: min(360px, 40vw); height: 34px; padding-left: 26px; }
.rc-xp .rc-hat { position: absolute; left: -2px; top: 50%; transform: translateY(-58%); width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: radial-gradient(#fffbe8, #ffe39a); border: 2.5px solid #c98c1c; box-shadow: 0 3px 0 rgba(0,0,0,.12); z-index: 2; }
.rc-xp .rc-hat svg { width: 32px; height: 32px; }
.rc-xp .nh-xp { position: relative; flex: 1; height: 20px; border-radius: 999px; background: #fff; border: 2.5px solid #5b6570; overflow: hidden; display: block; margin: 0; box-shadow: inset 0 2px 0 rgba(0,0,0,.08); }
.rc-xp .nh-xp > span { display: block; height: 100%; width: 0; background: linear-gradient(#ffe27a, #f6b21b); border-right: 2px solid #c98c1c; transition: width .4s; }
.rc-xpn { position: absolute; left: 50%; top: 50%; transform: translate(-40%, -50%); font: 900 .82rem 'Be Vietnam Pro', system-ui; color: #2d3640; text-shadow: 0 1px 0 #fff, 1px 0 0 #fff, -1px 0 0 #fff, 0 -1px 0 #fff; pointer-events: none; }
.rc-lvn { min-width: 30px; height: 30px; margin-left: -6px; border-radius: 10px; display: grid; place-items: center; background: #3a4450; color: #fff; font: 900 1rem 'Be Vietnam Pro', system-ui; border: 2.5px solid #fff; box-shadow: 0 3px 0 rgba(0,0,0,.15); z-index: 1; }
.rc-right { display: flex; gap: 6px; justify-self: end; }
.rc-hud .nh-title { background: rgba(255,255,255,.9); border-radius: 12px; padding: 4px 10px; }
@media (max-width: 640px) {
  .rc-hud { grid-template-columns: auto 1fr auto; row-gap: 6px; }
  .rc-hud .rc-xp { grid-column: 1 / -1; grid-row: 2; width: min(420px, 92vw); }
  .rc-right .nh-stat:last-child { display: none; }
  .rc-hud .nh-hudrow { grid-row: 3; }
  .rc-hud .nh-title { display: none; }
}

/* bảng công cụ đáy màn hình */
.rc-dock { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(6px + env(safe-area-inset-bottom)); z-index: 6; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; width: min(720px, calc(100vw - 12px)); pointer-events: none; }
.rc-dock > * { pointer-events: auto; }
.nh-building .rc-dock { display: none; }
.rc-dock-top { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.rc-panel { width: 100%; background: #fbfbfa; border: 3px solid #d5d8dc; border-radius: 18px 18px 14px 14px; box-shadow: 0 6px 18px rgba(30,40,50,.22), inset 0 3px 0 #fff; padding: 6px 8px 8px; }
.rc-tools.nh-dock { position: static; display: flex; gap: 4px; justify-content: center; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.rc-tools .rc-tool { position: relative; flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; min-width: 62px; min-height: 54px; padding: 4px 6px; border: none; border-radius: 14px; background: transparent; color: #33404c; font: 800 .7rem 'Be Vietnam Pro', system-ui; cursor: pointer; box-shadow: none; animation: none; }
.rc-tools .rc-tool i { font-style: normal; font-size: 1.65rem; line-height: 1.05; filter: drop-shadow(0 2px 0 rgba(0,0,0,.18)); transition: transform .15s; }
.rc-tools .rc-tool:hover i, .rc-tools .rc-tool:focus-visible i { transform: translateY(-3px) scale(1.08); }
.rc-tools .rc-tool:active { transform: translateY(2px); }
.rc-tools .rc-tool[hidden] { display: none; }
.rc-tools .rc-tool.is-quiz { background: linear-gradient(#fff6c4, #fde68a); }
.rc-tool em { position: absolute; top: 2px; right: 8px; min-width: 18px; height: 18px; border-radius: 9px; background: #ef4444; color: #fff; font: 900 .7rem system-ui; display: grid; place-items: center; border: 2px solid #fff; }
.rc-tool em[hidden] { display: none; }
.rc-crew { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-top: 6px; margin-top: 4px; border-top: 2px dashed #e1e4e8; cursor: pointer; }
.rc-crew:empty { display: none; }
.rc-mate { flex: none; position: relative; width: 74px; padding: 4px 4px 8px; border-radius: 12px; background: #eef4fb; border: 2px solid #c9d6e4; display: flex; flex-direction: column; align-items: center; text-align: center; }
.rc-mate img { width: 54px; height: 54px; }
.rc-mate b { font-size: .72rem; font-weight: 900; color: #26323d; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-mate small { font-size: .62rem; color: #66727e; }
.rc-mate .rc-en { position: absolute; left: 8px; right: 8px; bottom: 3px; height: 4px; border-radius: 2px; background: #d6dbe0; overflow: hidden; }
.rc-mate .rc-en i { display: block; height: 100%; width: 100%; }
.rc-mate.is-hire, .rc-mate.is-lock { justify-content: center; background: #f6f7f8; border-style: dashed; min-height: 86px; }
.rc-mate em { font-style: normal; font-size: 1.6rem; color: #4b9a2f; font-weight: 900; }
.rc-mate.is-lock em { font-size: 1.3rem; }
@media (max-width: 520px) { .rc-mate { width: 62px; } .rc-mate img { width: 44px; height: 44px; } .rc-tools .rc-tool { min-width: 54px; font-size: .64rem; } .rc-tools .rc-tool i { font-size: 1.45rem; } }
@media (max-height: 520px) and (orientation: landscape) { .rc-crew { display: none; } .rc-panel { padding: 4px 6px; } .rc-dock { width: min(560px, 70vw); } }

/* biển mở / đóng cửa + nút thưởng */
.rc-sign.nh-open { display: inline-flex; flex-direction: column; align-items: center; gap: 0; padding: 6px 14px 5px; border-radius: 10px; border: 3px solid #5b3a1c; background: linear-gradient(#2c2f36, #16181d); box-shadow: 0 4px 0 #3b2614, 0 6px 14px rgba(0,0,0,.3); color: #6dff9a; font: 900 .9rem 'Be Vietnam Pro', system-ui; letter-spacing: .04em; text-shadow: 0 0 8px rgba(109,255,154,.7); cursor: pointer; }
.rc-sign.nh-open i { display: none; }
.rc-sign.nh-open small { font-size: .62rem; color: #ffe27a; text-shadow: none; letter-spacing: 0; }
.rc-sign.nh-open.is-closed { color: #ff5d6c; text-shadow: 0 0 8px rgba(255,93,108,.75); background: linear-gradient(#2c2f36, #16181d); }
.rc-sign[hidden], .rc-bonus[hidden] { display: none; }
.rc-bonus { display: inline-flex; flex-direction: column; align-items: center; padding: 6px 16px; border-radius: 12px; border: 3px solid #8a3b0b; background: linear-gradient(#ffb347, #f0731c); color: #fff; font: 900 1rem 'Be Vietnam Pro', system-ui; text-shadow: 0 2px 0 rgba(120,40,0,.55); box-shadow: 0 4px 0 #8a3b0b, 0 6px 14px rgba(0,0,0,.25); cursor: pointer; animation: nhPulse 1.6s ease-in-out infinite; }
.rc-bonus small { font-size: .68rem; text-shadow: none; color: #fff5dc; }

/* ngăn trang trí */
.nh-play .nh-drawer { background: #fbfbfa; border: 3px solid #d5d8dc; border-bottom: none; box-shadow: 0 -6px 22px rgba(30,40,50,.22), inset 0 3px 0 #fff; }
.nh-play .nh-tabs button { border-color: #d5d8dc; color: #33404c; border-radius: 12px; }
.nh-play .nh-tabs button[aria-selected="true"] { background: #e6f2ff; border-color: #3b82f6; color: #1d4ed8; }
.rc-shoprow { display: flex; gap: 8px; align-items: center; }
.rc-shoprow .nh-cats { flex: 1; min-width: 0; padding-bottom: 4px; }
.nh-drawer.is-min .rc-shoprow .nh-cats { display: none; }
.rc-sell { flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; width: 58px; height: 52px; border-radius: 12px; border: 2.5px dashed #9aa5b1; background: #f1f4f7; color: #33404c; font: 900 .66rem 'Be Vietnam Pro', system-ui; cursor: pointer; transition: transform .12s, background .12s; }
.rc-sell i { font-style: normal; font-size: 1.4rem; line-height: 1; }
.rc-sell.is-over { background: #fde68a; border-color: #d97706; border-style: solid; transform: scale(1.12); }
.nh-play .nh-chip { background: #eef1f4; color: #33404c; border: 2px solid #d5d8dc; }
.nh-play .nh-chip[aria-pressed="true"] { background: #fff3c4; border-color: #f2a71b; color: #7a4a00; }
.nh-play .nh-card { background: #f3f5f7; border: 3px solid #5f6b77; border-radius: 16px; box-shadow: inset 0 -4px 0 rgba(0,0,0,.06); }
.nh-play .nh-card:hover { border-color: #2f7de1; }
.nh-play .nh-card .nh-price { font-weight: 900; color: #fff; text-shadow: 0 0 2px #000, 1px 1px 0 #000, -1px 1px 0 #000, 1px -1px 0 #000, -1px -1px 0 #000; font-size: .9rem; }
.nh-play .nh-card.is-poor .nh-price { color: #ffb4b4; }

/* nút xoay nổi */
.rc-rot { position: absolute; left: 0; top: 0; z-index: 7; width: 44px; height: 44px; border-radius: 10px; border: 2.5px solid #1e3a8a; background: linear-gradient(#5aa2ff, #2563eb); box-shadow: 0 3px 0 #1e3a8a, 0 5px 12px rgba(0,0,0,.25); display: grid; place-items: center; cursor: pointer; padding: 0; }
.rc-rot[hidden] { display: none; }
.rc-rot:active { transform: translateY(2px); }

/* hòm thư, hạt giống, thưởng */
.rc-mail { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 12px; }
.rc-letter { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 14px; background: #fff; border: 2px solid #e4e7eb; }
.rc-letter.is-new { border-color: #f59e0b; background: #fffbeb; }
.rc-letter > i { font-style: normal; font-size: 1.7rem; }
.rc-letter > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rc-letter b { font-weight: 900; color: #26323d; }
.rc-letter small { font-size: .78rem; color: #66727e; line-height: 1.35; }
.rc-letter .btn { flex: none; }
.rc-seeds { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; max-height: 52vh; overflow-y: auto; margin: 8px 0 12px; }
.rc-seed { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px; border-radius: 14px; border: 2.5px solid #b6d8a0; background: #f4fbef; cursor: pointer; font: inherit; color: #26323d; }
.rc-seed b { font-size: .82rem; font-weight: 900; }
.rc-seed small { font-size: .68rem; color: #6b7a59; }
.rc-seed span { font-weight: 900; font-size: .85rem; }
.rc-seed.is-poor { opacity: .55; }
.rc-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin: 10px 0; }
.rc-day { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; border-radius: 12px; background: #f1f4f7; border: 2px solid #d5d8dc; font-size: .72rem; }
.rc-day b { font-weight: 900; }
.rc-day em { font-style: normal; font-size: .7rem; }
.rc-day.is-past { opacity: .5; }
.rc-day.is-cur { background: #fff3c4; border-color: #f2a71b; transform: scale(1.06); }
@media (max-width: 420px) { .rc-days { grid-template-columns: repeat(4, 1fr); } }
.rc-tools.nh-dock { justify-content: safe center; }
.rc-tools #nhQuizBtn { display: none; }
.rc-dock { width: min(640px, calc(100vw - 12px)); }
@media (min-width: 641px) { .rc-mate { width: 66px; padding-top: 2px; } .rc-mate img { width: 44px; height: 44px; } .rc-mate.is-hire, .rc-mate.is-lock { min-height: 74px; } }
@media (max-width: 640px) { .nh-play .nh-side { top: 34%; } }
@media (max-height: 520px) and (orientation: landscape) {
  .rc-dock { left: 8px; transform: none; width: auto; max-width: calc(100vw - 80px); flex-direction: row; align-items: flex-end; }
  .rc-dock-top { flex-direction: column; align-items: stretch; gap: 4px; }
  .rc-sign.nh-open { font-size: .72rem; padding: 4px 8px; }
  .rc-bonus { font-size: .8rem; padding: 4px 10px; }
  .rc-bonus small { display: none; }
  .rc-panel { width: auto; padding: 3px 4px; border-radius: 14px; }
  .rc-tools .rc-tool { min-width: 46px; min-height: 44px; font-size: .58rem; padding: 2px 4px; }
  .rc-tools .rc-tool i { font-size: 1.3rem; }
  .rc-hud .nh-title { display: none; }
}

.rc-bonus.is-late { background: linear-gradient(#f87171, #b91c1c); border-color: #7f1d1d; box-shadow: 0 4px 0 #7f1d1d, 0 6px 14px rgba(0,0,0,.25); }

.rc-bar { display: block; height: 6px; margin-top: 4px; border-radius: 3px; background: #e5e7eb; overflow: hidden; }
.rc-bar > span { display: block; height: 100%; background: linear-gradient(90deg, #fbbf24, #f59e0b); }
.rc-check { display: flex; align-items: center; gap: 8px; margin: 8px 0 12px; font-weight: 700; }
.rc-expand[disabled] { opacity: .6; }
.rc-tut { position: absolute; left: 50%; top: 84px; transform: translateX(-50%); z-index: 30; width: min(420px, calc(100vw - 24px)); }
.rc-tut[hidden] { display: none; }
.rc-tut-box { background: #fffbeb; border: 3px solid #f59e0b; border-radius: 16px; padding: 12px 14px; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.rc-tut-box small { font-weight: 900; color: #b45309; }
.rc-tut-box p { margin: 4px 0 10px; font-weight: 700; color: #3b2a20; line-height: 1.4; }
.rc-tut-box .nh-row { justify-content: flex-end; gap: 8px; }
.rc-tut-on { position: relative; z-index: 31; outline: 4px solid #f59e0b; outline-offset: 2px; border-radius: 14px; animation: nhPulse 1.2s ease-in-out infinite; }
@media (max-width: 520px) {
  .rc-tools.nh-dock { display: grid; grid-template-columns: repeat(auto-fit, minmax(42px, 1fr)); gap: 2px; overflow: visible; }
  .rc-tools .rc-tool { min-width: 0; min-height: 48px; padding: 2px 1px; font-size: .56rem; line-height: 1.1; text-align: center; white-space: normal; }
  .rc-tools .rc-tool i { font-size: 1.3rem; }
  .rc-tool em { right: 2px; }
}

/* 0.9: thanh công cụ Trang trí không bao giờ tràn khỏi màn hình – nút Xong luôn hiện */
.nh-btop { flex-wrap: wrap; justify-content: center; row-gap: 6px; }
.nh-btop .nh-done { order: 9; }
.nh-tb.nh-done span { display: inline !important; }
#nhExpandT { display: inline-block; max-width: 46vw; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
@media (max-width: 760px) {
  #nhUndo span, #nhRedo span { display: none; }
  #nhUndo, #nhRedo { min-width: 46px; font-size: 1.1rem; }
  .nh-save { min-width: 0; font-size: .7rem; }
  .nh-btop { left: 10px; right: 10px; transform: none; max-width: none; }
  #nhExpandT { max-width: 26vw; }
  .nh-btop .nh-tb { padding: 0 9px; }
}
@media (max-width: 460px) { #nhExpandT { display: none; } }
@media (max-height: 480px) and (orientation: landscape) { .nh-btop { left: 64px; right: 10px; } }

/* 0.9.2: thao tác nổi ngay trên món (xoay, di chuyển, cất kho, bán, hoàn tác, xong) – kiểu nút vuông xanh của game gốc */
.rc-itools { position: absolute; left: 0; top: 0; z-index: 7; display: flex; flex-direction: column; align-items: center; gap: 4px; pointer-events: none; }
.rc-itools[hidden] { display: none; }
.rc-itools-row { display: flex; gap: 6px; pointer-events: auto; }
.rc-itools-why { font-style: normal; font: 800 .72rem/1.2 'Be Vietnam Pro', system-ui; color: #fff; background: rgba(55,65,81,.85); padding: 3px 8px; border-radius: 8px; white-space: nowrap; }
.rc-itools-why:empty { display: none; }
.rc-tb { position: relative; width: 42px; height: 42px; border-radius: 11px; border: 2.5px solid #1e3a8a; background: linear-gradient(#5aa2ff, #2563eb); box-shadow: 0 3px 0 #1e3a8a, 0 5px 12px rgba(0,0,0,.25); display: grid; place-items: center; cursor: pointer; padding: 0; }
.rc-tb[hidden] { display: none; }
.rc-tb:active { transform: translateY(2px); box-shadow: 0 1px 0 #1e3a8a; }
.rc-tb:disabled { opacity: .38; cursor: default; filter: grayscale(.6); }
.rc-tb.is-ok { border-color: #166534; background: linear-gradient(#4ade80, #16a34a); box-shadow: 0 3px 0 #166534, 0 5px 12px rgba(0,0,0,.25); }
.rc-tb.is-undo { border-color: #7c2d12; background: linear-gradient(#fb923c, #ea580c); box-shadow: 0 3px 0 #7c2d12, 0 5px 12px rgba(0,0,0,.25); }
.rc-tb.is-store { border-color: #6b4226; background: linear-gradient(#d6a26b, #a16207); box-shadow: 0 3px 0 #6b4226, 0 5px 12px rgba(0,0,0,.25); }
.rc-tb.is-sell { border-color: #854d0e; background: linear-gradient(#fde047, #eab308); box-shadow: 0 3px 0 #854d0e, 0 5px 12px rgba(0,0,0,.25); }
.rc-tb.is-sell.is-arm { animation: rcArm .6s ease-in-out infinite alternate; }
@keyframes rcArm { to { transform: scale(1.12); } }
.rc-tb-n { position: absolute; bottom: -9px; left: 50%; transform: translateX(-50%); font: 900 .62rem/1 'Be Vietnam Pro', system-ui; color: #713f12; background: #fef9c3; border: 1.5px solid #854d0e; border-radius: 7px; padding: 2px 4px; white-space: nowrap; }
.rc-tb-n:empty { display: none; }
/* thanh dưới cũ (tên món + nút chữ) không còn dùng khi đã có thao tác nổi */
#nhGhostBar, #nhSelBar { display: none !important; }

/* ---------- 2.0: Xưởng nhân vật (characters.php) ---------- */
.cl-page { background: #fbe9cf; }
.cl-app { position: fixed; inset: 0; display: flex; flex-direction: column; font-family: 'Be Vietnam Pro', system-ui, sans-serif; color: #3b2a20; }
.cl-top { display: flex; align-items: center; gap: .6rem; padding: .5rem .8rem; flex-wrap: wrap; }
.cl-top h1 { font-size: 1.15rem; margin: 0; font-weight: 800; }
.cl-tabs { display: flex; gap: .35rem; flex-wrap: wrap; margin-left: auto; }
.cl-tab { border: 2px solid #e2c59c; background: #fff8ec; color: #5b3a22; border-radius: 999px; padding: .32rem .8rem; font-weight: 700; cursor: pointer; }
.cl-tab.is-on { background: #f59e0b; border-color: #d97706; color: #fff; }
.cl-stage { position: relative; flex: 1 1 auto; min-height: 260px; }
.cl-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: manipulation; }
.cl-labels { position: absolute; inset: 0; pointer-events: none; }
.cl-lab { position: absolute; left: 0; top: 0; background: rgba(255,255,255,.88); border: 2px solid #e2c59c; border-radius: 999px; padding: .1rem .6rem; font-weight: 800; font-size: .82rem; white-space: nowrap; }
.cl-lab.is-on { background: #f59e0b; color: #fff; border-color: #d97706; }
.cl-panel { flex: 0 0 auto; max-height: 42vh; overflow: auto; background: #fffaf1; border-top: 3px solid #e2c59c; padding: .6rem .8rem calc(.6rem + env(safe-area-inset-bottom)); }
.cl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .45rem .7rem; }
.cl-f { display: flex; flex-direction: column; gap: .15rem; font-size: .78rem; font-weight: 700; }
.cl-f select, .cl-f input[type=color] { width: 100%; min-height: 36px; border: 2px solid #e2c59c; border-radius: 10px; background: #fff; font: inherit; font-weight: 600; }
.cl-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .6rem; }
.cl-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #3b2a20; color: #fff; padding: .5rem 1rem; border-radius: 999px; font-weight: 700; opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 40; }
.cl-toast.show { opacity: 1; }
@media (min-width: 900px) {
  .cl-app { flex-direction: row; flex-wrap: wrap; }
  .cl-top { flex: 1 0 100%; }
  .cl-stage { flex: 1 1 60%; height: calc(100vh - 60px); }
  .cl-panel { flex: 0 0 360px; max-height: none; height: calc(100vh - 60px); border-top: 0; border-left: 3px solid #e2c59c; }
}
