/* World canvas chrome. Authored iframe documents and OS rails own their CSS. */
/* Directory skins are normally supplied by theme.js on neutral pages. A
   World resolves its owner's choice separately, so it also needs the same
   public palette on its body before the context helper reads the tokens. */
body.a96[data-world-word].theme-craigslist {
  --bg: #fff; --fg: #000; --panel: #eee; --muted: #666;
  --line: #ccc; --link: #0000ee; --visited: #551a8b; --highlight: #ffffcc;
  --body-font: Arial, Helvetica, sans-serif; --mono-font: monospace;
  --radius: 0; --shadow: none;
}
body.a96[data-world-word].theme-wikipedia {
  --bg: #fff; --fg: #202122; --panel: #fff; --muted: #54595d;
  --line: #a2a9b1; --link: #0645ad; --visited: #0b0080; --highlight: #eaf3ff;
  --body-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Lato, Helvetica, Arial, sans-serif;
  --mono-font: monospace; --radius: 0; --shadow: none;
}
body.a96 [data-world-theme-scope][data-world-skin] :is(
  #worldHero, #pFounder, #pConsole, #pDiscourse, #pWall, #pSites,
  #pObjects, #pNeighbor, #worldContinuity, #worldArcade, #worldAnkl,
  .panel, .section, .world-stream, .wwidget, .stat
) {
  background-color: var(--panel) !important;
  color: var(--fg) !important;
  border-color: var(--line) !important;
  border-radius: var(--radius, 0) !important;
}

/* The standard mode is a layout, not a second gray palette. Explicit owner
   fills and wallpapers still win through their inline/doubled-ID rules. */
body.a96 [data-world-theme-scope][data-world-skin] :is(
  .world-stream-head, .world-arcade-head, .section-head, .panel-head,
  #worldBuildDoor
) {
  background-color: var(--panel);
  color: var(--fg);
  border-color: var(--line);
}

body.a96 [data-world-theme-scope][data-world-skin] :is(
  .worldsite, .worldsite-enter, .worldsite-info
) {
  background-color: var(--panel);
  color: var(--fg);
  border-color: var(--line);
}
body.a96 [data-world-theme-scope][data-world-skin] .worldsite {
  border-radius: var(--radius, 0);
}
body.a96 [data-world-theme-scope][data-world-skin] :is(
  .worldsite-address, .worldsite-provenance, .worldsite-game .worldsite-title::after
) { color: var(--muted); }
body.a96 [data-world-theme-scope][data-world-skin] .worldsite-portal:hover {
  background-color: var(--highlight);
  color: var(--fg);
}

body.a96 [data-world-theme-scope][data-world-skin] :where(
  button, .btn, input, textarea, select, summary, .worldsite-portal,
  .worldsite-set-front, .worldsite-set-portal
) { font-family: var(--body-font); }
body.a96 [data-world-theme-scope][data-world-skin] .world-build-quick button {
  border: 1px solid var(--line);
}
body.a96 [data-world-theme-scope][data-world-skin]:not([data-world-skin="ankle96"]):not([data-world-skin="homepage96"]) :is(
  .world-build-door-cta, .worldsite-portal, .worldsite-set-front,
  .worldsite-set-portal, #founder-tools > summary
) {
  border: 1px solid var(--line) !important;
  border-radius: var(--radius, 0) !important;
  background-color: var(--panel) !important;
  color: var(--link) !important;
  box-shadow: none !important;
}
body.a96 [data-world-theme-scope][data-world-skin] :is(
  a, button, input, textarea, select, summary
):focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}

/* World tools mount beside the canvas rather than inside it. Their old
   literal silver/black windows must use the same active World skin too. */
body.a96[data-world-word] :is(#world-widget-tray, #ankle-autotune,
  #world-widget-tray-fab, #ankle-autotune-fab) {
  color: var(--fg);
  font-family: var(--body-font);
}
body.a96[data-world-word] :is(#world-widget-tray, #ankle-autotune) :is(
  .tray, .win, .tb, .chip, .btn, button
), body.a96[data-world-word] :is(#world-widget-tray-fab, #ankle-autotune-fab) {
  background-color: var(--panel) !important;
  color: var(--fg) !important;
  border-color: var(--line) !important;
  border-radius: var(--radius, 0) !important;
  box-shadow: none !important;
}
body.a96[data-world-word] :is(#world-widget-tray, #ankle-autotune) :is(.chip, .btn):hover {
  background-color: var(--highlight) !important;
}
html[data-ankle-color-scheme="dark"] body.a96[data-world-word] :is(
  #world-widget-tray, #ankle-autotune, #world-widget-tray-fab, #ankle-autotune-fab
) {
  --panel: #1e222b; --fg: #f0f3f8; --line: #596274; --highlight: #2b3a4a;
}

/* These themes have a recognizable header grammar, shared by every panel. */
body.a96 [data-world-theme-scope][data-world-skin="campus-2007"] :is(
  .world-stream-head, .world-arcade-head, .section-head, .panel-head
) { background-color: #d8dfea; color: #3b5998; }
body.a96 [data-world-theme-scope][data-world-skin="craigslist"] :is(
  .world-stream-head, .world-arcade-head, .section-head, .panel-head
) { background-color: #eee; }

/* A night viewing layer keeps all World controls and copy legible even where
   older skins still contain literal day colors. Owner artwork stays visible. */
body.a96 [data-world-theme-scope][data-world-color-scheme="dark"] :is(
  #worldBuildDoor, .world-stream-head, .world-arcade-head, .section-head,
  .panel-head, .worldsite, .worldsite-enter, .worldsite-info,
  button, .btn, input, textarea, select, .worldsite-portal
) {
  background-color: var(--panel) !important;
  color: var(--fg) !important;
  border-color: var(--line) !important;
}
body.a96 [data-world-theme-scope][data-world-color-scheme="dark"] :is(
  .section-title, .world-stream-title, .worldsite-title, .world-build-door-title
) { color: var(--fg) !important; }

@media (max-width: 700px) {
  body.a96[data-world-word] :is(#world-widget-tray, #ankle-autotune) :is(button, .chip, .btn) {
    min-height: 44px !important;
    min-width: 44px;
  }
  body.a96 [data-world-theme-scope][data-world-skin] :is(button, .btn, summary,
    .worldsite-portal, .worldsite-set-front, .worldsite-set-portal) {
    min-height: 44px !important;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  body.a96 [data-world-theme-scope][data-world-skin] :is(.worldsite-edit, .worldsite-hide) {
    min-width: 44px;
    min-height: 44px !important;
  }
  body.a96 [data-world-theme-scope][data-world-skin] :is(input, textarea, select) {
    min-height: 44px !important;
    font-size: 16px !important;
  }
  body.a96 [data-world-theme-scope][data-world-skin] .world-stream-head {
    flex-wrap: wrap;
  }
  body.a96 [data-world-theme-scope][data-world-skin] .world-stream-controls {
    flex-wrap: wrap;
    min-width: 0;
  }
}
