/* THE PROBATE ROOM — all rules scoped under #screen-probate */

#screen-probate .pr-room {
  max-width: 60rem;
  margin: 0 auto;
  padding: 0.4rem 0.8rem 1.2rem;
  text-align: center;
}

/* ---------- header ---------- */
#screen-probate .pr-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
  padding-top: 0.4rem;
}
#screen-probate .pr-title {
  color: var(--gold);
  letter-spacing: 0.32em;
  font-size: 1.05rem;
  font-weight: 600;
  text-shadow: 0 0 14px rgba(216, 180, 90, 0.3);
}
#screen-probate .pr-owner { letter-spacing: 0.06em; }
#screen-probate .pr-leave {
  margin-top: 0;
  font-size: 0.72rem;
  padding: 0.45rem 0.6rem;
  min-height: 44px;
}
#screen-probate .pr-stats {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.15rem;
}
#screen-probate .pr-purse {
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  font-size: 1.05rem;
  text-shadow: 0 0 10px rgba(216, 180, 90, 0.35);
}
#screen-probate .pr-rules-link {
  background: none;
  border: none;
  color: #8c8775;
  font-style: italic;
  font-size: 0.72rem;
  font-family: inherit;
  text-decoration: underline dotted;
  cursor: pointer;
  padding: 0.35rem;
  min-height: 30px;
}
#screen-probate .pr-rules-link:hover { color: var(--gold-dim); }

#screen-probate .pr-houseline {
  min-height: 1.2rem;
  margin: 0.35rem auto 0.45rem;
  max-width: 38rem;
  color: #9b9480;
}

/* ---------- the stage ---------- */
#screen-probate .pr-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 100 / 64;
  max-height: 62vh;
  margin: 0 auto;
  border: 1px solid var(--gold-dim);
  box-shadow:
    inset 0 0 0 3px rgba(6, 9, 6, 0.9),
    inset 0 0 60px rgba(0, 0, 0, 0.7),
    0 14px 44px rgba(0, 0, 0, 0.6);
  background: #070907;
  overflow: hidden;
  touch-action: none;
}
#screen-probate .pr-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: crosshair;
}
#screen-probate .pr-oil {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 0.45rem;
  height: 0.3rem;
  border: 1px solid rgba(216, 180, 90, 0.35);
  background: rgba(6, 9, 6, 0.6);
  pointer-events: none;
}
#screen-probate .pr-oil-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #d8b45a, #b07c30);
  box-shadow: 0 0 10px rgba(216, 180, 90, 0.5);
  transition: width 0.2s linear;
}
#screen-probate .pr-phase-label {
  position: absolute;
  top: 0.45rem;
  left: 0;
  right: 0;
  font-size: 0.66rem;
  letter-spacing: 0.3em;
  color: rgba(216, 180, 90, 0.75);
  pointer-events: none;
  text-transform: uppercase;
}
#screen-probate .pr-begin {
  position: absolute;
  left: 50%;
  top: 56%;
  transform: translate(-50%, -50%);
  letter-spacing: 0.2em;
  padding: 0.9rem 1.4rem;
  min-height: 48px;
  background: rgba(6, 9, 6, 0.82);
  box-shadow: 0 0 30px rgba(216, 180, 90, 0.2);
}
#screen-probate .pr-toast {
  position: absolute;
  left: 50%;
  bottom: 1.2rem;
  transform: translateX(-50%);
  background: rgba(6, 9, 6, 0.88);
  border: 1px solid var(--gold-dim);
  color: var(--bone);
  font-size: 0.74rem;
  font-style: italic;
  padding: 0.4rem 0.8rem;
  pointer-events: none;
  white-space: nowrap;
  max-width: 92%;
  overflow: hidden;
  text-overflow: ellipsis;
}
#screen-probate .pr-slander-flash { animation: pr-slander 0.9s ease-out; }
@keyframes pr-slander {
  0% { box-shadow: inset 0 0 0 3px rgba(6, 9, 6, 0.9), inset 0 0 120px rgba(168, 54, 46, 0.85); }
  100% { box-shadow: inset 0 0 0 3px rgba(6, 9, 6, 0.9), inset 0 0 60px rgba(0, 0, 0, 0.7); }
}

/* ---------- the picker ---------- */
#screen-probate .pr-picker {
  position: absolute;
  transform: translate(-50%, -100%);
  background: linear-gradient(170deg, var(--felt-deep), var(--felt));
  border: 1px solid var(--gold-dim);
  box-shadow: inset 0 0 0 2px rgba(6, 9, 6, 0.9), 0 10px 30px rgba(0, 0, 0, 0.7);
  padding: 0.55rem 0.6rem 0.5rem;
  z-index: 6;
  min-width: 15rem;
}
#screen-probate .pr-picker-title {
  font-size: 0.72rem;
  font-style: italic;
  color: var(--bone);
  margin-bottom: 0.45rem;
}
#screen-probate .pr-picker-row {
  display: flex;
  gap: 0.35rem;
  justify-content: center;
}
#screen-probate .pr-glyph {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  min-width: 48px;
  min-height: 48px;
  padding: 0.3rem 0.3rem 0.25rem;
  background: #0b130d;
  border: 1px solid var(--gold-dim);
  color: var(--gold);
  font-family: inherit;
  cursor: pointer;
}
#screen-probate .pr-glyph b { font-size: 1.15rem; font-weight: 400; }
#screen-probate .pr-glyph span { font-size: 0.5rem; letter-spacing: 0.12em; color: #a9a28d; }
#screen-probate .pr-glyph:hover:not(:disabled) {
  box-shadow: inset 0 0 14px rgba(216, 180, 90, 0.35);
}
#screen-probate .pr-glyph-off {
  opacity: 0.3;
  cursor: not-allowed;
  border-color: #3a3526;
  color: #8c8775;
}
#screen-probate .pr-picker-cancel {
  margin-top: 0.45rem;
  font-size: 0.68rem;
  padding: 0.3rem 0.5rem;
  min-height: 34px;
}

/* ---------- the dock: chips, escrow, actions ---------- */
#screen-probate .pr-dock {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  max-width: 56rem;
  margin: 0.7rem auto 0;
  padding: 0.5rem 0.7rem;
  border: 1px solid rgba(216, 180, 90, 0.22);
  background: linear-gradient(180deg, rgba(12, 22, 16, 0.65), rgba(6, 9, 6, 0.65));
  opacity: 0.45;
  transition: opacity 0.4s ease;
}
#screen-probate .pr-dock-live { opacity: 1; }
#screen-probate .pr-chips {
  display: flex;
  gap: 0.45rem;
  min-height: 52px;
  align-items: center;
}
#screen-probate .pr-chips.pr-disabled { opacity: 0.35; pointer-events: none; }
#screen-probate .pr-chips.pr-armed .pr-chip { box-shadow: 0 0 16px rgba(216, 180, 90, 0.55); }
#screen-probate .pr-chip {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid var(--gold-dim);
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 226, 150, 0.25), transparent 55%),
    radial-gradient(circle, #6b5523 0%, #43350f 75%);
  color: var(--gold);
  font-family: inherit;
  cursor: grab;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
#screen-probate .pr-chip span { font-size: 1rem; line-height: 1; }
#screen-probate .pr-chip i { font-style: normal; font-size: 0.55rem; color: #cdb169; }
#screen-probate .pr-chip-lifted { opacity: 0.25; }
#screen-probate .pr-escrow {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.05rem;
}
#screen-probate .pr-escrow-num {
  color: var(--gold);
  font-size: 1.3rem;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 12px rgba(216, 180, 90, 0.4);
}
#screen-probate .pr-seal {
  color: #b0413a;
  font-size: 0.7rem;
  letter-spacing: 0.25em;
  min-height: 0.9rem;
  text-shadow: 0 0 8px rgba(168, 54, 46, 0.6);
}
#screen-probate .pr-actions {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  align-items: stretch;
}
#screen-probate .pr-actions button {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  padding: 0.55rem 0.8rem;
  min-height: 44px;
}
#screen-probate .pr-actions button:disabled { opacity: 0.35; cursor: default; }

/* ---------- the clerk's ledger ---------- */
#screen-probate .pr-ledger {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(3, 5, 3, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  overflow-y: auto;
}
#screen-probate .pr-ledger-book {
  width: min(56rem, 96vw);
  max-height: 94vh;
  overflow-y: auto;
  background: linear-gradient(175deg, #171410 0%, #100e0a 70%);
  border: 1px solid var(--gold-dim);
  box-shadow:
    inset 0 0 0 3px rgba(6, 9, 6, 0.9),
    inset 0 0 0 4px rgba(216, 180, 90, 0.25),
    0 18px 60px rgba(0, 0, 0, 0.8);
  padding: 1.1rem 1.2rem 1.3rem;
  animation: pr-page-in 0.5s ease-out;
}
@keyframes pr-page-in {
  from { opacity: 0; transform: translateY(16px) rotate(0.4deg); }
  to { opacity: 1; transform: none; }
}
#screen-probate .pr-ledger-head h3 {
  margin: 0.2rem 0 0.3rem;
  color: var(--bone);
  letter-spacing: 0.18em;
  font-size: 1rem;
  font-weight: 600;
}
#screen-probate .pr-ledger-outcome {
  display: block;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  margin-bottom: 0.6rem;
}
#screen-probate .pr-good { color: var(--gold); }
#screen-probate .pr-bad { color: #c4503f; }
#screen-probate .pr-miss { color: #6f695a; }
#screen-probate .pr-ledger-pages {
  display: flex;
  gap: 0.8rem;
  justify-content: center;
}
#screen-probate .pr-ledger-pages figure {
  margin: 0;
  flex: 1 1 0;
  min-width: 0;
}
#screen-probate .pr-mini {
  width: 100%;
  display: block;
  border: 1px solid rgba(216, 180, 90, 0.3);
  background: #0a0d0a;
}
#screen-probate .pr-ledger-pages figcaption {
  font-size: 0.58rem;
  letter-spacing: 0.26em;
  color: var(--gold-dim);
  margin-top: 0.3rem;
}
#screen-probate .pr-ledger-lists {
  display: flex;
  gap: 1.2rem;
  margin: 0.9rem 0 0.4rem;
  text-align: left;
}
#screen-probate .pr-ledger-col { flex: 1 1 0; min-width: 0; }
#screen-probate .pr-led-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.32rem 0.1rem;
  border-bottom: 1px dotted rgba(216, 180, 90, 0.2);
  font-size: 0.78rem;
}
#screen-probate .pr-led-row i { color: #a9a28d; }
#screen-probate .pr-led-ink { color: var(--bone); }
#screen-probate .pr-led-row b { letter-spacing: 0.14em; font-size: 0.66rem; white-space: nowrap; }
#screen-probate .pr-stamp-mark {
  border: 1px solid currentColor;
  padding: 0.08rem 0.3rem;
  transform: rotate(-3deg);
  display: inline-block;
}
#screen-probate .pr-ledger-next {
  margin-top: 1rem;
  letter-spacing: 0.18em;
  padding: 0.7rem 1.3rem;
  min-height: 48px;
}

/* ---------- session end ---------- */
#screen-probate .pr-end {
  position: fixed;
  inset: 0;
  z-index: 41;
  background: rgba(3, 5, 3, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
#screen-probate .pr-end-card {
  width: min(26rem, 94vw);
  background: linear-gradient(170deg, var(--felt-deep), var(--felt));
  border: 1px solid var(--gold-dim);
  box-shadow:
    inset 0 0 0 3px rgba(6, 9, 6, 0.9),
    inset 0 0 0 4px rgba(216, 180, 90, 0.28),
    0 18px 60px rgba(0, 0, 0, 0.8);
  padding: 1.3rem 1.2rem 1.4rem;
  animation: pr-page-in 0.5s ease-out;
}
#screen-probate .pr-end-card h3 {
  margin: 0.3rem 0 0.8rem;
  font-size: 2.2rem;
  color: var(--gold);
  text-shadow: 0 0 18px rgba(216, 180, 90, 0.4);
  font-weight: 600;
}
#screen-probate .pr-end-card h3 small {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  color: var(--gold-dim);
  font-weight: 400;
  margin-top: 0.2rem;
}
#screen-probate .pr-end-rows { margin: 0 auto; max-width: 18rem; }
#screen-probate .pr-end-rows div {
  display: flex;
  justify-content: space-between;
  padding: 0.3rem 0;
  border-bottom: 1px dotted rgba(216, 180, 90, 0.2);
  font-size: 0.8rem;
}
#screen-probate .pr-end-rows i { color: #a9a28d; }
#screen-probate .pr-end-rows b { color: var(--bone); font-variant-numeric: tabular-nums; }
#screen-probate .pr-end-line { margin: 0.9rem auto 0.2rem; max-width: 20rem; }
#screen-probate .pr-end-actions {
  display: flex;
  gap: 0.6rem;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 0.8rem;
}
#screen-probate .pr-end-actions button { margin-top: 0; min-height: 46px; }

/* ---------- the explainer ---------- */
#screen-probate .pr-explainer {
  position: fixed;
  inset: 0;
  z-index: 42;
  background: rgba(3, 5, 3, 0.94);
  overflow-y: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
#screen-probate .pr-expl-inner {
  max-width: 50rem;
  padding: 1rem 0 1.4rem;
}
#screen-probate .pr-expl-house { margin: 0.4rem auto 1rem; max-width: 26rem; }
#screen-probate .pr-expl-go {
  letter-spacing: 0.22em;
  padding: 0.8rem 1.6rem;
  min-height: 48px;
}

/* explainer demos */
#screen-probate .pr-demo {
  position: relative;
  height: 3.65rem;
  background: #070907;
  border: 1px solid rgba(216, 180, 90, 0.2);
  overflow: hidden;
}
#screen-probate .pr-demo-light {
  position: absolute;
  top: 50%;
  left: 0;
  width: 3.2rem;
  height: 3.2rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 196, 110, 0.85) 0%, rgba(255, 170, 80, 0.25) 55%, transparent 72%);
  transform: translateY(-50%);
  animation: pr-lampsweep 4.5s ease-in-out infinite;
}
@keyframes pr-lampsweep {
  0%, 100% { left: -8%; opacity: 0.95; }
  45% { left: 72%; opacity: 1; }
  52% { opacity: 0.55; }
  60% { opacity: 1; }
}
#screen-probate .pr-demo-shape {
  position: absolute;
  bottom: 0.5rem;
  background: #050605;
}
#screen-probate .pr-ds-bottle {
  left: 22%;
  width: 0.85rem;
  height: 2.2rem;
  clip-path: polygon(38% 0, 62% 0, 62% 30%, 100% 45%, 100% 100%, 0 100%, 0 45%, 38% 30%);
}
#screen-probate .pr-ds-clock {
  left: 45%;
  width: 1.7rem;
  height: 1.8rem;
  clip-path: polygon(50% 0, 88% 18%, 100% 55%, 100% 100%, 0 100%, 0 55%, 12% 18%);
}
#screen-probate .pr-ds-pot {
  left: 72%;
  width: 1.6rem;
  height: 1.3rem;
  clip-path: polygon(10% 35%, 35% 18%, 50% 0, 65% 18%, 90% 35%, 100% 70%, 88% 100%, 12% 100%, 0 70%);
}
#screen-probate .pr-demo-accuse {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
}
#screen-probate .pr-demo-coin {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 2px solid var(--gold-dim);
  background: radial-gradient(circle, #6b5523 0%, #43350f 75%);
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  animation: pr-coinhop 2.4s ease-in-out infinite;
}
@keyframes pr-coinhop {
  0%, 100% { transform: translateX(-0.5rem); }
  50% { transform: translateX(0.5rem) translateY(-0.3rem); }
}
#screen-probate .pr-demo-glyphs { display: flex; gap: 0.3rem; }
#screen-probate .pr-demo-glyphs b {
  width: 1.5rem;
  height: 1.5rem;
  border: 1px solid var(--gold-dim);
  background: #0b130d;
  color: var(--gold);
  font-weight: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}
#screen-probate .pr-demo-ledger {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
#screen-probate .pr-demo-page {
  position: relative;
  width: 2.6rem;
  height: 2.6rem;
  background: #14110c;
  border: 1px solid rgba(216, 180, 90, 0.35);
}
#screen-probate .pr-demo-page::after {
  content: '';
  position: absolute;
  left: 28%;
  bottom: 18%;
  width: 0.5rem;
  height: 1rem;
  background: #050605;
}
#screen-probate .pr-demo-page2::before {
  content: '';
  position: absolute;
  left: 58%;
  bottom: 18%;
  width: 0.5rem;
  height: 1rem;
  background: #050605;
}
#screen-probate .pr-demo-page2::after { left: 58%; background: transparent; }
#screen-probate .pr-demo-ring {
  position: absolute;
  left: 44%;
  bottom: 6%;
  width: 1.3rem;
  height: 1.5rem;
  border: 2px solid #c4503f;
  border-radius: 50%;
  transform: rotate(-6deg);
  animation: pr-ringpulse 2s ease-in-out infinite;
}
@keyframes pr-ringpulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

/* dragged chip ghost rides on <body>, so it is NOT scoped — give it a
   probate-unique class name instead to stay collision-safe */
.pr-chip-ghost {
  position: fixed !important;
  z-index: 90;
  transform: translate(-50%, -50%) scale(1.15);
  pointer-events: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 226, 150, 0.3), transparent 55%),
    radial-gradient(circle, #6b5523 0%, #43350f 75%);
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.7), 0 0 18px rgba(216, 180, 90, 0.35);
  font-family: Georgia, serif;
}
.pr-chip-ghost span { font-size: 1rem; line-height: 1; }
.pr-chip-ghost i { font-style: normal; font-size: 0.55rem; color: #cdb169; }

/* ---------- mobile (≤600px): thumb-fair, no horizontal scroll ---------- */
@media (max-width: 600px) {
  #screen-probate .pr-room { padding: 0.3rem 0.4rem 5.4rem; }
  #screen-probate .pr-top { flex-wrap: wrap; }
  #screen-probate .pr-head { order: -1; width: 100%; }
  #screen-probate .pr-title { font-size: 0.9rem; letter-spacing: 0.22em; }
  #screen-probate .pr-stats { flex-direction: row; align-items: center; gap: 0.6rem; }
  #screen-probate .pr-stage { max-height: 48vh; }
  #screen-probate .pr-dock {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    margin: 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
    background: rgba(6, 9, 6, 0.94);
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.45rem 0.5rem calc(0.45rem + env(safe-area-inset-bottom, 0px));
  }
  #screen-probate .pr-actions { flex-direction: row; }
  #screen-probate .pr-actions button { font-size: 0.62rem; padding: 0.5rem 0.5rem; }
  #screen-probate .pr-picker { min-width: 13rem; max-width: 92vw; }
  #screen-probate .pr-ledger-pages { flex-direction: column; }
  #screen-probate .pr-ledger-lists { flex-direction: column; gap: 0.6rem; }
  #screen-probate .pr-ledger-book { padding: 0.8rem 0.7rem 1rem; }
  #screen-probate .pr-end-card h3 { font-size: 1.7rem; }
  #screen-probate .pr-demo { height: 3rem; }
}
