:root {
  --cream: #FFF1D6;
  --paper: #FFFAF0;
  --tomato: #FF6B57;
  --tomato-d: #E4503D;
  --honey: #FFC94D;
  --mint: #5FD3B0;
  --cocoa: #5B3A29;
  --cocoa-l: #8C6A55;
  --line: rgba(91, 58, 41, .14);
  --shadow: 0 6px 0 rgba(91, 58, 41, .16);
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --font: ui-rounded, "SF Pro Rounded", "Nunito", "Quicksand", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; }
html, body { margin: 0; height: 100%; }
body {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: var(--cream);
  color: var(--cocoa);
  font-family: var(--font);
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -webkit-user-select: none; user-select: none;
  overscroll-behavior: none;
  touch-action: manipulation;
}
input, textarea { -webkit-user-select: text; user-select: text; }
h1, h2, h3 { margin: 0; font-weight: 900; letter-spacing: -.2px; }
h1 { font-size: 26px; }
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; }

#app { height: 100%; height: 100dvh; display: flex; flex-direction: column; opacity: 0; transition: opacity .25s; }
body.ready #app { opacity: 1; }
body.ready #splash { opacity: 0; pointer-events: none; }
#splash {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 50;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--cream); transition: opacity .3s; font-weight: 900; font-size: 22px;
}
.splash-mark { width: 96px; height: 96px; border-radius: 28px; background: var(--tomato); display: flex; align-items: center; justify-content: center; font-size: 52px; box-shadow: var(--shadow); animation: bob 1.2s ease-in-out infinite; }

/* ----- chibi ----- */
.chibi { width: 100%; height: 100%; display: block; overflow: visible; }
.cb-bounce { transform-origin: 50% 100%; animation: bob 1.7s ease-in-out infinite; }
.cb-eye { transform-box: fill-box; transform-origin: center; animation: blink 4.5s infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0) scale(1, 1); } 50% { transform: translateY(-3%) scale(1.02, .98); } }
@keyframes blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }

/* ----- controls ----- */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 20px; border-radius: 16px; font-weight: 800; font-size: 16px; transition: transform .08s, box-shadow .08s; }
.btn-block { display: flex; width: 100%; }
.btn-primary { background: var(--tomato); color: #fff; box-shadow: 0 5px 0 var(--tomato-d); }
.btn-primary:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--tomato-d); }
.btn-soft { background: #fff; border: 2px solid var(--line); box-shadow: 0 4px 0 var(--line); }
.btn-soft:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--line); }
.btn-ghost { background: rgba(91, 58, 41, .08); }
.btn-link { color: var(--cocoa-l); min-height: 40px; font-weight: 700; text-decoration: underline; }
.btn:disabled { opacity: .5; }
.field { display: block; width: 100%; height: 50px; padding: 0 16px; margin-bottom: 12px; border-radius: 16px; border: 2px solid var(--line); background: #fff; font: inherit; font-size: 16px; color: var(--cocoa); outline: none; -webkit-appearance: none; appearance: none; }
.field:focus { border-color: var(--honey); }
.muted { color: var(--cocoa-l); margin: 6px 0 0; }
.lbl { display: block; font-weight: 800; margin: 16px 0 8px; font-size: 14px; color: var(--cocoa-l); }
.form-err { color: var(--tomato-d); font-weight: 700; min-height: 20px; margin: -4px 0 8px; font-size: 14px; }
.or { display: flex; align-items: center; margin: 18px 0; color: var(--cocoa-l); font-size: 13px; font-weight: 700; }
.or::before, .or::after { content: ""; flex: 1; height: 2px; background: var(--line); }
.or span { padding: 0 12px; }
.seg { display: flex; background: rgba(91, 58, 41, .09); border-radius: 16px; padding: 4px; margin-bottom: 16px; }
.seg button { flex: 1; height: 42px; border-radius: 12px; font-weight: 800; color: var(--cocoa-l); }
.seg button.on { background: #fff; color: var(--cocoa); box-shadow: 0 2px 0 var(--line); }

/* ----- auth / gate / onboarding ----- */
.screen-auth, .screen-gate { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: calc(var(--sat) + 20px) 24px calc(var(--sab) + 24px); }
.auth { width: 100%; max-width: 420px; margin: 0 auto; }
.auth-head { text-align: center; margin-bottom: 18px; }
.auth-chef { width: 104px; height: 140px; margin: 0 auto 6px; }
.lang-row { text-align: center; margin-top: 8px; }
.onboard { text-align: center; }
.onboard .lbl { text-align: left; }
.onboard-chef { width: 130px; height: 176px; margin: 0 auto 8px; }
.onboard .btn-block { margin-top: 18px; }
.gate { width: 100%; max-width: 420px; margin: auto; text-align: center; }
.gate-chef { width: 110px; height: 150px; margin: 0 auto 10px; }
.steps { list-style: none; padding: 0; margin: 22px 0; text-align: left; }
.steps li { display: flex; align-items: center; background: #fff; border-radius: 16px; padding: 12px 14px; margin-bottom: 10px; font-weight: 700; box-shadow: 0 3px 0 var(--line); }
.step-n { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--honey); display: inline-flex; align-items: center; justify-content: center; font-weight: 900; margin-right: 12px; }
.share-ico { display: inline-block; margin-left: 6px; padding: 0 6px; border: 2px solid var(--cocoa-l); border-radius: 6px; font-size: 13px; }
.warn { background: #FFE8B8; border-radius: 12px; padding: 10px 12px; font-weight: 700; font-size: 14px; }

/* ----- game shell ----- */
.screen-game { background: var(--cream); }
.game { display: flex; flex-direction: column; height: 100%; }
.topbar { flex: none; padding: calc(var(--sat) + 10px) 16px 10px; display: flex; align-items: center; justify-content: space-between; }
.shopname { font-weight: 900; font-size: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 42%; }
.chips { display: flex; }
.chip { display: inline-flex; align-items: center; background: #fff; border-radius: 999px; padding: 5px 11px; margin-left: 6px; font-weight: 900; font-size: 14px; box-shadow: 0 3px 0 var(--line); }
.chip i { font-style: normal; margin-right: 4px; }
.chip-day { background: var(--honey); }
.pane { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 4px 16px 16px; }
.tabbar { flex: none; display: flex; background: var(--paper); border-top: 2px solid var(--line); padding: 6px 6px calc(var(--sab) + 6px); }
.tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 6px 0; border-radius: 14px; color: var(--cocoa-l); font-size: 11px; font-weight: 800; }
.tabbar i { font-style: normal; font-size: 24px; line-height: 1.1; filter: grayscale(.6); transition: transform .15s; }
.tabbar button.on { color: var(--tomato-d); background: rgba(255, 107, 87, .1); }
.tabbar button.on i { filter: none; transform: translateY(-2px) scale(1.1); }

/* ----- scene ----- */
.scene { position: relative; height: min(50vh, 400px); min-height: 300px; border-radius: 28px; overflow: hidden; background: #FFE9C2; border: 3px solid var(--line); }
.wall { position: absolute; top: 0; left: 0; right: 0; height: 58%; background: linear-gradient(#FFD9A8, #FFEBC7); }
.win { position: absolute; top: 22%; left: 8%; width: 26%; height: 36%; border-radius: 16px; background: linear-gradient(#9AD8FF, #D8F1FF); border: 5px solid #fff; box-shadow: 0 3px 0 var(--line); }
.sign { position: absolute; top: 8%; left: 50%; transform: translateX(-50%); background: var(--tomato); color: #fff; padding: 6px 16px; border-radius: 12px; font-weight: 900; font-size: 15px; white-space: nowrap; max-width: 80%; overflow: hidden; text-overflow: ellipsis; box-shadow: 0 4px 0 var(--tomato-d); }
.lamp { position: absolute; top: 0; width: 4px; height: 16%; background: var(--cocoa-l); }
.lamp::after { content: ""; position: absolute; bottom: -12px; left: -12px; width: 28px; height: 20px; border-radius: 14px 14px 4px 4px; background: var(--honey); box-shadow: 0 0 22px 6px rgba(255, 201, 77, .55); }
.l1 { left: 30%; } .l2 { right: 22%; }
.floor { position: absolute; left: 0; right: 0; bottom: 0; height: 42%; background: conic-gradient(#F6D9A8 25%, #EDC688 0 50%, #F6D9A8 0 75%, #EDC688 0) 0 0 / 56px 56px; border-top: 4px solid #D9A35F; }
.counter { position: absolute; left: 14%; right: 14%; bottom: 7%; height: 20%; border-radius: 18px; background: #A8683D; border-top: 8px solid #D89B62; box-shadow: 0 6px 0 rgba(91, 58, 41, .22); }
.chef-btn { position: absolute; left: 50%; bottom: 17%; width: 38%; max-width: 170px; aspect-ratio: 100 / 136; transform: translateX(-50%); z-index: 3; }
.chef-btn.pop { animation: pop .28s ease-out; }
@keyframes pop { 0% { transform: translateX(-50%) scale(1); } 40% { transform: translateX(-50%) scale(1.14, .9); } 100% { transform: translateX(-50%) scale(1); } }
.cust { position: absolute; width: 17%; aspect-ratio: 100 / 136; bottom: 30%; z-index: 1; }
.cust .chibi { animation-delay: .4s; }
.c1 { left: 5%; } .c2 { right: 5%; }
.c2 .chibi { animation-delay: 1s; }
.floaters { position: absolute; left: 0; right: 0; top: 0; bottom: 0; pointer-events: none; z-index: 4; }
.floater { position: absolute; top: 34%; font-weight: 900; font-size: 20px; color: #fff; text-shadow: 0 2px 0 var(--cocoa), 0 0 6px var(--cocoa); animation: floatup .9s ease-out forwards; }
@keyframes floatup { from { transform: translateY(0); opacity: 1; } to { transform: translateY(-70px); opacity: 0; } }
.info-card { display: flex; justify-content: space-between; background: #fff; border-radius: 18px; padding: 14px 16px; margin-top: 14px; font-weight: 700; box-shadow: 0 4px 0 var(--line); }
.hint { text-align: center; color: var(--cocoa-l); font-weight: 700; font-size: 14px; }

/* ----- placeholder tabs ----- */
.soon { text-align: center; padding-top: 28px; }
.soon-chef { width: 110px; height: 150px; margin: 0 auto 10px; }
.badge { display: inline-block; margin-top: 10px; background: var(--honey); border-radius: 999px; padding: 4px 14px; font-weight: 900; font-size: 13px; }
.soon .muted { max-width: 300px; margin: 14px auto 0; }

/* ----- settings ----- */
.list { max-width: 520px; margin: 0 auto; }
.sect { margin: 20px 4px 8px; font-size: 13px; font-weight: 900; color: var(--cocoa-l); text-transform: uppercase; letter-spacing: .5px; }
.row { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 52px; padding: 10px 16px; margin-bottom: 8px; background: #fff; border-radius: 16px; font-weight: 800; text-align: left; box-shadow: 0 3px 0 var(--line); }
.row small { color: var(--cocoa-l); font-weight: 700; font-size: 13px; }
.row em { font-style: normal; color: var(--cocoa-l); }
.btn-row:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--line); }
.danger { color: var(--tomato-d); }

/* ----- modal / toast ----- */
.modal-back { position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(60, 30, 10, .45); opacity: 0; transition: opacity .2s; }
.modal-back.show { opacity: 1; }
.modal { width: 100%; max-width: 340px; background: var(--paper); border-radius: 26px; padding: 22px 20px 18px; text-align: center; box-shadow: 0 10px 0 rgba(91, 58, 41, .2); transform: scale(.92); transition: transform .2s; }
.modal-back.show .modal { transform: scale(1); }
.modal h3 { font-size: 20px; margin-bottom: 8px; }
.modal p, .modal-body { margin: 0 0 14px; color: var(--cocoa-l); font-weight: 700; }
.modal-body b { color: var(--tomato-d); }
.modal-chef { width: 84px; height: 114px; margin: -4px auto 6px; }
.modal-actions { display: flex; }
.modal-actions .btn { flex: 1; margin-left: 8px; padding: 0 10px; }
.modal-actions .btn:first-child { margin-left: 0; }
#toast { position: fixed; left: 50%; bottom: calc(var(--sab) + 96px); z-index: 70; transform: translate(-50%, 20px); max-width: 86%; background: var(--cocoa); color: #fff; padding: 12px 18px; border-radius: 16px; font-weight: 800; font-size: 14px; text-align: center; opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  .cb-bounce, .cb-eye, .splash-mark { animation: none; }
}
@media (min-width: 700px) {
  #app { max-width: 520px; margin: 0 auto; }
  body { background: #F3DCB4; }
}

.coin { display: inline-block; width: 1em; height: 1em; vertical-align: -.15em; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #FFF3B0 0 18%, #FFC94D 45%, #E9A100 100%); border: 2px solid #C98400; box-shadow: inset 0 -2px 0 rgba(150, 90, 0, .35); }

/* ===== Phase 1 ===== */
.btn-lg { min-height: 56px; font-size: 18px; margin-top: 8px; }
.btn-sm { min-height: 38px; padding: 0 12px; font-size: 14px; border-radius: 12px; }
.star { color: rgba(91, 58, 41, .2); font-size: 22px; }
.star.on { color: #FFB020; text-shadow: 0 1px 0 #C98400; }
.stat-row { display: flex; margin-top: 12px; }
.stat { flex: 1; margin-left: 8px; background: #fff; border-radius: 16px; padding: 8px 10px; box-shadow: 0 3px 0 var(--line); text-align: center; }
.stat:first-child { margin-left: 0; }
.stat small { display: block; color: var(--cocoa-l); font-weight: 800; font-size: 11px; }
.stat b { font-size: 18px; }
.warn-card { margin: 12px 0 4px; background: #FFE8B8; border-radius: 14px; padding: 10px 14px; font-weight: 800; font-size: 14px; }

.svc-top { display: flex; align-items: center; }
.progress { flex: 1; height: 14px; background: rgba(91, 58, 41, .12); border-radius: 8px; overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--mint); border-radius: 8px; transition: width .6s linear; }
.speed { display: flex; margin-left: 10px; }
.sp { min-width: 38px; height: 34px; margin-left: 5px; border-radius: 10px; background: #fff; font-weight: 900; font-size: 13px; box-shadow: 0 2px 0 var(--line); }
.sp.on { background: var(--honey); }
.svc-stats { display: flex; margin: 10px 0 4px; }
.svc-stats div { flex: 1; text-align: center; background: #fff; margin-left: 8px; border-radius: 14px; padding: 6px 4px; box-shadow: 0 3px 0 var(--line); }
.svc-stats div:first-child { margin-left: 0; }
.svc-stats small { display: block; color: var(--cocoa-l); font-size: 11px; font-weight: 800; }
.svc-stats b { font-size: 17px; }
.lbl-s { margin: 12px 2px 6px; font-size: 12px; font-weight: 900; color: var(--cocoa-l); text-transform: uppercase; letter-spacing: .4px; }
.queue { display: flex; align-items: flex-end; min-height: 56px; padding: 4px 8px; background: rgba(255, 255, 255, .55); border-radius: 16px; overflow: hidden; }
.q-cust { flex: none; width: 34px; height: 46px; margin-right: 4px; }
.muted-s { color: var(--cocoa-l); font-weight: 700; font-size: 13px; align-self: center; }
.seats { display: flex; flex-wrap: wrap; margin: 10px -4px 0; }
.seat { position: relative; width: calc(25% - 8px); margin: 4px; height: 84px; border-radius: 18px; background: #F3D7A6; border: 3px dashed rgba(91, 58, 41, .18); display: flex; align-items: center; justify-content: center; }
.seat.occ { border-style: solid; background: #FFE9C2; }
.seat.dirty { background: #E9D2B0; }
.seat-cust { width: 38px; height: 52px; }
.seat-badge { position: absolute; top: -8px; right: -4px; font-size: 18px; background: #fff; border-radius: 50%; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 0 var(--line); }
.pbar { position: absolute; left: 8px; right: 8px; bottom: 5px; height: 6px; background: rgba(91, 58, 41, .15); border-radius: 4px; overflow: hidden; }
.pbar i { display: block; height: 100%; background: var(--mint); }
.pbar.urgent i { background: var(--tomato); }
.crew { display: flex; overflow-x: auto; -webkit-overflow-scrolling: touch; padding: 4px 2px 8px; }
.crew-chip { position: relative; flex: none; width: 66px; margin-right: 8px; padding: 6px 4px 4px; background: #fff; border-radius: 16px; text-align: center; box-shadow: 0 3px 0 var(--line); }
.crew-chip.slack { background: #E7E1FF; animation: nudge .5s ease-in-out infinite alternate; }
@keyframes nudge { from { transform: rotate(-2deg); } to { transform: rotate(2deg); } }
.crew-face { width: 36px; height: 48px; margin: 0 auto; }
.crew-role { position: absolute; top: 4px; left: 6px; font-size: 13px; }
.crew-st { position: absolute; top: 4px; right: 6px; font-size: 14px; }
.crew-chip small { display: block; font-weight: 800; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log { margin-top: 6px; min-height: 76px; font-size: 13px; font-weight: 700; color: var(--cocoa-l); }
.log div { padding: 3px 4px; }
.log div:first-child { color: var(--cocoa); }

.summary { max-width: 460px; margin: 0 auto; text-align: center; }
.summary h2 { margin: 8px 0 2px; }
.sum-stars { margin-bottom: 10px; }
.sum-stars small { margin-left: 8px; font-weight: 900; color: var(--cocoa-l); }
.sum-row { display: flex; justify-content: space-between; align-items: center; background: #fff; border-radius: 14px; padding: 10px 14px; margin-bottom: 6px; font-weight: 700; box-shadow: 0 3px 0 var(--line); }
.sum-row.sub { margin-left: 18px; font-size: 13px; color: var(--cocoa-l); padding: 6px 12px; }
.sum-row.net { font-size: 18px; background: #E7F8F1; }
.sum-row.net.bad { background: #FFE3DE; }
.net.good b { color: #1E9E77; } .net.bad b { color: var(--tomato-d); }
.sum-sep { height: 8px; }
.gem-note { margin: 10px 0 4px; font-weight: 900; color: #7C4DDB; }

.staff-card { display: flex; background: #fff; border-radius: 20px; padding: 12px; margin-bottom: 10px; border: 3px solid var(--rar, var(--line)); box-shadow: 0 4px 0 var(--line); text-align: left; }
.staff-face { flex: none; width: 66px; height: 90px; margin-right: 12px; }
.staff-info { flex: 1; min-width: 0; }
.staff-head { display: flex; align-items: center; justify-content: space-between; }
.rar { background: var(--rar); color: #fff; border-radius: 999px; padding: 1px 10px; font-size: 11px; font-weight: 900; }
.staff-sub { font-size: 13px; font-weight: 800; color: var(--cocoa-l); margin: 2px 0; }
.quirk { font-size: 12px; font-weight: 700; color: var(--cocoa-l); margin-bottom: 6px; }
.quirk b { color: var(--cocoa); }
.stat-bar { display: flex; align-items: center; font-size: 11px; font-weight: 800; margin-bottom: 3px; }
.stat-bar span { width: 62px; color: var(--cocoa-l); }
.stat-bar div { flex: 1; height: 7px; background: rgba(91, 58, 41, .12); border-radius: 4px; overflow: hidden; }
.stat-bar i { display: block; height: 100%; background: var(--rar, var(--mint)); }
.stat-bar b { width: 18px; text-align: right; }
.staff-info .btn-sm { margin-top: 6px; }
.modal .staff-card { margin: 0 0 14px; box-shadow: none; }
.hire-card { display: flex; align-items: center; flex-wrap: wrap; background: #fff; border-radius: 18px; padding: 12px; margin-bottom: 10px; box-shadow: 0 4px 0 var(--line); }
.hire-ico { font-size: 30px; width: 44px; text-align: center; }
.hire-info { flex: 1; min-width: 0; }
.hire-info small { display: block; color: var(--cocoa-l); font-weight: 700; font-size: 12px; }
.hire-btns { display: flex; width: 100%; margin-top: 10px; }
.hire-btns .btn { flex: 1; margin-left: 8px; padding: 0 6px; }
.hire-btns .btn:first-child { margin-left: 0; }

.dish { display: flex; align-items: center; flex-wrap: wrap; background: #fff; border-radius: 18px; padding: 10px 12px; margin-bottom: 8px; box-shadow: 0 3px 0 var(--line); }
.dish.locked { opacity: .75; }
.dish.off { background: #F1E8D8; }
.dish-ico { font-size: 30px; width: 44px; text-align: center; }
.dish-info { flex: 1; min-width: 0; }
.dish-info b { display: block; }
.dish-info small { display: block; font-size: 12px; font-weight: 700; color: var(--cocoa-l); }
.tone-good { color: #1E9E77 !important; } .tone-cheap { color: #D08A00 !important; } .tone-hot { color: var(--tomato-d) !important; }
.stepper { display: flex; align-items: center; width: 100%; margin-top: 8px; justify-content: space-between; }
.stepper button { min-width: 44px; height: 40px; border-radius: 12px; background: rgba(91, 58, 41, .09); font-weight: 900; }
.stepper button:active { background: var(--honey); }
.stepper output { flex: 1; text-align: center; font-weight: 900; font-size: 20px; }
.modal-body .staff-card b { color: inherit; font-size: inherit; }
.modal-body .staff-card .rar { color: #fff; }

/* ===== Phase 2: quán chạy liên tục, nâng cấp, bếp ===== */
.gear { margin-left: 6px; width: 36px; height: 36px; border-radius: 50%; background: #fff; font-size: 18px; box-shadow: 0 3px 0 var(--line); }
.reg-card { background: #fff; border-radius: 20px; padding: 12px 14px; box-shadow: 0 4px 0 var(--line); }
.reg-card.full { background: #FFF2CC; }
.reg-top { display: flex; align-items: center; }
.reg-ico { font-size: 30px; margin-right: 10px; }
.reg-info { flex: 1; min-width: 0; margin-right: 10px; }
.reg-bar { height: 12px; margin-top: 4px; background: rgba(91, 58, 41, .12); border-radius: 8px; overflow: hidden; }
.reg-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #FFC94D, #FF9F2E); border-radius: 8px; transition: width .5s; }
.reg-amt { margin-top: 6px; font-weight: 800; font-size: 14px; color: var(--cocoa-l); }
.reg-full { color: var(--tomato-d); }
.alert { display: block; width: 100%; margin-top: 8px; padding: 10px 14px; border-radius: 14px; background: #E7E1FF; font-weight: 800; font-size: 14px; text-align: left; }
.alert.bad { background: #FFDAD3; color: var(--tomato-d); }

.builders { display: flex; align-items: center; justify-content: space-between; background: #fff; border-radius: 18px; padding: 12px 14px; box-shadow: 0 4px 0 var(--line); }
.builders small { display: block; color: var(--cocoa-l); font-weight: 700; font-size: 12px; }
.builders .btn { margin-left: 10px; text-align: center; line-height: 1.2; padding: 6px 10px; }
.up-card, .dur-card { display: flex; align-items: center; flex-wrap: wrap; background: #fff; border-radius: 18px; padding: 10px 12px; margin-bottom: 8px; box-shadow: 0 3px 0 var(--line); }
.up-card.busy { background: #FFF6DC; }
.up-ico { flex: none; width: 46px; font-size: 28px; text-align: center; }
.up-info { flex: 1; min-width: 0; }
.up-info small { display: block; font-size: 12px; font-weight: 700; color: var(--cocoa-l); }
.up-info .nx { color: #1E9E77; }
.lv { display: inline-block; background: var(--honey); border-radius: 999px; padding: 0 8px; font-size: 11px; font-weight: 900; margin-left: 4px; }
.prog { height: 9px; margin: 5px 0 3px; background: rgba(91, 58, 41, .12); border-radius: 6px; overflow: hidden; }
.prog i { display: block; height: 100%; background: var(--mint); border-radius: 6px; transition: width 1s linear; }
.prog.dur i { background: #5FD3B0; }
.prog.dur i.low { background: var(--tomato); }
.up-btn { margin-left: 8px; text-align: center; line-height: 1.15; padding: 4px 10px; min-width: 84px; }
.up-btn small { font-size: 11px; opacity: .85; }
.why { width: 100%; margin-top: 6px; font-size: 12px; font-weight: 800; color: var(--tomato-d); text-align: right; }
.dur-card.broken { background: #FFE9E5; }

.eff-card { display: flex; align-items: center; justify-content: space-between; border-radius: 18px; padding: 12px 16px; box-shadow: 0 4px 0 var(--line); background: #E7F8F1; }
.eff-card.mid { background: #FFF2CC; } .eff-card.bad { background: #FFE3DE; }
.eff-card small { display: block; font-weight: 800; color: var(--cocoa-l); font-size: 12px; }
.eff-card b { font-size: 30px; }
.eff-d { max-width: 55%; font-size: 12px; font-weight: 700; color: var(--cocoa-l); text-align: right; }
.kgrid { display: grid; grid-template-columns: repeat(var(--cols), 1fr); grid-gap: 6px; padding: 8px; background: #F3D7A6; border-radius: 20px; border: 3px solid rgba(91, 58, 41, .15); }
.cell { position: relative; aspect-ratio: 1 / 1; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-direction: column; background: rgba(255, 255, 255, .45); }
.cell.empty:active { background: var(--honey); }
.cell.door { background: #B57B4A; color: #fff; font-size: 22px; }
.cell.door small { font-size: 10px; font-weight: 900; }
.cell.item { background: #fff; box-shadow: 0 3px 0 var(--line); }
.cell.item.sel { outline: 4px solid var(--tomato); transform: scale(1.06); z-index: 2; }
.cell.item.broken { background: #FFDAD3; }
.cell.item.building { opacity: .6; border: 2px dashed var(--cocoa-l); }
.ci { font-size: 26px; }
.cell em { position: absolute; right: 3px; bottom: 1px; font-style: normal; font-weight: 900; font-size: 11px; background: var(--honey); border-radius: 8px; padding: 0 5px; }
.smoke { position: absolute; top: -6px; left: 2px; font-style: normal; font-size: 16px; }
.sup-row { display: flex; }
.sup { flex: 1; margin-left: 8px; background: #fff; border-radius: 16px; padding: 10px 4px; box-shadow: 0 3px 0 var(--line); font-weight: 800; }
.sup:first-child { margin-left: 0; }
.sup span { display: block; font-size: 26px; }
.sup.on { background: var(--honey); }
.chip { white-space: nowrap; padding: 5px 9px; }
.chips { flex-shrink: 0; }
.shopname { max-width: 34%; }
.up-btn, .dur-card .btn, .builders .btn { display: inline-block; line-height: 1.2; padding: 6px 10px; min-height: 0; text-align: center; }

/* ===== Phase 3 ===== */
.alert.good { background: #DDF6EA; color: #1E7F60; }
.alert.fire { animation: nudge .4s ease-in-out infinite alternate; }
div.alert { cursor: default; }
.seat-tag { position: absolute; top: -8px; left: -4px; font-size: 15px; background: #fff; border-radius: 50%; width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 0 var(--line); }
.seat.flee { background: #FFE0DA; border-color: var(--tomato); animation: nudge .3s ease-in-out infinite alternate; }
.flee-hint { position: absolute; left: 0; right: 0; bottom: 4px; text-align: center; font-size: 10px; font-weight: 900; color: var(--tomato-d); }
.loy { display: flex; align-items: center; font-size: 11px; font-weight: 800; margin: 4px 0; }
.loy span { width: 62px; color: var(--cocoa-l); }
.loy .prog { flex: 1; margin: 0; }
.loy b { width: 24px; text-align: right; }
.loy-warn { font-size: 12px; font-weight: 900; color: var(--tomato-d); margin-bottom: 2px; }
.treat { display: flex; margin-top: 4px; }
.treat .btn { flex: 1; margin-left: 5px; padding: 4px 2px; min-height: 0; font-size: 12px; line-height: 1.15; display: inline-block; text-align: center; }
.treat .btn:first-child { margin-left: 0; }
.treat .btn small { font-size: 10px; opacity: .8; }
.away-notes { margin-top: 10px; text-align: left; font-size: 12px; }
.away-notes small { display: block; font-weight: 900; margin-bottom: 2px; }
.away-notes div { color: var(--cocoa); margin-top: 2px; }
