/* The same deep water surrounds each room. Its art and reading surface
   supply the room's own colour, while the shared controls keep their roles. */
body[data-interior] {
  --room-wash: #164c52;
  --room-edge: #bd9f64;
  --room-gold: #e8ce96;
  --room-light: #fff2d9;
  --room-muted: #d4e1d9;
  min-height: 100vh;
  isolation: isolate;
  background: #041c23;
}

body[data-room=ogon] { --room-wash: #76432b; --room-edge: #cd965f; --room-gold: #f2c795; }
body[data-room=zemlya] { --room-wash: #4e5930; --room-edge: #b9ac74; --room-gold: #e5d49c; }
body[data-room=vozduh] { --room-wash: #385970; --room-edge: #9db9c0; --room-gold: #d9e9e8; }
body[data-room=voda] { --room-wash: #12656b; --room-edge: #83bcb8; --room-gold: #c6ebe0; }
body[data-room=kniga] { --room-wash: #65502f; --room-edge: #c7a36a; }
body[data-room=detskaya] { --room-wash: #4f5b52; --room-edge: #cbb789; }

body[data-interior]::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(180deg, #0318216e, #04191fba 53%, #02151ddb),
    radial-gradient(ellipse at 19% 29%, var(--room-wash), transparent 67%),
    var(--lumena-depth) center / cover no-repeat;
}

body[data-interior] :is(.topbar, .caption, .finish-row, .children-footer, .element-paging) {
  --control-ink: #fff0d0;
  --control-edge: #a69367;
  --control-surface: linear-gradient(145deg, #235453, #0d3337);
  --control-hover: linear-gradient(145deg, #346964, #14434a);
  --control-shadow: 0 3px 0 #031a20, 0 6px 15px #00161d45, inset 0 1px 0 #e9d49a38;
}

body[data-interior] .topbar {
  color: var(--room-light);
  border-color: #d6ba754d;
  background: #041c25c9;
}

body[data-interior] :is(.room-heading, .element-intro, .children-heading) {
  color: var(--room-light);
  text-shadow: 0 3px 15px #00131b96;
}

body[data-interior] :is(.room-heading .overline, .children-kicker) {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--room-gold);
}

body[data-interior] :is(.room-heading .overline, .children-kicker)::before {
  content: '';
  width: 24px;
  height: 1px;
  background: currentColor;
  flex: none;
}

body[data-interior] :is(.room-grid > .art-column, .children-illustration) {
  padding: 9px;
  border: 1px solid var(--room-edge);
  border-radius: 16px;
  background: linear-gradient(148deg, #123942, #07262e);
  box-shadow: 0 16px 36px #00141c80, inset 0 1px 0 #fff1bd29;
}

body[data-interior] :is(.room-grid > .art-column .frame, .library-image, .children-image) {
  border-radius: 8px;
}

body[data-interior] .caption {
  align-items: center;
  flex-wrap: wrap;
  padding: 10px 3px 3px;
  color: var(--room-muted);
}

body[data-interior] .caption span {
  flex: 1 1 135px;
}

body[data-interior] :is(.room-grid > .panel, .element-entrance, .children-panel) {
  padding: clamp(20px, 2.5vw, 34px);
  border: 1px solid var(--room-edge);
  border-radius: 17px 17px 14px 14px;
  color: var(--ink);
  background: linear-gradient(150deg, #fffaf0, var(--paper));
  box-shadow: 0 15px 37px #00121b65, inset 0 1px 0 #fff9;
}

body[data-interior] :is(.finish-row, .children-footer) {
  border-color: #d6ba754d;
  padding-top: 14px;
}

body[data-interior] .book-panel {
  background: linear-gradient(90deg, #decaa752, transparent 8%), linear-gradient(150deg, #fffaf0, #f1e7d4);
}

.book-panel .chapter-origin {
  padding-bottom: 12px;
  border-bottom: 1px solid #9d7b463d;
}

.book-panel > .actions + .text-action {
  margin-top: 10px;
}

body[data-room=stihii] .element-entrance {
  margin-bottom: 26px;
}

.element-entrance .element-gate {
  margin: 0;
  gap: 14px 24px;
}

.element-entrance > .guest-quote {
  max-width: 65ch;
  margin-top: 0;
}

.element-entrance .birth-form,
body[data-interior] .sign-choice fieldset {
  min-width: 0;
}

body[data-room=stihii] .elements-section > .rollup {
  border-color: #d6ba754d;
}

body[data-room=stihii] .elements-section > .rollup > summary {
  color: var(--room-light);
}

body[data-room=stihii] .element-intro p,
body[data-room=detskaya] .children-caption {
  color: var(--room-muted);
}

:is(body[data-room=stihii], body[data-room=komnaty]) .element-door {
  border-color: #bca16a9c;
  border-radius: 12px;
}

:is(body[data-room=stihii], body[data-room=komnaty]) .element-door:focus-visible {
  outline-color: #ffdfa0;
  outline-offset: -4px;
}

body[data-room=detskaya] .children-caption {
  padding: 10px 4px 3px;
}

@media (max-width: 690px) {
  body[data-interior] .room-grid { gap: 17px; margin-bottom: 24px; }
  body[data-interior] :is(.room-grid > .art-column, .children-illustration) { padding: 7px; }
  body[data-interior] :is(.room-grid > .panel, .element-entrance, .children-panel) { padding: 18px 16px; }
  body[data-interior] .caption button { margin-left: 0; }
  body[data-interior] .finish-row { gap: 10px; }
  body[data-room=detskaya] .children-image { max-height: none; object-fit: contain; }
}
