/* Tepeyac scene shell. The existing painting and story controls keep their IDs. */
:root {
  --ink: #3c3026;
  --muted: #776757;
  --line: #ded5c3;
  --panel: #fffcf5;
  --gold: #936629;
  --red: #b95445;
}
body { background: #f7f3e9; color: var(--ink); }
button, a.btn { min-height: 44px; }
button:focus-visible, a:focus-visible, canvas:focus-visible { outline: 3px solid #287e79; outline-offset: 4px; }
[hidden] { display: none !important; }
#visit-header { height: 86px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 28px; border-bottom: 1px solid var(--line); background: #fffcf5; }
.room-link { color: #735d42; text-decoration: none; font-size: 13px; font-weight: 750; letter-spacing: .025em; padding: 12px 0; }
.view-switch { display: flex; border: 1px solid #d9ceba; border-radius: 14px; background: #f0eadf; padding: 4px; gap: 4px; }
.view-switch button { border: 0; border-radius: 10px; padding: 10px 19px; font: inherit; font-size: 14px; color: #705f4d; background: transparent; cursor: pointer; font-weight: 700; }
.view-switch button[aria-pressed="true"] { background: #a44735; color: #fff8ec; box-shadow: 0 2px 7px #754a2620; }
.view-switch button:disabled { opacity: .45; }
#layout { inset: 86px 0 0; grid-template-columns: 284px minmax(0, 1fr); gap: 18px; padding: 22px 24px 24px; }
.side { gap: 15px; scrollbar-width: thin; scrollbar-color: #c4b799 transparent; padding: 0 3px 3px 0; }
.panel { padding: 19px; border-radius: 17px; box-shadow: none; backdrop-filter: none; }
.intro-panel { background: transparent; border: none; padding: 5px 2px 9px; }
.eyebrow { font-size: 10px; letter-spacing: .12em; line-height: 1.6; }
h1 { text-shadow: none; font-size: 34px; line-height: 1.07; letter-spacing: -.045em; color: #473a2c; }
.subtitle { margin-top: 15px; font-size: 13px; line-height: 1.7; }
.visit-card { background: #efeadd; }
.visit-card p:not(.eyebrow) { font-size: 14px; line-height: 1.65; margin: 0 0 14px; }
.visit-card #walk-status { font-size: 12px; color: #547242; border-top: 1px solid #d5cdbb; padding-top: 12px; }
.landmarks { display: flex; flex-wrap: wrap; gap: 6px; }
.landmarks button { border: 1px solid #cdbfa9; background: #fffcf5; border-radius: 9px; padding: 9px 11px; color: #6a5944; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.landmarks button[aria-pressed="true"] { background: #d6e2c6; border-color: #799466; }
.btn { min-height: 44px; border: 1px solid #d6c8b2; border-radius: 10px; color: #544733; background: #fffcf5; display: grid; place-items: center; }
.btn:hover { background: #efe6d8; }
.btn.gold { background: #eee0c8; border-color: #d7c5a4; color: #594124; }
.btn.gold:hover { background: #e5d3b1; }
.btn.paint-cta { width: 100%; margin-top: 16px; background: #a44735; color: #fff8ee; border-color: #a44735; }
.vignette-panel { display: none; }
.actions { padding: 0; border: none; background: transparent; }
#easel { border: 1px solid #ded5c3; border-radius: 24px; background: #e9e7d7; overflow: hidden; }
#hill-view { width: 100%; height: 100%; position: relative; min-width: 0; }
#hill-canvas { width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
#hill-canvas:active { cursor: grabbing; }
.scene-heading { position: absolute; left: 28px; right: 28px; top: 25px; z-index: 2; display: flex; justify-content: space-between; gap: 10px; color: #746b50; pointer-events: none; }
.scene-heading span:first-child { font-size: 10px; font-weight: 800; letter-spacing: .17em; }
.scene-heading span:last-child { font: italic 16px Georgia, serif; }
#scene-loading { position: absolute; inset: 0; display: grid; place-items: center; background: #e9e7d7; font: 22px Georgia, serif; }
.scene-bottom { position: absolute; bottom: 20px; left: 20px; right: 20px; display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; pointer-events: none; }
#scene-hint { font-size: 12px; line-height: 1.55; color: #685c47; max-width: 185px; margin: 0 0 5px; }
.walk-pad { display: grid; grid-template-columns: repeat(3, 44px); grid-template-rows: repeat(2, 44px); gap: 4px; pointer-events: auto; }
.walk-pad button { border: 1px solid #d5c9b3; background: #fffcf5f0; color: #544d37; font: 24px system-ui; border-radius: 9px; cursor: pointer; touch-action: none; }
.walk-pad button[data-walk="up"] { grid-column: 2; }
.walk-pad button[data-walk="left"] { grid-row: 2; grid-column: 1; }
.walk-pad button[data-walk="down"] { grid-row: 2; grid-column: 2; }
.walk-pad button[data-walk="right"] { grid-row: 2; grid-column: 3; }
.walk-pad button:active { background: #d8e6c6; }
.scene-controls button[aria-pressed="true"] { background: #dbe5cb; color: #415c30; }
.scene-controls { display: flex; gap: 4px; padding: 5px; border: 1px solid #d6cdb9; border-radius: 14px; background: #fffcf5ed; box-shadow: 0 5px 20px #55422112; pointer-events: auto; flex-wrap: wrap; justify-content: center; }
.scene-controls button { min-width: 44px; border: 0; border-radius: 8px; font: inherit; font-size: 13px; font-weight: 700; color: #5c4e3c; padding: 8px; cursor: pointer; background: transparent; }
.scene-controls button:nth-child(-n+4) { font-size: 22px; }
.scene-controls button:hover { background: #ece5d8; }
#scene-fallback { padding: 14px; text-align: center; color: #754b2b; max-width: 400px; }
body[data-view="hill"] .paint-only, body[data-view="paint"] .hill-only { display: none !important; }
body[data-view="paint"] #easel { flex-direction: column; padding: 20px 20px 46px; background: #eee7d9; }
body[data-view="paint"] .intro-panel .subtitle { display: none; }
body[data-view="paint"] h1 { font-size: 25px; }
body[data-view="paint"] #frame { max-height: calc(100dvh - 181px); padding: 12px; box-shadow: 0 16px 25px #5f48252b; background: #aa8040; }
#paint-canvas { max-height: calc(100dvh - 210px); width: auto; max-width: 100%; }
#caption { color: #6b5336; font-size: 15px; text-shadow: none; bottom: -29px; }
#caption.story { max-width: 95%; }
.palette { grid-template-columns: repeat(4, 1fr); gap: 12px 8px; }
.swatch { min-width: 44px; min-height: 44px; border-color: #d9cdb8; }
.swatch.selected { border-color: #53492f; box-shadow: 0 0 0 3px #fffcf5; transform: none; }
.swatch.is-next { animation: color-hint 1.5s ease-in-out infinite; }
@keyframes color-hint { 50% { box-shadow: 0 0 0 3px #b9955459; } }
.swatch-name { font-size: 10px; line-height: 1.35; }
.progress { background: #e7ddca; }
.progress-fill { background: #5e9276; }
.challenge-count { color: #7b5a2d; }
.storybook { background: #e8dfcbe6; }
.sb-card { box-shadow: 0 25px 80px #64533630; background: #fffcf5; }
.sb-dot { background: #d7cdb9; }
.sb-btn { background: #ede5d5; border-color: #d3c5ac; }
.sb-btn.gold { background: #a44735; color: #fff8ec; border-color: #a44735; }
.sb-skip { min-height: 44px; }
#celebrate { background: #efe8dce8; }
@media (max-width: 1100px) {
  #layout { grid-template-columns: 242px minmax(0, 1fr); gap: 14px; padding: 16px; }
  h1 { font-size: 30px; }
  .scene-bottom { flex-wrap: wrap; align-items: flex-end; gap: 9px; }
  #scene-hint { max-width: 150px; margin: 0; text-align: center; }
  .scene-controls { margin-left: auto; }
  .panel { padding: 14px; }
}
@media (max-width: 980px) {
  html, body { height: auto; min-height: 100%; overflow: auto; }
  #visit-header { height: auto; min-height: 116px; padding: 12px 16px; flex-direction: column; justify-content: center; gap: 9px; }
  .room-link { padding: 0; font-size: 11px; }
  .view-switch { width: min(100%, 390px); }
  .view-switch button { flex: 1; font-size: 13px; padding: 10px; }
  #layout { position: relative; inset: auto; display: flex; flex-direction: column; gap: 18px; padding: 12px 12px 24px; overflow: visible; }
  #easel { order: 0; min-height: 440px; height: 58svh; max-height: 600px; border-radius: 20px; flex-shrink: 0; }
  .side { order: 1; display: grid; grid-template-columns: 1fr; overflow: visible; padding: 0 4px; gap: 14px; }
  .intro-panel { padding: 0 2px; }
  h1 { font-size: 32px; max-width: 300px; }
  .subtitle { margin: 9px 0 0; }
  .scene-heading { left: 16px; right: 16px; top: 17px; }
  .scene-heading span:first-child { font-size: 9px; }
  .scene-heading span:last-child { font-size: 12px; }
  .scene-bottom { left: 8px; right: 8px; bottom: 10px; gap: 8px; }
  #scene-hint { font-size: 10px; max-width: 145px; margin: 0 10px 25px; }
  .walk-pad { grid-template-columns: repeat(3, 44px); grid-template-rows: repeat(2, 44px); }
  .scene-controls { gap: 0; padding: 3px; }
  .scene-controls button { padding: 6px; font-size: 11px; }
  .scene-controls button:nth-child(-n+4) { min-width: 44px; font-size: 20px; }
  .actions { grid-template-columns: 1fr 1fr; }
  body[data-view="paint"] #easel { min-height: 0; height: auto; max-height: none; padding: 12px 12px 42px; }
  body[data-view="paint"] #frame { max-height: none; width: min(100%, 450px); padding: 8px; }
  #paint-canvas { width: 100%; height: auto; max-height: none; }
  #caption { display: block; font-size: 13px; line-height: 1.35; bottom: -31px; }
  .palette { grid-template-columns: repeat(6, 1fr); gap: 13px 7px; }
  .swatch-name { font-size: 9px; }
  .challenge { padding: 13px 15px; }
}
@media (max-width: 600px) {
  #scene-motion { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
