/* ============================================================
   SolVet Tycoon — style
   Brand: slate #526366 · gold #b9996d · cream #f1ebde
   Font: deuterium-variable (Typekit, same kit as solveterinary.com)
   ============================================================ */

:root {
  --slate: #526366;
  --slate-deep: #3b4a4d;
  --slate-ink: #2c3a3d;
  --gold: #b9996d;
  --gold-soft: #d3b48c;
  --gold-deep: #96794f;
  --cream: #f1ebde;
  --cream-dim: #ddd4c0;
  --sand: #e7dfcc;
  --good: #7fa98c;
  --bad: #c96f5f;
  --warn: #d0a34f;
  --rad: 18px;
  --rad-sm: 12px;
  --shadow: 0 10px 30px rgba(28, 38, 40, 0.35);
  --font: "deuterium-variable", "Century Gothic", "Gill Sans", ui-sans-serif, system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--slate);
  color: var(--cream);
  font-family: var(--font);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  background:
    radial-gradient(1100px 500px at 85% -10%, rgba(185, 153, 109, 0.16), transparent 60%),
    radial-gradient(900px 600px at -10% 110%, rgba(241, 235, 222, 0.07), transparent 55%),
    var(--slate);
  overflow-x: hidden;
}

button {
  font-family: inherit;
  border: none;
  cursor: pointer;
  color: inherit;
  touch-action: manipulation;
}

.noanim, .noanim * { animation: none !important; }

button:disabled { cursor: not-allowed; opacity: 0.45; }

::selection { background: var(--gold); color: var(--slate-ink); }

/* ------------------------------------------------------------ scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(241, 235, 222, 0.18); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: rgba(241, 235, 222, 0.3); }

/* ------------------------------------------------------------ typography */
h1, h2, h3 { font-weight: 600; letter-spacing: 0.01em; }
.mono { font-variant-numeric: tabular-nums; }

.small { font-size: 0.8rem; opacity: 0.75; }
.tiny { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.12em; opacity: 0.6; font-weight: 600; }

/* ============================================================ title screen */
.title-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 26px;
  text-align: center;
  padding: 32px 20px;
  position: relative;
  animation: fadeIn 0.7s ease both;
}

.sun-big {
  width: 96px; height: 96px;
  animation: sunSpin 60s linear infinite;
  filter: drop-shadow(0 6px 22px rgba(185, 153, 109, 0.5));
}

@keyframes sunSpin { to { transform: rotate(360deg); } }

.title-name {
  font-size: clamp(2.6rem, 9vw, 4.6rem);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: 0.02em;
  background: linear-gradient(180deg, var(--cream) 30%, var(--gold-soft));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.title-sub {
  font-size: clamp(0.95rem, 2.6vw, 1.2rem);
  color: var(--gold-soft);
  max-width: 560px;
  line-height: 1.5;
}

.title-buttons { display: flex; flex-direction: column; gap: 12px; width: min(320px, 84vw); margin-top: 10px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  padding: 12px 22px;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.15s ease, color 0.15s ease;
  user-select: none;
}

.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(1px) scale(0.98); }

.btn-gold { background: var(--gold); color: var(--slate-ink); }
.btn-gold:hover:not(:disabled) { background: var(--gold-soft); }
.btn-cream { background: var(--cream); color: var(--slate); }
.btn-cream:hover:not(:disabled) { background: #fffaf0; }
.btn-ghost { background: transparent; color: var(--cream); border: 1.5px solid rgba(241, 235, 222, 0.35); }
.btn-ghost:hover:not(:disabled) { border-color: var(--gold); color: var(--gold-soft); }
.btn-danger { background: var(--bad); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #d97f6e; }

/* ============================================================ game shell */
.game-shell { min-height: 100vh; display: flex; flex-direction: column; }

.header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(59, 74, 77, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(241, 235, 222, 0.12);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.brand { display: flex; align-items: center; gap: 9px; margin-right: 4px; }
.brand svg { width: 30px; height: 30px; flex: none; }
.brand-name { font-size: 1.05rem; font-weight: 700; letter-spacing: 0.03em; white-space: nowrap; }
.brand-name span { color: var(--gold-soft); }

.daybox {
  background: var(--slate-deep);
  border: 1px solid rgba(241, 235, 222, 0.14);
  border-radius: 12px;
  padding: 5px 12px;
  text-align: center;
  min-width: 76px;
}
.daybox .d { font-size: 1.15rem; font-weight: 700; line-height: 1; }
.daybox .l { font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.14em; opacity: 0.7; }

.stat {
  display: flex; flex-direction: column;
  padding: 4px 12px;
  border-left: 1px solid rgba(241, 235, 222, 0.12);
  min-width: 96px;
}
.stat .k { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.12em; opacity: 0.62; font-weight: 600; }
.stat .v { font-size: 1.02rem; font-weight: 700; white-space: nowrap; }
.stat .v small { font-size: 0.72rem; opacity: 0.7; font-weight: 500; }
.stat .v.pos { color: var(--good); }
.stat .v.neg { color: var(--bad); }

.meter {
  display: flex; flex-direction: column; gap: 3px;
  padding: 4px 12px;
  border-left: 1px solid rgba(241, 235, 222, 0.12);
  min-width: 130px;
}
.meter .row { display: flex; justify-content: space-between; align-items: baseline; }
.meter .k { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.12em; opacity: 0.62; font-weight: 600; }
.meter .val { font-size: 0.85rem; font-weight: 700; }
.meter .bar { height: 7px; border-radius: 6px; background: rgba(241, 235, 222, 0.12); overflow: hidden; }
.meter .fill { height: 100%; border-radius: 6px; transition: width 0.5s ease, background 0.4s ease; }

.header-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.icon-btn {
  background: transparent;
  border: 1px solid rgba(241, 235, 222, 0.25);
  border-radius: 10px;
  width: 38px; height: 38px;
  font-size: 1.05rem;
  display: inline-flex; align-items: center; justify-content: center;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.icon-btn:hover { border-color: var(--gold); background: rgba(185, 153, 109, 0.15); }

.sell-btn {
  position: relative;
  background: var(--gold);
  color: var(--slate-ink);
  border-radius: 999px;
  font-weight: 700;
  padding: 9px 20px;
  font-size: 0.92rem;
  transition: transform 0.12s ease, background 0.15s ease;
}
.sell-btn:hover { background: var(--gold-soft); transform: translateY(-1px); }
.sell-btn.pulse { animation: sellPulse 1.6s ease infinite; }
@keyframes sellPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(185, 153, 109, 0.55); }
  50% { box-shadow: 0 0 0 9px rgba(185, 153, 109, 0); }
}
.sell-btn .dot {
  position: absolute; top: -4px; right: -4px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--bad); border: 2px solid var(--slate);
}

/* ------------------------------------------------------------ layout */
.main {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr);
  gap: 16px;
  padding: 16px;
  max-width: 1500px;
  width: 100%;
  margin: 0 auto;
}

.panel {
  background: rgba(241, 235, 222, 0.055);
  border: 1px solid rgba(241, 235, 222, 0.12);
  border-radius: var(--rad);
  padding: 16px;
}

.panel h3 {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  opacity: 0.65;
  margin-bottom: 12px;
  font-weight: 700;
}

/* waiting room */
/* Waiting room is a churn zone — pets arrive/leave constantly. Cap it and
   let it scroll INSIDE on every viewport so the page below never reflows
   (this was the desktop jank: the left column grew with every arrival and
   pushed the feed + everything else around). */
.waiting { min-height: 280px; max-height: 520px; overflow-y: auto; contain: layout paint; overscroll-behavior: contain; }
.waiting .empty {
  text-align: center;
  padding: 44px 16px;
  opacity: 0.55;
  font-style: italic;
  line-height: 1.6;
}
.pet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 10px;
}
.pet {
  background: var(--cream);
  color: var(--slate-ink);
  border-radius: var(--rad-sm);
  padding: 12px 10px 10px;
  text-align: center;
  cursor: pointer;
  position: relative;
  transition: transform 0.1s ease, box-shadow 0.15s ease;
  box-shadow: 0 3px 10px rgba(20, 28, 30, 0.3);
  animation: petIn 0.28s ease both;
  user-select: none;
}
@keyframes petIn { from { transform: scale(0.85) translateY(6px); opacity: 0; } }
.pet:hover { transform: translateY(-3px) scale(1.02); box-shadow: 0 8px 18px rgba(20, 28, 30, 0.4); }
.pet:active { transform: scale(0.96); }
.pet .pet-emoji { font-size: 2.1rem; display: block; line-height: 1.15; }
.pet .pet-name { font-weight: 700; font-size: 0.9rem; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pet .pet-fee { font-size: 0.78rem; opacity: 0.75; font-weight: 600; }
.pet .patience { height: 5px; border-radius: 4px; background: rgba(82, 99, 102, 0.2); margin-top: 7px; overflow: hidden; }
.pet .patience .fill { height: 100%; border-radius: 4px; background: var(--gold); transition: width 0.3s linear, background 0.3s; }
.pet .patience .fill.low { background: var(--bad); }
.pet.urgent { outline: 2px solid var(--bad); }
.pet .flavor { display: none; }

.queue-warn {
  margin-top: 10px;
  background: rgba(201, 111, 95, 0.16);
  border: 1px solid rgba(201, 111, 95, 0.4);
  color: #e8b3a9;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 0.82rem;
}

/* team auto-treatment status strip */
.auto-strip {
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 0.82rem;
  line-height: 1.45;
  margin-bottom: 12px;
}
.auto-strip.warn { background: rgba(201, 111, 95, 0.12); border: 1px solid rgba(201, 111, 95, 0.35); color: #e8b3a9; }
.auto-strip.ok { background: rgba(127, 169, 140, 0.12); border: 1px solid rgba(127, 169, 140, 0.35); color: var(--good); }
.auto-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.auto-title { font-weight: 700; font-size: 0.9rem; }
.auto-rate { font-weight: 700; }
.auto-strip.warn .auto-rate { color: #e8b3a9; }
.auto-strip.ok .auto-rate { color: var(--good); }
.auto-body { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 3px; opacity: 0.9; }
.auto-who { opacity: 0.65; font-size: 0.74rem; }
.auto-status { margin-top: 5px; font-size: 0.8rem; }

/* feed */
.feed { margin-top: 16px; contain: layout paint; }
.feed-list { display: flex; flex-direction: column; gap: 5px; max-height: 300px; overflow-y: auto; padding-right: 4px; }
.feed-item {
  display: flex; gap: 8px; align-items: baseline;
  font-size: 0.84rem;
  line-height: 1.35;
  padding: 5px 8px;
  border-radius: 8px;
  animation: slideIn 0.25s ease both;
}
.feed-item .d { font-size: 0.66rem; opacity: 0.5; flex: none; font-weight: 700; width: 26px; }
.feed-item .cat {
  flex: none; font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.08em;
  padding: 2px 7px; border-radius: 999px; font-weight: 700; margin-top: 1px;
}
.feed-item.cat-client .cat { background: rgba(127, 169, 140, 0.25); color: var(--good); }
.feed-item.cat-staff .cat { background: rgba(185, 153, 109, 0.28); color: var(--gold-soft); }
.feed-item.cat-finance .cat { background: rgba(201, 111, 95, 0.28); color: #e8b3a9; }
.feed-item.cat-pharma .cat { background: rgba(208, 163, 79, 0.28); color: var(--warn); }
.feed-item.cat-marketing .cat { background: rgba(127, 169, 140, 0.2); color: var(--good); }
.feed-item.cat-clinic .cat { background: rgba(241, 235, 222, 0.15); color: var(--cream-dim); }
.feed-item.new { background: rgba(241, 235, 222, 0.07); }
@keyframes slideIn { from { transform: translateX(14px); opacity: 0; } }

/* ------------------------------------------------------------ right rail */
.rail { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab {
  flex: 1;
  background: transparent;
  border: 1px solid rgba(241, 235, 222, 0.16);
  border-radius: 999px;
  padding: 8px 10px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--cream-dim);
  position: relative;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}
.tab:hover { border-color: var(--gold); color: var(--gold-soft); }
.tab.active { background: var(--gold); color: var(--slate-ink); border-color: var(--gold); }
.tab .badge {
  position: absolute; top: -5px; right: -2px;
  background: var(--bad); color: #fff;
  font-size: 0.6rem; font-weight: 700;
  border-radius: 999px; padding: 1px 6px;
  border: 2px solid var(--slate);
}

.rail-panel { display: none; }
.rail-panel.active { display: block; }

/* staff cards */
.staff-list { display: flex; flex-direction: column; gap: 9px; }
.staff-card {
  display: flex; gap: 10px; align-items: center;
  background: rgba(241, 235, 222, 0.06);
  border: 1px solid rgba(241, 235, 222, 0.1);
  border-radius: 14px;
  padding: 10px 12px;
}
.staff-card .av {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--slate-deep);
  border: 2px solid var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; flex: none;
}
.staff-card .info { flex: 1; min-width: 0; }
.staff-card .nm { font-weight: 700; font-size: 0.9rem; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.staff-card .role { font-size: 0.7rem; opacity: 0.65; }
.staff-card .quirk { font-size: 0.72rem; font-style: italic; opacity: 0.7; margin-top: 1px; }
.staff-card .mbar { height: 5px; border-radius: 4px; background: rgba(241, 235, 222, 0.12); margin-top: 5px; overflow: hidden; }
.staff-card .mbar .fill { height: 100%; border-radius: 4px; transition: width 0.5s ease, background 0.4s; }
.state-chip {
  font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700;
  padding: 2px 8px; border-radius: 999px;
}
.state-chip.working { background: rgba(127, 169, 140, 0.25); color: var(--good); }
.state-chip.out { background: rgba(201, 111, 95, 0.28); color: #e8b3a9; }
.state-chip.rest { background: rgba(208, 163, 79, 0.28); color: var(--warn); }

/* inbox items */
.inbox-list { display: flex; flex-direction: column; gap: 9px; }
.inbox-item {
  background: rgba(241, 235, 222, 0.06);
  border: 1px solid rgba(241, 235, 222, 0.1);
  border-radius: 14px;
  padding: 11px 12px;
}
.inbox-item .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.inbox-item .big { font-weight: 700; font-size: 1rem; }
.inbox-item .desc { font-size: 0.76rem; opacity: 0.72; margin-top: 2px; line-height: 1.35; }
.btn-row { display: flex; gap: 7px; margin-top: 9px; flex-wrap: wrap; }
.mini-btn {
  background: var(--slate-deep);
  border: 1px solid rgba(241, 235, 222, 0.18);
  color: var(--cream);
  border-radius: 999px;
  padding: 6px 13px;
  font-size: 0.78rem;
  font-weight: 600;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.mini-btn:hover:not(:disabled) { border-color: var(--gold); background: rgba(185, 153, 109, 0.2); }
.mini-btn.gold { background: var(--gold); color: var(--slate-ink); border-color: var(--gold); }
.mini-btn.gold:hover:not(:disabled) { background: var(--gold-soft); }
.mini-btn.danger { background: rgba(201, 111, 95, 0.2); border-color: rgba(201, 111, 95, 0.5); color: #e8b3a9; }

/* shop */
.shop-tabs { display: flex; gap: 5px; margin-bottom: 10px; flex-wrap: wrap; }
.shop-tab {
  background: transparent; border: 1px solid rgba(241, 235, 222, 0.15);
  color: var(--cream-dim); border-radius: 999px; padding: 5px 12px;
  font-size: 0.74rem; font-weight: 600;
  transition: all 0.15s ease;
}
.shop-tab.active { background: var(--cream); color: var(--slate); border-color: var(--cream); }
.shop-list { display: flex; flex-direction: column; gap: 9px; max-height: 560px; overflow-y: auto; padding-right: 4px; }
.shop-item {
  display: flex; gap: 11px; align-items: center;
  background: rgba(241, 235, 222, 0.06);
  border: 1px solid rgba(241, 235, 222, 0.1);
  border-radius: 14px;
  padding: 11px 12px;
}
.shop-item .ic { font-size: 1.6rem; flex: none; }
.shop-item .info { flex: 1; min-width: 0; }
.shop-item .nm { font-weight: 700; font-size: 0.9rem; }
.shop-item .desc { font-size: 0.74rem; opacity: 0.72; line-height: 1.35; margin-top: 1px; }
.shop-item .cost { font-weight: 700; color: var(--gold-soft); font-size: 0.9rem; white-space: nowrap; }
.shop-item .cost.cant { color: var(--bad); }
.shop-item.bought { opacity: 0.55; }
.shop-item.bought .nm:after { content: " ✓"; color: var(--good); }
.shop-item .cov { font-size: 0.68rem; opacity: 0.8; margin-top: 2px; }
.shop-item.locked { opacity: 0.75; }

/* sell panel */
.sell-hero {
  background: linear-gradient(140deg, rgba(185, 153, 109, 0.22), rgba(185, 153, 109, 0.05));
  border: 1px solid rgba(185, 153, 109, 0.4);
  border-radius: 14px;
  padding: 14px;
  text-align: center;
  margin-bottom: 12px;
}
.sell-hero .who { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.14em; opacity: 0.75; font-weight: 700; }
.sell-hero .amt { font-size: 1.9rem; font-weight: 700; color: var(--cream); line-height: 1.1; margin: 4px 0 2px; }
.sell-hero .sub { font-size: 0.74rem; opacity: 0.72; }
.sell-hero.none { border-color: rgba(241, 235, 222, 0.2); background: rgba(241, 235, 222, 0.05); }

.breakdown { display: flex; flex-direction: column; gap: 5px; font-size: 0.8rem; }
.breakdown .ln { display: flex; justify-content: space-between; gap: 10px; }
.breakdown .ln .k { opacity: 0.7; }
.breakdown .ln .v { font-weight: 600; text-align: right; }
.breakdown .ln.bad .v { color: var(--bad); }
.breakdown .ln.good .v { color: var(--good); }
.breakdown .ln.total { border-top: 1px solid rgba(241, 235, 222, 0.15); padding-top: 7px; margin-top: 5px; }
.breakdown .ln.total .v { font-size: 1.05rem; }
.breakdown .hint { font-size: 0.7rem; opacity: 0.6; font-style: italic; }

.terms { margin-top: 12px; font-size: 0.76rem; opacity: 0.75; font-style: italic; line-height: 1.45; border-left: 2px solid var(--gold); padding-left: 10px; }

.mkt-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.trend { font-size: 0.95rem; }
.trend.up { color: var(--good); }
.trend.down { color: var(--bad); }
.rate-chip {
  font-size: 0.62rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  padding: 2px 8px; border-radius: 999px;
  background: rgba(127, 169, 140, 0.22); color: var(--good);
}
.rate-chip.hot { background: rgba(201, 111, 95, 0.25); color: #e8b3a9; }

/* ------------------------------------------------------------ modals */
.overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(28, 38, 40, 0.8);
  display: flex; align-items: center; justify-content: center;
  padding: 18px;
  animation: fadeIn 0.2s ease both;
}
.modal {
  background: var(--slate-deep);
  border: 1px solid rgba(185, 153, 109, 0.45);
  border-radius: 20px;
  box-shadow: var(--shadow);
  max-width: 560px;
  width: 100%;
  padding: 28px;
  animation: modalIn 0.3s cubic-bezier(0.2, 1.4, 0.4, 1) both;
  max-height: 88vh;
  overflow-y: auto;
}
@keyframes modalIn { from { transform: scale(0.92) translateY(14px); opacity: 0; } }
.modal .eyebrow { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.16em; color: var(--gold-soft); font-weight: 700; }
.modal h2 { font-size: 1.5rem; margin: 6px 0 12px; line-height: 1.15; }
.modal p { font-size: 1rem; line-height: 1.65; opacity: 0.95; }
.modal .choices { display: flex; flex-direction: column; gap: 9px; margin-top: 18px; }
.modal .choices .btn { width: 100%; text-align: center; }

/* toast (timed events) */
.toast-zone {
  position: fixed; top: 74px; left: 50%; transform: translateX(-50%);
  z-index: 110; width: min(440px, 92vw);
  display: flex; flex-direction: column; gap: 10px;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  background: var(--cream);
  color: var(--slate-ink);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 14px 16px;
  animation: toastIn 0.3s cubic-bezier(0.2, 1.3, 0.4, 1) both;
  border: 2px solid var(--gold);
}
@keyframes toastIn { from { transform: translateY(-18px) scale(0.95); opacity: 0; } }
.toast .t { font-weight: 700; font-size: 0.9rem; display: flex; justify-content: space-between; gap: 8px; }
.toast .t .count { font-size: 0.7rem; opacity: 0.6; font-weight: 600; }
.toast .msg { font-size: 0.82rem; line-height: 1.4; margin-top: 3px; }
.toast .timer { height: 4px; border-radius: 3px; background: rgba(82, 99, 102, 0.15); margin-top: 10px; overflow: hidden; }
.toast .timer .fill { height: 100%; background: var(--gold); transition: width 0.1s linear; }
.toast .choices { display: flex; gap: 8px; margin-top: 10px; }

/* ------------------------------------------------------------ ending */
.ending-screen {
  min-height: 100vh;
  display: flex; flex-direction: column; align-items: center;
  padding: 44px 20px 60px;
  animation: fadeIn 0.7s ease both;
  max-width: 760px; margin: 0 auto;
  width: 100%;
}
.ending-tier {
  font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.22em;
  color: var(--gold-soft); font-weight: 700;
}
.ending-title { font-size: clamp(2.2rem, 7vw, 3.4rem); font-weight: 700; line-height: 1; margin: 10px 0 4px; }
.ending-size {
  font-size: 0.95rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  background: var(--gold); color: var(--slate-ink);
  padding: 6px 16px; border-radius: 999px; margin: 12px 0 6px;
}
.ending-payout { font-size: clamp(2.4rem, 8vw, 4rem); font-weight: 700; color: var(--cream); line-height: 1.05; }
.ending-payout small { font-size: 0.45em; opacity: 0.6; display: block; letter-spacing: 0.14em; text-transform: uppercase; }
.ending-headline { font-size: 1.05rem; opacity: 0.92; margin-top: 12px; line-height: 1.5; text-align: center; }
.ending-body { font-size: 0.88rem; opacity: 0.75; line-height: 1.55; margin-top: 10px; text-align: center; max-width: 560px; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  width: 100%;
  margin-top: 26px;
}
.stat-card {
  background: rgba(241, 235, 222, 0.06);
  border: 1px solid rgba(241, 235, 222, 0.12);
  border-radius: 14px;
  padding: 12px;
  text-align: center;
}
.stat-card .k { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.12em; opacity: 0.6; font-weight: 600; }
.stat-card .v { font-size: 1.15rem; font-weight: 700; margin-top: 3px; }
.stat-card .v.bad { color: var(--bad); }
.stat-card .v.good { color: var(--good); }

.epilogues { width: 100%; margin-top: 26px; text-align: left; }
.epilogues h3 { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.16em; opacity: 0.65; margin-bottom: 12px; font-weight: 700; }
.epi {
  background: rgba(241, 235, 222, 0.055);
  border: 1px solid rgba(241, 235, 222, 0.1);
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 8px;
  display: flex; gap: 10px; align-items: baseline;
}
.epi .who { font-weight: 700; font-size: 0.86rem; flex: none; min-width: 120px; }
.epi .what { font-size: 0.82rem; opacity: 0.8; line-height: 1.4; }

.ending-buttons { display: flex; gap: 10px; margin-top: 30px; flex-wrap: wrap; justify-content: center; }

/* ------------------------------------------------------------ how-to */
.howto { font-size: 0.9rem; }
.howto ol { padding-left: 20px; display: flex; flex-direction: column; gap: 9px; line-height: 1.5; margin-top: 8px; }
.howto b { color: var(--gold-soft); }

/* floating gain text */
.float-zone { position: fixed; inset: 0; pointer-events: none; z-index: 90; overflow: hidden; }
.float {
  position: absolute;
  font-weight: 700;
  color: var(--good);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
  font-size: 0.95rem;
  animation: floatUp 0.9s ease-out both;
}
@keyframes floatUp { from { transform: translateY(0); opacity: 1; } to { transform: translateY(-56px); opacity: 0; } }

/* toast/notice flash */
.flash-in { animation: flashIn 0.4s ease both; }
@keyframes flashIn { from { background-color: rgba(185, 153, 109, 0.4); } }

/* ------------------------------------------------------------ location chips */
.loc-chips { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 12px; }
.loc-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(82, 99, 102, 0.35);
  border: 1.5px solid rgba(241, 235, 222, 0.18);
  color: var(--cream);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
  max-width: 240px;
}
.loc-chip:hover { border-color: var(--gold); color: var(--gold-soft); }
.loc-chip.active { background: var(--gold); color: var(--slate-ink); border-color: var(--gold); }
.loc-chip .loc-emoji { font-size: 0.95rem; line-height: 1; }
.loc-chip .loc-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.loc-chip .loc-clientele { font-size: 0.66rem; opacity: 0.8; background: rgba(127, 169, 140, 0.25); color: var(--good); padding: 1px 6px; border-radius: 999px; }
.loc-chip.open { border-style: dashed; opacity: 0.75; }
.loc-chip.open:hover { opacity: 1; }

/* ------------------------------------------------------------ growth tab */
.growth-list { display: flex; flex-direction: column; gap: 14px; }
.growth-card {
  background: rgba(241, 235, 222, 0.045);
  border: 1px solid rgba(241, 235, 222, 0.13);
  border-radius: 12px;
  padding: 11px 13px;
  margin-bottom: 9px;
  transition: border-color 0.15s ease;
}
.growth-card.active { border-color: var(--gold); }
.growth-card.bought { opacity: 0.7; }
.growth-card.takeover { border-color: rgba(201, 111, 95, 0.45); }
.growth-card .row { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.growth-card .big { font-weight: 700; font-size: 0.92rem; }
.growth-card .desc { font-size: 0.76rem; opacity: 0.75; margin-top: 3px; line-height: 1.4; }
.growth-card .cov { font-size: 0.7rem; opacity: 0.85; margin-top: 4px; }
.growth-card .ln { display: flex; justify-content: space-between; gap: 10px; }
.growth-card .ln .k { opacity: 0.7; }
.growth-card .ln .v { font-weight: 600; text-align: right; }
.growth-card .ln.total { border-top: 1px solid rgba(241, 235, 222, 0.15); padding-top: 6px; margin-top: 4px; }
.growth-card .ln.total .v { font-size: 1rem; }
.panel .ln { display: flex; justify-content: space-between; gap: 10px; font-size: 0.8rem; padding: 2px 0; }
.panel .ln .k { opacity: 0.7; }
.panel .ln .v { font-weight: 600; text-align: right; }
.panel .ln.total { border-top: 1px solid rgba(241, 235, 222, 0.15); padding-top: 6px; margin-top: 4px; }
.panel .ln .v.bad { color: var(--bad); }
.panel .ln .v.good { color: var(--good); }

/* ------------------------------------------------------------ responsive */
@media (max-width: 980px) {
  .main { grid-template-columns: 1fr; padding: 12px; }
  .header { gap: 8px; }
  .stat { min-width: 80px; padding: 4px 8px; }
  .meter { min-width: 110px; padding: 4px 8px; }
  .brand-name { display: none; }
  .pet-grid { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); }

  /* Mobile single-column: the waiting room and feed sit ABOVE the shop rail,
     so any pet arriving/leaving reflows the whole page under your thumb.
     Cap both panels and let them scroll INSIDE — the rail below never moves.
     Also isolate their layout/paint so internal changes can't leak out. */
  .waiting { max-height: 380px; overflow-y: auto; contain: layout paint; overscroll-behavior: contain; }
  .feed { max-height: 240px; contain: layout paint; }
  .feed-list { max-height: 180px; overscroll-behavior: contain; }
}

@media (max-width: 560px) {
  .header { padding: 8px 10px; }
  .stat .v { font-size: 0.88rem; }
  .daybox { min-width: 62px; }
  .sell-btn { padding: 8px 14px; font-size: 0.82rem; }
  .modal { padding: 20px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
