/* Worlds experience preferences: independent from the room decoration theme. */
html[data-worlds-theme="dark"] {
  color-scheme: dark;
  --ink: #e8f2e9;
  --muted: #b3c7bd;
  --line: #405850;
  --paper: #203b36;
  --green: #9dd7bd;
  color: var(--ink);
  background: #142924;
}
html[data-worlds-theme="dark"] body { color: var(--ink); background: #142924; }
html[data-worlds-theme="dark"] button,
html[data-worlds-theme="dark"] select { color: #e8f2e9; background: #29463e; border-color: #688679; }
html[data-worlds-theme="dark"] button:hover:not(:disabled) { background: #3a6052; border-color: #a2c9b3; }
html[data-worlds-theme="dark"] .primary { background: #a7d8ba; color: #173d30; border-color: #a7d8ba; }
html[data-worlds-theme="dark"] .primary:hover:not(:disabled) { background: #c4ead0; }
html[data-worlds-theme="dark"] .site-header,
html[data-worlds-theme="dark"] .view-nav,
html[data-worlds-theme="dark"] .island-note { border-color: var(--line); }
html[data-worlds-theme="dark"] .view-nav button { color: #b7cdc0; }
html[data-worlds-theme="dark"] .view-nav button[aria-pressed="true"] { color: #e8f8eb; }
html[data-worlds-theme="dark"] .eyebrow,
html[data-worlds-theme="dark"] .region small,
html[data-worlds-theme="dark"] .passport small,
html[data-worlds-theme="dark"] .passport span,
html[data-worlds-theme="dark"] .challenge-panel p,
html[data-worlds-theme="dark"] .home-editor label,
html[data-worlds-theme="dark"] .decor-item small,
html[data-worlds-theme="dark"] .journal-card small,
html[data-worlds-theme="dark"] .goal-card p,
html[data-worlds-theme="dark"] #community-status,
html[data-worlds-theme="dark"] footer { color: #bbcec1; }
html[data-worlds-theme="dark"] .passport,
html[data-worlds-theme="dark"] .map-card,
html[data-worlds-theme="dark"] .challenge-panel,
html[data-worlds-theme="dark"] .home-editor,
html[data-worlds-theme="dark"] .goal-card,
html[data-worlds-theme="dark"] .favorite-links a { background: #203b36; border-color: var(--line); }
html[data-worlds-theme="dark"] .journal-card { background: #1b342f; }
html[data-worlds-theme="dark"] .journal-card.done,
html[data-worlds-theme="dark"] .decor-item[aria-pressed="true"],
html[data-worlds-theme="dark"] .favorite-picker button[aria-pressed="true"] { background: #355647; border-color: #88b99b; }
html[data-worlds-theme="dark"] .community-hero,
html[data-worlds-theme="dark"] .room-card,
html[data-worlds-theme="dark"] #hints p,
html[data-worlds-theme="dark"] .journey-next,
html[data-worlds-theme="dark"] .islander-dialogue { background: #2a493e; color: #e0eee3 !important; border-color: #638775; }
html[data-worlds-theme="dark"] .journey-next p:not(.eyebrow),
html[data-worlds-theme="dark"] .journey-next small { color: #d0e4d4; }
html[data-worlds-theme="dark"] .status { background: #554629; color: #ffeac3; }
html[data-worlds-theme="dark"] .map-node { background: #fffdf3; color: #223e3e; }
html[data-worlds-theme="dark"] .map-node.is-locked { background: #dce4d5; color: #374a40; }
html[data-worlds-theme="dark"] .map-node:hover:not(:disabled) { background: #e5eddf; color: #223e3e; }
html[data-worlds-theme="dark"] .secret-pin { background: transparent; color: #fff0a2; text-shadow: 0 1px 4px #142924; }
html[data-worlds-theme="dark"] .secret-pin.collected { color: #e5ffe5; }
html[data-worlds-theme="dark"] .color-options button { background: var(--color); border-color: #e8f2e9; }
html[data-worlds-theme="dark"] .community-links a { background: #a7d8ba; color: #173d30; }

/* The sky is controlled independently of interface theme. Map labels stay bright. */
html[data-worlds-time="night"] .island-art { filter: brightness(.73) saturate(.83); }
html[data-worlds-time="night"] .map-scene::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(circle at 13% 10%, #fffbd8 0 1px, transparent 2px),
              radial-gradient(circle at 28% 7%, #fffbd8 0 1px, transparent 2px),
              radial-gradient(circle at 70% 10%, #fffbd8 0 1px, transparent 2px),
              radial-gradient(circle at 88% 16%, #fffbd8 0 1px, transparent 2px),
              linear-gradient(180deg, #102c584d, transparent 65%);
}
html[data-worlds-time="night"] .beacon-glow { filter: drop-shadow(0 0 8px #ffe9a0); }

.worlds-settings { margin: 20px 0; padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); }
.worlds-settings summary { padding: 0; display: flex; align-items: center; gap: 10px; }
.worlds-settings summary::after { content: "+"; margin-left: auto; font-size: 20px; }
.worlds-settings[open] summary::after { content: "−"; }
.worlds-settings-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; padding-top: 18px; }
.worlds-settings-row { display: flex; flex-direction: column; gap: 8px; min-width: 0; font-size: 13px; font-weight: 650; }
.worlds-settings-row select, .worlds-settings-row input[type="range"] { width: 100%; }
.worlds-settings-row input[type="range"] { accent-color: #4d8d71; min-height: 32px; }
.worlds-settings-row small { font-size: 11px; font-weight: 400; line-height: 1.5; color: var(--muted); }
.worlds-settings-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 16px; }
.worlds-objective { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; margin: 18px 0 0; padding: 14px 18px; border: 1px solid #a8c8b0; border-radius: 12px; background: #edf3e8; font-size: 13px; line-height: 1.5; }
.worlds-objective strong { color: #245442; }
.worlds-objective button { margin-left: auto; }
html[data-worlds-theme="dark"] .worlds-objective { background: #2a493e; border-color: #638775; }
html[data-worlds-theme="dark"] .worlds-objective strong { color: #d5f4db; }
html[data-worlds-text="large"] body { font-size: 1.125rem; }
html[data-worlds-text="large"] p,
html[data-worlds-text="large"] small,
html[data-worlds-text="large"] label,
html[data-worlds-text="large"] .view-nav button span,
html[data-worlds-text="large"] .region,
html[data-worlds-text="large"] .region b,
html[data-worlds-text="large"] .journal-card b,
html[data-worlds-text="large"] .worlds-objective,
html[data-worlds-text="large"] .worlds-settings-row { font-size: max(1rem, 1em); }
html[data-worlds-effects="reduced"] *, html[data-worlds-effects="reduced"] *::before, html[data-worlds-effects="reduced"] *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
@media (max-width: 760px) {
  .worlds-settings { padding: 16px; }
  .worlds-settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .worlds-objective button { margin-left: 0; }
}
@media (max-width: 420px) {
  .worlds-settings-grid { grid-template-columns: 1fr; }
  html[data-worlds-text="large"] .view-nav { gap: 10px; }
  html[data-worlds-text="large"] .challenge-list { grid-template-columns: 1fr; }
}
.worlds-objective > div { display:flex; flex-direction:column; gap:2px; }
.worlds-objective > div > span { color:var(--muted); font-size:10px; font-weight:750; letter-spacing:1px; }
.worlds-objective small { color:var(--muted); }
.worlds-tip,.worlds-idle-hint { margin:12px 0; padding:12px 16px; border:1px solid var(--line); border-radius:10px; background:var(--paper); font-size:13px; line-height:1.5; }
.worlds-tip:not([hidden]) { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.worlds-tip button,.worlds-idle-hint button { min-height:40px; }
.worlds-settings-actions small { color:var(--muted); line-height:1.5; }
html[data-worlds-theme="dark"] .room-display { background:transparent; border-color:transparent; }
html[data-worlds-theme="dark"] .room-display:hover { background:#fff3!important; }
html[data-worlds-theme="dark"] .room-display[aria-pressed="true"] { border:2px dashed #b0d8b9; background:#fff2; }
