/* Dark gallery skin. Layout and touch target sizes stay in shadow-shape.html. */
:root {
  color-scheme: dark;
  --ink: #e1e8e5;
  --muted: #99acae;
  --teal: #91bdb9;
  --mint: #193238;
  --gold: #d7b781;
  --lav: #acacc6;
  --panel: #111e27ed;
}

html, body { background: #080f16; color: var(--ink); }
body { font-family: "Segoe UI", "Microsoft Yahei", system-ui, sans-serif; }
.app {
  background: radial-gradient(ellipse at 54% 36%, #1b2b35 0, #101c26 42%, #080f16 82%);
}
.app::before, .app::after { display: none; }
button { -webkit-tap-highlight-color: transparent; }
button:focus-visible, select:focus-visible {
  outline: 2px solid #e3c389;
  outline-offset: 3px;
}

/* Quiet exhibition catalogue. */
.menu {
  background: linear-gradient(145deg, #18252fef, #101b24f5);
  border-color: #66828a32;
  border-radius: 24px;
  box-shadow: 0 30px 90px #0008, inset 0 1px #d7e8e908;
  backdrop-filter: blur(20px);
}
.brand h1 {
  color: #ede8dc;
  font-weight: 650;
  letter-spacing: 5px;
  text-shadow: none;
}
.brand p { color: #9cabad; }
.badge {
  background: #24313b88;
  color: #d6bc8c;
  border-color: #b59c6538;
}
.level-card {
  background: linear-gradient(150deg, #23313be8, #17232deb);
  border-color: #91a9ad25;
  border-radius: 15px;
  box-shadow: 0 8px 24px #0002, inset 0 1px #dce8e804;
}
.level-card::after { display: none; }
.level-card:hover {
  border-color: #c1a77377;
  box-shadow: 0 13px 30px #0004, inset 0 1px #d2b57e16;
}
.level-card h2 { color: #e0e6e2; font-weight: 650; letter-spacing: .4px; }
.level-card p { color: #9dafb1; }
.level-card .mode { color: #9abcb9; }
.level-card .mode span { color: #cbb17d; }
.number b {
  background: #32424b;
  color: #d8bf93;
  font-weight: 650;
  border: 1px solid #d2b88025;
  box-shadow: none;
}
.stars { color: #d8b77c; }
.shape-preview {
  background: radial-gradient(ellipse at 50% 30%, #b3aa9225, #080f162b 80%);
  border: 1px solid #b3c2be12;
  border-radius: 10px;
}
.shape-preview svg g { fill: #c6bca5; }
.shape-preview.is-unrevealed svg { filter: blur(12px); opacity: .65; }
#reference:disabled { opacity: .5; cursor: default; }
.settings-box { max-height: calc(100dvh - 24px); overflow-y: auto; }
.gem-swatch.is-disco {
  background: conic-gradient(#ff70b7, #a782ff, #70baff, #70edb5, #ffda70, #ff70b7);
}
.gem-swatch {
  flex: 0 0 24px;
  height: 24px;
  border-radius: 7px;
  background: linear-gradient(135deg, #ffffffb0, transparent 55%), var(--gem-color, #61d9b4);
  border: 1px solid #ffffff70;
  box-shadow: 0 0 12px color-mix(in srgb, var(--gem-color, #61d9b4) 40%, transparent);
}
.shape-preview span { color: #bfb7a3; text-shadow: none; }
.play, .primary {
  color: #1b2227;
  background: linear-gradient(135deg, #e0c99b, #bfa16c);
  font-weight: 650;
  box-shadow: 0 5px 15px #0003;
  border: 1px solid #e7d4ac66;
}
.play:hover, .primary:hover { filter: brightness(1.08); }
.chapter-title { color: #bcb9a8; border-bottom-color: #a5b4b221; font-weight: 550; }
.category-tabs button {
  background: #172731;
  color: #adbfbd;
  border-color: #829c9d2a;
}
.category-tabs button.active {
  background: #314343;
  border-color: #bba4716b;
  color: #e7d5b3;
}
.difficulty-filter { color: #a2b4b3; }
.difficulty-filter select {
  background: #14242e;
  color: #d0dcd7;
  border-color: #819b9e3b;
}
.gallery-summary, .empty-gallery { color: #8ea5a7; }
.gallery-filters { display: block; }
.category-tabs { gap: 7px; margin-bottom: 12px; }
.category-tabs button { min-height: 44px; font-size: 12px; padding: 9px 13px; }
.theme-tabs { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding: 12px 0 2px; border-top: 1px solid #92a5a51c; }
.theme-label { margin-right: 4px; color: #8b9e9c; font-size: 11px; }
.theme-tabs button { min-height: 40px; border: 1px solid #7e999524; border-radius: 20px; padding: 7px 12px; background: #152630; color: #9bb4ae; font: inherit; font-size: 11px; }
.theme-tabs button[aria-pressed="true"] { background: #31443f; border-color: #bfa77877; color: #eddec1; }
.theme-tabs span:not(.theme-label) { font-size: 10px; opacity: .6; margin-left: 6px; }
.gallery-description { color: #8fa5a1; font-size: 12px; line-height: 1.7; margin: 9px 0 13px; }
.gallery-toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 0 0 14px; }
.gallery-search { display: flex; align-items: center; gap: 11px; flex: 1 1 220px; min-width: 0; }
.gallery-search > span { color: #8fa7a3; font-size: 11px; flex-shrink: 0; }
.gallery-search input { width: 100%; min-width: 0; min-height: 44px; border: 1px solid #829c9d33; background: #12232d; border-radius: 12px; padding: 10px 13px; color: #d8e2da; font: inherit; font-size: 12px; }
.gallery-search input::placeholder { color: #758e8e; }
.gallery-toolbar .difficulty-filter { display: flex; gap: 7px; align-items: center; }
.gallery-toolbar select { min-height: 44px; }
.clear-gallery-filters, .empty-gallery button { min-height: 44px; border: 1px solid #a69a7655; border-radius: 12px; background: #283731; color: #d4c8ad; padding: 8px 12px; font: inherit; font-size: 11px; }
.clear-gallery-filters[hidden] { display: none; }
.chapter-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 9px; margin-top: 17px; }
.chapter-title small { flex-shrink: 0; font-size: 10px; font-weight: 400; color: #809693; }
.empty-gallery { grid-column: 1 / -1; }
@media (pointer: coarse) { .theme-tabs button { min-height: 44px; } }
@media (max-width: 600px) {
  .category-tabs { gap: 6px; }
  .category-tabs button { min-height: 44px; padding: 8px 10px; font-size: 11px; }
  .theme-tabs { gap: 6px; }
  .theme-tabs button { min-height: 44px; padding: 7px 11px; }
  .gallery-toolbar { gap: 9px; }
  .gallery-search { flex-basis: 100%; }
  .gallery-search > span { display: none; }
  .chapter-title { font-size: 15px; }
}
.tip {
  color: #a1b4b5;
  background: #10202a;
  border-color: #778f9329;
}
.tip b { color: #cfbd98; font-weight: 600; }
.gallery-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 24px;
  align-items: center;
  padding: 25px 30px;
  margin: 0 0 16px;
  position: relative;
  overflow: hidden;
  border: 1px solid #cdb18030;
  border-radius: 17px;
  background: radial-gradient(ellipse at 88% 48%, #7b755023, transparent 57%), #0f1c25;
}
.entry-copy { position: relative; z-index: 1; }
.entry-eyebrow { color: #c5ad82; font-size: 12px; letter-spacing: 2px; }
.entry-copy h2 { margin: 9px 0; color: #eee8dc; font-size: clamp(23px, 3vw, 31px); font-weight: 550; letter-spacing: 1px; }
.entry-copy p { margin: 0; color: #a7b7b6; font-size: 13px; line-height: 1.7; }
.entry-actions { display: flex; align-items: center; gap: 22px; margin-top: 20px; }
.entry-actions button { min-height: 44px; }
.entry-actions .primary { display: inline-flex; gap: 30px; align-items: center; }
.entry-browse { color: #d0d5ca; background: none; padding: 8px 0; font-size: 13px; }
.entry-browse span { margin-left: 8px; color: #c9b58d; }
.entry-caption { display: block; margin-top: 11px; color: #91a5a5; font-size: 11px; }
.entry-art { height: 178px; position: relative; background: radial-gradient(ellipse, #e5cc9038, #c6af6d0d 48%, transparent 70%); }
.entry-art::before { content: ''; position: absolute; inset: 28px 42px; border: 1px solid #cdbb832b; border-radius: 50%; transform: rotate(-24deg); }
.entry-art i { position: absolute; width: 55px; height: 72px; left: 90px; top: 45px; background: linear-gradient(135deg, #b3d3bc, #397a7180 58%, #172e35); clip-path: polygon(0 15%, 84% 0, 100% 70%, 36% 100%); transform: rotate(-24deg); }
.entry-art i:nth-child(2) { left: 53px; top: 85px; width: 38px; height: 38px; transform: rotate(21deg); opacity: .6; }
.entry-art i:nth-child(3) { left: 155px; top: 33px; width: 24px; height: 48px; transform: rotate(39deg); opacity: .75; }
.entry-art span { position: absolute; bottom: 1px; width: 100%; text-align: center; font-size: 9px; letter-spacing: 3px; color: #c6bc9b8c; }
.how-to { margin: 0 0 18px; padding: 0; background: #11202a70; }
.how-to summary { cursor: pointer; padding: 12px 15px; color: #c1cdc6; font-size: 12px; }
.how-to summary > span { float: right; color: #95a7a5; font-size: 11px; }
.how-to[open] summary { border-bottom: 1px solid #8b9f9c20; }
.how-to[open] summary > span { display: none; }
.how-to-steps { display: grid; grid-template-columns: repeat(3, 1fr); list-style: none; padding: 0 15px; margin: 16px 0; gap: 16px; }
.how-to-steps li { display: flex; flex-direction: column; gap: 5px; font-size: 12px; }
.how-to p { margin: 10px 15px; font-size: 12px; line-height: 1.75; }
.gallery-filters { scroll-margin-top: 12px; }
.shape-preview.is-unrevealed { background: radial-gradient(ellipse at 50% 60%, #b0a06c20, transparent 70%), #10202b; }
.shape-preview.is-unrevealed::before { display: block; width: 48px; height: 38px; left: calc(50% - 24px); top: 15px; background: linear-gradient(145deg, #abc9b6a0, #638c8b40); border-radius: 0; clip-path: polygon(0 20%, 65% 0, 100% 65%, 28% 100%); transform: rotate(var(--preview-angle, 0deg)); filter: hue-rotate(var(--preview-hue, 0deg)); box-shadow: none; }
.shape-preview.is-unrevealed::after { content: ''; position: absolute; width: 14px; height: 20px; left: calc(50% + 23px); top: 22px; background: #c1b59266; clip-path: polygon(0 0, 100% 20%, 70% 100%, 15% 75%); transform: rotate(var(--preview-angle, 0deg)); }
.shape-preview.is-unrevealed svg { opacity: .2; }
#game.has-toast .instruction { opacity: 0; }
@media (max-width: 600px) {
  .brand { margin-bottom: 18px; }
  .brand p { font-size: 12px; line-height: 1.7; }
  .gallery-entry { grid-template-columns: minmax(0, 1fr); padding: 19px 18px; gap: 0; }
  .entry-art { position: absolute; width: 190px; height: 180px; right: -55px; top: 8px; opacity: .32; pointer-events: none; }
  .entry-eyebrow { font-size: 10px; letter-spacing: 1px; }
  .entry-copy h2 { font-size: 24px; }
  .entry-copy p { max-width: 230px; font-size: 12px; }
  .entry-actions { margin-top: 16px; gap: 19px; }
  .entry-actions .primary { gap: 18px; padding: 9px 15px; font-size: 14px; }
  .how-to-steps { grid-template-columns: 1fr; gap: 13px; }
  .how-to summary { padding: 11px 12px; font-size: 11px; }
}
.menu::-webkit-scrollbar-thumb { background: #4a6067; }

/* Controls recede into the room; illuminated geometry remains the focus. */
.round-btn, .small-btn, .timer {
  background: #111e29dc;
  color: #c9d7d3;
  border: 1px solid #9eb8bb25;
  box-shadow: 0 4px 15px #0003, inset 0 1px #ffffff04;
  backdrop-filter: blur(12px);
}
.round-btn { color: #cfbb95; }
.small-btn { font-weight: 500; }
.small-btn:hover, .round-btn:hover { background: #243640e8; border-color: #bcb08a69; }
.level-title { color: #d8ded6; font-weight: 600; }
.timer { color: #d2bd94; font-variant-numeric: tabular-nums; font-weight: 600; }
.progress-wrap {
  background: #283a43;
  box-shadow: inset 0 1px 3px #0005;
}
.progress {
  background: linear-gradient(90deg, #698d8d, #b2bfac 65%, #d4b77e);
  box-shadow: 0 0 10px #bdd9c126;
}
.instruction {
  color: #9fb3b4;
  background: #101c25a8;
  box-shadow: none;
  border: 1px solid #b7c9c411;
  border-radius: 9px;
  font-weight: 400;
}
.instruction b { color: #d2c3a4; font-weight: 500; }
.assembly-panel {
  background: linear-gradient(145deg, #16242eeb, #101d27f0);
  border-color: #89a2a52e;
  border-radius: 14px;
  box-shadow: 0 10px 36px #0005, inset 0 1px #e0ece806;
  backdrop-filter: blur(18px);
}
.part-tabs { scrollbar-color: #50676b transparent; }
.part-tabs button {
  background: #22333d;
  color: #aebfbd;
  border-color: #7f999e1a;
  border-radius: 8px;
  font-weight: 500;
}
.part-tabs button.selected {
  background: #3e4946;
  color: #f1ddba;
  border-color: #c2a46c99;
  box-shadow: inset 0 1px #f1d2a012;
}
.part-actions button {
  color: #b2c3c0;
  background: #162832;
  border-color: #9fb3b230;
  border-radius: 7px;
}
.part-actions button:hover:not(:disabled), .part-tabs button:hover {
  background: #2a3d46;
  border-color: #bdba9280;
}
.part-actions button.active {
  color: #f1d9ad;
  background: #40473e;
  border-color: #ba9d68a3;
}
.part-actions button:disabled { color: #789094; opacity: .52; }
.part-help { color: #94aaad; font-weight: 400; }
.toast {
  background: #263b44ed;
  color: #e0e9e0;
  border: 1px solid #b2c9c73b;
  box-shadow: 0 6px 20px #0004;
}
.result { background: #060e18a8; }
.result-box {
  color: #dce5de;
  background: linear-gradient(150deg, #24353d, #15242e);
  border-color: #baa4775c;
  box-shadow: 0 25px 90px #0009, inset 0 1px #d7c08d19;
}
.result-box h2 { color: #e0c89b; font-weight: 600; }
.result-stars { color: #ddbd81; text-shadow: 0 0 24px #c5aa6940; }
.result-box p { color: #a9bcba; }
.secondary { background: #2a3d46; color: #c9d9d3; border: 1px solid #b2c7c82b; }
.secondary:hover { background: #354c55; }

/* The first three collected shadows stay visible above a quiet exhibit label. */
.result.is-collection {
  align-items: flex-end;
  justify-content: center;
  padding: 20px;
  background: none;
  backdrop-filter: none;
  pointer-events: none;
}
.is-collection .result-box {
  width: min(440px, calc(100% - 16px));
  padding: 19px 23px 18px;
  text-align: left;
  border-radius: 18px;
  border-color: #cbb28270;
  background: linear-gradient(135deg, #21343bea, #12232ded);
  backdrop-filter: blur(15px);
  pointer-events: auto;
  animation: collection-arrive .45s ease both;
}
.collection-kicker { color: #cfb98e; font-size: 10px; letter-spacing: 2px; }
.is-collection .collection-heading { display: flex; align-items: center; gap: 14px; margin-top: 8px; }
.is-collection .result-box h2 { color: #f1e4c9; font-size: 25px; letter-spacing: 1px; }
#resultArt.collection-art {
  display: block;
  position: static;
  left: auto;
  top: auto;
  bottom: auto;
  flex: 0 0 72px;
  width: 72px;
  height: 55px;
  transform: none;
  touch-action: auto;
  cursor: default;
}
#resultArt[hidden] { display: none; }
.is-collection .result-stars { font-size: 17px; letter-spacing: 3px; margin: 3px 0 6px; }
.is-collection .result-box p { font-size: 12px; line-height: 1.65; margin: 0; color: #adbfba; }
.is-collection .result-row { justify-content: flex-start; margin-top: 14px; }
.is-collection .result-row button { min-height: 42px; font-size: 13px; padding: 9px 14px; }
#game.collection-revealed .instruction { opacity: 0; }
@keyframes collection-arrive {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (max-width: 600px) {
  .result.is-collection { padding: 12px 8px max(12px, env(safe-area-inset-bottom)); }
  .is-collection .result-box { padding: 15px 18px; }
  .is-collection .result-box h2 { font-size: 23px; }
  .is-collection .result-row { gap: 8px; margin-top: 11px; }
}
.touch-landscape .result.is-collection { justify-content: flex-end; padding: 10px 16px; }
.touch-landscape .is-collection .result-box { width: min(320px, 46%); padding: 13px 16px; }
.touch-landscape .is-collection .collection-heading { margin-top: 4px; gap: 10px; }
.touch-landscape #resultArt.collection-art { flex-basis: 52px; width: 52px; height: 40px; }
.touch-landscape .is-collection .result-box h2 { font-size: 22px; }
.touch-landscape .is-collection .result-row { margin-top: 8px; gap: 7px; }
.touch-landscape .is-collection .result-row button { padding: 7px 10px; min-height: 40px; font-size: 12px; }
@media (prefers-reduced-motion: reduce) {
  .is-collection .result-box { animation: none; }
}

.portrait .instruction { background: none; border: 0; }
.portrait .assembly-panel { background: #13212cf5; }
@media (pointer: coarse) {
  .menu { backdrop-filter: none; }
  .round-btn, .small-btn, .timer { backdrop-filter: none; }
}
@media (prefers-reduced-motion: reduce) {
  .level-card, .progress, .toast { transition: none; }
  .level-card:hover { transform: none; }
}
