:root {
  --wine: #2a0a12;
  --velvet: #3d1220;
  --panel: #4a1828;
  --gold: #d4a84b;
  --gold-soft: #e8c97a;
  --cream: #f3e6d0;
  --mute: #c4a890;
  --emerald: #1a6b54;
  --line: #6b3a2e;
  --safe: env(safe-area-inset-bottom, 0px);
  --top: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body {
  height: 100%;
  height: 100svh;
  overflow: hidden;
}
body {
  font-family: "Libre Baskerville", "Palatino Linotype", Palatino, Georgia, serif;
  background: var(--wine);
  color: var(--cream);
}
button, input, select, textarea { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
.off, [hidden] { display: none !important; }

#salon {
  height: 100%;
  height: 100svh;
  max-width: 430px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background:
    radial-gradient(48% 30% at 12% 0%, rgba(212, 168, 75, 0.18), transparent 55%),
    radial-gradient(55% 36% at 100% 8%, rgba(26, 107, 84, 0.22), transparent 50%),
    linear-gradient(165deg, #3a101c 0%, var(--wine) 48%, #1a060c 100%);
  padding: var(--top) 0 0;
  position: relative;
}
#salon::before {
  content: "";
  pointer-events: none;
  position: absolute;
  inset: 0;
  opacity: 0.07;
  background-image:
    repeating-linear-gradient(90deg, transparent 0 11px, rgba(243, 230, 208, 0.35) 11px 12px),
    repeating-linear-gradient(0deg, transparent 0 11px, rgba(243, 230, 208, 0.25) 11px 12px);
  mask-image: linear-gradient(180deg, #000 0%, transparent 70%);
}

.marquee {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px 6px;
  position: relative;
  z-index: 1;
}
.crest-btn {
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  transition: transform 0.25s ease;
}
.crest-btn:active { transform: scale(0.94); }
.crest-btn img { width: 48px; height: 48px; }
.title-block { min-width: 0; flex: 1; }
.title-block em {
  display: block;
  font-family: Cinzel, "Palatino Linotype", serif;
  font-style: normal;
  font-size: 11px;
  color: var(--gold);
  font-weight: 500;
}
.title-block strong {
  display: block;
  font-family: Cinzel, "Palatino Linotype", serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--cream);
  line-height: 1.2;
}
.pulse-pill {
  min-width: 44px;
  height: 40px;
  border: 1px solid var(--gold);
  background: linear-gradient(160deg, var(--velvet), #1e0810);
  display: flex;
  align-items: center;
  justify-content: center;
  clip-path: polygon(12% 0, 100% 0, 88% 100%, 0 100%);
  color: var(--gold-soft);
  font-family: Cinzel, serif;
  font-size: 14px;
  font-weight: 700;
}

.gold-rail {
  flex-shrink: 0;
  height: 2px;
  margin: 4px 20px 8px;
  background: linear-gradient(90deg, transparent, var(--gold), var(--emerald), var(--gold), transparent);
  position: relative;
  z-index: 1;
}

#stage {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 4px 18px calc(28px + var(--safe));
  position: relative;
  z-index: 1;
  -webkit-overflow-scrolling: touch;
}

.eyebrow {
  font-family: Cinzel, serif;
  font-size: 11px;
  color: var(--gold);
  font-weight: 500;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.doors-label { margin-top: 22px; }
h1 {
  font-family: Cinzel, serif;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 8px;
  color: var(--cream);
}
.lede {
  color: var(--mute);
  font-size: 14px;
  line-height: 1.45;
  margin-bottom: 16px;
}

.stat-arcade {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 8px;
}
.stat-tile {
  background:
    linear-gradient(145deg, rgba(212, 168, 75, 0.12), transparent 40%),
    var(--velvet);
  border: 1px solid var(--line);
  padding: 12px 14px;
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px));
  animation: tileIn 0.55s ease both;
}
.stat-tile:nth-child(2) { animation-delay: 0.06s; }
.stat-tile:nth-child(3) { animation-delay: 0.12s; }
.stat-tile:nth-child(4) { animation-delay: 0.18s; }
.stat-tile.wide { grid-column: 1 / -1; }
.stat-tile small {
  display: block;
  font-family: Cinzel, serif;
  font-size: 10px;
  color: var(--gold);
  margin-bottom: 4px;
}
.stat-tile b {
  font-family: Cinzel, serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--cream);
}
.stat-tile b.soft { font-size: 15px; font-weight: 500; line-height: 1.35; }

.week-bars {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 52px;
  margin-top: 6px;
}
.week-bars span {
  flex: 1;
  background: linear-gradient(180deg, var(--gold-soft), var(--emerald));
  min-height: 4px;
  border-radius: 2px 2px 0 0;
  opacity: 0.35;
  transition: height 0.4s ease, opacity 0.3s;
  position: relative;
}
.week-bars span.on { opacity: 1; }
.week-bars span::after {
  content: attr(data-d);
  position: absolute;
  bottom: -16px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  color: var(--mute);
  font-family: Cinzel, serif;
}

.door-ring {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 8px;
}
.door {
  border: 1px solid var(--gold);
  background:
    linear-gradient(180deg, rgba(212, 168, 75, 0.16), transparent 38%),
    linear-gradient(160deg, var(--panel), #220810);
  cursor: pointer;
  padding: 16px 12px 14px;
  text-align: center;
  clip-path: polygon(8% 0, 92% 0, 100% 10%, 100% 100%, 0 100%, 0 10%);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  animation: doorRise 0.5s ease both;
}
.door:nth-child(2) { animation-delay: 0.05s; }
.door:nth-child(3) { animation-delay: 0.1s; }
.door:nth-child(4) { animation-delay: 0.15s; }
.door:nth-child(5) { animation-delay: 0.2s; }
.door:nth-child(6) { animation-delay: 0.25s; }
.door:active { transform: translateY(2px); }
.door.focus {
  grid-column: 1 / -1;
  background:
    linear-gradient(180deg, rgba(26, 107, 84, 0.35), transparent 50%),
    linear-gradient(160deg, var(--panel), #1a0a10);
}
.door img {
  width: 56px;
  height: 56px;
  margin: 0 auto 8px;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.35));
}
.door span {
  display: block;
  font-family: Cinzel, serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--gold-soft);
}

.back-gilt {
  border: 0;
  background: transparent;
  color: var(--gold);
  font-family: Cinzel, serif;
  font-size: 13px;
  cursor: pointer;
  margin-bottom: 10px;
  padding: 4px 0;
}
.seal, .fade {
  border: 0;
  cursor: pointer;
  font-family: Cinzel, serif;
  font-size: 14px;
  font-weight: 700;
  padding: 14px 18px;
  margin: 4px 0 14px;
}
.seal {
  width: 100%;
  background: linear-gradient(180deg, var(--gold-soft), var(--gold) 55%, #a87a28);
  color: #2a0a12;
  clip-path: polygon(4% 0, 96% 0, 100% 50%, 96% 100%, 4% 100%, 0 50%);
}
.seal:active { filter: brightness(0.92); }
.fade {
  background: transparent;
  color: var(--mute);
  border: 1px solid var(--line);
  clip-path: polygon(3% 0, 97% 0, 100% 100%, 0 100%);
}
.row-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
}

.field {
  display: block;
  margin-bottom: 12px;
}
.field > span {
  display: block;
  font-family: Cinzel, serif;
  font-size: 11px;
  color: var(--gold);
  margin-bottom: 6px;
}
.field > span em {
  font-style: italic;
  color: var(--mute);
  font-weight: 400;
  font-family: "Libre Baskerville", serif;
  font-size: 11px;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  background: var(--velvet);
  border: 1px solid var(--line);
  color: var(--cream);
  padding: 12px 14px;
  border-radius: 0;
  outline: none;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--gold);
}
.field textarea { resize: vertical; min-height: 96px; }
.field input[type="range"] {
  padding: 0;
  height: 28px;
  accent-color: var(--gold);
  background: transparent;
  border: 0;
}

.list { display: flex; flex-direction: column; gap: 8px; }
.hollow {
  color: var(--mute);
  font-size: 14px;
  padding: 18px 8px;
  text-align: center;
  border: 1px dashed var(--line);
}
.entry {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  text-align: left;
  width: 100%;
  border: 1px solid var(--line);
  background: linear-gradient(120deg, rgba(212, 168, 75, 0.08), transparent 42%), var(--velvet);
  padding: 12px 14px;
  cursor: pointer;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%);
}
.entry:active { filter: brightness(1.06); }
.entry .meta { min-width: 0; flex: 1; }
.entry .meta small {
  display: block;
  font-family: Cinzel, serif;
  font-size: 10px;
  color: var(--gold);
  margin-bottom: 2px;
}
.entry .meta b {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: var(--cream);
  margin-bottom: 2px;
}
.entry .meta p {
  font-size: 12px;
  color: var(--mute);
  line-height: 1.35;
}
.entry .badge {
  font-family: Cinzel, serif;
  font-size: 11px;
  color: var(--gold-soft);
  border: 1px solid var(--gold);
  padding: 4px 8px;
  flex-shrink: 0;
}

.chip-pick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.chip {
  border: 1px solid var(--line);
  background: var(--velvet);
  color: var(--mute);
  font-family: Cinzel, serif;
  font-size: 11px;
  padding: 8px 12px;
  cursor: pointer;
}
.chip.on {
  border-color: var(--gold);
  color: var(--gold-soft);
  background: rgba(212, 168, 75, 0.15);
}

.search-hit small.kind {
  color: var(--emerald);
}

@keyframes tileIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes doorRise {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .stat-tile, .door { animation: none; }
  .week-bars span { transition: none; }
}
