/* Styles for CoryCloset (cory_closet.js). Themeable via CSS variables - the
   defaults match the browser extension's warm palette; override the vars on
   .cory-closet (or :root) to reskin per host. All classes are closet-scoped. */

/* Defaults live on :root so the closet styles also apply in "bind mode" (host
   elements not wrapped in .cory-closet). Override on .cory-closet or :root. */
:root, .cory-closet {
  --cc-ink: #66594a;
  --cc-ink-strong: #4d4339;
  --cc-muted: #8a7a66;
  --cc-tile: #f1e9dd;
  --cc-tile-hover: #e7dbc9;
  --cc-locked-bg: #f6f1e8;
  --cc-locked-ink: #a99a84;
  --cc-panel: #f7f1e7;
  --cc-border: #e7dbc9;
  --cc-track: #ddd1bd;
  --cc-accent: #d97b4f;
  --cc-accent-2: #e8a266;
}

/* ---- emotion picker (optional) ---- */
.emotion-menu {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}
.emotion-menu button {
  margin: 0;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  color: var(--cc-ink);
  background: var(--cc-tile);
}
.emotion-menu button:hover { background: var(--cc-tile-hover); }
.emotion-menu button.active { color: #fff; background: var(--cc-ink-strong); }
.emotion-menu button.locked { opacity: 0.45; cursor: not-allowed; }

.emotion-level-label { display: flex; justify-content: space-between; margin-bottom: 4px; color: var(--cc-ink); }
.cory-closet .emotion-level { width: 100%; margin: 0; accent-color: var(--cc-accent); }
.emotion-say { margin-top: 14px; padding: 8px 16px; border: 0; border-radius: 8px; cursor: pointer; color: #fff; background: var(--cc-accent); }
.emotion-say.active { background: #9b5137; }

/* ---- unlock progress panel ---- */
.closet-progress {
  margin: 14px 0;
  padding: 12px 14px;
  font-size: 13px;
  color: var(--cc-ink);
  background: var(--cc-panel);
  border: 1px solid var(--cc-border);
  border-radius: 8px;
}
.closet-progress-summary { margin: 0 0 8px; }
.closet-progress-next { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.closet-progress-next-count { font-weight: 700; color: var(--cc-ink-strong); }
.closet-progress-bar { height: 10px; background: var(--cc-border); border-radius: 5px; overflow: hidden; }
.closet-progress-fill { height: 100%; border-radius: 5px; background: linear-gradient(90deg, var(--cc-accent-2), var(--cc-accent)); transition: width 0.4s ease; }

/* ---- grids ---- */
.closet-heading {
  margin: 16px 0 8px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--cc-muted);
}
.closet-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }

.closet-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 10px 6px;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  font-size: 12px;
  color: var(--cc-ink);
  background: var(--cc-tile);
}
.closet-item:hover:not(:disabled) { background: var(--cc-tile-hover); }
.closet-item.active { color: #fff; background: var(--cc-ink-strong); }
.closet-item.locked { cursor: not-allowed; color: var(--cc-locked-ink); background: var(--cc-locked-bg); }
.closet-item.locked .closet-item-icon { opacity: 0.55; }

.closet-item-icon { display: block; line-height: 0; }
.closet-item-icon svg { width: 22px; height: 22px; }

.closet-item-progress { display: block; width: 100%; height: 5px; margin-top: 4px; background: var(--cc-track); border-radius: 3px; overflow: hidden; }
.closet-item-progress-fill { display: block; height: 100%; border-radius: 3px; background: var(--cc-accent); }
.closet-item-progress-text { font-size: 10px; color: var(--cc-muted); }
