.lincoln-world .world-night-sky,.lincoln-world .world-rain,.lincoln-world .world-decoration {
  position:absolute;
  inset:0;
  pointer-events:none;
  z-index:2;
}
.lincoln-world .world-night-sky,.lincoln-world .world-rain,.lincoln-world .world-decoration { display:none; }
.lincoln-world[data-period=night] .world-night-sky { display:block; }
.lincoln-world[data-period=night] .world-night-sky::before {
  content:"";
  position:absolute;
  top:4%;
  left:20%;
  width:12px;
  height:12px;
  background:#ffeeb1;
  clip-path:polygon(0 25%,25% 25%,25% 0,75% 0,75% 25%,100% 25%,100% 75%,75% 75%,75% 100%,25% 100%,25% 75%,0 75%);
}
.lincoln-world[data-period=night] .world-night-sky::after {
  content:"";
  position:absolute;
  top:13%;
  left:26%;
  width:3px;
  height:3px;
  background:#fff1b3;
  box-shadow:47px -24px #fff1b3,73px -14px #fff1b3,127px -24px #fff1b3,20px 180px #ffe476,165px 142px #ffe476;
  animation:world-firefly 3.1s steps(3,end) infinite alternate;
}
.lincoln-world[data-period=night] .world-interior .world-night-sky::before { display:none; }
.lincoln-world[data-period=night] .world-room-lights {
  background:radial-gradient(ellipse at 50% 45%, #ffe49a24 0 34%, transparent 64%),
    linear-gradient(180deg,#50689b9c,#ffdb9990);
}
.lincoln-world[data-weather=rain] .world-rain,.lincoln-world[data-weather=storm] .world-rain { display:block; }
.lincoln-world .world-rain {
  opacity:.33;
  background:repeating-linear-gradient(112deg,transparent 0 34px,#e4f7ff 34px 35px,transparent 35px 64px);
  mask-image:repeating-linear-gradient(0deg,#000 0 10px,transparent 10px 43px);
  animation:world-rainfall .72s linear infinite;
}
.lincoln-world .world-interior .world-rain { display:none; }
.lincoln-world .world-festival-greeting {
  grid-column:1 / -1;
  min-width:0;
  max-width:24em;
  overflow-wrap:anywhere;
  color:#643718;
  font-weight:600;
}
.lincoln-world:not([data-festival=""]) .world-decoration {
  display:block;
  height:24px;
  background:repeating-linear-gradient(90deg,#ed7186 0 16px,#fde17c 16px 32px,#88bf79 32px 48px,#85c7e8 48px 64px);
  clip-path:polygon(0 0,100% 0,100% 22%,94% 100%,88% 22%,82% 100%,76% 22%,70% 100%,64% 22%,58% 100%,52% 22%,46% 100%,40% 22%,34% 100%,28% 22%,22% 100%,16% 22%,10% 100%,4% 22%,0 100%);
}
.lincoln-world:is([data-festival=lunar],[data-festival=anniversary]) .world-decoration {
  background:repeating-linear-gradient(90deg,#ce4e39 0 18px,#ffcc61 18px 31px,transparent 31px 52px);
}
.lincoln-world[data-festival=christmas] .world-decoration {
  background:repeating-linear-gradient(90deg,#267249 0 18px,#bd4939 18px 31px,#fff1d2 31px 52px);
}
.lincoln-world[data-festival=halloween] .world-decoration {
  background:repeating-linear-gradient(90deg,#63397f 0 18px,#e79f41 18px 31px,transparent 31px 52px);
}
.lincoln-world[data-effects=off] :is(.world-water,.world-cloud,.world-leaf,.world-butterfly,.world-rain,.world-hotspot-label,.world-transition),
.lincoln-world[data-effects=off] .world-night-sky::after {
  animation:none;
}
.lincoln-world[data-effects=off] .world-avatar { transition:none; }
.lincoln-world .world-avatar {
  position:absolute;
  z-index:3;
  width:36px;
  height:auto;
  translate:-50% -92%;
  image-rendering:pixelated;
  pointer-events:none;
  transition:left .22s linear,top .22s linear;
}
.lincoln-world.world-options label {
  justify-content:space-between;
}
.lincoln-world button.world-mascot {
  appearance:none;
  pointer-events:auto;
  padding:0;
  border:0;
  background:transparent;
  box-shadow:none;
  min-inline-size:44px;
}
.lincoln-world .world-interior .world-mascot-corner {
  left:auto;
  right:1%;
  top:63%;
  width:10%;
}
.lincoln-world .world-weather { color:#245540; }
.lincoln-world .world-fountain {
  position:absolute;
  z-index:2;
  left:50%;
  top:56%;
  translate:-50% -50%;
  min-inline-size:44px;
  background:transparent;
  box-shadow:none;
  border:0;
}
 .lincoln-world[data-period=night] .world-campus-lights::after {
  content:""; position:absolute; inset:0;
  background:radial-gradient(ellipse at 36% 62%,#fff3b5 0 .44%,#fe9c417a 1.7%,transparent 4%),
    radial-gradient(ellipse at 64% 64%,#fff3b5 0 .44%,#fe9c417a 1.7%,transparent 4%),
    radial-gradient(ellipse at 35% 90%,#fff3b5 0 .36%,#fe9c4166 1.5%,transparent 3.7%);
}
@keyframes world-firefly { to { opacity:.32; transform:translateY(-4px); } }
@keyframes world-rainfall { to { background-position:5px 43px; } }
@media (prefers-reduced-motion:reduce) {
  .lincoln-world .world-avatar { transition:none; }
}
.lincoln-world.world-creator {
  color:#3c241f; background:#fff0cb; border:4px solid #784329; border-radius:14px;
  width:min(680px,calc(100% - 16px)); max-width:none; max-height:calc(100dvh - 16px);
  padding:0; box-shadow:0 0 0 2px #f0a75a,0 12px 32px #190f11a0;
}
.world-creator::backdrop { background:#191722b8; }
.world-creator h2 {
  margin:0; padding:9px 16px; color:#fff8d9; font-size:1.2rem;
  background:repeating-linear-gradient(0deg,#713d29 0 2px,#8d4b2d 2px 5px,#995832 5px 16px);
  border-bottom:3px solid #c98543; text-shadow:0 2px #47251d;
}
.creator-layout { display:grid; grid-template-columns:minmax(125px,1fr) minmax(0,2fr); gap:8px; padding:8px; }
.creator-stage {
  min-width:0; align-self:start; padding:5px; border:2px solid #b27544; border-radius:8px;
  text-align:center; background:linear-gradient(#e9f1c0,#fce1a5);
}
.creator-hero {
  display:grid; place-items:center; min-height:156px;
  background:radial-gradient(ellipse at 50% 60%,#fff5c8 0 32%,transparent 68%);
}
.creator-hero canvas { width:96px; height:144px; image-rendering:pixelated; }
.creator-uniform { margin:0 auto 5px; padding:4px; color:white; background:#232433; font-weight:800; font-size:.65rem; }
.creator-uniform[data-uniform="uniform-white"] { color:#203651; background:#fffbf1; }
.creator-uniform small { display:block; }
.creator-controls { display:grid; grid-template-columns:1fr 1fr; gap:4px; min-width:0; }
.creator-controls fieldset { min-width:0; padding:2px 3px 4px; margin:0; border:1px solid #cd9d67; border-radius:5px; }
.creator-controls fieldset:nth-child(1),.creator-controls fieldset:nth-child(4),.creator-controls fieldset:nth-child(5) { grid-column:1 / -1; }
.creator-controls legend { font-size:.84rem; font-weight:800; }
.creator-choices,.creator-actions { display:flex; flex-wrap:wrap; gap:4px; }
.world-creator button {
  min-height:44px; min-width:44px; border:1px solid #b57d50; border-radius:5px;
  background:#fff8e3; color:#442720; font:inherit; font-size:.78rem; font-weight:700; padding:4px;
}
.creator-choices button { display:grid; place-items:center; flex:1 1 44px; line-height:1.1; }
.creator-choices button[aria-pressed="true"] { background:#e0edbe; outline:2px solid #507640; outline-offset:-2px; }
.creator-choices canvas { width:24px; height:36px; image-rendering:pixelated; }
.creator-swatch { width:16px; height:15px; border:1px solid #744134; }
.creator-actions { padding:6px 8px 9px; justify-content:center; border-top:1px solid #cd9d67; }
.creator-actions button { flex:1; }
.creator-actions .creator-save { background:#416c40; color:#fffbea; border-color:#315630; }
.creator-error { color:#992c29; margin:0 8px 4px; }
.creator-error:empty { display:none; }
@media (max-width:480px) {
  .creator-layout { grid-template-columns:1fr; }
  .creator-stage { display:flex; align-items:center; padding:2px 8px; gap:8px; justify-content:space-between; }
  .creator-hero { min-height:0; }
  .creator-hero canvas { width:96px; height:144px; }
  .creator-uniform { margin:0; }
}

.creator-uniform[data-uniform="uniform-black"] .creator-brand { font-family:"Segoe Print","Comic Sans MS",cursive; font-style:italic; }
.creator-hero {
  background:linear-gradient(#355e3033,#486f2a66),url("assets/lincoln-world/campus.jpeg") center 41% / cover;
  border-radius:4px; image-rendering:pixelated;
}
.creator-preview-controls { display:grid; gap:4px; }
.creator-choices button { min-width:44px; }
.creator-actions .creator-save { flex:1.5; }
.lincoln-world.world-options [role=switch] {
  appearance:none; flex:none; position:relative; width:54px; height:32px; min-height:32px;
  margin:0; padding:0; background:#98765c; border:2px solid #71472f; border-radius:5px; cursor:pointer;
}
.lincoln-world.world-options [role=switch]::before {
  content:""; position:absolute; left:3px; top:3px; width:22px; height:22px;
  background:#fff3cf; border:1px solid #785338; border-radius:3px;
}
.lincoln-world.world-options [role=switch]:checked { background:#56814b; }
.lincoln-world.world-options [role=switch]:checked::before { left:24px; }
#account-settings button canvas {
  width:21px; height:32px; margin-inline-end:4px; vertical-align:middle; image-rendering:pixelated;
}
@media(max-width:480px) {
  .creator-stage .creator-hero { flex:1; min-width:105px; }
  .creator-controls fieldset:first-child .creator-choices { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); }
  .creator-controls fieldset:nth-child(4) .creator-choices { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); }
}
.lincoln-world.world-options[data-panel=settings] {
  border:4px solid #6d3924; border-radius:9px; padding:8px;
  background:repeating-linear-gradient(0deg,#a35c31 0 17px,#97502e 17px 19px,#b16b3a 19px 21px);
  box-shadow:0 0 0 2px #e1a05b,inset 0 0 0 2px #d99956,0 8px 28px #29160fb8;
}
.lincoln-world.world-options[data-panel=settings] h2 {
  margin:0 auto 8px; padding:7px; background:#f7d48e; border:2px solid #6d3924; border-radius:6px;
  text-align:center; box-shadow:inset 0 0 0 2px #ffe3a3;
}
.lincoln-world.world-options[data-panel=settings] form {
  background:#fff3d6; padding:6px 9px 9px; border:2px solid #6d3924; border-radius:8px; margin-bottom:6px;
}
.lincoln-world.world-options .world-setting-copy { display:block; font-weight:750; }
.lincoln-world.world-options .world-setting-copy small { display:block; font-size:.72rem; font-weight:500; }
.lincoln-world.world-options[data-panel=settings] label { border-bottom:1px solid #dec399; }
.lincoln-world.world-options [role=switch] { border-radius:20px; background:#baa38b; }
.lincoln-world.world-options [role=switch]::before { border-radius:50%; border:0; background:#fffbee; }
.lincoln-world.world-options [role=switch]:checked { background:#21734a; }
.creator-stage { background:repeating-linear-gradient(0deg,#bc7d4a 0 11px,#a7683d 11px 13px); }
.creator-hero { box-shadow:inset 0 0 0 2px #754525; background-position:center 63%; }
.creator-stage button { background:#ffe3a0; }

.creator-brand-dot { font-size:.64em; }
.creator-uniform[data-uniform="uniform-white"] .creator-brand-dot { display:none; }
.lincoln-world.world-options input[type=range] { width:min(45%,145px); min-height:44px; accent-color:#337343; }
/* The character moves in map coordinates. Its pose is updated by the shared sprite renderer. */
.lincoln-world .world-avatar { transition:none; z-index:3; width:7%; translate:-50% -94%; }
#lincoln-world .world-map-viewport .world-avatar { width:7%; }
#lincoln-world .world-map-viewport .world-avatar { z-index:3; }
#lincoln-world .world-map-viewport .world-principal strong { margin-top:3px; }

.lincoln-world .world-fountain-ripple { display:none; }
.lincoln-world[data-effects=on]:is([data-weather=rain],[data-weather=storm]) .world-fountain-ripple {
  display:block;
  position:absolute;
  inset:46% 12% 24%;
  border:2px solid #d8f5ff;
  border-radius:50%;
  pointer-events:none;
  animation:world-fountain-ripple 1.55s ease-out infinite;
}
@keyframes world-fountain-ripple {
  from { opacity:.85; transform:scale(.45); }
  to { opacity:0; transform:scale(1.3); }
}

.lincoln-world[data-effects=on] .world-campus:not(.world-welcome) .world-mascot > * {
  animation: world-cat-idle 7s steps(1,end) infinite;
}
.lincoln-world .world-mascot:is(:focus,:hover) > * { animation-play-state:paused; }
@keyframes world-cat-idle {
  0%, 92%, 100% { translate:0 0; }
  94% { translate:0 1px; }
  97% { translate:0 -1px; }
}

.world-calendar-toolbar { display:flex; flex-wrap:wrap; align-items:center; gap:6px; }
.world-calendar-toolbar button,.world-calendar-events button { min-height:44px; }
.world-calendar-grid { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:3px; margin-block:12px; text-align:center; }
.world-calendar-day { padding:5px 0; border:1px solid #80502c55; }
.world-calendar-day[aria-current=date] { outline:2px solid #694324; outline-offset:-2px; }
.world-calendar-day[data-scheduled] { background:#ffe09b; font-weight:700; }
.world-calendar-events { padding:0; list-style:none; }
.world-calendar-events li { display:flex; flex-wrap:wrap; gap:6px; align-items:center; padding:5px 0; }

.lincoln-world:not(:is([data-weather=rain],[data-weather=storm])) .world-rain-shelter { display:none; }

#lincoln-world .world-activity-board:has(.world-activity-sync) { flex-wrap:wrap; }
#lincoln-world .world-activity-sync { flex-basis:100%; text-align:center; font-size:.75rem; }
.world-branch-activities button { min-height:44px; margin:2px; }

.world-cat-motion { display:none; position:absolute; inset:auto 0 0; width:100%; aspect-ratio:1; image-rendering:pixelated; pointer-events:none; }
.world-mascot[data-cat-frame] .world-cat-motion { display:block; }
.world-mascot[data-cat-frame] .world-cat { visibility:hidden; }
.lincoln-world .world-mascot[data-cat-frame] .world-shirt {
  inset:auto 18% 22% 18%; font-size:4.3cqw; transform:none; z-index:1;
}
.lincoln-world .world-mascot[data-cat-frame="12"] .world-shirt { bottom:17%; }
.lincoln-world .world-mascot:is([data-cat-frame="13"],[data-cat-frame="14"],[data-cat-frame="16"]) .world-shirt { bottom:15%; left:46%; right:4%; }
.lincoln-world .world-mascot:is([data-cat-frame="6"],[data-cat-frame="7"],[data-cat-frame="8"],[data-cat-frame="9"],
  [data-cat-frame="10"],[data-cat-frame="11"]) .world-shirt { visibility:hidden; }
.lincoln-world[data-effects=on] .world-campus .world-mascot[data-cat-frame] > * { animation:none; }
.world-campus-prop,.world-avatar-umbrella {
  position:absolute; translate:-50% -100%; image-rendering:pixelated; pointer-events:none;
}
.world-campus-prop { width:9%; z-index:2; }
.world-prop-roof { z-index:4; }
.world-prop-flowers { width:7%; }
.world-avatar-umbrella { width:34px; z-index:4; display:none; translate:-50% -145%; }
.lincoln-world:is([data-weather=rain],[data-weather=storm]) .world-campus:not([data-avatar-pose=shelter]) .world-avatar-umbrella {
  display:block;
}

/* Rescue: stronger night lighting on artwork only; keep labels and controls readable. */
#lincoln-world[data-period=night] .world-campus .world-backdrop {
  filter:brightness(.48) saturate(.78) hue-rotate(8deg);
}
#lincoln-world[data-period=sunset] .world-campus .world-backdrop {
  filter:brightness(.78) sepia(.15);
}
#lincoln-world[data-period=night] .world-campus-lights {
  background:linear-gradient(180deg,#14234d30,#182a6620);
}
