/* THEME · MANOR — a void of a room, one heavy chocolate-oak door, light
   bleeding through. Everything is generated in-place: layered gradients +
   hand-authored SVG data-URIs (gothic tracery, strap hinges, carved-gold
   frame molding, wood grain, water stains). No assets, works offline. */

:root {
  /* fine plaster/canvas grain */
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.6'/%3E%3C/svg%3E");
  /* big soft water-stain blotches */
  --blotch: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='700' height='700'%3E%3Cfilter id='b'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.008 0.012' numOctaves='3' seed='11' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.9 0.9 0.9 0 -0.62'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23b)'/%3E%3C/svg%3E");
  /* vertical oak grain streaks */
  --woodgrain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='260'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.55 0.012' numOctaves='4' seed='4' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.75 0.75 0.75 0 -0.5'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
  /* damask motif for the aged wallpaper */
  --damask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='84' height='128'%3E%3Cg fill='none' stroke='%237c8cb4' stroke-opacity='.13' stroke-width='1.4'%3E%3Cpath d='M42 6 C56 28 70 36 70 64 C70 92 56 100 42 122 C28 100 14 92 14 64 C14 36 28 28 42 6 Z'/%3E%3Cpath d='M42 40 q10 12 0 24 q-10 -12 0 -24 Z'/%3E%3Cpath d='M42 76 q7 8 0 16 q-7 -8 0 -16 Z'/%3E%3Ccircle cx='42' cy='64' r='3'/%3E%3Cpath d='M0 0 q10 8 0 16 M84 0 q-10 8 0 16 M0 112 q10 8 0 16 M84 112 q-10 8 0 16'/%3E%3C/g%3E%3C/svg%3E");
  /* gothic lancet + trefoil tracery (top door panels) */
  --lancet: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 200'%3E%3Crect width='120' height='200' fill='%23190e06'/%3E%3Cg fill='none' stroke-linecap='round'%3E%3Crect x='7' y='7' width='106' height='186' stroke='%23000' stroke-opacity='.85' stroke-width='4'/%3E%3Crect x='5' y='5' width='106' height='186' stroke='%23684422' stroke-opacity='.4' stroke-width='2'/%3E%3Cpath d='M60 24 C42 36 30 54 30 80 L30 178 L90 178 L90 80 C90 54 78 36 60 24 Z' stroke='%23000' stroke-opacity='.9' stroke-width='5'/%3E%3Cpath d='M58 22 C40 34 28 52 28 78 L28 176 L88 176 L88 78 C88 52 76 34 58 22 Z' stroke='%236f4a24' stroke-opacity='.5' stroke-width='2'/%3E%3Ccircle cx='60' cy='56' r='11' stroke='%23000' stroke-opacity='.85' stroke-width='4'/%3E%3Ccircle cx='47' cy='72' r='11' stroke='%23000' stroke-opacity='.85' stroke-width='4'/%3E%3Ccircle cx='73' cy='72' r='11' stroke='%23000' stroke-opacity='.85' stroke-width='4'/%3E%3Ccircle cx='59' cy='55' r='11' stroke='%23755026' stroke-opacity='.45' stroke-width='1.5'/%3E%3Ccircle cx='46' cy='71' r='11' stroke='%23755026' stroke-opacity='.45' stroke-width='1.5'/%3E%3Ccircle cx='72' cy='71' r='11' stroke='%23755026' stroke-opacity='.45' stroke-width='1.5'/%3E%3Cpath d='M14 34 q14 4 22 18 M106 34 q-14 4 -22 18' stroke='%23000' stroke-opacity='.75' stroke-width='3'/%3E%3Cpath d='M12 32 q14 4 22 18 M104 32 q-14 4 -22 18' stroke='%23755026' stroke-opacity='.35' stroke-width='1.5'/%3E%3C/g%3E%3C/svg%3E");
  /* quatrefoil rosette (middle door panels) */
  --quatrefoil: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 150'%3E%3Crect width='120' height='150' fill='%23190e06'/%3E%3Cg fill='none' stroke-linecap='round'%3E%3Crect x='7' y='7' width='106' height='136' stroke='%23000' stroke-opacity='.85' stroke-width='4'/%3E%3Crect x='5' y='5' width='106' height='136' stroke='%23684422' stroke-opacity='.4' stroke-width='2'/%3E%3Ccircle cx='60' cy='51' r='19' stroke='%23000' stroke-opacity='.9' stroke-width='5'/%3E%3Ccircle cx='36' cy='75' r='19' stroke='%23000' stroke-opacity='.9' stroke-width='5'/%3E%3Ccircle cx='84' cy='75' r='19' stroke='%23000' stroke-opacity='.9' stroke-width='5'/%3E%3Ccircle cx='60' cy='99' r='19' stroke='%23000' stroke-opacity='.9' stroke-width='5'/%3E%3Ccircle cx='59' cy='50' r='19' stroke='%23755026' stroke-opacity='.4' stroke-width='1.5'/%3E%3Ccircle cx='35' cy='74' r='19' stroke='%23755026' stroke-opacity='.4' stroke-width='1.5'/%3E%3Ccircle cx='83' cy='74' r='19' stroke='%23755026' stroke-opacity='.4' stroke-width='1.5'/%3E%3Ccircle cx='59' cy='98' r='19' stroke='%23755026' stroke-opacity='.4' stroke-width='1.5'/%3E%3Ccircle cx='60' cy='75' r='7' fill='%233a2712' stroke='%23000' stroke-opacity='.8' stroke-width='2.5'/%3E%3Cpath d='M14 16 q10 2 14 10 M106 16 q-10 2 -14 10 M14 134 q10 -2 14 -10 M106 134 q-10 -2 -14 -10' stroke='%23000' stroke-opacity='.7' stroke-width='3'/%3E%3C/g%3E%3C/svg%3E");
  /* carved diamond (bottom door panels) */
  --diamondp: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 150'%3E%3Crect width='120' height='150' fill='%23190e06'/%3E%3Cg fill='none' stroke-linecap='round'%3E%3Crect x='7' y='7' width='106' height='136' stroke='%23000' stroke-opacity='.85' stroke-width='4'/%3E%3Crect x='5' y='5' width='106' height='136' stroke='%23684422' stroke-opacity='.4' stroke-width='2'/%3E%3Cpath d='M60 26 L96 75 L60 124 L24 75 Z' stroke='%23000' stroke-opacity='.9' stroke-width='5'/%3E%3Cpath d='M58 24 L94 73 L58 122 L22 73 Z' stroke='%23755026' stroke-opacity='.45' stroke-width='1.5'/%3E%3Cpath d='M60 48 L78 75 L60 102 L42 75 Z' stroke='%23000' stroke-opacity='.7' stroke-width='3'/%3E%3Ccircle cx='60' cy='75' r='4' fill='%233a2712' stroke='%23000' stroke-width='2'/%3E%3C/g%3E%3C/svg%3E");
  /* wrought-iron strap hinge with a scrolled tail */
  --strap: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 180 26'%3E%3Cpath d='M0 6 L118 9 Q138 10 146 13 Q138 16 118 17 L0 20 Z' fill='%233d3a34'/%3E%3Cpath d='M0 6 L118 9 Q138 10 146 13' fill='none' stroke='%23615c52' stroke-width='1.4'/%3E%3Cpath d='M146 13 q18 -9 26 1 q5 8 -7 10 q-8 1 -9 -6' fill='none' stroke='%233d3a34' stroke-width='5' stroke-linecap='round'/%3E%3Cpath d='M146 12 q18 -9 25 0' fill='none' stroke='%23615c52' stroke-width='1.2'/%3E%3Cg fill='%231c1a15'%3E%3Ccircle cx='16' cy='13' r='3.4'/%3E%3Ccircle cx='52' cy='13' r='3.4'/%3E%3Ccircle cx='88' cy='13' r='3.4'/%3E%3Ccircle cx='120' cy='13' r='3.4'/%3E%3C/g%3E%3Cg fill='%236a655a'%3E%3Ccircle cx='15' cy='12' r='1.1'/%3E%3Ccircle cx='51' cy='12' r='1.1'/%3E%3Ccircle cx='87' cy='12' r='1.1'/%3E%3Ccircle cx='119' cy='12' r='1.1'/%3E%3C/g%3E%3C/svg%3E");
  /* carved-gold picture-frame molding (border-image, slice 44) */
  --goldframe: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 132 132'%3E%3Crect width='132' height='132' fill='%23896428'/%3E%3Cg fill='none'%3E%3Crect x='1.5' y='1.5' width='129' height='129' stroke='%23392812' stroke-width='3'/%3E%3Crect x='5' y='5' width='122' height='122' stroke='%23a67e35' stroke-width='4'/%3E%3Crect x='9.5' y='9.5' width='113' height='113' stroke='%23ecd28d' stroke-width='3.5'/%3E%3Crect x='13.5' y='13.5' width='105' height='105' stroke='%236e4f1d' stroke-width='3'/%3E%3Crect x='21.5' y='21.5' width='89' height='89' stroke='%23dfc06a' stroke-width='6.5' stroke-dasharray='.1 9.2' stroke-linecap='round'/%3E%3Crect x='28.5' y='28.5' width='75' height='75' stroke='%23ecd28d' stroke-width='2.5'/%3E%3Crect x='32' y='32' width='68' height='68' stroke='%234a3312' stroke-width='3'/%3E%3Crect x='36' y='36' width='60' height='60' stroke='%23c9a355' stroke-width='4'/%3E%3Crect x='40.5' y='40.5' width='51' height='51' stroke='%23392812' stroke-width='2.5'/%3E%3C/g%3E%3Cg%3E%3Ccircle cx='21.5' cy='21.5' r='9.5' fill='%23b98f3f' stroke='%23553d14' stroke-width='1.6'/%3E%3Ccircle cx='110.5' cy='21.5' r='9.5' fill='%23b98f3f' stroke='%23553d14' stroke-width='1.6'/%3E%3Ccircle cx='21.5' cy='110.5' r='9.5' fill='%23b98f3f' stroke='%23553d14' stroke-width='1.6'/%3E%3Ccircle cx='110.5' cy='110.5' r='9.5' fill='%23b98f3f' stroke='%23553d14' stroke-width='1.6'/%3E%3Ccircle cx='21.5' cy='21.5' r='3.6' fill='%23ecd28d'/%3E%3Ccircle cx='110.5' cy='21.5' r='3.6' fill='%23ecd28d'/%3E%3Ccircle cx='21.5' cy='110.5' r='3.6' fill='%23ecd28d'/%3E%3Ccircle cx='110.5' cy='110.5' r='3.6' fill='%23ecd28d'/%3E%3C/g%3E%3C/svg%3E");
}

/* ── the room ──────────────────────────────────────────────────────────── */
html[data-theme="manor"] #scene-door .wall {
  background:
    /* damask over aged velvet blue-black-grey */
    var(--damask),
    repeating-linear-gradient(90deg,
      rgba(38,46,68,.22) 0 2px, rgba(0,0,0,0) 2px 42px),
    /* wainscot: dado rail + recessed panels on the lower wall */
    linear-gradient(0deg,
      rgba(10,11,16,.9) 0 24vh, rgba(30,34,48,.5) 24vh calc(24vh + 3px),
      rgba(14,16,24,.55) calc(24vh + 3px) 33vh,
      rgba(44,50,70,.35) 33vh calc(33vh + 2px), rgba(0,0,0,0) calc(33vh + 2px)),
    radial-gradient(ellipse at 50% 44%, #232e46 0%, #141a2c 48%, #0a0d18 80%, #04050b 100%);
  background-size: 84px 128px, auto, auto, auto;
}
html[data-theme="manor"] #scene-door .wall-age {
  background:
    var(--noise),
    var(--blotch),
    var(--blotch),
    /* broken-plaster shadows crowding the doorway, like the reference */
    radial-gradient(26vmax 34vmax at 34% 55%, rgba(3,4,7,.55), transparent 55%),
    radial-gradient(26vmax 34vmax at 66% 55%, rgba(3,4,7,.55), transparent 55%),
    radial-gradient(38vmax 26vmax at 12% 8%, rgba(4,5,9,.9), transparent 60%),
    radial-gradient(30vmax 22vmax at 88% 14%, rgba(3,4,7,.85), transparent 60%),
    radial-gradient(26vmax 30vmax at 6% 82%, rgba(2,3,5,.95), transparent 55%),
    radial-gradient(24vmax 26vmax at 94% 78%, rgba(2,3,5,.9), transparent 55%),
    radial-gradient(14vmax 10vmax at 30% 24%, rgba(70,80,110,.12), transparent 70%),
    radial-gradient(12vmax 9vmax at 72% 30%, rgba(70,80,110,.10), transparent 70%);
  background-size: auto, 700px 700px, 1100px 900px, auto, auto, auto, auto, auto, auto, auto, auto;
  background-position: 0 0, 0 0, 40% 60%, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0;
  opacity: .62; mix-blend-mode: multiply;
}
html[data-theme="manor"] #scene-door .floor {
  /* black oak boards, real grain, receding */
  background:
    var(--woodgrain),
    repeating-linear-gradient(90deg,
      rgba(0,0,0,.65) 0 2px, rgba(0,0,0,0) 2px 118px,
      rgba(60,44,24,.18) 118px 120px, rgba(0,0,0,0) 120px 121px),
    repeating-linear-gradient(90deg,
      #101017 0 119px, #17171f 119px 240px, #121219 240px 361px),
    linear-gradient(180deg, #17171f, #08080d);
  background-size: 260px 260px, auto, auto, auto;
  transform: perspective(620px) rotateX(58deg);
  transform-origin: 50% 0;
  height: 34vh; bottom: -2vh;
  box-shadow: 0 -2px 24px rgba(0,0,0,.9) inset;
}
html[data-theme="manor"] #scene-door .floor::after {
  content: ""; position: absolute; inset: 0;
  background: var(--noise); opacity: .45; mix-blend-mode: multiply;
}
html[data-theme="manor"] #scene-door .floor-pool {
  /* the door light thrown long across the boards */
  background:
    radial-gradient(30% 82% at 50% 0%, rgba(255,238,196,.30), rgba(255,238,196,.10) 48%, transparent 72%),
    radial-gradient(52% 40% at 50% 0%, rgba(255,230,170,.16), transparent 70%);
  height: 28vh; filter: blur(5px);
}
html[data-theme="manor"] #scene-door .vignette {
  background: radial-gradient(ellipse at 50% 52%,
    transparent 30%, rgba(0,0,0,.38) 62%, rgba(0,0,0,.85) 90%, #000 100%);
}

/* ── the door ──────────────────────────────────────────────────────────── */
html[data-theme="manor"] .burst {
  inset: -6% -18%;
  background: radial-gradient(closest-side, #fffdf4 0%, #ffe9b8 42%, rgba(255,214,140,.35) 68%, transparent 100%);
  filter: blur(26px); opacity: .8; transition: opacity 1.6s ease, transform 1.6s ease;
}
html[data-theme="manor"] .rays i {
  position: absolute; top: 4%; bottom: -18%; left: 50%; width: 34%;
  background: linear-gradient(180deg, rgba(255,238,196,.16), transparent 76%);
  transform-origin: 50% 0; filter: blur(10px); opacity: .55;
}
html[data-theme="manor"] .rays i:nth-child(1) { transform: translateX(-50%) rotate(-16deg); }
html[data-theme="manor"] .rays i:nth-child(2) { transform: translateX(-50%) rotate(0deg);
  animation: raybreathe 7s ease-in-out infinite; }
html[data-theme="manor"] .rays i:nth-child(3) { transform: translateX(-50%) rotate(16deg); }
@keyframes raybreathe { 0%,100% { opacity: .45; } 50% { opacity: .75; } }

html[data-theme="manor"] .dframe {
  inset: 0;
  background:
    var(--woodgrain),
    linear-gradient(180deg, #2a2118 0%, #1a130c 100%);
  background-size: 260px 260px, auto;
  border-radius: 4px 4px 0 0;
  box-shadow:
    0 0 0 7px #201810, 0 0 0 9px #35281a, 0 0 0 11px #171008, 0 0 0 13px #090603,
    0 18px 60px rgba(0,0,0,.85);
}
html[data-theme="manor"] .dframe::before {
  /* carved architrave bead running inside the frame */
  content: ""; position: absolute; inset: 0; border-radius: 4px 4px 0 0;
  box-shadow: inset 0 0 0 2px rgba(94,68,36,.4), inset 0 0 0 4px rgba(0,0,0,.6);
  pointer-events: none;
}
html[data-theme="manor"] .dgap {
  inset: 3px; border-radius: 3px 3px 0 0;
  background: #fff6dd;
  box-shadow: 0 0 22px 6px rgba(255,240,200,.85), 0 0 60px 18px rgba(255,224,150,.4);
}
html[data-theme="manor"] .door {
  inset: 5px 6px 0 6px; transform-origin: left center;
  background:
    linear-gradient(90deg, rgba(0,0,0,.42), transparent 12%, transparent 86%, rgba(0,0,0,.48)),
    linear-gradient(180deg, #332112 0%, #2a1a0b 30%, #211307 62%, #170d04 100%);
  border-radius: 2px 2px 0 0;
  box-shadow: inset 0 0 34px rgba(0,0,0,.75);
  transition: transform 2.4s cubic-bezier(.55,.02,.35,1);
}
html[data-theme="manor"] .door .grain {
  inset: 0;
  background:
    var(--woodgrain),
    var(--noise),
    repeating-linear-gradient(180deg, rgba(0,0,0,.2) 0 2px, transparent 2px 7px,
      rgba(96,62,30,.07) 7px 10px, transparent 10px 15px);
  background-size: 200px 200px, auto, auto;
  opacity: .6; mix-blend-mode: multiply; border-radius: 2px 2px 0 0;
}
/* gothic panels: lancet tracery up top, quatrefoils mid, carved diamonds low */
html[data-theme="manor"] .dpanel {
  left: 10%; width: 34%; border-radius: 2px;
  background: #190e06 center / 100% 100% no-repeat;
  box-shadow:
    inset 0 0 0 1px rgba(0,0,0,.6), 2px 2px 5px rgba(0,0,0,.55),
    -1px -1px 2px rgba(110,80,44,.18);
}
html[data-theme="manor"] .p-tr, html[data-theme="manor"] .p-mr,
html[data-theme="manor"] .p-br { left: 56%; }
html[data-theme="manor"] .p-tl, html[data-theme="manor"] .p-tr {
  top: 4.5%; height: 28%; background-image: var(--lancet); }
html[data-theme="manor"] .p-ml, html[data-theme="manor"] .p-mr {
  top: 36%; height: 26.5%; background-image: var(--quatrefoil); }
html[data-theme="manor"] .p-bl, html[data-theme="manor"] .p-br {
  top: 66%; height: 28.5%; background-image: var(--diamondp); }
/* wrought-iron strap hinges reaching across the door */
html[data-theme="manor"] .hinge {
  left: -1.5%; width: 40%; height: 3.4%;
  background: var(--strap) left center / 100% 100% no-repeat;
  filter: drop-shadow(1px 2px 2px rgba(0,0,0,.7));
}
html[data-theme="manor"] .h1 { top: 7.5%; } html[data-theme="manor"] .h2 { top: 48%; }
html[data-theme="manor"] .h3 { top: 86%; }
html[data-theme="manor"] .knob {
  right: 6.5%; top: 50.5%; width: 8.5%; aspect-ratio: 1; border-radius: 50%; z-index: 2;
  background: radial-gradient(circle at 34% 30%, #8a7550, #453823 55%, #1d1509 100%);
  box-shadow: 0 2px 6px rgba(0,0,0,.85), inset 0 -2px 4px rgba(0,0,0,.6);
}
html[data-theme="manor"] .knob::before {
  /* brass rosette backplate */
  content: ""; position: absolute; inset: -26%; border-radius: 50%; z-index: -1;
  background: radial-gradient(circle at 40% 32%, #6b5836, #40311a 60%, #241708);
  box-shadow: inset 0 1px 1px rgba(235,205,150,.35), 0 1px 3px rgba(0,0,0,.7);
}
/* brass escutcheon with the keyhole cut into it */
html[data-theme="manor"] .keyhole {
  right: 6.8%; top: 58%; width: 8%; aspect-ratio: 1 / 2.2; border-radius: 40% / 22%;
  background:
    radial-gradient(2.5px 2.5px at 50% 7%, #241a0c 45%, transparent 55%),
    radial-gradient(2.5px 2.5px at 50% 93%, #241a0c 45%, transparent 55%),
    linear-gradient(180deg, #7d6738 0%, #55411f 45%, #33230d 100%);
  box-shadow: 0 1px 3px rgba(0,0,0,.8), inset 0 1px 1px rgba(240,210,150,.4),
    inset 0 -1px 2px rgba(0,0,0,.6);
}
html[data-theme="manor"] .keyhole::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 58%; height: 60%;
  transform: translate(-50%, -52%);
  background: #0a0602;
  clip-path: polygon(50% 0, 68% 8%, 74% 26%, 62% 42%, 78% 96%, 22% 96%, 38% 42%, 26% 26%, 32% 8%);
  transition: background .4s ease, filter .4s ease;
}
#scene-door.granted .keyhole::after {
  background: #fff2c8; filter: drop-shadow(0 0 12px #ffe9a8);
}
html[data-theme="manor"] .seam, html[data-theme="manor"] .etch { display: none; }
html[data-theme="manor"] .threshold {
  left: -12%; right: -12%; bottom: -3px; height: 8px;
  background: #fff3d0; filter: blur(5px); opacity: .9; border-radius: 50%;
  box-shadow: 0 0 30px 10px rgba(255,235,180,.5);
}

/* the swing open */
#scene-door.opening .door { transform: rotateY(-108deg); }
#scene-door.opening .burst { opacity: 1; transform: scale(1.18); }
#scene-door.opening .rays i { opacity: 1; }

/* ── the lockbox, aged iron & leather ──────────────────────────────────── */
html[data-theme="manor"] #lockbox {
  background: linear-gradient(180deg, rgba(18,16,20,.9), rgba(8,8,10,.94));
  border: 1px solid rgba(150,130,95,.22); border-radius: 6px;
  box-shadow: 0 22px 60px rgba(0,0,0,.8), inset 0 1px 0 rgba(200,180,140,.08),
    inset 0 0 0 3px rgba(0,0,0,.35), inset 0 0 0 4px rgba(120,100,64,.12);
  color: #cfc4ad;
}
html[data-theme="manor"] #lockbox .brand { color: #b8a67f; text-shadow: 0 0 18px rgba(255,220,150,.25); }
html[data-theme="manor"] #lockbox .tabs button { color: #8d8168; }
html[data-theme="manor"] #lockbox .tabs button.on { color: #e4d3a6;
  border-bottom: 1px solid rgba(210,180,120,.5); }
html[data-theme="manor"] #lockbox input:focus { border-color: rgba(210,180,120,.55);
  box-shadow: 0 0 14px rgba(210,180,120,.12); }
html[data-theme="manor"] .forgebtn { color: #d9c79a; background: rgba(60,48,28,.35); }
html[data-theme="manor"] .forgebtn:hover { background: rgba(90,72,40,.45); }
html[data-theme="manor"] #door-theme { color: #cfc4ad; }

/* ── the hall: a dark salon hung with gold ─────────────────────────────── */
html[data-theme="manor"] .hallwall {
  background:
    var(--noise),
    var(--blotch),
    /* warm pools from unseen picture lights above */
    radial-gradient(34vmax 26vmax at 18% -8vmax, rgba(255,226,160,.10), transparent 60%),
    radial-gradient(34vmax 26vmax at 50% -8vmax, rgba(255,226,160,.12), transparent 60%),
    radial-gradient(34vmax 26vmax at 82% -8vmax, rgba(255,226,160,.10), transparent 60%),
    linear-gradient(180deg, #3a372f 0%, #302d26 46%, #26231d 74%, #1b1914 100%);
  background-size: auto, 900px 900px, auto, auto, auto, auto;
}
html[data-theme="manor"] .hallwall::before {
  /* dark oak floor at the base of the wall */
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 16vh;
  background:
    var(--woodgrain),
    repeating-linear-gradient(90deg,
      rgba(0,0,0,.5) 0 2px, transparent 2px 138px,
      rgba(120,90,50,.14) 138px 140px, transparent 140px 141px),
    repeating-linear-gradient(90deg,
      #33261a 0 139px, #3b2c1e 139px 280px, #362818 280px 421px),
    linear-gradient(180deg, #3b2c1e, #241a10);
  background-size: 260px 260px, auto, auto, auto;
  box-shadow: inset 0 12px 24px rgba(0,0,0,.55);
}
html[data-theme="manor"] .hallwall::after {
  /* crown molding, picture rail, and baseboard */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(180deg,
      rgba(210,190,150,.16) 0 5px, rgba(0,0,0,.5) 5px 7px,
      rgba(120,105,80,.12) 7px 12px, rgba(0,0,0,.35) 12px 13px, transparent 13px),
    linear-gradient(0deg,
      rgba(0,0,0,.55) 0 16vh, rgba(190,165,120,.14) 16vh calc(16vh + 3px),
      rgba(0,0,0,.4) calc(16vh + 3px) calc(16vh + 5px), transparent calc(16vh + 5px)),
    radial-gradient(ellipse at 50% 40%, transparent 42%, rgba(0,0,0,.42) 82%, rgba(0,0,0,.68) 100%);
}
html[data-theme="manor"] #scene-gallery { color: #d6cbb0; }
html[data-theme="manor"] #topbar { background: linear-gradient(180deg, rgba(20,18,14,.85), rgba(20,18,14,0)); }
html[data-theme="manor"] #topbar select, html[data-theme="manor"] #topbar button {
  color: #cdbf9e; border-color: rgba(190,165,115,.28); background: rgba(12,11,9,.5);
}
html[data-theme="manor"] #topbar select:hover, html[data-theme="manor"] #topbar button:hover {
  border-color: rgba(220,195,140,.6); color: #ecdfba;
}
html[data-theme="manor"] #filters .chip { color: #bfb191; border-color: rgba(190,165,115,.22);
  background: rgba(12,11,9,.45); }
html[data-theme="manor"] #filters .chip.on { border-color: rgba(225,200,145,.65);
  background: rgba(60,50,32,.6); color: #eee0b8; }
html[data-theme="manor"] #pulse { color: #a2916e; }

/* framed pictures under their lamps — salon hanging, varied sizes */
html[data-theme="manor"] .pic { width: clamp(220px, 25vw, 305px); }
html[data-theme="manor"] .pic.sz-1 { width: clamp(185px, 20vw, 245px);
  transform: translateY(-16px); }
html[data-theme="manor"] .pic.sz-2 { width: clamp(250px, 29vw, 350px);
  transform: translateY(12px); }
html[data-theme="manor"] .pic:nth-child(odd) .frame4 { rotate: .35deg; }
html[data-theme="manor"] .pic:nth-child(3n) .frame4 { rotate: -.4deg; }
html[data-theme="manor"] .pic::before {
  /* the lamp's pool of light thrown up the wall behind the frame */
  content: ""; position: absolute; inset: -22% -16% -8% -16%; z-index: -1;
  background: radial-gradient(52% 44% at 50% 10%, rgba(255,232,180,.13), transparent 70%);
  pointer-events: none;
}
html[data-theme="manor"] .pic .frame4 {
  position: relative;
  border: 21px solid transparent; border-radius: 2px;
  border-image: var(--goldframe) 44 / 21px round;
  background: none;
  box-shadow:
    0 30px 44px -18px rgba(0,0,0,.75), 0 10px 20px rgba(0,0,0,.45),
    0 0 0 1px rgba(0,0,0,.55);
  transform-origin: 50% -40px;
  transition: transform .5s ease, box-shadow .5s ease, filter .5s ease;
}
html[data-theme="manor"] .pic:hover .frame4 {
  transform: rotate(.6deg) translateY(-4px); filter: brightness(1.12);
  box-shadow:
    0 38px 56px -18px rgba(0,0,0,.8), 0 12px 24px rgba(0,0,0,.5),
    0 0 0 1px rgba(0,0,0,.55);
}
html[data-theme="manor"] .pic .frame4::before {
  /* the brass picture lamp on top of the frame */
  content: ""; position: absolute; top: -34px; left: 50%; transform: translateX(-50%);
  width: 38%; height: 11px; border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, #e2bc68 0%, #96702c 55%, #573f14 100%);
  box-shadow: 0 3px 5px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,240,200,.6),
    0 14px 10px -6px rgba(255,226,160,.28);
}
html[data-theme="manor"] .pic .frame4::after {
  /* its warm light washing down the canvas */
  content: ""; position: absolute; inset: -2px; pointer-events: none;
  background: radial-gradient(75% 55% at 50% -6%, rgba(255,232,170,.42),
    rgba(255,232,170,.10) 52%, transparent 74%);
  mix-blend-mode: screen;
}
html[data-theme="manor"] .pic .mat { padding: 8px;
  background: linear-gradient(180deg, #2a251c, #1d1912);
  box-shadow: inset 0 1px 4px rgba(0,0,0,.7), inset 0 0 0 1px rgba(190,160,110,.18); }
html[data-theme="manor"] .pic .art {
  aspect-ratio: 4 / 3; display: grid; place-items: center; position: relative;
  box-shadow: inset 0 0 34px rgba(0,0,0,.6); overflow: hidden;
}
html[data-theme="manor"] .pic.sz-1 .art { aspect-ratio: 3 / 4; }
html[data-theme="manor"] .pic.sz-2 .art { aspect-ratio: 3 / 2; }
html[data-theme="manor"] .pic .art .glyph {
  font-size: clamp(44px, 6vw, 70px); color: rgba(255,250,235,.92);
  text-shadow: 0 3px 14px rgba(0,0,0,.6); font-style: normal;
}
html[data-theme="manor"] .pic .art .lock-badge { position: absolute; right: 8px; bottom: 6px;
  font-size: 15px; opacity: .9; filter: drop-shadow(0 1px 2px rgba(0,0,0,.8)); }
html[data-theme="manor"] .pic .plaque {
  margin: 12px auto 0; width: fit-content; max-width: 92%;
  padding: 4px 16px; border-radius: 3px; text-align: center; position: relative;
  font-size: 11px; letter-spacing: .24em; color: #3d2f14;
  text-shadow: 0 1px 0 rgba(255,242,200,.5);
  background:
    radial-gradient(2.5px 2.5px at 7px 50%, #6b5321 45%, transparent 55%),
    radial-gradient(2.5px 2.5px at calc(100% - 7px) 50%, #6b5321 45%, transparent 55%),
    linear-gradient(180deg, #e8ca88 0%, #c5a058 55%, #a8843e 100%);
  box-shadow: inset 0 1px 0 rgba(255,240,200,.8), 0 2px 5px rgba(0,0,0,.6);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
html[data-theme="manor"] .pic .cat {
  text-align: center; font-size: 9.5px; letter-spacing: .3em; margin-top: 7px;
  color: rgba(200,182,140,.55); text-transform: uppercase;
}

/* the eight oil paintings — deeper, varnished */
html[data-theme="manor"] .art-0 { background:
  radial-gradient(120% 90% at 30% 20%, #6f8a99 0%, #3d5765 40%, #1d2e38 75%, #0c161d 100%); }
html[data-theme="manor"] .art-1 { background:
  radial-gradient(120% 100% at 60% 25%, #823148 0%, #572031 45%, #2f0e16 80%, #17050a 100%); }
html[data-theme="manor"] .art-2 { background:
  radial-gradient(130% 100% at 50% 15%, #cfa95f 0%, #99702c 40%, #563d13 75%, #2c1f08 100%); }
html[data-theme="manor"] .art-3 { background:
  radial-gradient(140% 110% at 45% 30%, #47727f 0%, #284754 78%, #091218 100%); }
html[data-theme="manor"] .art-4 { background:
  radial-gradient(120% 100% at 40% 20%, #547246 0%, #324a28 45%, #182612 78%, #0a1107 100%); }
html[data-theme="manor"] .art-5 { background:
  radial-gradient(130% 100% at 55% 22%, #364b82 0%, #21305a 48%, #101832 80%, #060918 100%); }
html[data-theme="manor"] .art-6 { background:
  radial-gradient(120% 95% at 50% 28%, #b25f33 0%, #7d3c1e 45%, #421d0d 78%, #1f0d07 100%); }
html[data-theme="manor"] .art-7 { background:
  radial-gradient(130% 100% at 45% 20%, #6e5185 0%, #443158 46%, #231831 78%, #0f0a18 100%); }
html[data-theme="manor"] .pic .art::after {
  content: ""; position: absolute; inset: 0;
  background:
    var(--noise),
    /* varnish craquelure sheen */
    radial-gradient(90% 60% at 30% 8%, rgba(255,244,214,.10), transparent 60%);
  opacity: .5; mix-blend-mode: overlay;
}

/* modal + app window: parchment museum labels against the dark salon */
html[data-theme="manor"] .modal-card, html[data-theme="manor"] .appwin-card {
  background:
    var(--noise),
    linear-gradient(180deg, #f2ecdc, #e4dcc6);
  color: #3b332a;
  border: 1px solid rgba(120,100,70,.4);
  box-shadow: 0 30px 80px rgba(0,0,0,.7), inset 0 0 0 3px rgba(255,255,255,.4),
    inset 0 0 0 4px rgba(150,125,85,.3);
}
html[data-theme="manor"] .modal-card input, html[data-theme="manor"] .modal-card select,
html[data-theme="manor"] #app-body input, html[data-theme="manor"] #app-body textarea {
  background: rgba(255,255,255,.75); border: 1px solid rgba(120,100,70,.35); color: #3b332a;
}
html[data-theme="manor"] .modal-row button, html[data-theme="manor"] #app-body button.act {
  border: 1px solid rgba(120,100,70,.4); color: #4a4136; background: rgba(255,255,255,.5);
}
html[data-theme="manor"] .modal-row button.primary, html[data-theme="manor"] #app-body button.act.primary {
  background: linear-gradient(180deg, #e6c887, #c9a55c); color: #3a2c10;
}
html[data-theme="manor"] .appwin-card header { background: linear-gradient(180deg, #e5dcc2, #d8ccae);
  border-bottom: 1px solid rgba(120,100,70,.35); color: #4a3d28; }
html[data-theme="manor"] #app-body .item { background: rgba(255,255,255,.6);
  border: 1px solid rgba(120,100,70,.25); }
html[data-theme="manor"] #app-body pre { background: rgba(255,255,255,.65);
  border: 1px solid rgba(120,100,70,.25); color: #3b332a; }
html[data-theme="manor"] .share-row { border-color: rgba(120,100,70,.35); }
