/* Стили экранов: зона, профиль, настройки, выбор кафе, ошибки. */

/* ── Экран зоны ────────────────────────────────────── */

.zone-hero {
  border-radius: var(--radius);
  padding: 22px 18px;
  margin-bottom: 14px;
  color: #fff;
  position: relative;
  overflow: hidden;
  /* фон задаётся из JS акцентным цветом зоны */
}

.zone-hero .zone-emoji { font-size: 40px; display: block; }

.zone-hero h1 { font-size: 24px; margin-top: 6px; }

.zone-hero .zone-tagline { opacity: 0.85; font-size: 14px; margin-top: 2px; }

.zone-chips { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

.chip {
  background: rgba(0, 0, 0, 0.25);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12px;
}

/* ── Комната зоны (пиксельный пол с камерой) ───────── */

.floor-card {
  position: relative;
  height: 44vh;
  min-height: 260px;
  margin-bottom: 12px;
  border-radius: var(--radius);
  overflow: hidden;
  background: radial-gradient(120% 90% at 50% 12%, var(--bg-card), var(--bg));
}

.floor-host { position: absolute; inset: 0; }

.floor-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
}

.floor-canvas.grabbing { cursor: grabbing; }

.floor-action-target {
  position: absolute;
  z-index: 2;
  pointer-events: none;
  transform: translate(-50%, -50%);
}
.floor-action-target[hidden] { display: none; }
.floor-action-target::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 3px solid #ff525f;
  border-radius: 50%;
  box-shadow: 0 0 9px #ff525f;
  animation: floor-action-pulse 1.8s ease-in-out infinite;
}
@keyframes floor-action-pulse {
  0%, 100% { transform: scale(.94); opacity: .65; }
  50% { transform: scale(1.08); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .floor-action-target::before { animation: none; }
}

/* Крестик «убрать на склад» над выбранным предметом (режим правки) */
.furn-remove-btn {
  position: absolute;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 50%;
  background: #e5484d;
  color: #fff;
  font-size: 14px;
  line-height: 1;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
}

.furn-rotate-btn {
  position: absolute;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 50%;
  background: #3b82f6;
  color: #fff;
  font-size: 15px;
  line-height: 1;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
}

.floor-hud {
  position: absolute;
  left: 10px;
  top: 10px;
  background: rgba(0, 0, 0, 0.45);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12px;
  color: #e8e0d6;
  pointer-events: none;
}

.floor-zoom {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: flex;
  gap: 8px;
}

.floor-btn {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
}

.room-actions {
  display: flex;
  gap: var(--control-gap);
  margin-bottom: 12px;
}

.decorate-btn {
  flex: 1;
  margin-bottom: 0;
}

.edit-hint {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 12px;
}

/* ── Магазин ────────────────────────────────────────── */

.shop-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 6px 0 12px;
}

.shop-title { font-size: 20px; font-weight: 700; }

.shop-treasury { color: var(--text-dim); font-size: 14px; }

.shop-tabs { display: flex; gap: 10px; margin-bottom: 14px; overflow-x: auto; }

.shop-tab {
  border: 1px solid var(--control-border);
  border-radius: 999px;
  background: var(--bg-card);
  color: var(--text-dim);
  font-size: 14px;
  padding: 8px 14px;
  white-space: nowrap;
  cursor: pointer;
}

.shop-tab { min-height: 44px; }
.shop-tab.active { background: var(--action-bg); color: var(--accent-text); }

/* Отдельная заметная кнопка «Склад» над рядом вкладок */
.warehouse-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-bottom: 12px;
  padding: 12px 16px;
  border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  background: color-mix(in srgb, var(--accent) 16%, var(--bg-card));
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}
.warehouse-btn.active {
  background: var(--accent);
  color: var(--accent-text);
  border-color: transparent;
}
.warehouse-count {
  min-width: 20px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-text);
  font-size: 12px;
  font-weight: 800;
}
.warehouse-btn.active .warehouse-count {
  background: var(--accent-text);
  color: var(--accent);
}

.shop-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.shop-item {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.shop-thumb {
  width: 96px;
  height: 56px;
  object-fit: contain;
  image-rendering: pixelated;
}

.shop-item.is-applied {
  outline: 2px solid var(--ok);
  outline-offset: -2px;
}

.shop-item-name { font-size: 14px; font-weight: 600; text-align: center; }

/* Подпись множителя декора и метка «уже стоит» */
.shop-item-bonus {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-ink);
  text-align: center;
}
.shop-placed { color: var(--ok); font-weight: 700; }

.shop-buy, .shop-apply { padding: 8px 16px; font-size: 14px; }
.shop-item > .shop-buy, .shop-item > .shop-apply { margin-top: auto; }

/* Цена-кнопка неактивна, когда не хватает казны */
.shop-buy.unaffordable { opacity: 0.4; cursor: not-allowed; }

.shop-applied { color: var(--ok); font-size: 14px; font-weight: 600; padding: 8px 0; }

/* Крио-огород — «особый предмет»: слегка выделенная карточка во вкладке «Интерьер». */
.garden-featured {
  position: relative;
  margin: 4px 0 14px;
  padding: 14px 16px 16px;
  border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent);
  background:
    radial-gradient(120% 100% at 90% -20%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%),
    var(--bg-card);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 20%, transparent),
              0 6px 20px color-mix(in srgb, var(--accent) 16%, transparent);
}
.garden-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  padding: 2px 8px;
  border-radius: 999px;
}
.garden-title { font-size: 18px; font-weight: 800; margin: 8px 0 4px; }
.garden-desc { font-size: 13.5px; line-height: 1.45; color: var(--text-dim); margin-bottom: 12px; }
.garden-btn {
  width: 100%;
  padding: 11px 16px;
  font-size: 15px;
  font-weight: 700;
}
.garden-btn.unaffordable { opacity: 0.4; cursor: not-allowed; }
.garden-note { display: block; font-size: 13px; color: var(--text-dim); padding: 6px 0 2px; }

/* Крио-огород как обычный товар (.shop-item), но слегка выделен: рамка + метка. */
.shop-item-garden {
  grid-column: 1 / -1;
  position: relative;
  outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent);
  outline-offset: -2px;
}
.shop-item-desc {
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-dim);
  text-align: center;
}
.garden-tag {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  padding: 2px 7px;
  border-radius: 999px;
}

/* Карточка стоит первой во вкладке «Интерьер» — чуть спокойнее, чем featured сверху. */
.garden-in-tab { margin: 2px 0 14px; }

/* «Что это» — нативный раскрывающийся блок с человеческим объяснением. */
.garden-info { margin: 2px 0 12px; }
.garden-info > summary {
  cursor: pointer;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  padding: 4px 0;
  user-select: none;
}
.garden-info > summary::-webkit-details-marker { display: none; }
.garden-info[open] > summary { margin-bottom: 4px; }
.garden-info-body {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-dim);
  padding: 8px 10px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent);
}

/* ── Кулинарная книга (покедекс рецептов) ───────────────────────────── */
.cb-top { padding: 8px 0 6px; }
.cb-top h1 { font-size: 22px; font-weight: 800; margin: 0 0 4px; }
.cb-overall { color: var(--text-dim); font-size: 14px; margin-bottom: 8px; }
.cb-bar {
  height: 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text) 12%, transparent);
  overflow: hidden;
}
.cb-fill { height: 100%; background: var(--accent); border-radius: 999px; }
.cb-section { margin-top: 18px; }
.cb-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.cb-head h2 { font-size: 16px; font-weight: 700; margin: 0; }
.cb-frac { font-size: 13px; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.cb-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}
.cb-item {
  position: relative;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 11px;
  border-radius: 10px;
  background: var(--bg-card);
  font-size: 13px;
  line-height: 1.25;
}
.cb-item.got .cb-name { color: var(--text); font-weight: 600; }
button.cb-item { width: 100%; border: 1px solid transparent; font: inherit; font-size: 13px; line-height: 1.25; text-align: left; color: var(--text); cursor: pointer; }
button.cb-item.got:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.book-preview h2 { padding: 12px 24px 0; overflow-wrap: anywhere; }
.book-preview-media { display: grid; place-items: center; min-height: 200px; color: var(--text-dim); }
.book-preview .cook-result-sticker { width: min(260px, 100%); height: auto; aspect-ratio: 1; margin: 0 auto; background: none; animation: none; }
.cb-item.locked { opacity: 0.5; }
.cb-item.locked .cb-name { color: var(--text-dim); }
.cb-item.rare {
  border: 1px solid color-mix(in srgb, #e8b04b 60%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, #e8b04b 20%, transparent);
}
.cb-name { word-break: break-word; }
.cb-count {
  margin-left: auto;
  flex: none;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  padding: 1px 6px;
  border-radius: 999px;
}

.floor-failed::after {
  content: "Не удалось загрузить пол 😿";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 14px;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 14px;
}

.stat-card .stat-value { font-size: 22px; font-weight: 700; }

.stat-card .stat-label { font-size: 12px; color: var(--text-dim); margin-top: 2px; }

.zone-locked {
  text-align: center;
  padding: 40px 20px;
}

.zone-locked .lock-emoji { font-size: 48px; display: block; margin-bottom: 10px; }

.placeholder-block {
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--radius);
  padding: 18px;
  text-align: center;
  color: var(--text-dim);
  font-size: 14px;
}

/* ── Профиль ───────────────────────────────────────── */

.profile-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 18px 0 6px;
  text-align: center;
}

.profile-avatar {
  width: 86px;
  height: 86px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  font-weight: 700;
  overflow: hidden;
  border: 3px solid rgba(255, 255, 255, 0.2);
}

.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }

.profile-name { font-size: 20px; font-weight: 700; margin-top: 10px; }

.profile-username { color: var(--text-dim); font-size: 14px; }

.role-badge {
  display: inline-block;
  margin-top: 8px;
  background: var(--bg-card);
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 13px;
}

.level-block { margin: 14px 0; }

.level-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 6px;
}

.progress-bar {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  transition: width 0.4s ease;
}

.kv-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 15px;
}

.kv-row:last-child { border-bottom: none; }

.kv-row .kv-value { font-weight: 600; }

/* ── Настройки ─────────────────────────────────────── */

.settings-title { font-size: 20px; font-weight: 700; margin: 6px 0 14px; }

.toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.toggle-row:last-child { border-bottom: none; }

.toggle-label { font-size: 15px; }

.toggle-hint { font-size: 12px; color: var(--text-dim); margin-top: 2px; }

.switch {
  position: relative;
  width: 48px;
  height: 44px;
  flex-shrink: 0;
  border: none;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  transition: background 0.2s ease;
}

.switch::after {
  content: "";
  position: absolute;
  top: 11px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s ease;
}

.switch::before { content: ""; position: absolute; inset: 8px 0; border-radius: 999px; background: color-mix(in srgb, var(--text) 25%, var(--bg-card)); }
.switch.on::before { background: var(--ok); }

.switch.on::after { transform: translateX(20px); }

.lang-select {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 14px;
}

/* ── Выбор кафе ────────────────────────────────────── */

.picker-screen { display: flex; flex-direction: column; gap: 14px; padding: 8px 0 16px; }
.picker-title { font-size: 22px; font-weight: 700; line-height: 1.25; margin: 0; text-align: center; }

.picker-sub { text-align: center; color: var(--text-dim); font-size: 14px; line-height: 1.45; margin-top: 6px; }
.picker-home { width: 100%; min-height: 48px; margin: 0; }
.picker-list { display: flex; flex-direction: column; gap: 12px; }

.cafe-item {
  width: 100%;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--bg-card);
  border: 1px solid var(--control-border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 14px;
  margin: 0;
  font-family: inherit;
  font-size: 15px;
  cursor: pointer;
  text-align: left;
  appearance: none;
}

.cafe-item.is-primary { border-color: color-mix(in srgb, var(--accent) 55%, var(--control-border)); }
.cafe-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.cafe-item:disabled { opacity: .6; cursor: default; }
.cafe-item-icon { flex: 0 0 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: color-mix(in srgb, var(--accent) 10%, var(--bg-card)); font-size: 23px; }
.cafe-item-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.cafe-item-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.cafe-item-name { flex: 1 1 150px; min-width: 0; overflow-wrap: anywhere; font-weight: 600; line-height: 1.35; }
.cafe-primary { flex-shrink: 0; padding: 3px 7px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 14%, var(--bg-card)); color: var(--accent-ink); font-size: 10px; font-weight: 600; line-height: 1.4; }
.cafe-item .cafe-lvl { display: flex; flex-wrap: wrap; gap: 5px 12px; color: var(--text-dim); font-size: 12px; line-height: 1.45; }
.cafe-lvl > span { white-space: nowrap; }

/* ── Заглушки/ошибки ───────────────────────────────── */

.center-note {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-dim);
}

.center-note .big-emoji { font-size: 52px; display: block; margin-bottom: 12px; }

.center-note h2 { color: var(--text); margin-bottom: 8px; font-size: 18px; }

.center-note .btn { margin-top: 16px; pointer-events: auto; }

.dev-banner {
  background: #5a4a1f;
  color: #ffe9a8;
  font-size: 12px;
  text-align: center;
  padding: 4px 8px;
}
/* Shared skill cooking in all three rooms. */
.cook-actions { margin: 14px 0; }
.cook-actions .btn { width: 100%; }
.cook-actions [data-cook].is-cooldown { background: #737373; border-color: #737373; color: #fff; opacity: 1; cursor: default; font-variant-numeric: tabular-nums; }
.cook-actions p { margin-top: 8px; text-align: center; font-size: 13px; }
.cook-backdrop { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 14px; background: rgba(0,0,0,.72); }
.cook-dialog { position: relative; width: min(100%, 400px); max-height: calc(100dvh - 28px); overflow: auto; padding: 24px 18px 18px; border: 1px solid var(--accent); border-radius: 24px; background: var(--bg-card); text-align: center; box-shadow: 0 18px 60px rgba(0,0,0,.4); }
.cook-dialog h2 { margin: 0 20px 8px; font-size: 21px; }
.cook-dialog > p { font-size: 13px; line-height: 1.5; }
.cook-dismiss { position: absolute; right: 10px; top: 8px; padding: 0 10px; color: var(--text-dim); background: transparent; border: 0; font-size: 30px; }
.cook-wheel-host { position: relative; margin: 22px auto 8px; width: min(100%, 310px); }
.cook-wheel-host canvas { display: block; width: 100%; height: auto; }
.cook-pointer { position: absolute; top: -11px; left: 50%; transform: translateX(-50%); font-size: 30px; color: var(--text); filter: drop-shadow(0 2px 2px #000); }
.cook-legend { display: flex; justify-content: center; flex-wrap: wrap; gap: 5px 10px; font-size: 11px; }
.cook-legend span { display: inline-flex; align-items: center; gap: 4px; }
.cook-legend i { width: 8px; height: 8px; border-radius: 50%; }
.cook-attempt-time { margin: 12px 0 8px; color: var(--text-dim); }
.cook-stop { width: 100%; min-height: 48px; }
.cook-feedback { margin-top: 10px; }
.cook-feedback strong { color: var(--text); }
@media (max-height: 650px) {
  .cook-wheel-host { width: min(100%, 230px); margin-top: 14px; }
  .cook-dialog { padding-top: 18px; }
}

/* Knife throw, impact and result reveal. */
.cook-motion-label { display: inline-block; margin: 2px 0 0; padding: 5px 11px; border-radius: 99px; color: var(--text-dim); background: rgba(255,255,255,.06); font-size: 11px; }
.cook-wheel-host.knife-mode { --knife-height: 100px; --knife-gap: 12px; padding-bottom: calc(var(--knife-height) + var(--knife-gap)); margin-top: 10px; touch-action: manipulation; }
.knife-mode .cook-pointer { top: auto; bottom: calc(var(--knife-height) + var(--knife-gap) + var(--rim-inset, 16px) - 4px); width: 4px; height: 8px; border-radius: 1px; background: #c9ad70; font-size: 0; pointer-events: none; }
.cook-knife-orbit { position: absolute; inset: 0; pointer-events: none; }
.cook-knife { position: absolute; bottom: 0; left: calc(50% - 12px); width: 24px; height: var(--knife-height); filter: drop-shadow(1px 3px 2px #0005); pointer-events: none; }
.cook-knife img { display: block; width: 100%; height: 100%; object-fit: contain; user-select: none; }
.has-hit .cook-knife { animation: cook-throw var(--throw-duration, .2s) cubic-bezier(.45,0,1,1) forwards; }
.has-hit .cook-knife img { animation: cook-embed var(--throw-duration, .2s) linear forwards; }
.has-hit .cook-pointer { opacity: 0; }
.has-hit canvas { animation: cook-impact .22s var(--throw-duration, .2s) ease-out; }
@keyframes cook-throw { to { transform: translateY(calc(-1 * var(--knife-travel, 36px))); } }
@keyframes cook-embed { 0%, 85% { clip-path: inset(0); } 100% { clip-path: inset(var(--knife-depth, 6px) 0 0); } }
@keyframes cook-impact { 35% { transform: translateY(-1px); } 65% { transform: translateY(1px); } }
.show-result > h2, .show-result > .cook-instruction, .show-result > .cook-motion-label, .show-result > .cook-wheel-host, .show-result > .cook-legend, .show-result > .cook-attempt-time { display: none; }
.show-result { display: flex; flex-direction: column; }
.show-result .cook-feedback { order: 1; margin-top: 0; }
.show-result .cook-stop { order: 2; margin-top: 16px; }
.cook-result { animation: cook-reveal .55s cubic-bezier(.2,.8,.2,1) both; }
.cook-result-eyebrow { color: var(--text-dim); font-size: 13px; }
.cook-result-sticker { display: grid; place-items: center; width: 200px; height: 200px; margin: 6px auto; border-radius: 50%; background: radial-gradient(circle,#f4c65b26,transparent 70%); }
.cook-result-sticker > span { font-size: 85px; }
.cook-result-sticker svg, .cook-result-sticker video { width: 100%; height: 100%; object-fit: contain; }
.cook-result h2 { color: var(--text); margin: 4px 0 14px; line-height: 1.2; font-size: 24px; }
.cook-result-quality { display: inline-block; color: var(--quality-color); padding: 6px 16px; border: 1px solid var(--quality-color); border-radius: 99px; font-weight: bold; }
.cook-quality-details { width: 100%; max-width: 320px; margin: 12px auto 0; padding: 10px; display: grid; gap: 8px; background: var(--sunk, var(--bg-card)); color: var(--text); box-shadow: inset 0 0 0 1px color-mix(in srgb,var(--text) 20%,transparent); }
.cook-quality-details-title { display: flex; align-items: center; justify-content: center; gap: 7px; font: 400 13px/1.25 var(--display, sans-serif); }
.cook-quality-flow { display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); align-items: center; gap: 6px; font-size: 13px; }
.cook-quality-flow small { display: block; margin-bottom: 2px; color: var(--text-dim); font-size: 11px; }
.cook-quality-flow b { overflow-wrap: anywhere; }
.cook-quality-details ul { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.cook-quality-details li { display: grid; grid-template-columns: minmax(0,1fr) 28px; align-items: center; gap: 8px; padding: 5px 7px; text-align: left; background: var(--honey-soft, var(--bg-card)); color: var(--honey-ink, var(--text)); font-size: 12px; line-height: 1.3; }
.cook-quality-details li span { overflow-wrap: anywhere; }
.cook-quality-details li strong { padding: 2px; text-align: center; font-variant-numeric: tabular-nums; background: color-mix(in srgb,currentColor 10%,transparent); }
.cook-quality-note { margin: 0; color: var(--text-dim); font-size: 11.5px; line-height: 1.35; }
.cook-result-rewards { display: flex; justify-content: center; gap: 12px; margin: 20px 0 12px; }
.cook-result-rewards strong { padding: 12px; border-radius: 14px; background: rgba(255,255,255,.06); color: #f4c65b; font-size: 20px; }
.cook-result > .muted { font-size: 12px; }
.is-fail .cook-result-sticker { background: radial-gradient(circle,#ee686826,transparent 70%); }
@keyframes cook-reveal { from { opacity: 0; transform: translateY(22px) scale(.92); } to { opacity: 1; transform: translateY(0) scale(1); } }
@media (max-height:650px) { .cook-wheel-host.knife-mode { --knife-height: 84px; --knife-gap: 8px; } .cook-result-sticker { width: 160px; height: 160px; } }
/* Flight timing determines the hit: reduce decoration, not the scored flight. */
@media (prefers-reduced-motion:reduce) { .cook-result, .has-hit canvas { animation: none; } }

/* Staged entry/exit rather than an abrupt modal or layout swap. */
.cook-backdrop { animation: cook-backdrop-in .38s ease both; }
.cook-dialog { animation: cook-dialog-in .46s cubic-bezier(.18,.85,.25,1) both; }
.cook-dialog > .cook-instruction, .cook-dialog > .cook-motion-label { animation: cook-content-in .4s .09s both; }
.cook-dialog > .cook-wheel-host { animation: cook-content-in .48s .12s both; }
.cook-dialog > .cook-legend, .cook-dialog > .cook-attempt-time, .cook-dialog > .cook-stop { animation: cook-content-in .4s .2s both; }
.cook-dialog > h2, .cook-dialog > .cook-instruction, .cook-dialog > .cook-motion-label, .cook-dialog > .cook-wheel-host, .cook-dialog > .cook-legend, .cook-dialog > .cook-attempt-time { transition: opacity .22s ease, filter .22s ease; }
.is-resolving > h2, .is-resolving > .cook-instruction, .is-resolving > .cook-motion-label, .is-resolving > .cook-wheel-host, .is-resolving > .cook-legend, .is-resolving > .cook-attempt-time { animation: none; opacity: 0; filter: blur(3px); }
.cook-backdrop.is-closing { pointer-events: none; animation: cook-backdrop-out .24s ease both; }
.is-closing .cook-dialog { animation: cook-dialog-out .24s ease both; }
.cook-result-sticker { animation: cook-sticker-in .65s .08s cubic-bezier(.2,.85,.2,1) both; }
.cook-result h2 { animation: cook-content-in .45s .16s both; }
.cook-result-quality { animation: cook-content-in .45s .23s both; }
.cook-result-rewards { animation: cook-content-in .45s .3s both; }
.show-result > .cook-stop { animation: cook-content-in .45s .38s both; }
@keyframes cook-backdrop-in { from { background-color: rgba(0,0,0,0); } to { background-color: rgba(0,0,0,.72); } }
@keyframes cook-backdrop-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes cook-dialog-in { from { opacity: 0; transform: translateY(36px) scale(.93); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes cook-dialog-out { from { opacity: 1; transform: translateY(0) scale(1); } to { opacity: 0; transform: translateY(18px) scale(.96); } }
@keyframes cook-content-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes cook-sticker-in { from { opacity: 0; transform: translateY(16px) scale(.76) rotate(-7deg); } to { opacity: 1; transform: translateY(0) scale(1) rotate(0); } }
@media (prefers-reduced-motion:reduce) { .cook-backdrop, .cook-dialog, .cook-dialog > *, .cook-result > * { animation: none !important; transition: none !important; } }

/* Rooms occupy the available viewport; the map receives the remaining space. */
#screen.zone-screen { flex: 0 0 auto; height: calc(var(--tg-viewport-stable-height, 100dvh) - var(--header-h) - var(--nav-h) - env(safe-area-inset-top) - env(safe-area-inset-bottom)); padding: 8px 12px; display: flex; flex-direction: column; gap: 6px; min-height: 0; overflow: hidden; }
.zone-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 28px; flex-shrink: 0; }
.zone-heading h1 { font-size: 17px; line-height: 1.2; white-space: nowrap; }
.zone-heading > span { color: var(--text-dim); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Diagnostics and bonus cards must not reduce the room to a thumbnail. */
.zone-screen .floor-card { flex: 1 0 min(64vw, 280px); height: auto; min-height: min(64vw, 280px); margin: 0; }
#screen.zone-screen { overflow-x: hidden; overflow-y: auto; }
.floor-seat-badge { position: absolute; right: 10px; top: 10px; padding: 5px 9px; border-radius: 999px; background: rgba(0,0,0,.45); color: #e8e0d6; font-size: 11px; pointer-events: none; }
.floor-route { width: 44px; height: 44px; flex-shrink: 0; border: none; border-radius: 50%; background: rgba(0,0,0,.5); color: #fff; font-size: 20px; cursor: pointer; }
.floor-route:disabled { opacity: .45; cursor: default; }
.zone-screen .cook-actions { flex-shrink: 0; margin: 0; }
.zone-screen .cook-actions .btn { min-height: 44px; padding: 10px 12px; margin: 0; }
.zone-screen .cook-actions p { margin: 5px 0 0; font-size: 12px; line-height: 16px; }
.zone-screen .room-actions { flex-shrink: 0; margin: 0; gap: 10px; }
.zone-screen .room-actions .btn { min-height: 44px; padding: 9px 10px; font-size: 13px; }
.zone-screen #zone-stats { flex-shrink: 0; min-height: 38px; }
.zone-screen .stats-grid { display: flex; gap: 6px; margin: 0; }
.zone-screen .stat-card { flex: 1; min-width: 0; padding: 4px 6px; text-align: center; }
.zone-screen .stat-value { font-size: 13px; line-height: 16px; }
.zone-screen .stat-label { font-size: 11px; margin: 0; line-height: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zone-screen .edit-hint { flex-shrink: 0; padding: 6px 8px; margin: 0; font-size: 11px; }
.zone-screen .zone-locked { margin: auto 0; }
.cook-result-sticker { color: var(--text-dim); font-size: 12px; }
.daily-quests-btn { width: 100%; margin-top: 0; }
.quests-heading h1 { margin: 8px 0 12px; font-size: 23px; }
.quests-heading p { margin: 6px 0; }
.quest-card { margin-top: 14px; }
.quest-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.quest-heading h2 { margin: 0; font-size: 17px; line-height: 1.4; }
.quest-heading > span { flex-shrink: 0; font-weight: 700; }
.quest-card .muted { line-height: 1.45; }
.quest-rewards { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 12px; font-weight: 700; color: var(--accent-ink); }
.quest-completed-note { font-size: 13px; margin-bottom: 0; }
.quest-help { font-size: 13px; line-height: 1.5; margin: 16px 0; }
.quest-help summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; color: var(--text-dim); }
.quest-help p { margin: 0 0 12px; color: var(--text-dim); }
.quest-card.is-completed { padding-top: 10px; padding-bottom: 10px; }
.quest-card.is-completed .quest-rewards { margin-top: 6px; }
.quest-completed-note { color: var(--text-dim); }
.quest-bonus { color: var(--accent-ink); font-size: 14px; margin: 12px 0; }

/* Общие фильтры каталога и книги: одинаковые размеры в обеих темах. */
.catalog-tools { margin: 0 0 14px; }
.catalog-search { width: 100%; min-width: 0; min-height: 44px; padding: 10px 12px; font: inherit; font-size: 14px; color: var(--text); background: var(--bg-card); border: 1px solid color-mix(in srgb, var(--text) 20%, transparent); border-radius: 12px; }
.catalog-search { display: block; margin: 12px 0; }
.catalog-search::placeholder { color: var(--text-dim); opacity: 1; }
.filter-tabs { display: flex; gap: 8px; margin: 12px 0; }
.filter-tab { min-height: 44px; flex: 1; padding: 10px 12px; border: 0; border-radius: 12px; background: var(--bg-card); color: var(--text); font: inherit; font-size: 14px; cursor: pointer; }
.filter-tab.active { background: var(--action-bg); color: var(--accent-text); }
.leaderboard-filters { margin-inline: 3px; }
.leaderboard-results { display: grid; gap: 14px; margin: 14px 3px 0; }
.leaderboard-results .card { margin: 0; min-width: 0; }
.leaderboard-results h2 { margin: 0; font-size: 16px; overflow-wrap: anywhere; }
.leaderboard-table-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 4px 12px;
  margin-bottom: 9px;
}
.leaderboard-table-head small, .leaderboard-prizes p { color: var(--text-dim); font-size: 12px; }
.leaderboard-entries, .leaderboard-prize-list, .leaderboard-legacy-prizes {
  padding: 0;
  margin: 0;
  list-style: none;
}
.leaderboard-entry {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) max-content;
  align-items: baseline;
  column-gap: 8px;
  min-height: 44px;
  margin-inline: -6px;
  padding: 11px 6px 8px;
  line-height: 1.3;
  border-top: 2px dashed var(--paper-lo);
}
.leaderboard-entry.is-current { background: var(--honey-soft); }
.leaderboard-place { color: var(--text-dim); font-size: 13px; font-variant-numeric: tabular-nums; }
.leaderboard-entry:first-child .leaderboard-place { color: var(--accent-ink); font-weight: 700; }
.leaderboard-name { overflow-wrap: anywhere; font-weight: 700; }
.leaderboard-name small { display: block; margin-top: 2px; color: var(--text-dim); font-size: 11px; }
.leaderboard-xp { text-align: end; white-space: nowrap; font-size: 13px; font-variant-numeric: tabular-nums; }
@media (max-width: 420px) {
  .leaderboard-results .card { padding-inline: 12px; }
  .leaderboard-table-head { flex-direction: column; align-items: flex-start; }
}
.leaderboard-prize-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 10px; }
.leaderboard-prize-list li { display: grid; gap: 3px; padding: 6px 3px; background: var(--honey-soft); text-align: center; }
.leaderboard-prize-list li > span { color: var(--honey-ink); font-size: 12px; }
.leaderboard-prize-list b { display: flex; align-items: center; justify-content: center; gap: 4px; }
.leaderboard-prizes p, .leaderboard-empty { margin: 8px 0 0; }
.leaderboard-legacy-prizes { margin-top: 8px; display: grid; gap: 6px; font-size: 13px; }
.book-more { width: 100%; margin-top: 16px; }
.cb-head { gap: 12px; font-size: 13px; color: var(--text-dim); margin: 14px 0; }
.cb-grid { margin-top: 12px; }
.shop-details-trigger { font-family: inherit; color: var(--text); background: none; border: 0; padding: 0; min-height: 44px; cursor: pointer; }
.shop-details-trigger::after { content: " ⓘ"; font-size: 12px; color: var(--accent-ink); }
.shop-thumb[data-decor-details] { cursor: pointer; }
.item-details { position: fixed; inset: 0; width: min(400px, calc(100% - 24px)); max-height: calc(100dvh - 32px); margin: auto; padding: 24px 20px; overflow-y: auto; border: 1px solid color-mix(in srgb, var(--text) 20%, transparent); border-radius: 20px; background: var(--bg); color: var(--text); }
.item-details::backdrop { background: rgba(0, 0, 0, .6); }
.item-details[open] { display: flex; flex-direction: column; overflow: hidden; }
.details-content { overflow-y: auto; min-height: 0; overscroll-behavior: contain; }
.details-close { position: absolute; z-index: 1; top: 8px; right: 8px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--bg-card); color: var(--text); font-size: 20px; cursor: pointer; }
.details-image { display: block; width: 128px; height: 96px; object-fit: contain; image-rendering: pixelated; margin: 12px auto; }
.item-details h2 { text-align: center; font-size: 22px; margin: 12px 0; }
.item-details .shop-item-bonus { font-size: 15px; line-height: 1.45; }
.pass-contribution-details h2 { margin: 0 44px 5px 0; text-align: left; }
.pass-contribution-item { margin: 0 44px 14px 0; font-size: 13px; }
.pass-contribution-rows { margin: 0; }
.pass-contribution-rows > div { display: grid; grid-template-columns: 1fr minmax(0, 1fr); align-items: baseline; gap: 8px; padding: 8px 0; border-top: 1px solid var(--sunk); }
.pass-contribution-rows dt { font-size: 13px; color: var(--text-dim); }
.pass-contribution-rows dd { margin: 0; font-weight: 700; text-align: right; overflow-wrap: anywhere; }
.collection-details { padding: 16px; margin-top: 16px; background: var(--bg-card); border-radius: 14px; font-size: 14px; line-height: 1.5; }
.collection-details h3 { font-size: 16px; }
.collection-details p { margin: 8px 0; }
.collection-details ul { list-style: none; padding: 0; }
.collection-details li { margin: 6px 0; }
.details-action { flex-shrink: 0; display: flex; flex-direction: column; align-items: center; gap: 12px; padding-top: 16px; }
.item-unlock { font-size: 14px; line-height: 1.5; }
button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 3px; }
/* Full department progress belongs in the cafe card, not the room controls. */
.cafe-growth-heading { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.cafe-growth-heading h2 { margin: 0; font-size: 16px; }
.cafe-growth-heading > span { font-size: 12px; color: var(--text-dim); white-space: nowrap; }
.cafe-growth-row { --department-color: #b97959; }
.cafe-growth-row[data-department="hall"] { --department-color: #8a9a78; }
.cafe-growth-row[data-department="bar"] { --department-color: #819da8; }
.cafe-growth-row + .cafe-growth-row { margin-top: 18px; }
.cafe-growth-label { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 5px 10px; font-size: 14px; }
.cafe-growth-label > span:first-child { font-weight: 600; }
.cafe-growth-label > span:last-child { font-size: 12px; font-variant-numeric: tabular-nums; }
.cafe-growth progress { appearance: none; display: block; width: 100%; height: 10px; border: 0; border-radius: 8px; overflow: hidden; margin-top: 8px; background: color-mix(in srgb, var(--text) 10%, var(--bg-card)); accent-color: var(--department-color); }
.cafe-growth progress::-webkit-progress-bar { background: color-mix(in srgb, var(--text) 10%, var(--bg-card)); }
.cafe-growth progress::-webkit-progress-value { background: var(--department-color); border-radius: 8px; }
.cafe-growth progress::-moz-progress-bar { background: var(--department-color); border-radius: 8px; }
.cafe-growth-numbers { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 10px; margin-top: 6px; font-size: 11px; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.cafe-growth .is-locked { color: var(--text-dim); }
.cafe-growth p { margin: 16px 0 0; font-size: 11px; line-height: 1.5; }

/* Карточка общего кафе. */
.cafe-card-hero { text-align:center; padding:16px 10px 22px; overflow-wrap:anywhere; }
.cafe-card-emblem { width:76px; height:76px; margin:0 auto 12px; display:grid; place-items:center; font-size:38px; border-radius:24px; background:color-mix(in srgb,var(--accent) 16%,var(--bg-card)); border:1px solid color-mix(in srgb,var(--accent) 28%,transparent); }
.cafe-card-eyebrow { font-size:10px; letter-spacing:1.4px; color:var(--text-dim); margin-bottom:7px; }
.cafe-card-hero h1 { font-size:25px; line-height:1.2; }
.cafe-card-title { margin-top:10px; font-size:13px; }
.cafe-card-description { font-size:14px; line-height:1.5; margin:12px 0; color:var(--text-dim); }
.cafe-card-chips { display:flex; flex-wrap:wrap; justify-content:center; gap:7px; margin-top:13px; }
.cafe-card-chips span,.cafe-honor { padding:7px 10px; border-radius:10px; background:color-mix(in srgb,var(--accent) 12%,var(--bg-card)); font-size:12px; overflow-wrap:anywhere; }
.cafe-card-section h2 { font-size:16px; margin:0 0 12px; }
.cafe-card-section .muted { font-size:13px; line-height:1.5; }
.cafe-card-section .btn { width:100%; margin-top:var(--control-gap); }
.cafe-card-section .kv-row { gap:12px; align-items:flex-start; }
.cafe-card-section .kv-value { text-align:right; overflow-wrap:anywhere; max-width:60%; }
.cafe-card-section.kv-card .kv-row { align-items:center; }
.cafe-card-section.kv-card .kv-row > span:first-child {
  display:grid;
  grid-template-columns:24px auto;
  align-items:center;
  gap:10px;
}
.cafe-card-section.kv-card .kv-row > span:first-child > .ico { justify-self:center; }
.cafe-staff-row small { display:block; color:var(--text-dim); font-size:12px; margin-top:3px; }
.cafe-showcase-shelf {
  --shelf-row: 62px;
  --shelf-floor: 52px;
  display:flex;
  flex-wrap:wrap;
  column-gap:4px;
  list-style:none;
  padding:0 7px;
  margin:0;
  border:2px solid #4a2a19;
  background:
    repeating-linear-gradient(0deg,transparent 0 11px,#9a6a402e 11px 12px),
    repeating-linear-gradient(to bottom,#73432759 0,transparent 8px var(--shelf-floor),
      #e9b47a var(--shelf-floor) 54px,#b78452 54px 58px,#9b663a 58px 60px,#6c4229 60px var(--shelf-row)),
    #e4cca3;
  box-shadow:0 2px #d9bf95,inset 5px 0 #64402724,inset -5px 0 #64402724;
}
.cafe-showcase-piece { flex:none; height:var(--shelf-row); }
.cafe-showcase-reward {
  position:relative;
  display:flex;
  align-items:flex-end;
  justify-content:center;
  min-width:44px;
  height:var(--shelf-floor);
  padding:0 3px;
  border:0;
  background:none;
  color:#2e1a14;
  cursor:pointer;
  touch-action:manipulation;
}
.cafe-showcase-reward:is(:hover,[aria-expanded="true"]) { background:linear-gradient(0deg,#ad713329,transparent); }
.cafe-showcase-reward[aria-expanded="true"] { box-shadow:inset 0 -2px #9a5d2d; }
.cafe-showcase-art { display:block; image-rendering:pixelated; }
.cafe-showcase-rank {
  position:absolute;
  inset-inline-end:1px;
  inset-block-end:1px;
  padding:1px 4px;
  border:1px solid #684220;
  background:#f6dc9a;
  color:#382218;
  font:700 11px/1.15 system-ui,sans-serif;
}
.cafe-showcase-detail {
  margin-top:9px;
  padding:8px 9px;
  background:var(--sunk);
  border-inline-start:3px solid #b5814d;
}
.cafe-showcase-detail h3 { margin:0; font-size:14px; }
.cafe-showcase-detail p { margin:4px 0 0; font-size:12px; color:var(--text-dim); }
.cafe-switch-note { margin-top:12px; }
.cafe-management summary { cursor:pointer; font-weight:600; min-height:28px; }
.cafe-management label { display:block; margin:14px 0 7px; font-size:13px; }
.cafe-management input:not([type=checkbox]),.cafe-management select { width:100%; min-height:44px; border:1px solid color-mix(in srgb,var(--text) 20%,transparent); background:var(--bg); color:var(--text); border-radius:10px; padding:10px 12px; font:inherit; }
.cafe-management .cafe-cleanup-label { display:flex; gap:10px; align-items:center; min-height:44px; line-height:1.4; }
.cafe-cleanup-label input { width:20px; height:20px; flex-shrink:0; accent-color:var(--accent); }
.cafe-card-refresh { width:100%; }
#personal-settings { margin-top:24px; }
#personal-settings .settings-title { font-size:17px; }

/* Расширение текущей зоны в разделе «Оформить». */
.zone-expansion { margin: 0 0 16px; border: 1px solid var(--control-border, color-mix(in srgb,var(--text) 28%,var(--bg-card))); }
.zone-expansion-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.zone-expansion h2 { font-size: 15px; }
.zone-expansion-heading > span { font-weight: 700; font-variant-numeric: tabular-nums; }
.zone-expansion p { margin-top: 9px; font-size: 12px; line-height: 1.5; }
.zone-expansion .btn { width: 100%; margin-top: 12px; }
.zone-expansion .btn:disabled { opacity: .55; cursor: default; }

/* Automatic action bonuses stay inline; no floating notifications or inventory. */
.cook-bonuses { flex-shrink: 0; border-radius: 12px; background: var(--bg-card); text-align: left; }
.cook-bonuses[hidden] { display: none; }
.cook-bonuses summary { min-height: 44px; padding: 12px; cursor: pointer; font-size: 13px; font-weight: 600; }
.cook-bonus-list { max-height: 180px; overflow-y: auto; padding: 0 12px 12px; }
.cook-bonus-row { display: flex; flex-direction: column; gap: 4px; padding: 10px 0; font-size: 12px; }
.cook-bonus-row + .cook-bonus-row { border-top: 1px solid color-mix(in srgb,var(--text) 12%,transparent); }
.cook-bonus-row small { color: var(--text-dim); line-height: 1.4; }
.cook-bonus-row span { font-variant-numeric: tabular-nums; }

/* Coffee slot: neutral ceramics, inline receipts and no floating notifications. */
.gacha-screen {max-width:560px;margin:0 auto;display:grid;gap:12px;padding-bottom:20px}
.gacha-screen h1 {margin:0;font-size:26px}
.gacha-screen header p {margin:6px 0 4px}
.gacha-screen .card {margin:0;min-width:0}
.gacha-screen summary {min-height:44px;display:flex;align-items:center;font-weight:700;cursor:pointer}
.gacha-machine {text-align:center;border:1px solid #ae8b5c;background:linear-gradient(145deg,rgba(176,134,83,.16),rgba(137,160,116,.08));padding:20px 16px}
.gacha-machine .btn {width:100%;margin-top:16px}
.gacha-machine small {display:block}.gacha-machine p {margin:8px 0}
.gacha-pity {font-size:13px;padding-top:8px}
.gacha-row {display:grid;gap:7px;padding:14px 0;border-top:1px solid rgba(128,128,128,.18);overflow-wrap:anywhere}
.gacha-row small,.gacha-row span {font-size:13px;color:var(--tg-theme-hint-color,#888)}
.gacha-result {text-align:center;border:1px solid #9ba97d}
.gacha-result-icon {display:block;font-size:40px}.gacha-result h2 {font-size:21px}
.gacha-note {font-size:14px;overflow-wrap:anywhere}.gacha-note:empty {display:none}
.gacha-pending {display:grid;gap:10px}

/* Case opening: server-confirmed reward lands beneath the fixed pointer. */
.gacha-reel { position:relative; margin:4px -8px 16px; min-width:0; }
.gacha-screen.is-revealing details { display:none; }
.gacha-reel-window { overflow:hidden; padding:12px 0; border:1px solid var(--control-border); border-radius:14px; background:var(--bg); }
.gacha-reel-track { position:relative; display:flex; gap:10px; width:max-content; will-change:transform; }
.gacha-reel-card { --reel-color:#98a5b5; flex:0 0 108px; width:108px; min-height:138px; box-sizing:border-box; display:flex; align-items:center; justify-content:center; flex-direction:column; gap:7px; padding:12px 7px; border:1px solid var(--reel-color); border-bottom:5px solid var(--reel-color); border-radius:10px; background:var(--bg-card); }
.gacha-reel-card.rare { --reel-color:#68a8dd; }.gacha-reel-card.epic { --reel-color:#ae83eb; }.gacha-reel-card.legendary { --reel-color:#f4c65b; }
.gacha-reel-emoji { font-size:40px; line-height:1.2; }
.gacha-reel-card b { font-size:11px; line-height:1.25; min-height:28px; overflow-wrap:anywhere; }
.gacha-reel-card small { font-size:10px; color:var(--text-dim); }
.gacha-reel-pointer { position:absolute; z-index:1; left:50%; top:0; bottom:0; width:2px; background:linear-gradient(#f4c65b,transparent 40%,transparent 60%,#f4c65b); pointer-events:none; }
.gacha-reel-pointer:before { content:""; position:absolute; left:-6px; top:0; border-left:7px solid transparent; border-right:7px solid transparent; border-top:11px solid #f4c65b; }
.gacha-reel-pointer:after { content:""; position:absolute; left:-6px; bottom:0; border-left:7px solid transparent; border-right:7px solid transparent; border-bottom:11px solid #f4c65b; }
.gacha-reel.has-winner [data-reel-winner] { box-shadow:inset 0 0 20px color-mix(in srgb,var(--reel-color) 22%,transparent); }
.gacha-result { animation:gacha-result-in .3s ease-out both; }
@keyframes gacha-result-in { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }
@media(prefers-reduced-motion:reduce) { .gacha-result { animation:none; } }

/* Different owners of the same currency: player wallet and cafe fund. */
.wallet-badge { display: inline-flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; padding: 6px 10px; border: 1px solid; border-radius: 12px; }
.wallet-personal { background: rgba(196,146,62,.12); border-color: rgba(196,146,62,.5); }
.wallet-treasury { background: rgba(65,140,173,.12); border-color: rgba(65,140,173,.5); }
.wallet-source { font-size: 12px; line-height: 1.5; }
.shop-head:has(.wallet-badge) { flex-wrap: wrap; gap: 10px; }

/* One shared weekly cafe order. */
.weekly-order { border: 1px solid rgba(176,137,65,.48); }
.weekly-order-eyebrow { font-size: 10px; letter-spacing: .08em; opacity: .72; margin-bottom: 8px; }
.weekly-order-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.weekly-order-heading h2 { margin: 0; }
.weekly-order-state { font-size: 12px; padding: 5px 8px; border-radius: 12px; background: rgba(176,137,65,.14); }
.weekly-order-state.is-complete { color: var(--tg-theme-button-color); font-weight: 700; }
.weekly-order-title { margin: 10px 0 16px; opacity: .85; }
.weekly-order-department { margin: 10px 0; }
.weekly-order-department > div { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.weekly-order-department progress { width: 100%; height: 9px; margin-top: 5px; accent-color: #ac844b; }
.weekly-order-reward { margin-top: 15px; font-size: 13px; line-height: 1.6; }
.weekly-order-honor {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 16px;
  background: rgba(176,137,65,.11);
  border-radius: 12px;
}
.weekly-order-honor strong { display: block; font-size: 17px; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.weekly-order-honor small { display: block; margin-top: 5px; font-size: 12px; line-height: 1.4; }
.weekly-order-network { font-size: 12px; line-height: 1.5; opacity: .8; }
