/* ── House ───────────────────────────────────────────────────────────────────── */
#house-col {
  flex: 0 0 30%;
  border-left: 1px solid var(--border);
  padding: 16px 14px;
  overflow-y: auto;
}

/* Sidebar live preview — click to open the full-screen overlay */
#house-preview-btn {
  display: block;
  width: 100%;
  padding: 8px 8px 6px;
  background: #0c0c22;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s, transform 0.12s;
}
#house-preview-btn:hover { border-color: var(--accent); transform: translateY(-1px); }
#house-preview {
  display: block;
  width: 100%;
  border-radius: 10px;
  background: #dff4ee;
}
#house-preview-label {
  display: block;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  padding-top: 6px;
}

/* Full-screen house overlay */
#house-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  flex-direction: column;
  background: rgba(8, 7, 18, 0.94);
  /* No backdrop-filter: blurring the full-screen backdrop on every frame of the
     continuously-animating canvas is a severe webkit compositing cost that
     starves input dispatch (topbar clicks hung in CI). The 0.94 bg already
     hides the page behind, so the blur was imperceptible anyway. */
}
#house-overlay.hidden { display: none; }

#hov-topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
#hov-title { font-size: 15px; font-weight: 800; margin-right: auto; }
.hov-btn {
  background: #14142e;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 12px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.hov-btn:hover:not(:disabled) { border-color: var(--accent); background: #1a1a3a; }
.hov-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.hov-btn.active { border-color: var(--accent); background: rgba(124,58,237,0.22); }
#hov-coins { font-weight: 700; color: var(--gold); font-size: 13px; }

#hov-canvas-wrap {
  flex: 1;
  position: relative;
  min-height: 0;
  overflow: hidden;
}
#hov-event-timer {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(20, 20, 45, 0.82);
  border: 2px solid var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}
#hov-event-timer[hidden] { display: none; }
#hov-et-icon { font-size: 16px; }
#hov-et-bar {
  width: 70px;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.22);
  overflow: hidden;
}
#hov-et-fill {
  height: 100%;
  width: 100%;
  background: var(--accent);
  transition: width 0.2s linear;
}
.hov-btn.locked { opacity: 0.35; cursor: not-allowed; }
#house-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none; /* Pointer Events handle all gestures, incl. touch drag */
}

/* Floating flip/delete buttons over a selected item (edit mode) */
.hov-float-btn {
  position: absolute;
  z-index: 5;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 2px solid #6b4a35;
  background: #fffdf8;
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.35);
  transition: transform 0.1s;
}
.hov-float-btn:hover { transform: scale(1.12); }

/* Bottom catalog panel (edit mode) */
#hov-panel {
  border-top: 1px solid var(--border);
  background: #0c0c22;
  padding: 8px 12px 10px;
}
#hov-panel.hidden { display: none; }
#hov-panel-tabs { display: flex; gap: 8px; margin-bottom: 8px; }
#hov-panel-items {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.hov-cat-item {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  width: 74px;
  padding: 6px 4px;
  background: #14142e;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  position: relative;
  transition: border-color 0.15s;
}
.hov-cat-item:hover:not(:disabled) { border-color: var(--accent2); }
.hov-cat-item:disabled { opacity: 0.38; cursor: not-allowed; }
.hov-cat-item.selected { border-color: var(--accent); background: rgba(124,58,237,0.18); }
.hov-cat-item canvas { width: 48px; height: 36px; }
.hov-cat-swatch { width: 48px; height: 36px; border-radius: 6px; border: 1.5px solid rgba(107,74,53,0.4); }
.hov-cat-name { font-size: 10px; color: var(--text); text-align: center; line-height: 1.2; }
.hov-cat-cost { font-size: 10px; font-weight: 700; color: var(--gold); }
.hov-cat-cost.owned { color: #4ade80; }
.hov-cat-count {
  position: absolute; top: -6px; right: -6px;
  background: var(--accent); color: #fff;
  border-radius: 8px; font-size: 9px; font-weight: 700;
  padding: 1px 5px;
}
.hov-cat-item.locked { opacity: 0.55; }
.hov-cat-locked { color: #9ca3af; font-size: 10px; font-weight: 600; }

/* "Buy new house" button in the topbar */
.hov-buy-plot {
  background: rgba(34,197,94,0.18);
  border-color: #4ade80;
  color: #4ade80;
  font-weight: 700;
}
.hov-buy-plot:hover:not(:disabled) { background: rgba(34,197,94,0.32); }
.hov-buy-plot:disabled { opacity: 0.5; border-color: #6b7280; color: #9ca3af; }

/* Character card (life mode) */
#hov-charcard {
  position: absolute;
  z-index: 6;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: 240px;
  padding: 14px;
  background: var(--card, #0c0c22);
  border: 1.5px solid var(--accent);
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}
#hov-charcard.hidden { display: none; }
#hov-cc-close {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 2px 8px;
  font-size: 12px;
}
#hov-cc-name {
  width: 70%;
  background: #14142e;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  font-weight: 800;
  padding: 6px 10px;
  margin-bottom: 8px;
}
#hov-cc-name:focus { outline: none; border-color: var(--accent); }
.hov-cc-row { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.hov-cc-born { font-size: 11px; }
#hov-cc-swatches { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.hov-cc-swatch {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid rgba(107, 74, 53, 0.4);
  cursor: pointer;
  transition: transform 0.1s;
}
.hov-cc-swatch:hover { transform: scale(1.15); }
.hov-cc-swatch.selected { border-color: #fff; box-shadow: 0 0 0 2px var(--accent); }

/* Events panel (life mode) */
#hov-events-panel {
  position: absolute;
  z-index: 6;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: min(400px, calc(100% - 24px));
  padding: 14px;
  background: var(--card, #0c0c22);
  border: 1.5px solid var(--accent);
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}
#hov-events-panel.hidden { display: none; }
#hov-ev-close {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 2px 8px;
  font-size: 12px;
}
.hov-ev-title { font-size: 15px; font-weight: 800; margin-bottom: 10px; }
.hov-ev-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  border-top: 1px solid var(--border);
}
.hov-ev-row.locked { opacity: 0.55; }
.hov-ev-icon { font-size: 22px; flex: 0 0 auto; }
.hov-ev-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.hov-ev-info strong { font-size: 13px; }
.hov-ev-info small { font-size: 11px; color: var(--muted); line-height: 1.25; }
.hov-ev-buy { flex: 0 0 auto; color: var(--gold); font-weight: 700; white-space: nowrap; }
.hov-ev-lock { flex: 0 0 auto; font-size: 11px; font-weight: 700; color: #9ca3af; white-space: nowrap; }

/* "Almost affordable" goal card pinned first in the catalog */
.hov-goal {
  border-color: var(--gold);
  cursor: default;
}
.hov-goal-tag {
  font-size: 9px;
  font-weight: 800;
  color: var(--gold);
  letter-spacing: 0.5px;
}
.hov-goal-bar {
  display: block;
  width: 56px;
  height: 5px;
  border-radius: 3px;
  background: #1a1a3a;
  overflow: hidden;
}
.hov-goal-bar span {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: var(--gold);
}

/* Hint credits badge on hint button */
.hint-avail {
  display: inline-block;
  background: rgba(124,58,237,0.25);
  color: #c4b5fd;
  border-radius: 10px;
  padding: 1px 6px;
  font-size: 10px; font-weight: 700;
  margin-left: 3px; vertical-align: middle;
}
