@import url('data:text/css,');

:root {
  color-scheme: light;
  font-family: 'Avenir Next', 'Segoe UI', system-ui, sans-serif;
  color: #273e3d;
  background: #f4f3ed;
  font-synthesis: none;
  --accent: #285f55;
  --muted: #63716b;
  --line: #d9ded4;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 0; }
button, input, select { font: inherit; }
button, select { min-height: 42px; }
button {
  border: 1px solid #cbd3c8;
  border-radius: 11px;
  background: #fffdf8;
  color: #2c4941;
  padding: 10px 14px;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease;
}
button:hover { background: #eaf0e5; border-color: #7c9c89; }
button:disabled { opacity: 0.48; cursor: default; }
button.accent { color: #fffef7; background: var(--accent); border-color: var(--accent); font-weight: 650; }
button.accent:hover { background: #1d4f46; }
button:focus-visible, select:focus-visible, input:focus-visible { outline: 3px solid #308b94; outline-offset: 3px; }
select { background: #fffdf8; border: 1px solid #cbd3c8; border-radius: 10px; color: #28423a; padding: 8px 30px 8px 10px; max-width: 100%; }
p { line-height: 1.55; margin: 0; }
h1, h2 { margin: 0; }
h1 { font-family: Georgia, 'Times New Roman', serif; font-size: clamp(1.9rem, 3.3vw, 3.2rem); line-height: 1.12; font-weight: 500; letter-spacing: -0.045em; }
h2 { font-size: 0.97rem; font-weight: 700; }
.page-header { max-width: 1480px; padding: 28px 28px 22px; margin: auto; display: flex; align-items: center; justify-content: space-between; gap: 22px; }
.heading { min-width: 0; }
.heading p { color: var(--muted); margin-top: 8px; font-size: 0.95rem; }
.header-actions { display: flex; align-items: end; gap: 12px; flex-wrap: wrap; flex-shrink: 0; }
.language-control { display: grid; gap: 5px; font-size: 0.75rem; color: var(--muted); }
#music-toggle { font-size: 0.85rem; white-space: nowrap; }
#music-toggle[aria-pressed='true'] { background: #dbe8dc; border-color: #729c84; }
main { max-width: 1480px; margin: auto; padding: 0 28px; display: grid; grid-template-columns: minmax(0, 1fr) 302px; gap: 24px; align-items: start; }
.gallery-column { min-width: 0; }
.upload-bar { display: flex; align-items: center; gap: 16px; min-height: 61px; padding-bottom: 14px; }
.upload-bar button { flex-shrink: 0; }
.upload-bar p { color: var(--muted); font-size: 0.78rem; }
.stage { position: relative; height: clamp(470px, 69vh, 780px); background: #dce9eb; border: 1px solid #c8d7d2; border-radius: 22px; overflow: hidden; isolation: isolate; }
#scene { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
#scene:active { cursor: grabbing; }
#scene:focus-visible { outline: 3px solid #288891; outline-offset: -5px; border-radius: 22px; }
.opening { position: absolute; inset: 45% 15% auto; text-align: center; padding: 16px; color: #35554d; background: #f7f5eccc; border-radius: 14px; }
.scene-tools { position: absolute; inset: auto 16px 16px; display: flex; justify-content: space-between; align-items: end; gap: 12px; pointer-events: none; }
.scene-tools p { max-width: 250px; background: #fffdf0e8; border: 1px solid #fff7e5; padding: 10px 13px; border-radius: 12px; font-size: 0.76rem; box-shadow: 0 4px 16px #5268580d; }
.view-buttons { display: flex; gap: 7px; flex-wrap: wrap; justify-content: end; pointer-events: auto; }
.view-buttons button { font-size: 0.75rem; background: #fffdf5ed; }
.state { min-height: 48px; padding: 15px 2px 7px; font-size: 0.91rem; color: #244e44; }
.muted { color: var(--muted); font-size: 0.77rem; }
#sample-note { padding: 0 2px; }
.errors { font-size: 0.84rem; color: #8f402b; margin: 12px 0 0; padding: 12px 16px 12px 30px; border: 1px solid #e7c9b9; border-radius: 11px; background: #fff2e9; overflow-wrap: anywhere; }
#music-notice { padding-left: 14px; }
.editor { min-width: 0; background: #fffdf7; border: 1px solid #e1e1d5; border-radius: 19px; padding: 19px; }
.editor section + section { border-top: 1px solid #e4e6da; margin-top: 19px; padding-top: 18px; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 12px; }
#photo-count { font-size: 0.76rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.photo-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; max-height: 310px; overflow-y: auto; padding: 3px; margin: -3px; }
.photo-button { display: grid; min-width: 0; text-align: left; gap: 5px; padding: 6px; border-radius: 10px; }
.photo-button img { width: 100%; height: 65px; object-fit: cover; border-radius: 5px; background: #e9e6da; }
.photo-button.selected { background: #e9f0e6; border-color: #438573; box-shadow: inset 0 0 0 1px #438573; }
.photo-name { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.71rem; }
.photo-button small { color: #607265; font-size: 0.66rem; }
.selected-name { margin: 10px 0 14px; font-size: 0.8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #627367; }
.range-label { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 0.78rem; margin-top: 14px; }
.range-label output { white-space: nowrap; color: #486c5e; font-variant-numeric: tabular-nums; }
input[type='range'] { display: block; width: 100%; min-width: 0; margin: 8px 0 13px; accent-color: #3c7d68; min-height: 25px; }
.full { width: 100%; }
.edit-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 9px; }
.edit-actions button { flex: 1 1 105px; padding: 8px; font-size: 0.73rem; }
.look-buttons { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; margin-top: 12px; }
.look-buttons button { font-size: 1.1rem; padding: 5px; }
.keyboard-help { margin-top: 4px; font-size: 0.72rem; }
.preferences { display: grid; gap: 13px; }
.preferences label { display: flex; align-items: center; gap: 9px; font-size: 0.78rem; }
input[type='checkbox'] { accent-color: #3c7d68; width: 17px; height: 17px; margin: 0; }
footer { max-width: 1480px; margin: 0 auto; padding: 24px 30px; color: #718074; font-size: 0.72rem; }
.fallback { height: 100%; overflow: auto; padding: 25px; background: #edf0e7; }
.fallback > p { font-size: 0.86rem; color: var(--muted); margin: 8px 0 20px; }
.fallback-images { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(165px, 100%), 1fr)); gap: 14px; }
.fallback-card { display: grid; align-content: start; gap: 8px; min-width: 0; text-align: left; }
.fallback-card img { width: 100%; height: 155px; object-fit: contain; background: #e2dfd1; border-radius: 5px; }
.fallback-card strong { overflow-wrap: anywhere; font-size: 0.8rem; }
.fallback-card span { font-size: 0.73rem; color: var(--muted); }
.fallback-card[aria-pressed='true'] { border-color: #398675; }
.noscript { margin: 25px; padding: 20px; background: #fff0df; }

@media (max-width: 1000px) {
  .page-header { align-items: start; }
  .header-actions { max-width: 185px; justify-content: end; }
  main { grid-template-columns: minmax(0, 1fr) 260px; gap: 16px; }
  .editor { padding: 15px; }
  .scene-tools { align-items: stretch; flex-direction: column; }
  .scene-tools p { align-self: start; }
}

@media (max-width: 760px) {
  .page-header { padding: 22px 16px 18px; flex-wrap: wrap; gap: 16px; }
  .heading { width: 100%; }
  .header-actions { max-width: none; width: 100%; justify-content: space-between; align-items: end; }
  .language-control { grid-template-columns: auto auto; align-items: center; gap: 9px; }
  main { grid-template-columns: minmax(0, 1fr); padding: 0 12px; gap: 20px; }
  .stage { height: clamp(440px, 66svh, 680px); border-radius: 17px; }
  .upload-bar { gap: 10px; }
  .upload-bar p { font-size: 0.7rem; }
  .scene-tools { inset: auto 10px 10px; gap: 8px; }
  .scene-tools p { padding: 8px 10px; font-size: 0.72rem; }
  .view-buttons { justify-content: start; }
  .view-buttons button { padding: 8px 10px; }
  .editor { padding: 18px; }
  .photo-list { grid-template-columns: repeat(4, minmax(0, 1fr)); max-height: 260px; }
  .photo-button img { height: 62px; }
  .photo-button small { font-size: 0.6rem; }
  footer { padding: 21px 18px; }
}

@media (max-width: 390px) {
  .photo-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .language-control { font-size: 0.7rem; }
  select { max-width: 145px; }
  .upload-bar { align-items: start; }
  .upload-bar button { font-size: 0.84rem; padding: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
