/* Hotel (gamificação) — fase 1: lista de cartões das salas. */
.hotel-page {
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter, sans-serif;
  color: #1d1d1f;
  background:
    radial-gradient(circle at 15% 20%, rgba(10, 132, 255, 0.10), transparent 40%),
    radial-gradient(circle at 85% 80%, rgba(255, 149, 0, 0.08), transparent 45%),
    #f2f2f7;
}

.hotel-top {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-5) var(--sp-6) var(--sp-3);
}
.hotel-top__title { margin: 0; font-size: var(--fs-xl); color: var(--navy-800); }
.hotel-top__subtitle { margin: 2px 0 0; font-size: var(--fs-sm); color: var(--text-muted); }

.hotel-main { padding: var(--sp-3) var(--sp-6) var(--sp-8); }
.hotel-status { margin: 0 0 var(--sp-4); color: var(--text-muted); }
.hotel-status.is-error { color: #b3261e; }

.hotel-rooms {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--sp-4);
}

.hotel-room {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: var(--sp-4);
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  border-top: 4px solid var(--grey-300);
}
.hotel-room--great { border-top-color: #34c759; }
.hotel-room--steady { border-top-color: #ff9500; }
.hotel-room--struggling { border-top-color: #ff3b30; }
.hotel-room.is-locked { background: repeating-linear-gradient(-45deg, var(--surface), var(--surface) 12px, rgba(255, 149, 0, 0.06) 12px, rgba(255, 149, 0, 0.06) 24px); }

.hotel-room__head { display: flex; align-items: center; gap: var(--sp-2); }
.hotel-room__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--navy-050);
  color: var(--navy-700);
}
.hotel-room__name { margin: 0; font-size: var(--fs-md); color: var(--navy-800); }
.hotel-room__state {
  margin-left: auto;
  padding: 2px 10px;
  border-radius: var(--r-full);
  font-size: var(--fs-xs);
  font-weight: 700;
  background: var(--grey-100);
  color: var(--grey-600);
}
.hotel-room--great .hotel-room__state { background: rgba(52, 199, 89, 0.14); color: #248a3d; }
.hotel-room--steady .hotel-room__state { background: rgba(255, 149, 0, 0.14); color: #c76a00; }
.hotel-room--struggling .hotel-room__state { background: rgba(255, 59, 48, 0.11); color: #b3261e; }

.hotel-room__score { display: flex; align-items: baseline; flex-wrap: wrap; gap: var(--sp-2) var(--sp-3); }
.hotel-room__number { font-size: 40px; font-weight: 800; line-height: 1; color: var(--navy-800); }
.hotel-room__split { font-size: var(--fs-sm); color: var(--text-muted); }
.hotel-room__trend { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-xs); font-weight: 700; color: var(--text-muted); }
.hotel-room__trend--up { color: #248a3d; }
.hotel-room__trend--down { color: #b3261e; }

.hotel-room__locked, .hotel-room__note { margin: 0; font-size: var(--fs-sm); color: var(--text-muted); }
.hotel-room__locked a { font-weight: 700; }
.hotel-room__group {
  margin: var(--sp-1) 0 0;
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.hotel-metrics { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-2); }
.hotel-metric {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px var(--sp-2);
  font-size: var(--fs-sm);
}
.hotel-metric__name a { color: inherit; text-decoration: none; }
.hotel-metric__name a:hover { text-decoration: underline; }
.hotel-metric__value { font-weight: 700; color: var(--navy-800); }
.hotel-metric__bar { grid-column: 1 / -1; height: 4px; border-radius: 2px; background: var(--grey-100); overflow: hidden; }
.hotel-metric__bar > span { display: block; height: 100%; background: #34c759; }
.hotel-metric.is-alert .hotel-metric__bar > span { background: #ff3b30; }
.hotel-metric.is-alert .hotel-metric__value { color: #b3261e; }
.hotel-metric.is-unavailable { color: var(--text-muted); }
.hotel-metric.is-unavailable .hotel-metric__value { color: var(--text-muted); font-weight: 500; }

@media (max-width: 640px) {
  .hotel-top { padding: var(--sp-4) var(--sp-4) var(--sp-2); }
  .hotel-main { padding: var(--sp-2) var(--sp-4) var(--sp-6); }
}

/* ---------- Fase 2: cena isométrica, alternância, painel e engrenagem ---------- */
.hotel-top__actions { display: flex; align-items: center; gap: var(--sp-2); margin-left: auto; }

.hotel-view {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border-radius: var(--r-full);
  background: rgba(120, 120, 128, 0.12);
}
.hotel-view[hidden] { display: none; }
.hotel-view__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 0;
  border-radius: var(--r-full);
  background: transparent;
  font: inherit;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: #6e6e73;
  cursor: pointer;
}
.hotel-view__btn.is-active { background: #fff; color: #1d1d1f; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }
.hotel-view__btn:focus-visible { outline: 2px solid #0a84ff; outline-offset: 2px; }

.hotel-stage {
  height: calc(100vh - 140px);
  min-height: 520px;
  border-radius: 24px;
  overflow: hidden;
}
.hotel-stage[hidden] { display: none; }
.hotel-stage canvas { display: block; }

.hotel-panel {
  position: fixed;
  top: var(--sp-4);
  right: var(--sp-4);
  bottom: var(--sp-4);
  z-index: 50;
  width: min(400px, calc(100vw - 32px));
  padding: var(--sp-6) var(--sp-4) var(--sp-4);
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.14);
  transform: translateX(16px);
  opacity: 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.hotel-panel[hidden] { display: none; }
.hotel-panel.is-open { transform: none; opacity: 1; }
.hotel-panel__close { position: absolute; top: var(--sp-3); right: var(--sp-3); }
.hotel-panel .hotel-room { border: 0; padding: 0; background: transparent; border-top: 0; }

.hotel-settings__help { margin: 0; font-size: var(--fs-sm); color: #6e6e73; }
.hotel-settings__list { display: flex; flex-direction: column; gap: var(--sp-2); }
.hotel-settings__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px;
  align-items: center;
  gap: var(--sp-3);
}
.hotel-settings__dept { font-weight: 600; color: #1d1d1f; }

@media (prefers-reduced-motion: reduce) {
  .hotel-panel { transition: none; }
}


/* Modal da engrenagem no estilo das páginas redesenhadas (cabeçalho branco, azul da app). */
#modal-hotel-settings .modal__dialog { border-radius: 24px; overflow: hidden; }
#modal-hotel-settings .modal__header { background: #fff; border-bottom: 1px solid rgba(60, 60, 67, 0.1); }
#modal-hotel-settings .modal__title { color: #1d1d1f; }
#modal-hotel-settings .modal__close { color: #6e6e73; }
#modal-hotel-settings .modal__footer { background: #fff; }
#modal-hotel-settings .btn--primary { background: #0a84ff; border-color: #0a84ff; }

/* ---------- Fase 3: nível, missões, conquistas, resumo e ranking ---------- */
.hotel-level { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: var(--sp-2); }
.hotel-level__badge {
  padding: 2px 10px;
  border-radius: var(--r-full);
  background: rgba(10, 132, 255, 0.12);
  color: #0058c7;
  font-size: var(--fs-xs);
  font-weight: 700;
}
.hotel-level__bar { height: 6px; border-radius: 3px; background: rgba(120, 120, 128, 0.16); overflow: hidden; }
.hotel-level__bar > span { display: block; height: 100%; background: #0a84ff; border-radius: 3px; }
.hotel-level__xp { font-size: var(--fs-xs); color: #6e6e73; }

.hotel-missions { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.hotel-mission {
  display: grid;
  grid-template-columns: 20px 1fr auto;
  align-items: center;
  gap: var(--sp-2);
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(120, 120, 128, 0.08);
  font-size: var(--fs-sm);
}
.hotel-mission__check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid rgba(60, 60, 67, 0.3);
  font-size: 12px;
  font-weight: 800;
  color: #fff;
}
.hotel-mission.is-done { background: rgba(52, 199, 89, 0.12); }
.hotel-mission.is-done .hotel-mission__check { background: #34c759; border-color: #34c759; }
.hotel-mission__label { color: #1d1d1f; }
.hotel-mission__value { font-weight: 700; color: #6e6e73; white-space: nowrap; }
.hotel-mission.is-done .hotel-mission__value { color: #248a3d; }

.hotel-achievements { display: flex; flex-wrap: wrap; gap: 6px; }
.hotel-achievement {
  padding: 3px 10px;
  border-radius: var(--r-full);
  background: rgba(255, 149, 0, 0.14);
  color: #8a4b00;
  font-size: var(--fs-xs);
  font-weight: 700;
}

.hotel-summary {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin: 0 0 var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.7);
}
.hotel-summary[hidden] { display: none; }
.hotel-summary__top { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-4); }
.hotel-summary__level {
  padding: 3px 12px;
  border-radius: var(--r-full);
  background: #0a84ff;
  color: #fff;
  font-size: var(--fs-sm);
  font-weight: 700;
}
.hotel-summary__champion { font-size: var(--fs-sm); color: #1d1d1f; }
.hotel-summary__ranking { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.hotel-summary__label { font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #6e6e73; }
.hotel-ranking { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.hotel-ranking li {
  padding: 3px 10px;
  border-radius: var(--r-full);
  background: rgba(120, 120, 128, 0.1);
  font-size: var(--fs-xs);
  color: #1d1d1f;
}
.hotel-ranking li:first-child { background: rgba(255, 149, 0, 0.16); }
.hotel-ranking__pos { color: #6e6e73; font-weight: 700; }

.hotel-stage { height: calc(100vh - 220px); }
