/* The scene is furniture; the papers below it remain ordinary, readable HTML. */
body:has(#debate:not([hidden])) { background: #eee7da; }
#debate .desk-topline { margin: 15px 0 12px; }
#debate .motion-heading { max-width: 1080px; }
#debate .motion-heading h1 { color: #273e3c; font-size: clamp(24px, 2.5vw, 34px); font-weight: 600; line-height: 1.45; }
#debate .motion-heading > p:last-child { color: #a2674f; font-size: 17px; }
#debate .seat-bar { margin: 17px 0 16px; }
#debate .seat-options { background: #d9dace; }
#debate .seat-options button { padding: 9px 18px; }
#debate .swap-button { background: #2f4945; border-color: #2f4945; color: #fff5dd; }
#debate .swap-button:hover { background: #9d5a42; border-color: #9d5a42; }

.workbench { position: relative; border-radius: 14px 14px 5px 5px; box-shadow: 0 15px 40px #51433216; }
.room-stage { position: relative; height: 365px; overflow: hidden; isolation: isolate; background: radial-gradient(ellipse at 23% 0%, #fff9e9, transparent 65%), linear-gradient(160deg, #e9ddca, #d6d4c6); border: 1px solid #cec3ac; border-bottom: 0; border-radius: 14px 14px 0 0; }
.room-stage::before { content: ''; position: absolute; inset: 0; background: linear-gradient(122deg, #fff9 0%, #fff1 27%, transparent 27.3%, transparent 36%, #fff3 36.2%, transparent 52%), linear-gradient(0deg, #a7ac8e12, transparent 35%); pointer-events: none; z-index: 1; }
.room-stage::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 70px; background: linear-gradient(transparent, #bdb79c35); pointer-events: none; }
.desk-viewport { position: absolute; inset: 0; }
.desk-viewport canvas { display: block; width: 100%; height: 100%; touch-action: pan-y; }
.room-caption { position: absolute; z-index: 2; top: 20px; left: 24px; right: 24px; display: flex; justify-content: space-between; gap: 15px; color: #66766b; font-size: 8px; letter-spacing: 2px; pointer-events: none; }
.room-caption > span:first-child { display: flex; gap: 9px; align-items: center; }
.room-caption i { width: 5px; height: 5px; border-radius: 50%; background: #a76a46; box-shadow: 0 0 0 4px #a76a4610; }
.room-caption > span:last-child { color: #93856d; font-size: 8px; letter-spacing: 1px; }
.room-floor-copy { position: absolute; z-index: 2; left: 24px; bottom: 17px; color: #687569; pointer-events: none; }
.room-floor-copy > span { font: 18px "KaiTi", "STKaiti", var(--serif); color: #7e735b; }
.room-floor-copy p { font-size: 8px; letter-spacing: .6px; margin-top: 5px; }
.room-seat-sign { position: absolute; z-index: 2; pointer-events: none; transform: translate(-50%, -100%); padding: 6px 10px; border: 1px solid #d1bda07d; border-radius: 3px; background: #fff9e4cb; font-size: 9px; color: #8b513e; letter-spacing: 1px; box-shadow: 0 3px 10px #5143320b; white-space: nowrap; }
.room-seat-sign--pro { left: 20%; top: 46%; }
.room-seat-sign--con { left: 80%; top: 38%; color: #426375; }
.room-seat-sign i { display: inline-block; width: 5px; height: 5px; background: #a9503e; border-radius: 50%; margin-right: 5px; }
.room-seat-sign--con i { background: #426b7c; }
.workbench[data-seat="pro"] .room-seat-sign--pro, .workbench[data-seat="con"] .room-seat-sign--con { background: #fff7da; box-shadow: 0 0 0 3px #fff7da66, 0 5px 14px #51433220; }

/* This front is an accessible handle for the same drawer shown in the 3D scene. */
.desk-front { position: relative; min-height: 81px; display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 0 30px; border: 1px solid #4d3023; border-top: 3px solid #bd9264; background: repeating-linear-gradient(0deg, #ffffff03 0px, #ffffff03 1px, transparent 1px, transparent 5px), linear-gradient(95deg, #4e352a, #7e5438 37%, #67452f 70%, #4c3529); box-shadow: 0 4px 0 #382c22, 0 8px 0 #9c8054, 0 15px 24px #4b392c23; border-radius: 0 0 5px 5px; z-index: 3; }
.drawer-index { color: #cfb692; font-size: 9px; letter-spacing: 1px; }
.drawer-side-note { color: #c9ad88; font: 16px "KaiTi", "STKaiti", var(--serif); }
.drawer-handle { position: relative; display: grid; grid-template-columns: auto auto; align-items: center; gap: 5px 23px; padding: 12px 28px 10px; width: 350px; min-height: 79px; background: linear-gradient(105deg, #80573d, #68462f); border: 1px solid #33271d; border-top-color: #ba8e5a; border-bottom-color: #39291d; box-shadow: inset 0 0 0 3px #ad825023, 0 0 0 2px #321f1370, 0 4px 9px #1c120b25; transition: transform .35s, box-shadow .35s; }
.drawer-handle-label { color: #f0d9af; font-family: var(--serif); font-size: 13px; letter-spacing: 1px; grid-column: 1 / -1; }
.brass-pull { position: relative; display: flex; align-items: center; justify-content: space-between; width: 105px; height: 19px; justify-self: end; filter: drop-shadow(0 4px 2px #2a1a1480); }
.brass-pull i { width: 13px; height: 13px; background: linear-gradient(115deg, #f1d89c, #9b7139); border-radius: 50%; box-shadow: inset 0 0 0 1px #4b35173d; }
.brass-pull b { position: absolute; left: 4px; right: 4px; height: 6px; top: 9px; border-radius: 4px; background: linear-gradient(#f2dca0, #bc9454 55%, #856033); box-shadow: 0 1px 0 #caa35e, 0 -1px 0 #f3dda6; }
.drawer-action { font-size: 8px; letter-spacing: .8px; color: #d6ba89; justify-self: start; }
.drawer-handle:hover, .drawer-handle:focus-visible { transform: translateY(4px); box-shadow: inset 0 0 0 3px #ad825023, 0 0 0 2px #321f1370, 0 8px 13px #1c120b40; }
.drawer-handle:focus-visible { outline-color: #f4dc9f; }
.is-drawer-open .drawer-handle { transform: translateY(7px); }
.drawer-notebook.notebook { position: relative; margin: 0 28px; padding: 15px 17px 19px; background: #a47a4d; border: 1px solid #69452c; border-top: 0; border-left-width: 9px; border-right-width: 9px; border-bottom-width: 13px; border-radius: 0 0 7px 7px; box-shadow: inset 0 12px 20px #4e321b46, 0 12px 0 -6px #72502f, 0 22px 28px #4f3f2b20; scroll-margin-top: 30px; }
.drawer-inner { position: relative; margin-top: 13px; padding: 25px 29px 18px; background: #fbf4e4; box-shadow: 1px 3px 0 #d1bf95, 3px 5px 0 #f1e6c9, 5px 7px 10px #452b1a30; border: 1px solid #e0cfac; }
.drawer-inner::before { content: ''; position: absolute; top: -10px; left: 32px; width: 68px; height: 22px; background: #d8bd7d8a; transform: rotate(-4deg); }
.drawer-inner .notebook-header h2 { color: #5a523d; }
.drawer-inner .reflection-prompts { color: #a5674a; }
.drawer-inner .note-pages label > span { color: #435d60; }
.drawer-inner .note-pages label:nth-child(2) > span { color: #a25f48; }
.drawer-inner .note-pages textarea { background-color: #fffdf526; }

.reading-caption { display: flex; align-items: center; gap: 20px; margin: 34px 0 21px; color: #8a826d; }
.reading-caption > span:first-child { font-family: var(--serif); font-size: 20px; color: #364c43; }
.reading-caption p { font-size: 10px; letter-spacing: .4px; }
.reading-caption > span:last-child { margin-left: auto; font-size: 25px; color: #9b7a50; }
#debate .desk-scene { border: 0; border-radius: 0; background: transparent; box-shadow: none; padding: 8px 8px 13px; grid-template-columns: 260px minmax(0, 1fr); gap: 33px; }
#debate .desk-edge { display: none; }
#debate .case-file { background: #e6e1c9; border-color: #c5c4a7; box-shadow: 1px 3px 0 #cecaaf, 0 9px 18px #6d5c3e0c; }
#debate .case-file h2 { color: #546449; }
#debate #scenario { color: #68694e; }
#debate .folio { border-color: #d0c7b0; box-shadow: 3px 5px 0 #dfd8c5, 6px 8px 0 #f7f1df, 8px 14px 25px #56472f13; }
#debate .side-heading h2 { font-size: 24px; }
#debate .side-opener { font-size: 13px; color: #72765e; }
#debate .argument summary { font-size: 15px; }
#debate .argument-reason { font-size: 13px; color: #5d6654; }
#debate .premise p { font-size: 12px; color: #8c8a70; }
#debate .challenge-button, #debate .challenge-reply { font-size: 12px; }
#debate .both-sides .side-heading h2 { font-size: 19px; }
#debate .both-sides .argument summary { font-size: 13px; }
#debate .both-sides .side-opener { font-size: 12px; }
#debate .desk-bottom { margin: 17px 5px; }

/* A geometric fallback keeps the furniture and handle usable without WebGL. */
.desk-fallback { position: absolute; inset: 0; perspective: 800px; }
.desk-viewport.is-rendered .desk-fallback { display: none; }
.fallback-table { position: absolute; width: 52%; height: 35%; left: 24%; top: 29%; background: linear-gradient(130deg, #9d714c, #69422e); transform: rotateX(38deg) rotateZ(-6deg); border: 7px solid #65402e; box-shadow: 0 12px 0 #473326, 0 45px 40px #4c513b24; }
.fallback-table i { position: absolute; height: 105px; width: 14px; background: #51392c; top: 100%; left: 13%; transform: rotateX(-38deg); }
.fallback-table i + i { left: auto; right: 9%; }
.fallback-table span { position: absolute; width: 25%; height: 43%; background: #fcf1d9; top: 20%; left: 35%; box-shadow: 4px 5px 0 #ddd1ac; }
.fallback-chair { position: absolute; width: 12%; height: 24%; top: 40%; border-radius: 12px 12px 5px 5px; background: #a6503c; box-shadow: 0 12px 0 #653e2e, 0 43px 0 -15px #4f3827; }
.fallback-chair--red { left: 12%; transform: rotate(-13deg); }
.fallback-chair--blue { left: auto; right: 11%; top: 28%; background: #406b7b; transform: rotate(-13deg); }

@media (min-width: 1550px) { .room-stage { height: 415px; } }
@media (max-width: 1000px) {
  .room-stage { height: 350px; }
  .drawer-side-note { display: none; }
  .desk-front { padding-inline: 24px; }
  #debate .desk-scene { grid-template-columns: 220px minmax(0, 1fr); gap: 25px; }
  #debate .both-sides .side-heading h2 { font-size: 17px; }
}
@media (max-width: 800px) {
  #debate .desk-scene { grid-template-columns: minmax(0, 1fr); gap: 25px; padding-inline: 3px; }
  .room-stage { height: 340px; }
  .drawer-handle { width: 310px; }
  .drawer-notebook.notebook { margin-inline: 15px; padding-inline: 11px; border-inline-width: 7px; }
  .drawer-inner { padding-inline: 21px; }
}
@media (max-width: 580px) {
  #debate .motion-heading h1 { font-size: 25px; line-height: 1.5; }
  #debate .motion-heading > p:last-child { font-size: 15px; }
  #debate .seat-options button { padding: 9px 7px; }
  .room-stage { height: 310px; border-radius: 9px 9px 0 0; }
  .room-caption { left: 14px; right: 14px; top: 14px; font-size: 6px; letter-spacing: 1.3px; }
  .room-caption > span:last-child { font-size: 6px; }
  .room-floor-copy { bottom: 13px; left: 14px; }
  .room-floor-copy > span { font-size: 15px; }
  .room-floor-copy p { font-size: 7px; letter-spacing: 0; }
  .room-seat-sign { padding: 4px 7px; font-size: 8px; letter-spacing: .3px; }
  .desk-front { min-height: 84px; padding-inline: 14px; gap: 9px; }
  .drawer-index { font-size: 7px; letter-spacing: .5px; max-width: 42px; line-height: 1.9; }
  .drawer-handle { width: calc(100% - 54px); min-height: 80px; padding: 10px 14px; gap: 5px 13px; }
  .drawer-handle-label { font-size: 12px; letter-spacing: .5px; }
  .brass-pull { width: 76px; }
  .drawer-action { font-size: 7px; letter-spacing: .4px; }
  .drawer-notebook.notebook { margin: 0 5px; padding: 12px 8px 16px; border-inline-width: 6px; border-bottom-width: 10px; }
  .drawer-inner { padding: 22px 15px 17px; }
  .drawer-inner .notebook-header h2 { font-size: 22px; }
  .drawer-inner .notebook-header .eyebrow { font-size: 5px; letter-spacing: 1px; }
  .drawer-inner .reflection-prompts { font-size: 15px; }
  .reading-caption { margin: 29px 0 17px; gap: 11px; }
  .reading-caption > span:first-child { font-size: 18px; white-space: nowrap; }
  .reading-caption p { font-size: 8px; line-height: 1.8; }
  .reading-caption > span:last-child { font-size: 21px; }
  #debate .case-file h2 { font-size: 23px; }
  #debate .side-heading h2, #debate .both-sides .side-heading h2 { font-size: 20px; }
  #debate .argument summary, #debate .both-sides .argument summary { font-size: 14px; }
  #debate .side-opener, #debate .both-sides .side-opener { font-size: 12px; }
  #debate .argument-reason { font-size: 12px; }
  #debate .premise p { font-size: 11px; }
  #debate .challenge-button, #debate .challenge-reply { font-size: 11px; }
}
@media (max-width: 350px) {
  #debate .motion-heading h1 { font-size: 22px; }
  .room-stage { height: 285px; }
  .room-seat-sign { font-size: 7px; }
  .drawer-handle { padding-inline: 9px; column-gap: 7px; }
  .drawer-handle-label { font-size: 10px; }
  .brass-pull { width: 65px; }
}
@media (prefers-reduced-motion: reduce) {
  .drawer-handle:hover, .drawer-handle:focus-visible, .is-drawer-open .drawer-handle { transform: none; }
}
