/* THE LAST LECTURE: the two flags that switch a page between Thai and English (no words on them; their names are
   for screen readers and the tooltip). A visitor whose browser asks for the other language sees that flag pulse once and a
   small note under it, the first time only. */
.ll-lang { display: inline-flex; align-items: center; gap: 6px; position: relative; flex: none; line-height: 0; }
.ll-lang a { display: block; width: 27px; height: 18px; border-radius: 4px; overflow: hidden; opacity: .5;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .18); transition: opacity .2s, transform .2s; -webkit-tap-highlight-color: transparent; }
.ll-lang a svg { display: block; width: 100%; height: 100%; }
.ll-lang a:hover, .ll-lang a:focus-visible { opacity: 1; transform: translateY(-1px); }
.ll-lang a:focus-visible { outline: 2px solid #e8c37a; outline-offset: 2px; }
.ll-lang a[aria-current="true"] { opacity: 1; box-shadow: 0 0 0 2px #fff, 0 0 0 3px rgba(80, 6, 22, .35); }
.ll-lang.ll-dark a { box-shadow: 0 0 0 1px rgba(255, 255, 255, .35); }
.ll-lang.ll-dark a[aria-current="true"] { box-shadow: 0 0 0 2px #e8c37a; }
.ll-lang a.ll-invite { opacity: 1; animation: ll-pulse 1.6s ease-out 3; }
@keyframes ll-pulse { 0% { box-shadow: 0 0 0 0 rgba(232, 195, 122, .95); } 70% { box-shadow: 0 0 0 10px rgba(232, 195, 122, 0); }
  100% { box-shadow: 0 0 0 0 rgba(232, 195, 122, 0); } }
.ll-tip { position: absolute; top: calc(100% + 10px); right: -4px; z-index: 5; white-space: nowrap; pointer-events: none;
  padding: 6px 11px; border-radius: 9px; background: #500616; color: #fff; font: 600 13px/1.4 "Bai Jamjuree", system-ui, sans-serif;
  letter-spacing: .01em; box-shadow: 0 6px 18px rgba(0, 0, 0, .22); opacity: 0; transform: translateY(-4px);
  transition: opacity .35s, transform .35s; }
.ll-tip::before { content: ""; position: absolute; top: -5px; right: 12px; width: 10px; height: 10px; background: inherit;
  transform: rotate(45deg); border-radius: 2px; }
.ll-lang.ll-tip-on .ll-tip { opacity: 1; transform: none; }
.ll-lang.ll-dark .ll-tip { background: #f4e2b8; color: #500616; }
@media (prefers-reduced-motion: reduce) { .ll-lang a, .ll-tip { transition: none; } .ll-lang a.ll-invite { animation: none; box-shadow: 0 0 0 2px #e8c37a; } }
/* where the flags sit on each kind of page */
.ll-corner { position: fixed; top: calc(env(safe-area-inset-top, 0px) + 14px); right: calc(env(safe-area-inset-right, 0px) + 14px); z-index: 60; }
.context .ll-lang { margin-right: 4px; }
.context:not(:has(.context-text)) .ll-lang { margin-left: auto; }
.context .ll-lang + .context-go, .context .ll-lang ~ .context-go { margin-left: 0; }
/* phones: the context bar keeps the logo, the flags and the way to the museum; its date gives way */
@media (max-width: 440px) {
  .context:has(.ll-lang) .context-text { display: none; }
  .context .ll-lang { margin-left: auto; }
  .ll-lang a { width: 25px; height: 17px; }
}
/* the museum: inside the lecture room the corner belongs to the room's own buttons; the flags wait outside */
html.in-room .ll-corner { opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .3s, visibility 0s .3s; }
/* r56e (23 Oct 2569, Alpha: ปุ่มเปลี่ยนภาษาไม่ควรบังโปสการ์ดเลย): the postcard that shows in the walk's corner waits below the
   row of flags, two or three, as on his English and Japanese pages */
body:has(> .ll-corner) .w-stage .w-card { top: calc(52px + var(--w-st)); }
/* r56e (Alpha: เพลงกดเปิดยาก ต้องกลับไปกดอีกมุมหนึ่ง ควรอยู่มุมเดียวกัน): in the museum the walk's music switch and the flags share the
   top right corner, in one row (ll-lang.js moves the switch there); the postcard waits below the row */
.ll-row { position: fixed; top: calc(env(safe-area-inset-top, 0px) + 14px); right: calc(env(safe-area-inset-right, 0px) + 14px);
  z-index: 60; display: flex; align-items: center; gap: 10px; }
.ll-row > .ll-corner { position: relative; top: auto; right: auto; }
.ll-row > .w-sound { position: relative; left: auto; top: auto; z-index: auto; }
html.in-room .ll-row { opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .3s, visibility 0s .3s; }
/* r56g: clear of the row by a few pixels even while the card pops up (scale 1.14) as a new stamp lands */
:root body:has(> .ll-row) .w-stage .w-card { top: calc(76px + var(--w-st)); }
/* r56d: three flags in the dark bar of the seed guide and the films: on a small phone the bar keeps to the screen as the
   Japanese pages' bar does (ll-ja.css) */
@media (max-width: 400px) {
  .context:has(.ll-lang a[hreflang="ja"]) { gap: 8px; padding-left: 12px; }
  .context .ll-lang:has(a[hreflang="ja"]) { gap: 4px; }
  .context .ll-lang:has(a[hreflang="ja"]) a { width: 22px; height: 15px; }
  .context:has(.ll-lang a[hreflang="ja"]) .context-logo { height: 26px; }
  .context:has(.ll-lang a[hreflang="ja"]) .context-go svg { display: none; }
}
/* English pages of the films (their policy allows no style in the page): a unit's long English name and a long button
   may wrap on small phones */
html[lang="en"] .cr-mk { white-space: normal; }
html[lang="en"] .mus-go { white-space: normal; text-align: center; }
/* r56c (23 Oct 2569, Alpha: มีไอคอนเปลี่ยนภาษาให้ทุกจุดในเว็บ): where the page's own flags are out of reach they come along.
   r56g (Alpha: ติ่งใสใสนี้คนใช้ทั่วไปไม่รู้ว่าคืออะไร และควรอยู่ใกล้ตัวเปิดเพลง): the flags themselves, every language, in a white pill
   of the room's buttons' look: in the museum's lecture room right after the music switch (where the bar has room beside
   the stage's name; on a phone the room's menu has them), on the seed guide and the films at the top right once the bar
   with the flags has scrolled away */
.ll-lang.ll-room, .ll-lang.ll-float { gap: 6px; padding: 0 10px; border-radius: 999px; background: rgba(255, 255, 255, .86);
  box-shadow: 0 1px 0 rgba(42, 35, 37, .08), 0 8px 22px -14px rgba(42, 35, 37, .6); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.ll-lang.ll-room a, .ll-lang.ll-float a { width: 24px; height: 16px; border-radius: 3px; }
.stage-btns .ll-room { display: none; align-self: stretch; min-height: 28px; }
html.in-room .stage-btns .ll-room { display: inline-flex; }
html.in-room .stage-btns .ll-room.ll-tight { display: none; }
/* while the credits fill the screen the bar keeps to the left, so the music switch goes last there: its words grow when
   the music starts and the flags beside it then stay where the finger is */
html.cr-full .stage-btns #sound { order: 1; }
/* in the museum's menu, beside the button that closes it */
.jr-top .ll-menu { margin-left: auto; align-self: center; gap: 8px; }
html.akk-on :is(.ll-room, .ll-float) { display: none !important; }
.ll-lang.ll-float { position: fixed; top: calc(env(safe-area-inset-top, 0px) + 12px); right: calc(env(safe-area-inset-right, 0px) + 12px);
  z-index: 60; height: 32px; opacity: 0; visibility: hidden; transition: opacity .25s, visibility 0s .25s; }
.ll-lang.ll-float.on { opacity: 1; visibility: visible; transition: opacity .25s; }
@media (prefers-reduced-motion: reduce) { .ll-lang.ll-float, .ll-lang.ll-float.on { transition: none; } }
