/* The Coat Room — quiet settings for the house shell.
 *
 * Synchronized with Part I's Coat Room wrapper: keyed brand, back-door header,
 * ghost mirror, progress glance, door-list directory, and a framed epigraph.
 * The Call-specific controls still live here: difficulty, audio, purchases,
 * account state, and key balance.
 */

.coat-room-body {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: calc(2.5rem + env(safe-area-inset-top, 0)) 1.25rem
    calc(2.5rem + env(safe-area-inset-bottom, 0));
  text-align: left;
}

.coat-room-body [hidden] {
  display: none !important;
}

.coatroom-id {
  display: grid;
  gap: 1rem;
  overflow: hidden;
  padding: 0;
}

.coatroom-id-body {
  min-width: 0;
  padding: 0 1.2rem 1.2rem;
}

.coatroom-eyebrow {
  margin: 0 0 0.15rem;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.coatroom-mirror {
  min-height: clamp(12rem, 54vw, 19rem);
  display: grid;
  place-items: center;
  padding: clamp(0.9rem, 4vw, 1.4rem) 1rem 0.3rem;
  background:
    radial-gradient(80% 65% at 50% 8%, rgba(141, 35, 55, 0.24), transparent 62%),
    #08070d;
  touch-action: pan-y;
}

.coatroom-ghost {
  --ghost-size: min(100%, 18.5rem);
  --ghost-accent: #d9aeb7;
  --ghost-float: 4px;
  animation: halloway-ghost-float 8s ease-in-out infinite;
}

.coat-room-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: baseline;
  margin-bottom: 0.85rem;
}

.coat-room-panel-head--inline {
  margin-bottom: 0.6rem;
}

.coat-room-panel-head .shell-section-title {
  margin: 0;
  text-align: left;
}

.coat-room-state {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: right;
}

.coat-difficulty-options {
  display: grid;
  gap: 0.55rem;
}

.coat-difficulty-option {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.65rem;
  align-items: start;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.72rem 0.78rem;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease;
}

.coat-difficulty-option:hover,
.coat-difficulty-option:focus-within,
.coat-difficulty-option.is-selected {
  border-color: rgba(178, 126, 132, 0.52);
  background: rgba(255, 255, 255, 0.035);
}

.coat-difficulty-option input {
  margin-top: 0.22rem;
  accent-color: var(--accent);
}

.coat-difficulty-option strong {
  display: block;
  margin-bottom: 0.18rem;
}

.coat-difficulty-option span:last-child {
  color: var(--fg-secondary);
  font-size: 0.88rem;
  line-height: 1.42;
}

.coat-toggle-list {
  display: grid;
  gap: 0.65rem;
}

.coat-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.78rem 0.85rem;
}

.coat-toggle small {
  display: block;
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.coat-toggle input {
  width: 2.6rem;
  height: 1.35rem;
  flex: 0 0 auto;
  accent-color: var(--accent);
}

.coat-key-balance {
  margin: 0 0 0.85rem;
  color: color-mix(in srgb, var(--moss) 72%, var(--fg-secondary));
  font-size: 0.92rem;
}

.coat-ownership {
  margin: 0 0 0.9rem;
  padding: 0.78rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
}

.coat-ownership-title,
.coat-ownership-note {
  margin: 0;
}

.coat-ownership-title {
  color: var(--fg);
  font-size: 0.9rem;
  font-weight: 750;
}

.coat-ownership-note {
  margin-top: 0.16rem;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.4;
}

.coat-ownership-list {
  display: grid;
  gap: 0.34rem;
  margin: 0.62rem 0 0;
  padding: 0;
  list-style: none;
}

.coat-ownership-item {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  color: var(--fg-secondary);
  font-size: 0.79rem;
}

.coat-ownership-item strong {
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.coat-ownership-item.is-owned strong {
  color: color-mix(in srgb, var(--moss) 72%, #fff);
}

.coat-room-actions {
  display: grid;
  gap: 0.6rem;
}

.coat-room-actions .btn-secondary {
  width: 100%;
}

.coat-code-form {
  display: grid;
  gap: 0.42rem;
  margin-top: 0.9rem;
}

.coat-code-form label,
.coat-code-state {
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.4;
}

.coat-code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem;
}

.coat-code-row input {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.24);
  color: var(--fg);
  font: inherit;
  padding: 0.68rem 0.72rem;
  text-transform: uppercase;
}

.coat-code-row input:focus {
  border-color: rgba(217, 174, 183, 0.62);
  outline: 2px solid rgba(217, 174, 183, 0.18);
}

.coat-code-state {
  margin: 0;
}

.metrics-optout {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.65rem;
  align-items: start;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.78rem 0.85rem;
  color: var(--fg-secondary);
  font-size: 0.88rem;
  line-height: 1.42;
}

.metrics-optout input {
  margin-top: 0.18rem;
  accent-color: var(--accent);
}

.coatroom-progress {
  display: grid;
  gap: 0.55rem;
}

.coatroom-prog-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.55rem;
  align-items: stretch;
}

.coatroom-prog-row,
.coatroom-link {
  display: grid;
  align-items: center;
  gap: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
  text-decoration: none;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.coatroom-prog-row {
  grid-template-columns: 2.35rem minmax(0, 1fr);
  padding: 0.72rem 0.82rem;
}

.coatroom-reset {
  min-width: 4.7rem;
  display: grid;
  place-items: center;
  color: var(--fg-secondary);
}

.coatroom-link {
  grid-template-columns: 2.35rem minmax(0, 1fr) auto;
  padding: 0.75rem 0.82rem;
}

.coatroom-prog-row:hover,
.coatroom-prog-row:focus-visible,
.coatroom-link:hover,
.coatroom-link:focus-visible {
  border-color: var(--fg-secondary);
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-1px);
  outline: none;
}

.coatroom-prog-door,
.coatroom-link-door {
  width: 2.35rem;
  height: 2.35rem;
  display: grid;
  place-items: center;
  border-radius: 9px;
}

.coatroom-prog-door {
  color: var(--row-accent, var(--fg-secondary));
  background: color-mix(in srgb, var(--row-accent, #888) 12%, transparent);
}

.coatroom-link-door {
  color: var(--fg-secondary);
  background: rgba(255, 255, 255, 0.045);
}

.coatroom-prog-door svg,
.coatroom-link-door svg {
  width: 1.15rem;
  height: 1.55rem;
}

.coatroom-prog-main,
.coatroom-link-text {
  min-width: 0;
}

.coatroom-prog-head,
.coatroom-link-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.coatroom-prog-name,
.coatroom-link-name {
  color: var(--fg);
  font-size: 0.96rem;
  letter-spacing: 0;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.coatroom-prog-state,
.coatroom-link-note {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.25;
}

.coatroom-prog-bar {
  display: block;
  height: 4px;
  margin-top: 0.55rem;
  overflow: hidden;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
}

.coatroom-prog-fill {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: var(--row-accent, var(--fg-secondary));
  transition: width 220ms ease;
}

.coatroom-dir {
  display: grid;
  gap: 0.55rem;
}

.coatroom-link-chev {
  color: var(--muted);
  font-size: 1.35rem;
  line-height: 1;
}

.coatroom-link:hover .coatroom-link-chev,
.coatroom-link:focus-visible .coatroom-link-chev {
  color: var(--fg);
}

.coatroom-epigraph {
  padding-inline: 0.7rem;
}

@media (prefers-reduced-motion: reduce) {
  .shell-door-back,
  .shell-door-back::after,
  .coat-difficulty-option,
  .coatroom-prog-row,
  .coatroom-reset,
  .coatroom-link,
  .coatroom-prog-fill {
    transition: none;
  }

  .shell-door-back:hover,
  .shell-door-back:focus-visible,
  .coatroom-prog-row:hover,
  .coatroom-prog-row:focus-visible,
  .coatroom-reset:hover,
  .coatroom-reset:focus-visible,
  .coatroom-link:hover,
  .coatroom-link:focus-visible {
    transform: none;
  }
}

@media (max-width: 560px) {
  .coatroom-prog-item {
    grid-template-columns: 1fr;
  }

  .coatroom-reset {
    width: 100%;
    min-height: 2.55rem;
  }
}
