/* One chrome. Pages do not size the header. */
html,body{height:100%;margin:0}
body{display:flex;flex-direction:column;min-height:100dvh}
.site-bar{
  display:grid;
  grid-template-columns:72px 1fr auto;
  grid-template-areas:"burger how emerg";
  align-items:center;
  column-gap:12px;
  padding:10px 16px;
  border-bottom:1px solid var(--line,#C9B79A);
  background:var(--ground,#EDE4D2);
  position:sticky;top:0;z-index:80;
  flex:none;
}
.site-bar .back,.site-bar .brand{display:none}
.site-bar .emerg{grid-area:emerg;flex:none;min-height:48px;padding:10px 16px;border-radius:12px;background:#8B2E2E;color:#F7F1E4;text-decoration:none;font:600 15px inherit;display:inline-flex;align-items:center;white-space:nowrap}
.site-bar .how{
  grid-area:how;margin:0;padding:0 8px;
  text-align:center;
  font-family:var(--font-display),Georgia,"Palatino Linotype",serif;
  font-size:clamp(22px,2.6vw,34px);
  font-weight:600;line-height:1.25;color:#1A1612;
}
.site-bar .how.how-stub{color:#6B3B18;font-size:clamp(16px,1.8vw,22px)}
.site-bar .how a{font-weight:600;color:#1A1612;margin-left:6px}
.site-bar .how .where{display:block;margin-top:4px;font:500 13px/1.2 var(--font-body),system-ui,sans-serif;color:#4E4840}
.shell,.wrap{flex:1;min-height:0}

.room-bar{display:flex;align-items:center;gap:10px;padding:10px 12px;border-bottom:1px solid var(--line,#C9B79A);background:var(--ground,#EDE4D2);position:sticky;top:0;z-index:40}
.room-bar h1{font-family:var(--font-display),Georgia,serif;font-size:18px;font-weight:600;flex:1}
.emerg{flex:none;min-height:44px;padding:8px 12px;border-radius:12px;background:#8B2E2E;color:#F7F1E4;text-decoration:none;font:600 14px inherit;display:inline-flex;align-items:center;white-space:nowrap}
.room-bar .back{color:var(--accent,#8B4A2B);text-decoration:none;font-size:20px;min-width:32px}
.burger{width:44px;height:44px;border:0;background:transparent;display:flex;flex-direction:column;justify-content:center;gap:5px;padding:10px}
.burger span{display:block;height:2px;background:#3A2A18;border-radius:2px}
.drawer{display:none;position:fixed;inset:56px 0 0 auto;width:min(320px,92vw);background:#F7F1E4;border-left:1.5px solid #C9B79A;z-index:50;overflow:auto;padding:12px}
body.drawer-on .drawer{display:block}
.drawer a,.drawer button{display:flex;width:100%;text-align:left;padding:12px 14px;margin:0 0 8px;border-radius:14px;border:1.5px solid #5C4630;background:linear-gradient(#FBF6EA,#EFE3C8);color:#1A1612;text-decoration:none;font:600 15px inherit;cursor:pointer;box-shadow:0 3px 0 #5C4630}
.room-panel{margin:12px;padding:14px;background:#F7F1E4;border:1.5px solid #C9B79A;border-radius:14px}
.room-panel[hidden]{display:none}
.place-card{display:grid;grid-template-columns:88px 1fr;gap:10px;padding:10px 0;border-bottom:1px solid #E4D6B8}
.place-card img{width:88px;height:88px;object-fit:cover;border-radius:8px;background:#E8DCC4}
.share-list,.work-btn{display:flex;align-items:center;min-height:48px;padding:12px 14px;margin:0 0 8px;border-radius:14px;border:1.5px solid #5C4630;background:linear-gradient(#FBF6EA,#EFE3C8);color:#1A1612;text-decoration:none;font:600 15px inherit;box-shadow:0 3px 0 #5C4630}
.work-btn{width:100%;cursor:pointer;text-align:left}
.row-muted{font-size:13px;color:#4E4840}
input,textarea,select{font:16px inherit;padding:8px;border:1.5px solid #8A6A3C;border-radius:8px;width:100%;margin:6px 0}

body.home .rail,
body.map-only:not(.place-page) .rail{display:none !important}
body.home .shell,
body.map-only:not(.place-page) .shell{grid-template-columns:1fr !important;grid-template-rows:1fr !important}
.lfg-burger{
  grid-area:burger;
  position:relative;left:auto;bottom:auto;
  width:64px;height:64px;padding:16px 14px;
  display:flex;flex-direction:column;justify-content:center;gap:8px;
  border:0;border-radius:16px;cursor:pointer;
  background:linear-gradient(#E8C76A,#C9A227);
  box-shadow:0 4px 0 #8A6A3C,0 10px 20px rgba(40,24,8,.25);
}
.lfg-burger span{
  display:block;height:3px;border-radius:2px;
  background:linear-gradient(#F4F4F4,#B8B8B8);
  box-shadow:0 1px 0 rgba(255,255,255,.7),0 -1px 0 rgba(80,80,80,.35);
}
body.menu-on .lfg-burger{box-shadow:0 2px 0 #8A6A3C,0 6px 12px rgba(40,24,8,.2)}
.lfg-menu{
  position:fixed;left:16px;top:88px;bottom:auto;z-index:90;
  width:min(320px,calc(100vw - 32px));
  max-height:min(70vh,560px);overflow:auto;
  padding:10px;
  background:#2A2118;border:1.5px solid #1A140E;border-radius:16px;
  box-shadow:0 16px 40px rgba(20,12,6,.55);
}
.lfg-menu-a{
  display:flex;flex-direction:column;gap:2px;
  padding:12px 14px;margin:0 0 8px;
  border-radius:14px;border:1.5px solid #5C4630;
  background:linear-gradient(#FBF6EA,#EFE3C8);
  color:#1A1612;text-decoration:none;box-shadow:0 3px 0 #3A2A18;
}
.lfg-menu-a strong{font:600 16px inherit}
.lfg-menu-a small{font:500 12px inherit;opacity:.78}
.lfg-menu-a.on{outline:2px solid #F7F1E4;outline-offset:1px}
.lfg-menu-a.lv-share,.lfg-acc.lv-share{
  background:linear-gradient(#F3E6C8,#E4D2A4);
  border-color:#C9B079;color:#1A1612;
}
.lfg-menu-a.lv-home,.lfg-acc.lv-home{
  background:linear-gradient(#D9C294,#C4A56A);
  border-color:#A88848;color:#1A1612;
}
.lfg-menu-a.lv-do,.lfg-acc.lv-do{
  background:linear-gradient(#B8945A,#9A7340);
  border-color:#7A5828;color:#1A1612;
}
.lfg-menu-a.lv-learn,.lfg-acc.lv-learn{
  background:linear-gradient(#8B6840,#6E4A28);
  border-color:#4A3220;color:#F7F1E4;
}
.lfg-menu-a.lv-learn small,.lfg-acc.lv-learn summary small{color:#E8DCC4}
.lfg-menu-a.lv-admin,.lfg-acc.lv-admin{
  background:linear-gradient(#4A3220,#2E1A0E);
  border-color:#1A120A;color:#F7F1E4;
}
.lfg-menu-a.lv-admin small{color:#D4C29A}
.lfg-menu-a.lv-cbu{
  background:linear-gradient(#003767,#002347);
  border-color:#C4A35A;
  color:#F4E4B4;
  box-shadow:0 3px 0 #00182A;
}
.lfg-menu-a.lv-cbu small{color:#C4A35A;opacity:1}
.lfg-acc,.lfg-acc-sub{
  margin:0 0 8px;
  border:1.5px solid #5C4630;
  border-radius:14px;
  background:linear-gradient(#FBF6EA,#EFE3C8);
  box-shadow:0 3px 0 #3A2A18;
}
.lfg-acc summary,.lfg-acc-sub summary{
  list-style:none;
  cursor:pointer;
  padding:12px 14px;
  display:flex;flex-direction:column;gap:2px;
  font:600 16px inherit;
}
.lfg-acc summary::-webkit-details-marker,
.lfg-acc-sub summary::-webkit-details-marker{display:none}
.lfg-acc summary::after,
.lfg-acc-sub summary::after{
  content:'\25B8';
  position:absolute;
  right:22px;
  font-size:14px;
}
.lfg-acc{position:relative}
.lfg-acc-sub{position:relative;box-shadow:0 2px 0 rgba(20,12,6,.25);background:rgba(247,241,228,.12);border-color:rgba(247,241,228,.28);color:inherit}
.lfg-acc[open] summary::after,.lfg-acc-sub[open] summary::after{content:'\25BE'}
.lfg-acc summary small{font:500 12px inherit;opacity:.78}
.lfg-acc-body{padding:0 8px 8px}
.lfg-acc-body .lfg-menu-a{margin-bottom:6px;box-shadow:0 2px 0 #3A2A18}
.lfg-ask{margin-top:4px;padding:8px 4px;color:#D4C29A}
.lfg-ask summary{cursor:pointer;font:600 14px inherit;color:#E8DCC4;text-decoration:underline}
.lfg-ask p{font:13px/1.4 inherit;margin:8px 0}
.lfg-ask label{display:block;font:600 13px inherit;margin-top:8px;color:#E8DCC4}
.lfg-ask button[type=submit]{margin-top:10px;min-height:44px;width:100%;border-radius:12px;border:1.5px solid #5C4630;background:linear-gradient(#FBF6EA,#EFE3C8);color:#1A1612;font:600 15px inherit;cursor:pointer}

.site-bar .how-gal, a.gal-folder{
  display:inline-flex;align-items:center;justify-content:center;
  margin:8px 6px 0;padding:10px 16px;min-height:44px;
  border-radius:12px;border:1.5px solid #8A6A3C;
  background:linear-gradient(#E8C76A,#C9A227);
  color:#1A1612;text-decoration:none;white-space:nowrap;
  font:600 16px/1.1 var(--font-body),system-ui,sans-serif;
  box-shadow:0 3px 0 #8A6A3C;
}
a.gal-folder{display:inline-flex;margin:12px 0}
.gal-wrap{max-width:1100px;margin:0 auto;padding:16px 14px 40px}
.gal-wrap h2{font-family:var(--font-display),Georgia,serif;font-size:22px;margin:18px 0 8px}
.gal-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(160px,1fr));gap:10px}
.gal-grid a{display:block;border-radius:10px;overflow:hidden;border:1.5px solid #C9B79A;background:#E8DCC4;aspect-ratio:1}
.gal-grid img{width:100%;height:100%;object-fit:cover;display:block}
.gal-empty{font:14px/1.4 inherit;color:#4E4840;margin:0}
.gal-acc{margin:0 0 10px;border:1.5px solid #8A6A3C;border-radius:14px;background:#F7F1E4;box-shadow:0 3px 0 rgba(90,60,20,.12)}
.gal-acc summary{min-height:52px;padding:12px 14px;font:600 17px inherit;cursor:pointer;list-style:none;display:flex;justify-content:space-between;gap:8px}
.gal-acc summary::-webkit-details-marker{display:none}
.gal-acc .body{padding:0 12px 12px}
.gal-up{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:0 0 10px}
.gal-up .task{min-height:44px;padding:8px 14px;border-radius:12px;border:1.5px solid #5C4630;background:#5C4630;color:#F7F1E4;font:600 14px inherit;cursor:pointer}
.gal-up .hint{margin:0;flex:1 1 100%}
.gal-lite{position:fixed;inset:0;z-index:100;background:rgba(18,16,12,.88);display:flex;align-items:center;justify-content:center;padding:24px}
.gal-lite img{max-width:96vw;max-height:92vh;object-fit:contain;border-radius:8px}

@media (min-width:901px){
  body.home{
    height:100dvh;
    max-height:100dvh;
    overflow:hidden;
  }
  body.home .site-bar{
    position:relative;
    flex:none;
  }
  body.home .shell,
  body.home .pane,
  body.home #map-desk,
  body.home #map-desk .stage,
  body.home #map-desk .plate.world,
  body.home #farm-gl{
    width:100%;
    max-width:none;
    flex:1 1 auto;
    min-height:0;
    height:auto;
  }
  body.home #farm-gl,
  body.home #map-desk .plate.world{
    background:#EDE4D2 !important;
  }
  body.home #farm-gl canvas{
    width:100% !important;
    height:100% !important;
    display:block;
  }
}

@media (max-width:900px){
  body.home{
    height:100dvh;
    min-height:100dvh;
    overflow:hidden;
  }
  body.home .site-bar{
    position:fixed;
    inset:0;
    display:block;
    padding:0;
    border:0;
    background:transparent;
    pointer-events:none;
    z-index:80;
  }
  body.home .site-bar .how{display:none}
  body.home .site-bar .emerg{
    pointer-events:auto;
    position:absolute;
    top:max(8px, env(safe-area-inset-top));
    right:max(8px, env(safe-area-inset-right));
  }
  body.home #lfg-face{
    pointer-events:auto;
    position:fixed;
    top:max(8px, env(safe-area-inset-top));
    right:max(108px, calc(8px + env(safe-area-inset-right) + 96px));
    z-index:81;
  }
  body.home .lfg-burger{
    pointer-events:auto;
    position:fixed;
    left:max(12px, env(safe-area-inset-left));
    bottom:max(12px, env(safe-area-inset-bottom));
    top:auto;
    right:auto;
    z-index:91;
  }
  body.home .lfg-menu{
    top:auto;
    bottom:calc(12px + 64px + 10px + env(safe-area-inset-bottom));
    left:max(12px, env(safe-area-inset-left));
    max-height:min(62dvh, 420px);
  }
  body.home .shell,
  body.home .pane,
  body.home #map-desk,
  body.home #farm-gl{
    position:fixed;
    inset:0;
    width:100vw;
    height:100dvh;
    min-height:100dvh;
    padding:0;
    margin:0;
  }
  body.home #farm-gl canvas{
    width:100% !important;
    height:100% !important;
  }
  body.home .world-hud{
    left:88px !important;
    right:12px !important;
    bottom:max(14px, env(safe-area-inset-bottom)) !important;
    width:auto !important;
  }
}
@media (max-width:900px) and (orientation:landscape){
  body.home,
  body.home .shell,
  body.home .pane,
  body.home #map-desk,
  body.home #farm-gl{
    width:100vw;
    height:100dvh;
    height:100svh;
  }
}
