/* ==========================================================================
   Shack Stack · module shell + Name Drop. Loads after teacherview.css and uses the lofi.css tokens.
   Rules of the 3D chain (isometric style): only leaves carry opacity/filter/overflow inside .ndi-cam > .ndi-board > .ndi-wrap > .ndi-tile.
   ========================================================================== */
.icon-expand { mask-image: url(assets/ui-expand.svg?v=90); -webkit-mask-image: url(assets/ui-expand.svg?v=90); }

/* ---------- Module switcher ---------- */
.module-switch { display: flex; gap: 2px; padding: 2px; border-radius: 12px; background: var(--sunken); box-shadow: inset 0 1px 2px rgb(var(--shadow-warm) / .12); flex: none; }
.module-switch button { min-height: 32px; height: 32px; padding: 0 var(--s3); border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-weight: 600; gap: 7px; box-shadow: none; white-space: nowrap; }
.module-switch button:hover:not(:disabled) { color: var(--ink); background: color-mix(in srgb, var(--ink) 5%, transparent); border: 0; }
.module-switch button[aria-pressed=true] { background: var(--raised); color: var(--ink); box-shadow: var(--shadow-2); }
.module-switch button[aria-pressed=true] .toolbar-symbol { color: var(--ui-accent); }
.module-switch button:disabled { opacity: .55; cursor: default; }
.module-switch .toolbar-symbol { width: 16px; height: 16px; }
.module-switch small { font-size: 10px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; padding: 1px 6px; border-radius: 999px; background: color-mix(in srgb, var(--butter) 45%, var(--raised)); color: var(--warn-ink); }
@media (max-width: 760px) { .module-switch .mod-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } .module-switch small { display: none; } .module-switch button { padding: 0 10px; } }

/* Other modules own the screen. The Seat Studio stays laid out (so scroll and zoom survive) but is inert and invisible. */
body:not([data-module=seating]) .header-room, body:not([data-module=seating]) .header-actions, body:not([data-module=seating]) #saveState, body:not([data-module=seating]) .app-nav { display: none; }
body:not([data-module=seating]) main { visibility: hidden; position: absolute; left: 0; right: 0; top: 56px; height: calc(100vh - 56px); pointer-events: none; overflow: hidden; }
.module-view { display: grid; grid-template-columns: 328px minmax(0, 1fr); height: calc(100vh - 56px); min-height: 0; background: var(--bg); }
.module-view[hidden] { display: none !important; }
@media (max-width: 1150px) { .module-view { grid-template-columns: 300px minmax(0, 1fr); } }
@media (max-width: 800px) { .module-view { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); height: auto; min-height: calc(100vh - 56px); } .nd-panel { max-height: 46vh; border-right: 0; border-bottom: 1px solid var(--line); } .nd-main { min-height: 70vh; } }

/* themes.css hides every <aside> when the Seat Studio's own tool panel is hidden (or the window is narrow); module panels must be exempt. */
body[data-tools-hidden=true] .module-view > aside { display: block; }

/* ---------- Name Drop panel ---------- */
.nd-panel { overflow-y: auto; padding: var(--s5) var(--s5) var(--s8); background-color: var(--surface); background-image: var(--paper); background-size: 240px 240px; border-right: 1px solid var(--line); scrollbar-width: thin; }
.nd-title { margin: 0 0 var(--s1); font-family: var(--font-display) !important; font-size: 21px; font-weight: 700; letter-spacing: -.01em; }
.nd-panel .menu-section:first-of-type { border-top: 0; }
.nd-seg { width: 100%; }
.nd-seg button { flex: 1; justify-content: center; padding: 0 var(--s2); }
.nd-styles { display: grid; gap: var(--s2); }
.nd-style { flex-direction: row; justify-content: flex-start; text-align: left; gap: var(--s3); padding: 8px; min-height: 62px; border-radius: var(--r-md); background: var(--raised); box-shadow: var(--shadow-1); height: auto; }
.nd-style svg { width: 56px; height: 40px; flex: none; border-radius: 8px; background: color-mix(in srgb, var(--sunken) 60%, var(--raised)); }
.nd-style strong { display: block; font-size: var(--t-body); font-weight: 650; }
.nd-style small { display: block; color: var(--muted); font-size: var(--t-cap); font-weight: 500; line-height: 1.3; }
.nd-style[aria-pressed=true] { border-color: var(--ui-accent) !important; background: color-mix(in srgb, var(--ui-accent) 7%, var(--raised)); box-shadow: var(--shadow-1), 0 0 0 3px color-mix(in srgb, var(--ui-accent) 15%, transparent); }
.nd-roster { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--s2); }
.nd-chip { min-height: 30px; height: 30px; padding: 0 10px; border-radius: 999px; font-size: var(--t-cap); gap: 6px; background: var(--raised); box-shadow: none; }
.nd-chip small { font-size: 10px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.nd-chip[data-state=absent] { opacity: .6; text-decoration: line-through; }
.nd-chip[data-state=picked] { background: color-mix(in srgb, var(--ui-accent) 9%, var(--raised)); color: var(--muted); }
#ndPoolCount { color: var(--muted); font-weight: 500; }

/* ---------- Name Drop stage ---------- */
.nd-main { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: 12px; gap: 10px; }
.nd-top { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); transition: opacity var(--dur) var(--ease-out); }
.nd-hint { font-size: var(--t-cap); color: var(--muted); }
.nd-stage-wrap { position: relative; flex: 1; min-height: 240px; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow-2); background-color: color-mix(in srgb, var(--room, var(--surface)) 62%, var(--surface)); background-image: radial-gradient(120% 90% at 50% 38%, rgb(255 255 255 / .22), rgb(255 255 255 / 0) 60%), var(--paper); background-size: auto, 240px 240px; }
body[data-mode=dark] .nd-stage-wrap { background-image: radial-gradient(120% 90% at 50% 38%, rgb(255 255 255 / .04), rgb(255 255 255 / 0) 60%); }
.nd-stage { position: absolute; inset: 0; overflow: hidden; }
.nd-stage:empty::before { content: "Ready when you are"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font: 600 clamp(18px, 2.4vw, 30px) var(--font-display); }
.nd-note { position: absolute; left: 14px; bottom: 10px; right: 14px; margin: 0; text-align: center; font-size: var(--t-body); color: var(--muted); pointer-events: none; z-index: 4; }
.nd-note:empty { display: none; }
.nd-controls { display: flex; justify-content: center; gap: 12px; transition: opacity var(--dur) var(--ease-out); }
#ndDrop { min-width: 190px; height: 52px; min-height: 52px; font-size: 18px; font-weight: 700; border-radius: 15px; }
#ndDrop[data-mode=skip] { background: var(--raised) !important; color: var(--ink) !important; border: 1px solid var(--line) !important; }
#ndAgain { height: 52px; min-height: 52px; border-radius: 15px; padding: 0 var(--s5); font-size: 15px; }
.nd-result { position: absolute; inset: 0; z-index: 5; display: grid; place-content: center; justify-items: center; gap: 16px; padding: 28px; background: radial-gradient(90% 80% at 50% 45%, color-mix(in srgb, var(--surface) 92%, transparent), color-mix(in srgb, var(--surface) 80%, transparent)); }
.nd-result[hidden] { display: none; }
.ndr-row { display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(18px, 3vw, 44px); }
.ndr-card { display: flex; flex-direction: column; align-items: center; gap: 14px; max-width: min(34vw, 460px); animation: ndr-in .45s var(--ease-out) both; }
.ndr-portrait { display: grid; place-items: center; overflow: hidden; border-radius: 22px; color: var(--ui-accent); background: linear-gradient(160deg, color-mix(in srgb, var(--ui-accent) 22%, var(--seat-bg)), color-mix(in srgb, var(--ui-accent) 9%, var(--seat-bg))); box-shadow: 0 0 0 4px var(--seat-bg), 0 14px 30px rgb(var(--shadow-warm) / .28); font: 700 56px var(--font-display); }
.ndr-portrait img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ndr-name { font: 700 clamp(38px, 6.2vw, 96px)/1.04 var(--font-display); letter-spacing: -.02em; text-align: center; overflow-wrap: anywhere; color: var(--ink); }
.nd-result[data-count="2"] .ndr-name { font-size: clamp(30px, 4.4vw, 68px); }
.nd-result[data-count="3"] .ndr-name { font-size: clamp(26px, 3.4vw, 54px); }
.nd-result[data-count="2"] .ndr-portrait, .nd-result[data-count="3"] .ndr-portrait { width: 104px !important; height: 136px !important; }
.ndr-note { margin: 0; color: var(--muted); font-size: var(--t-body); }
@keyframes ndr-in { from { opacity: 0; transform: translateY(18px) scale(.94); } to { opacity: 1; transform: none; } }
.nd-main.nd-fs { position: fixed; inset: 0; z-index: 60; background: var(--bg); padding: 18px; }
.nd-main:fullscreen { background: var(--bg); padding: 18px; }
.nd-main.nd-idle { cursor: none; }
.nd-main.nd-idle .nd-top, .nd-main.nd-idle .nd-controls { opacity: 0; pointer-events: none; }
.nd-fs .nd-hint { display: none; }
@media print { #moduleNameDrop { display: none !important; } }

/* ---------- Shared tile / portrait look ---------- */
.nd-portrait { flex: none; display: grid; place-items: center; overflow: hidden; border-radius: 10px; color: var(--ui-accent); background: linear-gradient(160deg, color-mix(in srgb, var(--ui-accent) 20%, var(--seat-bg)), color-mix(in srgb, var(--ui-accent) 9%, var(--seat-bg))); box-shadow: 0 0 0 1px rgb(var(--shadow-warm) / .13), 0 2px 5px rgb(var(--shadow-warm) / .15); font: 650 20px var(--font); }
.nd-portrait img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nd-portrait b { font: inherit; }
.nd-nm { display: flex; flex-direction: column; align-items: center; text-align: center; font: 600 15px/18px var(--font); color: var(--seat-ink); }
.nd-nm span { display: block; white-space: nowrap; }

/* ---------- Style: Guess Who (isometric board) ---------- */
.ndi-root { position: absolute; inset: 0; perspective: 3000px; perspective-origin: 50% 40%; overflow: hidden; }
.ndi-cam { position: absolute; left: 0; top: 0; width: 0; height: 0; transform-style: preserve-3d; transform-origin: 0 0; will-change: transform; }
.ndi-board { position: absolute; left: 0; top: 0; transform-style: preserve-3d; }
.ndi-slab { position: absolute; border-radius: 14px; background: color-mix(in srgb, var(--desk-bottom, #cdb68f) 55%, #5a4632); }
.ndi-top { position: absolute; left: 0; top: 0; border-radius: 8px; background: linear-gradient(160deg, rgb(255 255 255 / .22), rgb(255 255 255 / 0) 55%), repeating-linear-gradient(1.5deg, rgb(var(--grain) / var(--grain-a)) 0 1px, transparent 1px 9px), color-mix(in srgb, var(--ui-accent) 20%, color-mix(in srgb, var(--desk-bottom, #cdb68f) 70%, var(--surface))); box-shadow: inset 0 0 0 3px rgb(var(--shadow-warm) / .22); }
.ndi-wrap { position: absolute; height: 0; transform-style: preserve-3d; }
.ndi-tile { position: absolute; left: 0; top: -158px; transform-origin: 50% 100%; transform-style: preserve-3d; }
.ndi-shadow { position: absolute; top: -8px; height: 22px; border-radius: 50%; background: radial-gradient(closest-side, rgb(var(--shadow-warm) / .42), rgb(var(--shadow-warm) / 0)); transform: translateZ(1px); opacity: 0; pointer-events: none; }
.ndi-front, .ndi-back { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 12px; }
.ndi-front { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 6px 6px; overflow: hidden; background: var(--seat-bg); border: 1px solid color-mix(in srgb, var(--ink) 10%, var(--seat-bg)); box-shadow: 0 1px 1px rgb(var(--shadow-warm) / .1), inset 0 1px 0 rgb(255 255 255 / .7); }
.ndi-back { transform: rotateY(180deg); background: linear-gradient(160deg, color-mix(in srgb, var(--ui-accent) 36%, var(--surface)), color-mix(in srgb, var(--ui-accent) 24%, var(--surface))); box-shadow: inset 0 0 0 5px rgb(255 255 255 / .18), inset 0 0 0 6px rgb(var(--shadow-warm) / .2); }
.ndi-back::after { content: ""; position: absolute; inset: 0; margin: auto; width: 30px; height: 30px; background: rgb(255 255 255 / .55); mask: url(assets/ui-person.svg?v=90) center / contain no-repeat; -webkit-mask: url(assets/ui-person.svg?v=90) center / contain no-repeat; }

/* ---------- Style: Plinko Drop ---------- */
.ndp-root, .ndc-root { position: absolute; inset: 0; }
.ndp-board { position: absolute; left: 50%; top: 50%; transform-origin: 50% 50%; border-radius: 26px; background: linear-gradient(165deg, rgb(255 255 255 / .22), rgb(255 255 255 / 0) 50%), color-mix(in srgb, var(--ui-accent) 14%, color-mix(in srgb, var(--desk-bottom, #cdb68f) 60%, var(--surface))); box-shadow: inset 0 0 0 4px rgb(var(--shadow-warm) / .2), 0 18px 40px rgb(var(--shadow-warm) / .25); }
.ndp-peg { position: absolute; width: 14px; height: 14px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff8e8, #b79f7c 70%); box-shadow: 0 2px 3px rgb(var(--shadow-warm) / .35); }
.ndp-bin { position: absolute; height: 120px; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 10px; border-radius: 0 0 16px 16px; background: color-mix(in srgb, var(--raised) 74%, transparent); border: 1.5px solid rgb(var(--shadow-warm) / .3); border-top: 0; }
.ndp-glow { position: absolute; inset: 0; border-radius: inherit; background: radial-gradient(circle at 50% 75%, rgb(246 212 112 / .8), rgb(246 212 112 / 0) 72%); opacity: 0; }
.ndp-bin-name { position: relative; max-width: 70px; font: 600 12.5px/14px var(--font); text-align: center; overflow-wrap: anywhere; color: var(--ink); }
.ndp-puck { position: absolute; left: 0; top: 0; width: 68px; height: 68px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 35% 28%, hsl(var(--hue) 75% 90%), hsl(var(--hue) 50% 68%) 70%); border: 2px solid rgb(var(--shadow-warm) / .38); box-shadow: 0 6px 10px rgb(var(--shadow-warm) / .3), inset 0 -4px 8px rgb(0 0 0 / .08); z-index: 2; }
.ndp-puck-name { max-width: 56px; font: 700 11px/12px var(--font); text-align: center; color: #3a2c1e; overflow: hidden; max-height: 36px; overflow-wrap: anywhere; }

/* ---------- Style: Capsule Machine ---------- */
.ndc-board { position: absolute; left: 50%; top: 50%; transform-origin: 50% 50%; }
.ndc-base { position: absolute; left: 100px; top: 372px; width: 300px; height: 228px; z-index: 1; border-radius: 28px 28px 18px 18px; background: linear-gradient(180deg, rgb(255 255 255 / .22), rgb(255 255 255 / 0) 40%), color-mix(in srgb, var(--ui-accent) 42%, #d8c3a3); box-shadow: inset 0 0 0 3px rgb(var(--shadow-warm) / .25), 0 14px 24px rgb(var(--shadow-warm) / .25); }
.ndc-slotlabel { position: absolute; left: 150px; top: 424px; width: 200px; z-index: 1; text-align: center; font: 700 12px var(--font); letter-spacing: .3em; color: rgb(255 255 255 / .78); text-shadow: 0 1px 1px rgb(0 0 0 / .25); }
.ndc-slotlabel::after { content: "NAME DROP"; }
.ndc-chute { position: absolute; left: 276px; top: 404px; width: 190px; height: 34px; z-index: 1; transform-origin: 0 50%; transform: rotate(38deg); border-radius: 17px; background: linear-gradient(180deg, color-mix(in srgb, var(--wood, #c9a77c) 80%, #fff), var(--wood, #c9a77c)); box-shadow: inset 0 0 0 2px rgb(var(--shadow-warm) / .28), 0 6px 8px rgb(var(--shadow-warm) / .25); }
.ndc-tray { position: absolute; left: 340px; top: 556px; width: 124px; height: 34px; z-index: 1; border-radius: 14px; background: color-mix(in srgb, var(--wood, #c9a77c) 70%, #3a2c1e); box-shadow: inset 0 0 0 2px rgb(var(--shadow-warm) / .3); }
.ndc-knob { position: absolute; left: 222px; top: 474px; width: 56px; height: 56px; z-index: 2; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff3c9, #e0b95a 70%); box-shadow: inset 0 0 0 2px rgb(var(--shadow-warm) / .35), 0 4px 6px rgb(var(--shadow-warm) / .3); }
.ndc-knob::after { content: ""; position: absolute; left: 50%; top: 8px; width: 6px; height: 20px; margin-left: -3px; border-radius: 3px; background: rgb(var(--shadow-warm) / .55); }
.ndc-dome { position: absolute; left: 80px; top: 45px; width: 340px; height: 340px; z-index: 3; border-radius: 50%; pointer-events: none; background: radial-gradient(circle at 34% 26%, rgb(255 255 255 / .6), rgb(255 255 255 / .1) 52%, rgb(150 180 195 / .2)); border: 3px solid rgb(var(--shadow-warm) / .5); box-shadow: inset 0 -22px 40px rgb(120 150 165 / .22), 0 12px 30px rgb(var(--shadow-warm) / .2); }
.ndc-cap { position: absolute; left: 0; top: 0; width: 56px; height: 56px; z-index: 2; }
.ndc-cap i { position: absolute; left: 0; width: 100%; height: 50%; box-shadow: inset 0 0 0 1.5px rgb(var(--shadow-warm) / .45); }
.ndc-cap .top { top: 0; border-radius: 28px 28px 0 0; background: var(--c); }
.ndc-cap .bot { bottom: 0; border-radius: 0 0 28px 28px; background: color-mix(in srgb, var(--c) 38%, #fff7e8); }
.ndc-cap::after { content: ""; position: absolute; left: 11px; top: 8px; width: 12px; height: 8px; border-radius: 50%; background: rgb(255 255 255 / .6); transform: rotate(-30deg); }
.ndc-slip { position: absolute; z-index: 4; width: 170px; min-height: 52px; padding: 10px 12px; display: grid; place-items: center; border-radius: 6px; background: #fffdf8; border: 1px solid rgb(var(--shadow-warm) / .4); box-shadow: 0 6px 12px rgb(var(--shadow-warm) / .25); font: 700 18px/1.15 var(--font); color: #2b2722; text-align: center; transform-origin: 50% 0; opacity: 0; overflow-wrap: anywhere; }
@media (forced-colors: active) { .ndr-card { border: 1px solid CanvasText; } }

/* ---------- Lists dialog ---------- */
#ndListsDialog { width: min(880px, calc(100vw - 32px)); }
.nd-lists-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: var(--s5); margin-top: var(--s3); }
.nd-lists-side { display: flex; flex-direction: column; gap: var(--s2); min-width: 0; }
.nd-listnav { display: grid; gap: 6px; max-height: 50vh; overflow: auto; }
.nd-listbtn { flex-direction: column; align-items: flex-start; justify-content: center; gap: 1px; text-align: left; height: auto; min-height: 46px; padding: 8px 12px; border-radius: var(--r-md); background: var(--raised); }
.nd-listbtn strong { font-size: var(--t-body); font-weight: 650; overflow-wrap: anywhere; }
.nd-listbtn small { color: var(--muted); font-size: var(--t-cap); font-weight: 500; }
.nd-listbtn[aria-pressed=true] { border-color: var(--ui-accent) !important; background: color-mix(in srgb, var(--ui-accent) 8%, var(--raised)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ui-accent) 14%, transparent); }
.nd-lists-edit { min-width: 0; }
.nd-lists-edit .row { margin-top: var(--s3); }
.nd-lists-edit textarea { min-height: 150px; }
@media (max-width: 700px) { .nd-lists-layout { grid-template-columns: 1fr; } }

/* Make room for the switcher: at laptop widths the brand text and the "Soon" badge step aside so the class name stays readable. */
@media (max-width: 1380px) { .brand > div { display: none; } .module-switch small { display: none; } .module-switch button { padding: 0 10px; } }
