/* The photo and its card coordinates use the same viewport geometry. */
:root { --header-height: 58px; --room-height: 100dvh; --scene-width: 390px; --scene-height: 844px; --scene-left: 0px; --table-top: 384px; --table-left: 44px; --table-width: 302px; --table-height: 290px; --card-width: 95px; --pick-width: 66px; --slot-width: 41px; }
html, body { height: var(--room-height); overflow: hidden; }
body { position: relative; background: #160e15; }
.room-backdrop { position: fixed; inset: 0; height: var(--room-height); pointer-events: none; overflow: hidden; }
.room-backdrop::before { content: ""; position: absolute; inset: -28px; background: url("/assets/welcome-room.webp") center/cover; filter: blur(24px) brightness(.82); }
body[data-screen="bacaan"] .room-backdrop::after { content: ""; position: absolute; left: 0; right: 0; top: var(--setup-fade-top, 48%); bottom: 0; background: linear-gradient(transparent, #160b175e 34%, #160b178a); }
.room-scene { position: absolute; top: 0; left: var(--scene-left); width: var(--scene-width); height: var(--scene-height); background: url("/assets/welcome-room.webp") center/100% 100% no-repeat; }
.room-floor { display: none; }
body[data-wide-room="true"] .room-backdrop::before { background-image: url("/assets/presence.webp"); }
body[data-wide-room="true"] .room-scene { background-image: url("/assets/presence.webp"); }
body[data-wide-room="true"] .room-floor { display: block; position: absolute; inset: 54% 0 0; background: linear-gradient(#57243122, #20101766), url("/assets/felt.webp") center/cover; mask-image: linear-gradient(transparent, #000 10%); }
.site-header { position: relative; z-index: 30; display: flex; align-items: center; justify-content: space-between; width: 100%; height: calc(var(--header-height) + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 12px 0; background: linear-gradient(#110b15bf, #110b1540); border: 0; }
.wordmark { display: flex; align-items: center; flex: 0 1 auto; min-width: 0; }
.brand-logo { width: 92px; height: 48px; object-fit: contain; }
.header-tools, .room-nav { display: flex; align-items: center; gap: 2px; }
.room-nav { position: static; padding: 0; background: transparent; border: 0; width: auto; }
.room-nav a, #volumeToggle { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border-radius: 50%; color: #dbc4aa; border: 1px solid transparent; background: none; }
.room-nav a svg { width: 20px; height: 20px; }
.room-nav a[aria-current="page"] { color: #f5dca7; background: #eac5861c; border-color: #e5c18559; }
.room-nav a:hover, #volumeToggle:hover { background: #eac5861c; }
.sound-control { position: relative; }
.sound-settings { position: absolute; top: 48px; right: 0; z-index: 60; width: min(280px, calc(100vw - 24px)); padding: 15px 17px; background: #22181ff5; border: 1px solid #d1ab7770; border-radius: 12px; box-shadow: 0 15px 45px #0009; backdrop-filter: blur(18px); }
.sound-settings-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; gap: 10px; }
.sound-settings-heading strong { font: 18px var(--serif); }
.sound-settings-heading .text-button { font-size: 11px; }
.sound-settings label { display: flex; justify-content: space-between; font-size: 12px; }
.sound-settings output { color: var(--gold); font-variant-numeric: tabular-nums; }
.sound-settings input { width: 100%; min-height: 44px; accent-color: var(--gold); }
#main { position: relative; z-index: 1; height: calc(var(--room-height) - var(--header-height) - env(safe-area-inset-top)); width: 100%; max-width: none; padding: 10px 18px calc(12px + env(safe-area-inset-bottom)); outline: none; }
.screen { width: 100%; height: 100%; min-height: 0; margin: 0 auto; padding: 0; border: 0; background: transparent; }
.session-heading { position: relative; width: 100%; max-width: 600px; margin: 0 auto; text-shadow: 0 2px 15px #000; }
.session-heading h1 { font-size: clamp(23px, 3.7vw, 32px); margin-top: 3px; }
.session-heading .session-step { font-size: 8px; }
.pick-screen .session-heading { padding-right: 90px; }
#selectionCount { position: absolute; right: 52px; top: 12px; font-size: 14px; color: var(--gold); }
.reshuffle { position: absolute; right: 0; top: 0; }
.table-stage { position: fixed; top: var(--table-top); left: var(--table-left); width: var(--table-width); height: var(--table-height); padding: 0; border: 0; background: transparent; display: flex; align-items: center; justify-content: center; margin: 0; }
.room-bottom { position: fixed; z-index: 5; bottom: calc(12px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); width: calc(100% - 36px); max-width: 540px; padding: 0; border: 0; border-radius: 0; background: none; }
.room-bottom::before { content: ""; position: absolute; z-index: -1; top: -45px; bottom: -24px; left: 50%; width: 100vw; transform: translateX(-50%); background: linear-gradient(transparent, #160b174d 42%, #160b1780); pointer-events: none; }
.caption-heading { display: flex; align-items: center; gap: 9px; min-height: 30px; }
.caption-heading .icon-button { width: 38px; min-height: 38px; border-color: transparent; margin-left: auto; }
.caption-heading .icon-button + .icon-button { margin-left: 0; }
.caption-heading .voice-status { flex: 1; max-width: 200px; }
.caption-heading .speaker-name { flex-shrink: 0; }
.chapter-label { margin-left: 6px; font-size: 9px; }
.live-caption { padding: 0; background: transparent; border: 0; text-shadow: 0 2px 5px #000, 0 0 14px #0009; }
.caption-window { position: relative; height: 76px; overflow: hidden; mask-image: linear-gradient(transparent, #000 55%); }
.caption-flow { position: absolute; left: 0; right: 0; bottom: 4px; display: flex; flex-direction: column; gap: 3px; }
.caption-roll { display: flex; flex-direction: column; gap: 3px; animation: captionRoll .4s ease both; }
.caption-flow p { margin: 0; font-size: 15px; line-height: 1.5; }
.caption-past { opacity: .65; }
.caption-current { color: #fff3e3; animation: captionRise .35s ease both; }
.arrival-heading { text-align: center; }
.arrival-heading h1 { font-size: clamp(26px, 4vw, 36px); }
.arrival-scene { pointer-events: none; }
.arrival-light { position: fixed; top: 41%; width: 30px; height: 45px; border-radius: 50%; background: #ffbd4922; filter: blur(14px); animation: candleBreathe 3s ease-in-out infinite alternate; }
.light-left { left: calc(50% - var(--scene-width) * .46); }
.light-right { left: calc(50% + var(--scene-width) * .43); animation-delay: 1s; }
.arrival-scatter { --scatter-width: min(78px, calc(var(--table-width) / 4.3), calc((var(--table-height) - 35px) / 1.9)); }
.scatter-card { position: absolute; left: calc(50% + var(--x) * var(--table-width)); top: calc(50% + var(--y)); width: var(--scatter-width); height: calc(var(--scatter-width) * 1.665); padding: 0; background: none; border-radius: 4px; transform: translate(-50%, -50%) rotate(var(--tilt)); box-shadow: 0 7px 12px #15071380; animation: scatterArrive .65s ease both; animation-delay: calc(var(--i) * 45ms); }
.scatter-card img { width: 100%; height: 100%; object-fit: cover; border-radius: 3px; }
button.scatter-card:hover { filter: brightness(1.15); }
.arrival-speaker { display: flex; justify-content: space-between; align-items: center; min-height: 30px; }
.arrival-voice { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 3px; color: var(--gold); background: none; font-size: 11px; }
.arrival-voice svg { width: 16px; height: 16px; }
.arrival-choices { display: flex; align-items: center; gap: 12px; margin-top: 5px; }
.arrival-choices > .button { flex: 1; }
.arrival-choices > .text-button { font-size: 11px; }
.arrival-voice-status { font-size: 10px; color: var(--muted); }
.arrival-voice-status:empty { display: none; }
.pick-table { flex-direction: column; gap: 9px; }
.spread-slots-bar { display: flex; justify-content: center; align-items: center; gap: calc(var(--slot-width) * .6); }
.slot-card-target { display: flex; flex-direction: column; align-items: center; }
.target-card { display: grid; place-items: center; width: var(--slot-width); height: calc(var(--slot-width) * 1.665); border: 1px dashed #eac98c7a; border-radius: 4px; background: #230e1c30; color: #eac98c9c; font: 14px var(--serif); }
.target-card:has(img) { border: 0; }
.target-card img { width: 100%; height: 100%; object-fit: contain; border-radius: 3px; box-shadow: 0 3px 8px #0007; }
.target-label, .physical-label { font-size: 9px; color: #ecd7b8; line-height: 1.3; margin-top: 5px; white-space: nowrap; text-shadow: 0 1px 4px #000; }
.pick-grid { display: flex; align-items: center; justify-content: center; padding: 8px 0; height: calc(var(--pick-width) * 1.665 + 20px); }
.pick-card { flex: 0 0 var(--pick-width); width: var(--pick-width); height: calc(var(--pick-width) * 1.665); padding: 0; background: none; border-radius: 4px; transform: rotate(var(--tilt)); transition: filter .2s; }
.pick-card + .pick-card { margin-left: calc(var(--pick-width) * -.47); }
.pick-card img { width: 100%; height: 100%; object-fit: contain; border-radius: 3px; box-shadow: 0 5px 8px #0007; }
.pick-card:not(:disabled):hover { filter: brightness(1.18); }
.pick-card.selected { opacity: .25; pointer-events: none; }
.pick-card.lifting { visibility: hidden; }
.shuffle-stack { position: absolute; left: 50%; bottom: 16px; width: var(--pick-width); height: calc(var(--pick-width) * 1.665); transform: translateX(-50%); visibility: hidden; pointer-events: none; }
.shuffle-stack.shuffling { visibility: visible; animation: shuffleCut .55s ease 2; }
.shuffle-stack span { position: absolute; inset: 0; transform: rotate(-4deg); }
.shuffle-stack span:nth-child(2) { transform: rotate(4deg); }
.shuffle-stack img { width: 100%; height: 100%; border-radius: 4px; }
.travelling-card { position: fixed; z-index: 25; margin: 0; pointer-events: none; transform-origin: top left; max-width: none; border-radius: 4px; }
.physical-spread { display: flex; justify-content: center; align-items: center; gap: 8px; width: 100%; }
.physical-slot { display: flex; align-items: center; flex-direction: column; min-width: 0; gap: 0; }
.flip-card { position: relative; width: var(--card-width); height: calc(var(--card-width) * 1.665); padding: 0; border-radius: 4px; background: none; perspective: 800px; }
.flip-card:disabled { opacity: .76; }
.flip-inner { display: block; position: absolute; inset: 0; transform-style: preserve-3d; }
.is-open .flip-inner { transform: rotateY(180deg); }
.flip-face { display: block; position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 4px; }
.flip-face img { width: 100%; height: 100%; object-fit: cover; border-radius: 4px; box-shadow: 0 7px 14px #16071380; }
.flip-front { transform: rotateY(180deg); }
.physical-slot.current .flip-card { outline: 1px solid #f1cc8c; outline-offset: 3px; box-shadow: 0 0 24px #f1cc8c30; }
.physical-slot.current .physical-label { color: #ffdf9e; }
.setup-screen { display: flex; flex-direction: column; justify-content: flex-end; max-width: 560px; }
.setup-room-space { flex: 1; min-height: 0; }
.setup-panel { display: flex; flex-direction: column; min-height: 0; gap: 12px; max-height: 100%; padding: 18px 0 0; background: transparent; }
.setup-panel .page-heading, .host-speech, .speaker-name { text-shadow: 0 2px 6px #160914a6; }
.setup-title-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.page-heading h1 { margin-top: 4px; font-size: 26px; }
.celestial-seal { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 50%; color: var(--gold); flex-shrink: 0; }
.host-note { padding: 0; border: 0; background: none; }
.host-header { display: flex; align-items: center; justify-content: space-between; }
.host-speech { font-size: 12px; line-height: 1.5; color: #ecd7c5; max-height: 58px; overflow-y: auto; }
.setup-form, .setup-fields { display: flex; flex-direction: column; min-height: 0; gap: 10px; }
.setup-screen fieldset { border: 0; padding: 0; margin: 0; }
.topics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.topic-tile { position: relative; display: grid; grid-template-columns: 36px minmax(0, 1fr); grid-template-rows: auto auto; align-content: center; column-gap: 8px; min-height: 72px; padding: 9px; border: 1px solid #d1ab7745; border-radius: 8px; background: #180c1780; cursor: pointer; }
.topic-tile input { position: absolute; opacity: 0; width: 1px; }
.topic-tile:has(input:checked) { border-color: #eac58c; background: #bb85443b; }
.topic-tile:has(input:focus-visible) { outline: 2px solid var(--gold); outline-offset: 3px; }
.topic-icon { grid-row: 1/3; display: grid; place-items: center; color: var(--gold); }
.topic-icon svg { width: 26px; height: 26px; stroke-width: 1.25; }
.topic-title { font-size: 13px; }
.topic-note { font-size: 9px; color: var(--muted); }
.tile-check { display: none; position: absolute; top: 5px; right: 5px; }
.tile-check svg { width: 11px; height: 11px; }
.topic-tile:has(input:checked) .tile-check { display: block; }
.selected-topic { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.selected-topic > span { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--gold); }
.selected-topic svg { width: 17px; }
.question-templates { display: grid; gap: 7px; }
.template-chip { display: flex; align-items: center; gap: 9px; min-height: 48px; padding: 9px 11px; background: #180c1780; color: var(--cream); border: 1px solid var(--line); border-radius: 7px; text-align: left; font-size: 13px; }
.template-chip.active { border-color: #d9b679; background: #bd8a4530; }
.chip-star { display: grid; place-items: center; width: 17px; height: 17px; border: 1px solid #d1ab7780; border-radius: 50%; flex-shrink: 0; }
.chip-star svg { width: 11px; height: 11px; }
.question-field textarea { min-height: 90px; margin-top: 5px; }
.spread-note { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 9px; color: var(--muted); }
.spread-note svg { width: 17px; height: 17px; }
.library-screen { display: grid; grid-template-rows: auto 44px 44px auto minmax(0, 1fr) 44px; gap: 9px; max-width: 940px; }
body[data-screen="kartu"] .room-backdrop { filter: brightness(.38); }
.library-heading { display: flex; align-items: center; justify-content: space-between; }
.library-heading h1 { font-size: 27px; margin-top: 4px; }
.library-search { display: flex; align-items: center; gap: 10px; padding: 0 12px; min-height: 44px; border: 1px solid var(--line); border-radius: 8px; background: #241921df; }
.library-search svg { color: var(--gold); width: 18px; }
.library-search input { min-width: 0; flex: 1; border: 0; outline-offset: 2px; padding: 8px 0; min-height: 44px; font-size: 16px; background: none; }
.library-search kbd { color: var(--muted); font-family: var(--serif); }
.suit-filters { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.suit-filters::-webkit-scrollbar { display: none; }
.suit-filter { display: flex; align-items: center; gap: 5px; padding: 6px 10px; min-height: 44px; flex-shrink: 0; border: 1px solid var(--line); border-radius: 7px; background: #261820a6; font-size: 11px; color: var(--muted); }
.suit-filter svg { width: 16px; height: 16px; }
.suit-filter[aria-pressed="true"] { color: #f3d29a; border-color: #d4b27a; background: #b9864036; }
.library-info { font-size: 10px; color: var(--muted); }
.library-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 12px; min-height: 0; }
.library-card { display: grid; grid-template-rows: minmax(0, 1fr) auto; min-height: 0; padding: 0; overflow: hidden; border: 1px solid #cda97346; border-radius: 10px; background: #251820e8; color: var(--cream); text-align: left; }
.library-card:hover { border-color: #e1ba7a; }
.library-art { position: relative; display: flex; justify-content: center; align-items: center; min-height: 0; padding: 12px 24px 8px; background: radial-gradient(ellipse at 50% 40%, #b57d4242, transparent 72%); }
.library-art::before { content: ""; position: absolute; width: 90px; height: 90px; border: 1px solid #d3b37b22; border-radius: 50%; box-shadow: 0 0 0 14px #d3b37b07; }
.library-art img { position: relative; width: auto; height: 100%; max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 3px; filter: drop-shadow(0 4px 6px #0009); }
.card-catalog-number { position: absolute; top: 8px; left: 9px; font: 12px var(--serif); color: #d7bb92; }
.catalog-suit { position: absolute; bottom: 7px; right: 8px; color: #cdae80; }
.catalog-suit svg { width: 17px; height: 17px; }
.library-card-copy { display: flex; flex-direction: column; gap: 1px; padding: 8px 10px; border-top: 1px solid #cdaa7726; }
.library-card-copy strong { font: 16px/1.2 var(--serif); }
.library-card-copy > span { color: var(--muted); font-size: 10px; }
.library-card-copy small { font-size: 9px; color: #bfa07c; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 24px; }
.pagination > span { min-width: 80px; font-size: 12px; text-align: center; color: var(--gold); }
.pagination small { display: block; font-size: 9px; color: var(--muted); }
.empty-state { grid-column: 1/-1; grid-row: 1/-1; align-self: center; text-align: center; }
.empty-state > svg { width: 30px; height: 30px; color: var(--gold); }
.reading-result { display: flex; flex-direction: column; gap: 12px; max-width: 620px; }
.reading-result .page-heading { text-align: center; }
.result-cards { position: fixed; top: var(--table-top); left: var(--table-left); width: var(--table-width); height: var(--table-height); display: flex; align-items: center; justify-content: center; gap: 8px; }
.result-card { position: relative; display: flex; flex-direction: column; align-items: center; width: var(--card-width); height: calc(var(--card-width) * 1.665 + 18px); padding: 0; background: transparent; color: var(--cream); }
.result-position { display: none; }
.result-card img { width: var(--card-width); height: calc(var(--card-width) * 1.665); border-radius: 4px; box-shadow: 0 5px 12px #0008; }
.result-card strong { position: absolute; bottom: 0; width: 100%; font-size: 9px; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.question-ribbon { font-size: 11px; color: #e8cba5; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reading-result .question-ribbon { max-width: 100%; }
.summary-speech { display: none; }
.reading-result > .screen-actions { position: fixed; bottom: calc(12px + env(safe-area-inset-bottom)); width: calc(100% - 36px); max-width: 540px; left: 50%; transform: translateX(-50%); }
.result-bottom .caption-heading { min-height: 24px; }
.result-bottom .caption-window { height: 50px; }
.result-actions { display: flex; align-items: center; gap: 8px; margin-top: 7px; }
.result-actions > .button { flex: 1; }
.result-actions > .icon-button { color: #f0d5ab; background: #160a164d; }
/* Long meanings scroll only within the dialog's reading area. */
dialog { width: min(660px, calc(100% - 24px)); height: min(750px, calc(var(--room-height) - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom))); max-height: calc(var(--room-height) - 24px); padding: 0; border: 1px solid #d5b47c70; border-radius: 14px; background: #241921; color: var(--cream); overflow: hidden; box-shadow: 0 20px 70px #0008; }
dialog::backdrop { background: #0e0814b8; backdrop-filter: blur(5px); }
dialog[open] { animation: cardArrive .4s cubic-bezier(.2,.7,.3,1) both; }
#modalBody { height: 100%; display: flex; flex-direction: column; min-height: 0; }
.modal-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-shrink: 0; padding: 14px 17px 10px; }
.modal-header h2 { font-size: 26px; margin-top: 3px; }
.modal-header .eyebrow { font-size: 8px; }
.modal-close { flex-shrink: 0; }
.modal-content { display: flex; flex-direction: column; min-height: 0; flex: 1; gap: 15px; padding: 2px 17px 17px; }
.card-hero { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 17px; flex-shrink: 0; }
.card-hero-art { width: clamp(80px, 16dvh, 140px); height: clamp(133px, 26.6dvh, 233px); }
.card-hero-art img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 6px 9px #0008); animation: heroTurn .55s ease both; }
.card-category { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; font-size: 9px; color: #d3b992; }
.card-category svg { width: 13px; height: 13px; }
.card-hero h3 { font-size: 25px; margin: 9px 0 7px; }
.card-hero-keywords { font-size: 11px; color: var(--muted); line-height: 1.7; }
.card-explanation { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.meaning-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); flex-shrink: 0; border-bottom: 1px solid var(--line); }
.meaning-tab { min-height: 44px; padding: 7px 3px; background: transparent; color: #bda894; border-bottom: 2px solid transparent; font-size: 12px; }
.meaning-tab[aria-selected="true"] { color: #f1d09a; border-bottom-color: #dcbc82; }
.meaning-panel { min-height: 0; overflow-y: auto; flex: 1; overscroll-behavior: contain; padding: 12px 1px 4px; scrollbar-width: thin; font-size: 15px; line-height: 1.8; color: #f0e3d3; }
.meaning-panel ul { margin: 0; padding-left: 19px; }
.meaning-panel li + li { margin-top: 9px; }
.card-dialog-footer { flex-shrink: 0; border-top: 1px solid var(--line); padding-top: 4px; }
.card-dialog-footer .caption-window { height: 54px; }
.card-dialog-footer .caption-flow p { font-size: 12px; line-height: 1.5; }
.card-dialog-footer > .button { width: 100%; margin-top: 7px; }
.card-dialog-footer .caption-heading { min-height: 38px; }
.card-dialog-footer .speaker-name { font-size: 16px; }
.card-dialog-footer .voice-status { font-size: 9px; }
.detail-audio { flex-shrink: 0; display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--line); }
.detail-audio .text-button { padding-left: 0; }
.share-dialog .modal-content { align-items: center; }
.share-preview { display: block; min-height: 0; max-height: 46dvh; width: 100%; object-fit: contain; flex: 1; border-radius: 5px; }
.share-caption { text-align: center; font-size: 12px; color: var(--muted); flex-shrink: 0; }
.share-site { color: var(--gold); font-size: 12px; text-align: center; overflow-wrap: anywhere; flex-shrink: 0; }
.share-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 7px; width: 100%; flex-shrink: 0; }
.share-actions > .button { flex: 1; }
.share-invitation { min-height: 70px; padding: 9px; font-size: 11px; color: #d8c3ad; flex-shrink: 0; }
@keyframes captionRise { from { opacity: .3; transform: translateY(9px); } to { opacity: 1; transform: translateY(0); } }
@keyframes captionRoll { from { transform: translateY(24px); } to { transform: translateY(0); } }
@keyframes cardArrive { from { opacity: 0; transform: translateY(20px) scale(.92); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes heroTurn { from { opacity: .4; transform: perspective(600px) rotateY(-25deg) rotate(-4deg); } to { opacity: 1; transform: none; } }
@keyframes scatterArrive { from { opacity: 0; transform: translate(-50%, -45%) rotate(0deg) scale(.9); } to { opacity: 1; transform: translate(-50%, -50%) rotate(var(--tilt)); } }
@keyframes shuffleCut { 50% { transform: translateX(-50%) rotate(6deg); } }
@keyframes candleBreathe { to { opacity: .6; transform: scale(.88); } }
@media (max-width: 699px) {
  .library-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .library-card-copy strong { font-size: 14px; }
  .library-card-copy small { display: none; }
  .library-art { padding: 9px 23px 6px; }
}
@media (max-height: 580px) {
  :root { --header-height: 52px; }
  #main { padding-top: 5px; }
  .session-heading h1 { font-size: 23px; }
  .room-bottom { bottom: calc(9px + env(safe-area-inset-bottom)); }
  .caption-window { height: 50px; }
  .caption-flow p { font-size: 13px; line-height: 1.45; }
  .caption-heading, .arrival-speaker { min-height: 28px; }
  .caption-heading .icon-button, .arrival-voice { min-height: 30px; }
  .speaker-name { font-size: 16px; }
  .pick-table .spread-slots-bar { display: none; }
  .pick-table.ready .spread-slots-bar { display: flex; gap: 8px; }
  .pick-table.ready .target-card { width: var(--card-width); height: calc(var(--card-width) * 1.665); }
  .pick-table.ready .pick-grid, .pick-table.ready .shuffle-stack { display: none; }
  .setup-panel { gap: 6px; padding-top: 10px; }
  .host-speech { max-height: 34px; font-size: 11px; }
  .host-header { min-height: 28px; }
  .setup-form, .setup-fields { gap: 6px; }
  .topic-tile { min-height: 57px; padding: 6px; }
  .page-heading h1 { font-size: 23px; }
  .template-chip { min-height: 44px; padding: 7px 9px; font-size: 12px; }
  .spread-note { display: none; }
  .library-screen { gap: 6px; }
  .library-heading h1 { font-size: 23px; }
  .library-card-copy { padding: 5px 8px; }
  .library-card-copy strong { font-size: 12px; }
  .modal-header { padding: 9px 13px 6px; }
  .modal-header h2 { font-size: 22px; }
  .modal-header .eyebrow { display: none; }
  .modal-content { padding: 2px 13px 12px; gap: 8px; }
  .card-hero-art { width: 52px; height: 86px; }
  .card-hero h3 { font-size: 21px; }
  .card-category { font-size: 8px; }
  .card-hero-keywords { font-size: 10px; }
  .meaning-panel { font-size: 14px; padding-top: 8px; }
  .card-dialog-footer .caption-window { height: 34px; }
  .card-dialog-footer .caption-flow p { font-size: 11px; }
  .card-dialog-footer .caption-heading { min-height: 30px; }
  .card-dialog-footer > .button { margin-top: 4px; }
  .card-dialog-footer { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: 34px 44px; gap: 4px 7px; }
  .card-dialog-footer .live-caption { grid-column: 1/-1; grid-row: 1; }
  .card-dialog-footer .caption-heading { grid-column: 2; grid-row: 2; }
  .card-dialog-footer .caption-heading .speaker-name, .card-dialog-footer .voice-status { display: none; }
  .card-dialog-footer > .button { grid-column: 1; grid-row: 2; margin: 0; font-size: 11px; padding-inline: 8px; }
  .share-dialog .modal-content { gap: 7px; }
  .share-preview { max-height: 35dvh; }
  .share-invitation { min-height: 52px; height: 52px; }
}
@media (max-width: 340px) {
  .site-header { padding-inline: 8px; }
  .brand-logo { width: 78px; }
  .header-tools, .room-nav { gap: 0; }
  #main { padding-inline: 12px; }
  .room-bottom { width: calc(100% - 24px); }
  .arrival-choices { gap: 8px; }
  .arrival-choices > .text-button { font-size: 10px; }
  .topic-title { font-size: 12px; }
  .topic-note { font-size: 8px; }
}
@media (max-height: 480px) and (orientation: landscape) {
  :root { --header-height: 48px; }
  .room-bottom { left: 75%; width: calc(50% - 32px); max-width: none; }
  .arrival-heading h1 { font-size: 24px; }
  .setup-screen { max-width: 640px; }
  .setup-host-note, .spread-note { display: none; }
  .topics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .topic-note { display: none; }
  .question-templates { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .selected-topic { min-height: 36px; }
  .template-chip { min-height: 62px; }
  .library-heading, .library-info { display: none; }
  .library-screen { grid-template-columns: 1fr 1fr; grid-template-rows: 44px minmax(0, 1fr) 44px; }
  .library-grid, .library-screen .pagination { grid-column: 1/-1; }
  .library-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-rows: minmax(0, 1fr); }
  .reading-dialog .modal-content { display: grid; grid-template-columns: 120px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; gap: 8px 15px; }
  .reading-dialog .card-hero { display: flex; flex-direction: column; align-items: center; gap: 6px; grid-column: 1; grid-row: 1/3; text-align: center; }
  .reading-dialog .card-hero-art { width: 68px; height: 113px; }
  .reading-dialog .card-hero h3 { font-size: 18px; margin: 4px 0; }
  .reading-dialog .card-hero-keywords { font-size: 9px; }
  .reading-dialog .card-category { display: none; }
  .reading-dialog .card-explanation, .reading-dialog .card-dialog-footer { grid-column: 2; }
}
@media (prefers-reduced-motion: reduce) { .caption-current, dialog[open], .card-hero-art img, .scatter-card, .arrival-light { animation: none; } }
