/* The look menu: the same on all five Frizzy G sites (Mbao, Stretcher, Earshot, frizzy-g.com, Sir Mucksalot).
   A burger in the top-right corner opens a small panel with the four looks. It's a <details>, so
   it opens without any script; each site's script closes it after a pick, a tap outside or Esc.
   Styled here for every look (html[data-look]), so it's identical wherever it is.
   MASTER COPY: Claude Code\lookmenu.css. Edit this one, then run sync-lookmenu.cmd, which copies
   it into each site (and into Earshot's single file).
   Markup:
     <details class="look-menu">
       <summary class="look-burger" aria-label="Look" title="Look"><i></i><i></i><i></i></summary>
       <div class="look-panel">  (Mbao: a <form class="look-panel" ...>)
         <span class="look-panel-label" id="...">Look</span>
         <div class="lm-opts" role="group" aria-labelledby="...">
           <button class="lm-opt lm-night" aria-pressed="true">Night</button> ...Frizzy G, Tom mode, Castle
   It sits in a .top-end (the right end of a site's header), or a .top-end.corner pinned to the
   page's top-right corner where there's no header. */

.top-end { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.top-end.corner { position: absolute; z-index: 50; top: max(14px, env(safe-area-inset-top)); right: max(14px, env(safe-area-inset-right)); }
.look-menu { position: relative; flex: none; }
/* While it's open, the header it sits in comes to the front: a look may give the header a
   transform (an entrance animation, say), which makes the header its own layer and would keep the
   panel underneath whatever follows it on the page. :where() leaves a look's own position alone */
:where(:has(> .top-end > .look-menu[open])) { position: relative; }
:has(> .top-end > .look-menu[open]) { z-index: 100; }
.joined .look-menu { display: none; } /* Earshot: the look can't change in the middle of a call */

.look-burger {
  display: grid; place-content: center; gap: 4px; box-sizing: border-box; width: 44px; height: 44px; border-radius: 50%;
  list-style: none; cursor: pointer; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent;
  transition: background-color .2s ease, box-shadow .2s ease;
}
.look-burger::-webkit-details-marker { display: none; }
.look-burger::marker { content: ""; }
.look-burger i { display: block; width: 18px; height: 2px; border-radius: 2px; background: currentColor; transition: transform .25s ease, opacity .2s ease; }
.look-menu[open] .look-burger i:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.look-menu[open] .look-burger i:nth-child(2) { opacity: 0; }
.look-menu[open] .look-burger i:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.look-panel {
  position: absolute; z-index: 60; top: calc(100% + 10px); right: 0; box-sizing: border-box; width: max-content; min-width: 210px;
  margin: 0; padding: 10px; display: grid; gap: 4px; text-align: left;
}
.look-panel-label { display: block; padding: 4px 8px 6px; font-family: inherit; font-size: 11px; font-weight: 700; line-height: 1.2; letter-spacing: .18em; text-transform: uppercase; }
.lm-opts { display: grid; gap: 4px; }
.lm-opt {
  display: flex; align-items: center; gap: 11px; width: 100%; min-height: 44px; margin: 0; padding: 0 14px 0 12px; border: 0; border-radius: 12px;
  font-family: inherit; font-size: 15px; font-weight: 600; line-height: 1; color: inherit; text-align: left; background: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.lm-opt::before { content: ""; flex: none; width: 16px; height: 16px; border-radius: 50%; }
.lm-night::before { background: conic-gradient(from 210deg, #ff4fa3, #8b6cff, #2fe5ef, #ff4fa3); }
.lm-frizzy::before { background: linear-gradient(135deg, #2b322b 0 50%, #55ff00 50% 100%); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .4); }
.lm-tom::before { background: conic-gradient(from 20deg, #ff00d4, #ffe600, #00e5ff, #ff00d4); }
.lm-castle::before { background: radial-gradient(circle at 50% 62%, #ffd84a 0 22%, #e0441c 23% 42%, #5d5447 43%); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .55); }
.lm-opt[aria-pressed="true"]::after { /* a tick: this one's on */
  content: ""; flex: none; margin-left: auto; width: 14px; height: 14px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M2.5 8.5l3.6 3.6L13.5 4.6' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M2.5 8.5l3.6 3.6L13.5 4.6' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}
.look-burger:focus-visible, .lm-opt:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }

/* ---- Night: glass, a neon rim, a violet glow ---- */
html[data-look="night"] .look-burger { color: #f6f3ff; background: rgba(255, 255, 255, .07); box-shadow: inset 0 0 0 1px rgba(214, 200, 255, .24), 0 10px 26px -14px rgba(0, 0, 0, .9); }
@media (hover: hover) { html[data-look="night"] .look-burger:hover { background: rgba(255, 255, 255, .12); } }
html[data-look="night"] .look-menu[open] .look-burger { background: rgba(255, 79, 163, .2); box-shadow: inset 0 0 0 1px rgba(255, 150, 205, .6), 0 0 20px rgba(255, 79, 163, .35); }
html[data-look="night"] .look-panel {
  color: #f6f3ff; border-radius: 18px;
  background: radial-gradient(90% 70% at 0% 0%, rgba(255, 79, 163, .16), rgba(255, 79, 163, 0) 70%), linear-gradient(180deg, #1e1752, #130e35);
  box-shadow: inset 0 0 0 1px rgba(214, 200, 255, .2), 0 26px 60px -22px rgba(0, 0, 0, .95), 0 0 44px -14px rgba(139, 108, 255, .55);
}
html[data-look="night"] .look-panel-label { color: rgba(222, 214, 255, .72); }
@media (hover: hover) { html[data-look="night"] .lm-opt:hover { background: rgba(255, 255, 255, .07); } }
html[data-look="night"] .lm-opt[aria-pressed="true"] { background: rgba(139, 108, 255, .22); box-shadow: inset 0 0 0 1px rgba(203, 187, 255, .38); }

/* ---- Frizzy G: Night in grey and green ---- */
html[data-look="frizzy"] .look-burger { color: #f5f9f5; background: rgba(255, 255, 255, .07); box-shadow: inset 0 0 0 1px rgba(208, 232, 210, .24), 0 10px 26px -14px rgba(0, 0, 0, .9); }
@media (hover: hover) { html[data-look="frizzy"] .look-burger:hover { background: rgba(255, 255, 255, .12); } }
html[data-look="frizzy"] .look-menu[open] .look-burger { background: rgba(85, 255, 0, .17); box-shadow: inset 0 0 0 1px rgba(150, 255, 110, .6), 0 0 20px rgba(85, 255, 0, .3); }
html[data-look="frizzy"] .look-panel {
  color: #f5f9f5; border-radius: 18px;
  background: radial-gradient(90% 70% at 0% 0%, rgba(85, 255, 0, .12), rgba(85, 255, 0, 0) 70%), linear-gradient(180deg, #242b24, #151915);
  box-shadow: inset 0 0 0 1px rgba(208, 232, 210, .2), 0 26px 60px -22px rgba(0, 0, 0, .95), 0 0 44px -14px rgba(85, 255, 0, .35);
}
html[data-look="frizzy"] .look-panel-label { color: rgba(214, 233, 217, .72); }
@media (hover: hover) { html[data-look="frizzy"] .lm-opt:hover { background: rgba(255, 255, 255, .07); } }
html[data-look="frizzy"] .lm-opt[aria-pressed="true"] { background: rgba(85, 255, 0, .14); box-shadow: inset 0 0 0 1px rgba(150, 255, 110, .42); }

/* ---- Tom mode: a Windows 95 button and window, obviously ---- */
html[data-look="tom"] .look-burger {
  border-radius: 0; color: #000; background: #c0c0c0;
  box-shadow: inset -2px -2px 0 #404040, inset 2px 2px 0 #fff, 3px 3px 0 #000;
}
html[data-look="tom"] .look-menu[open] .look-burger { box-shadow: inset 2px 2px 0 #404040, inset -2px -2px 0 #fff, 1px 1px 0 #000; }
html[data-look="tom"] .look-panel {
  padding: 3px 3px 10px; border-radius: 0; color: #000; background: #c0c0c0;
  font-family: "Comic Sans MS", "Comic Sans", "Chalkboard SE", cursive;
  box-shadow: inset -2px -2px 0 #404040, inset 2px 2px 0 #fff, 5px 5px 0 #000;
}
html[data-look="tom"] .look-panel-label { /* the title bar */
  margin: 0 0 8px; padding: 4px 8px; color: #fff; background: linear-gradient(90deg, #000080, #1084d0);
  font: 700 13px/1.2 Tahoma, "MS Sans Serif", Verdana, sans-serif; letter-spacing: 0; text-transform: none;
}
html[data-look="tom"] .look-panel-label::after { content: ".exe"; content: ".exe" / ""; }
html[data-look="tom"] .lm-opts { gap: 6px; padding: 0 8px; }
html[data-look="tom"] .lm-opt {
  border-radius: 0; color: #000; font: 700 15px/1 "Comic Sans MS", "Comic Sans", "Chalkboard SE", cursive; background: #c0c0c0;
  box-shadow: inset -2px -2px 0 #404040, inset 2px 2px 0 #fff;
}
html[data-look="tom"] .lm-opt[aria-pressed="true"] { background: #ffff00; box-shadow: inset 2px 2px 0 #404040, inset -2px -2px 0 #fff; }

/* ---- Castle: a bevelled stone button, and the menu an old fantasy MMO pops up on a right-click
   (black "Choose Option" bar, white pixel letters, yellow for the one that's on). The pixel font
   comes from the Castle look's own stylesheet (the castle kit). ---- */
html[data-look="castle"] .look-burger {
  border-radius: 0; color: #ffcf3f; background: #5d5447; border: 2px solid #000;
  box-shadow: inset 2px 2px 0 #8c7f6a, inset -2px -2px 0 #2b241b, 3px 3px 0 rgba(0, 0, 0, .55);
  transition: none;
}
html[data-look="castle"] .look-burger i { height: 3px; border-radius: 0; box-shadow: 1px 1px 0 #000; }
@media (hover: hover) { html[data-look="castle"] .look-burger:hover { color: #ffff00; } }
html[data-look="castle"] .look-menu[open] .look-burger { color: #ffff00; box-shadow: inset 2px 2px 0 #2b241b, inset -2px -2px 0 #8c7f6a; }
html[data-look="castle"] .look-panel {
  padding: 0 0 6px; border-radius: 0; color: #fff; background: #5d5447; border: 2px solid #000;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, .6);
}
html[data-look="castle"] .look-panel-label { /* the black title bar; "Look" stays the menu's name for screen readers */
  margin: 0 0 4px; padding: 7px 10px 5px; color: #5d5447; background: #000;
  font: 0/1 "Castle Pixel", "Lucida Console", monospace; letter-spacing: 0; text-transform: none;
}
html[data-look="castle"] .look-panel-label::after { content: "Choose Option"; content: "Choose Option" / ""; font-size: 20px; }
html[data-look="castle"] .lm-opts { gap: 0; padding: 0 4px; }
html[data-look="castle"] .lm-opt {
  min-height: 44px; border-radius: 0; color: #fff; text-shadow: 2px 2px 0 #000;
  font: 20px/1 "Castle Pixel", "Lucida Console", monospace;
}
@media (hover: hover) { html[data-look="castle"] .lm-opt:hover { color: #ffff00; } }
html[data-look="castle"] .lm-opt[aria-pressed="true"] { color: #ffff00; }
html[data-look="castle"] .lm-opt::before { border-radius: 0; box-shadow: 0 0 0 2px #000; }

@media (prefers-reduced-motion: reduce) { .look-burger, .look-burger i { transition: none; } }
@media (forced-colors: active) {
  .look-burger, .look-panel, .lm-opt { border: 1px solid CanvasText; background: Canvas; color: CanvasText; box-shadow: none; }
  .lm-opt[aria-pressed="true"] { outline: 2px solid Highlight; }
}
