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

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

.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%, #1d1610 0%, #0e0a07 100%);
}

.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-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: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
}

.room-actions {
  display: flex;
  gap: 8px;
  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: 8px; margin-bottom: 14px; overflow-x: auto; }

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

.shop-tab.active { background: var(--accent); color: var(--accent-text); }

.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; }

.shop-buy, .shop-apply { padding: 8px 16px; font-size: 14px; }

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

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

.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: 28px;
  flex-shrink: 0;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  cursor: pointer;
  transition: background 0.2s ease;
}

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

.switch.on { 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-title { font-size: 20px; font-weight: 700; margin: 10px 0 4px; text-align: center; }

.picker-sub { text-align: center; color: var(--text-dim); font-size: 14px; margin-bottom: 16px; }

.cafe-item {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  border: none;
  border-radius: var(--radius);
  color: var(--text);
  padding: 16px;
  margin-bottom: 10px;
  font-size: 15px;
  cursor: pointer;
  text-align: left;
}

.cafe-item .cafe-lvl { color: var(--text-dim); font-size: 13px; }

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

.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;
}
