/* itboji.com shared chrome (site rewrite 2026-10-09). Every page loads this; chrome.js builds the DOM.
   Everything here is namespaced .itb-* so it never collides with a page's own classes (the /raid/ guide and
   the gallery have their own .tag / .scrim / .panel). Mobile first: base = 375 px, the 900 px block widens it.
   Look: redesign/plaza-final (C's white Wii gloss, springy press) on the stream plaza's pale sky + tile floor. */
:root {
  --itb-tabbar: 80px;
  --itb-ink: #2b3a4c; --itb-soft: #6a7b8e; --itb-navy: #1d4f86;
  --itb-wii: #1ea4f2; --itb-wii-l: #6fd0ff; --itb-wii-ink: #1f67ad;
  --itb-ring: #bcd5ea; --itb-lift: 0 8px 20px rgba(24, 92, 150, .2);
  --itb-ui: 'M PLUS Rounded 1c', Nunito, system-ui, sans-serif;
  --itb-spring: cubic-bezier(.34, 1.7, .5, 1);
  /* 10-10 dark mode: the surfaces below are tokens so html[data-theme="dark"] (end of this file) can swap them */
  --itb-page: #f4f9fd;                               /* the page colour under the plaza */
  --itb-gl-a: #fff; --itb-gl-b: #eaf3fa;             /* white Wii gloss: top, bottom */
  --itb-halo: rgba(255, 255, 255, .9); --itb-halo-s: #fff;    /* the 2px white ring between a button and its blue ring */
}
html.itb-plaza { background: var(--itb-page); }
.itb-own .itb-wm .itb-logo { color: #fff; }        /* a page with its own dark backdrop (the raid guide) */
body { padding-bottom: calc(var(--itb-tabbar) + env(safe-area-inset-bottom)); overflow-x: hidden; }

/* ---------- the plaza (10-09: real 3D on home + /me, a still of the same world elsewhere) ---------- */
/* the still: a picture of the 3D plaza at the top of the page that scrolls WITH the content (no fixed layer),
   fading into the page colour. Rendered from plaza3d.js by tools/plaza3d/render_still.cjs. */
.itb-still { position: absolute; left: 0; right: 0; top: 0; z-index: -1; pointer-events: none; aspect-ratio: 750 / 1300; max-height: 1300px;
  background: var(--itb-page) url(/img/plaza_still_m.jpg) center top / 100% auto no-repeat;
  background-image: image-set(url(/img/plaza_still_m.webp) type("image/webp"), url(/img/plaza_still_m.jpg) type("image/jpeg"));
  -webkit-mask-image: linear-gradient(#000 62%, transparent 98%); mask-image: linear-gradient(#000 62%, transparent 98%); }
@media (min-width: 700px) {
  .itb-still { aspect-ratio: 1600 / 900; background-image: url(/img/plaza_still.jpg);
    background-image: image-set(url(/img/plaza_still.webp) type("image/webp"), url(/img/plaza_still.jpg) type("image/jpeg")); }
}
/* the 3D stage (home, /me): the still shows at once, the WebGL canvas fades in over it when its first frame is
   drawn, and the page's 2D blob (.hb canvas) + DOM follower fade out under it. No WebGL = the still + 2D blob stay. */
.p3d { position: absolute; left: 0; top: 0; width: 100%; height: 100vh; z-index: 0; overflow: hidden; pointer-events: none; background: var(--itb-page); }
.p3d .p3d-still { position: absolute; inset: 0; background: url(/img/plaza_still_m.jpg) center var(--still-y, 0px) / 100% auto no-repeat;
  background-image: image-set(url(/img/plaza_still_m.webp) type("image/webp"), url(/img/plaza_still_m.jpg) type("image/jpeg")); }
.p3d canvas.p3d-gl { position: absolute; left: 0; top: 0; display: block; opacity: 0; transition: opacity .35s ease; }
.p3d.on canvas.p3d-gl { opacity: 1; }
html[data-p3d="on"] .hb canvas.blob { opacity: 0; }
html[data-p3d="on"] .hb::after, html[data-p3d="on"] .fol { visibility: hidden; }
.hb canvas.blob { transition: opacity .35s ease; }
@media (min-width: 700px) {
  .p3d .p3d-still { background-image: url(/img/plaza_still.jpg); background-size: cover;
    background-image: image-set(url(/img/plaza_still.webp) type("image/webp"), url(/img/plaza_still.jpg) type("image/jpeg")); }
}
@media (prefers-reduced-motion: reduce) { .p3d canvas.p3d-gl, .hb canvas.blob { transition: none; } }

/* ---------- the wordmark (three flat options, see chrome.js logo()) ---------- */
.itb-logo { display: inline-flex; align-items: baseline; font: 700 1em/1 Fredoka, 'M PLUS Rounded 1c', system-ui, sans-serif;
  letter-spacing: -.01em; color: var(--itb-navy); white-space: nowrap; text-decoration: none; user-select: none; -webkit-user-select: none; }
.itb-logo .lo-blob { display: inline-block; width: .74em; height: .68em; margin: 0 .035em 0 .045em; color: currentColor; overflow: visible; }
.itb-logo .lo-i { position: relative; display: inline-block; }
.itb-logo .lo-dot { position: absolute; left: 50%; top: .14em; width: .18em; height: .18em; margin-left: -.09em; border-radius: .055em;
  background: var(--c); transform: rotate(var(--r)); box-shadow: inset 0 0 0 .018em rgba(29, 79, 134, .18); }
.itb-logo.lo3 .lo-j .lo-dot { margin-left: -.14em; }

/* ---------- top row: wordmark left (+ tabs and account on desktop) ---------- */
.itb-top { position: relative; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  height: 56px; max-width: 1180px; margin: 0 auto; padding: 8px 16px 0; pointer-events: none; }
.itb-top > * { pointer-events: auto; }        /* the empty part of the row lets taps through (e.g. /me's Log out) */
.itb-wm { display: block; font-size: 30px; line-height: 1; text-decoration: none; padding: 6px 4px 6px 0; }
.itb-acct { display: none; }
body[data-itb-page="home"] .itb-top { display: none; }            /* phone: the home's big wordmark IS the top */

/* ---------- tab bar: a frosted white capsule at the bottom of a phone ---------- */
.itb-tabs { position: fixed; z-index: 30; left: 10px; right: 10px; bottom: calc(8px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: repeat(4, 1fr);
  height: calc(var(--itb-tabbar) - 12px); max-width: 520px; margin: 0 auto; padding: 0 4px; border-radius: 30px;
  background: rgba(255, 255, 255, .95); box-shadow: 0 0 0 2px var(--itb-halo-s), 0 0 0 3.5px #c3d8ea, 0 10px 26px rgba(20, 80, 140, .24);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.itb-tabs a, .itb-tabs button { position: relative; z-index: 0; isolation: isolate; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-width: 0; padding: 0; border: 0; background: none; color: #4a6077; font: 800 11px/1 var(--itb-ui); letter-spacing: .3px; text-decoration: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent; transition: transform .38s var(--itb-spring); }
.itb-tabs .ti { position: relative; display: grid; place-items: center; width: 34px; height: 30px; }
.itb-tabs .ti svg { width: 27px; height: 27px; }
.itb-tabs .ti canvas { position: absolute; left: 50%; bottom: -1px; width: 42px; height: 42px; transform: translateX(-50%); image-rendering: pixelated; }
.itb-tabs .on { color: #fff; transform: translateY(-2px); }
.itb-tabs .on::before { content: ""; position: absolute; z-index: -1; inset: 6px 3px; border-radius: 22px;
  background: linear-gradient(#6fd0ff 0 30%, #1798ec); box-shadow: inset 0 -3px 0 rgba(0, 60, 130, .2), 0 3px 8px rgba(20, 110, 200, .35); }
.itb-tabs .on .ti svg { filter: drop-shadow(0 1px 0 rgba(0, 60, 120, .3)); }
.itb-tabs .down { transform: translateY(2px) scale(.9); transition-duration: .06s; }
.itb-tabs .tw { display: none; }
.itb-tabs :focus-visible { outline: 3px solid var(--itb-wii); outline-offset: -3px; border-radius: 22px; }

/* ---------- guide sheet ---------- */
.itb-scrim { position: fixed; inset: 0; z-index: 40; background: rgba(30, 80, 130, .32); opacity: 0; pointer-events: none; transition: opacity .2s;
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
/* 10-10: sized to the VISIBLE screen (dvh: a phone's address bar is not in it; 88vh hid the top + the close button), the header
   stays pinned while the rows scroll, and the scroll never leaks to the page behind */
.itb-sheet { position: fixed; z-index: 41; left: 0; right: 0; bottom: 0; max-width: 520px; max-height: 85vh; max-height: calc(100dvh - 24px - env(safe-area-inset-top)); margin: 0 auto; overflow: auto;
  overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  padding: 0 16px calc(14px + env(safe-area-inset-bottom)); border-radius: 30px 30px 0 0; background: linear-gradient(#fff, #eef6fc 160px);
  box-shadow: 0 -8px 30px rgba(20, 80, 140, .25); color: var(--itb-ink); font: 800 16px/1.35 var(--itb-ui); transform: translateY(105%); transition: transform .42s var(--itb-spring); }
.itb-sheet[hidden] { display: block; visibility: hidden; }
body.itb-sheet-open .itb-scrim { opacity: 1; pointer-events: auto; }
body.itb-sheet-open .itb-sheet { transform: none; visibility: visible; }
.itb-sheet:focus { outline: none; }
.itb-sheet .grab { width: 48px; height: 6px; margin: 0 auto; border-radius: 3px; background: #c6d4e2; }
.itb-sheet .sheethead { position: sticky; top: 0; z-index: 2; margin: 0 -16px 12px; padding: 10px 16px 8px; background: var(--itb-gl-a); border-radius: 30px 30px 0 0; box-shadow: 0 1px 0 rgba(20, 80, 140, .08); }
.itb-sheet h2 { display: flex; align-items: center; justify-content: space-between; margin: 8px 0 0; font: 800 20px/1.2 var(--itb-ui); color: var(--itb-wii-ink); }
.itb-sheet .x { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; cursor: pointer; color: var(--itb-wii-ink); font: 800 24px/1 var(--itb-ui);
  background: linear-gradient(var(--itb-gl-a) 0 40%, var(--itb-gl-b)); box-shadow: inset 0 -3px 0 rgba(40, 100, 160, .12), 0 0 0 2px var(--itb-halo-s), 0 0 0 3.5px var(--itb-ring); }
.itb-sheet .list { display: grid; gap: 12px; }
.itb-sheet .row { position: relative; display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 8px 16px 10px 10px; border-radius: 22px; overflow: hidden;
  background: linear-gradient(var(--itb-gl-a) 0 40%, var(--itb-gl-b)); color: var(--itb-wii-ink); text-decoration: none; font: 800 18px/1.1 var(--itb-ui);
  box-shadow: inset 0 -4px 0 rgba(40, 100, 160, .12), 0 0 0 2px var(--itb-halo), 0 0 0 3.5px var(--itb-ring), 0 6px 14px rgba(24, 92, 150, .16);
  -webkit-tap-highlight-color: transparent; transition: transform .38s var(--itb-spring); }
.itb-sheet .row.down { transform: translateY(2px) scale(.97); transition-duration: .06s; }
.itb-sheet .row.pop { animation: itb-pop .42s var(--itb-spring); }
.itb-sheet .row .ic { flex: none; display: grid; place-items: center; width: 46px; height: 46px; overflow: hidden; border-radius: 16px;
  background: linear-gradient(#f4faff, #dcecf8); box-shadow: inset 0 0 0 1.5px #c9dcec; }
.itb-sheet .row .ic svg { width: 30px; height: 30px; }
.itb-sheet .row .ic canvas { width: 52px; height: 52px; margin-top: 2px; image-rendering: pixelated; }
.itb-sheet .row .tx { min-width: 0; }
.itb-sheet .row small { display: block; margin-top: 3px; font: 700 13px/1.2 var(--itb-ui); color: var(--itb-soft); }
.itb-sheet .row .go { margin-left: auto; font-size: 28px; line-height: 1; color: #9bbad6; }
.itb-sheet .privacy { margin: 16px 4px 0; color: var(--itb-soft); font: 600 13px/1.45 var(--itb-ui); }
.itb-sheet .privacy b { color: var(--itb-ink); font-weight: 800; }
.itb-sheet .dnc { display: block; width: max-content; margin: 2px auto 0; padding: 16px 14px; color: #c22a20; font: 700 11px Silkscreen, monospace; text-decoration: none; opacity: .75; }
@keyframes itb-pop { 0% { transform: translateY(2px) scale(.96); } 45% { transform: translateY(-3px) scale(1.035); } 100% { transform: none; } }

/* ---------- desktop: one top row (wordmark, tabs, account) ---------- */
@media (min-width: 900px) {
  :root { --itb-tabbar: 0px; }
  body { padding-bottom: 0; }
  .itb-top { height: 76px; padding: 14px 32px 0; }
  .itb-wm { font-size: 36px; }
  body[data-itb-page="home"] .itb-top { display: flex; }
  body[data-itb-page="home"] .itb-wm { visibility: hidden; }     /* the home has its own big wordmark */
  .itb-tabs { position: static; display: flex; gap: 10px; height: auto; max-width: none; margin: 0 0 0 auto; padding: 0; border-radius: 0;
    background: none; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .itb-tabs a, .itb-tabs button { flex-direction: row; gap: 6px; height: 48px; padding: 0 16px 2px 12px; border-radius: 99px; font: 800 15px/1 var(--itb-ui); color: var(--itb-wii-ink);
    background: linear-gradient(var(--itb-gl-a) 0 40%, var(--itb-gl-b)); box-shadow: inset 0 -3px 0 rgba(40, 100, 160, .12), 0 0 0 2px var(--itb-halo), 0 0 0 3.5px var(--itb-ring), 0 4px 10px rgba(24, 92, 150, .18); }
  .itb-tabs .ti { width: 24px; height: 24px; } .itb-tabs .ti svg { width: 22px; height: 22px; }
  .itb-tabs .t-home, .itb-tabs .t-me { display: none; }
  .itb-tabs .on { transform: none; color: #fff; background: linear-gradient(#6fd0ff 0 30%, #1798ec); }
  .itb-tabs .on::before { display: none; }
  .itb-tabs .tw { display: inline; } .itb-tabs .tl { display: none; }
  .itb-acct { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; max-width: 260px; margin-left: 10px; padding: 0 16px 2px 6px; border-radius: 99px;
    background: linear-gradient(var(--itb-gl-a) 0 40%, var(--itb-gl-b)); color: var(--itb-wii-ink); font: 800 15px/1 var(--itb-ui); text-decoration: none;
    box-shadow: inset 0 -3px 0 rgba(40, 100, 160, .12), 0 0 0 2px var(--itb-halo), 0 0 0 3.5px var(--itb-ring), 0 4px 10px rgba(24, 92, 150, .18); }
  .itb-acct.out { padding: 0 18px 2px 14px; }
  .itb-acct.out svg { width: 20px; height: 20px; color: #9146ff; }
  .itb-acct .av { flex: none; width: 38px; height: 38px; overflow: hidden; border-radius: 50%; background: linear-gradient(#e3f1fc, #fff); box-shadow: inset 0 0 0 1.5px #c9dcec; }
  .itb-acct .av canvas { width: 50px; height: 50px; margin: -8px 0 0 -6px; image-rendering: pixelated; }
  .itb-acct .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  @media (hover: hover) { .itb-tabs a:hover, .itb-tabs button:hover, .itb-acct:hover { box-shadow: inset 0 -3px 0 rgba(40, 100, 160, .12), 0 0 0 2px var(--itb-halo-s), 0 0 0 5px var(--itb-wii-l), 0 4px 10px rgba(24, 92, 150, .18); } }
  .itb-sheet { bottom: auto; top: 50%; max-width: 480px; max-height: 88vh; max-height: calc(100dvh - 48px); border-radius: 30px; transform: translateY(-40%) scale(.92); opacity: 0;
    transition: transform .38s var(--itb-spring), opacity .15s; }
  body.itb-sheet-open .itb-sheet { transform: translateY(-50%); opacity: 1; }
  .itb-sheet .grab { display: none; }
}
@media (prefers-reduced-motion: reduce) { .itb-tabs a, .itb-tabs button, .itb-sheet, .itb-sheet .row { transition: none !important; } .itb-sheet .row.pop { animation: none !important; } }

/* ---------- colour scheme toggle (10-10): a round gloss button at the right of the top row, + a row in the Guide sheet ---------- */
.itb-theme { flex: none; order: 1; display: grid; place-items: center; width: 40px; height: 40px; margin: 0 auto 0 2px; padding: 0;     /* phone: right after the
  wordmark, because the right of the row belongs to the page (/me: Admin, Log out) */ border: 0; border-radius: 50%; cursor: pointer;
  background: linear-gradient(var(--itb-gl-a) 0 40%, var(--itb-gl-b)); box-shadow: inset 0 -3px 0 rgba(40, 100, 160, .12), 0 0 0 2px var(--itb-halo-s), 0 0 0 3.5px var(--itb-ring);
  -webkit-tap-highlight-color: transparent; transition: transform .38s var(--itb-spring); }
.itb-theme svg { width: 22px; height: 22px; }
.itb-theme:active { transform: translateY(2px) scale(.92); transition-duration: .06s; }
.itb-sheet .row .sw { flex: none; position: relative; width: 50px; height: 30px; margin-left: auto; border-radius: 99px; background: #c6d4e2; transition: background .2s; }
.itb-sheet .row .sw::after { content: ""; position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .3s var(--itb-spring); }
.itb-sheet .row[aria-checked="true"] .sw { background: linear-gradient(#6fd0ff, #1798ec); }
.itb-sheet .row[aria-checked="true"] .sw::after { transform: translateX(20px); }
button.row { width: 100%; border: 0; text-align: left; cursor: pointer; }
@media (min-width: 900px) { .itb-theme { order: 9; margin: 0 0 0 10px; width: 48px; height: 48px; } }

/* ---------- dark mode (10-10): the same plaza at night. Wii blue stays the accent; surfaces go deep navy, never purple ---------- */
:root[data-theme="dark"] {
  color-scheme: dark;
  --itb-ink: #e4edf6; --itb-soft: #9cb1c6; --itb-navy: #d4e9ff; --itb-wii-ink: #8fd0ff;
  --itb-ring: #2e4c69; --itb-lift: 0 8px 22px rgba(0, 0, 0, .4);
  --itb-page: #0c1724;
  --itb-gl-a: #243b54; --itb-gl-b: #1a2e44;
  --itb-halo: rgba(255, 255, 255, .06); --itb-halo-s: rgba(255, 255, 255, .14);
}
/* the plaza (still + 3D) at dusk: dimmed, a touch bluer, so the page reads over it */
[data-theme="dark"] .itb-still { filter: brightness(.62) saturate(.9); }
[data-theme="dark"] .itb-still::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: #3d5f92; mix-blend-mode: multiply; }
/* home + /me: your blob stands in the 3D, so that layer only dims (no blue tint: a pink blob must stay pink) */
[data-theme="dark"] .p3d .p3d-still, [data-theme="dark"] .p3d canvas.p3d-gl { filter: brightness(.68) saturate(.95); }
[data-theme="dark"] .p3d::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;     /* a night sky over the top, clear of the blob */
  background: linear-gradient(rgba(12, 23, 36, .82) 0, rgba(12, 23, 36, .45) 22%, rgba(12, 23, 36, 0) 44%); }
[data-theme="dark"] .itb-logo .lo-dot { box-shadow: none; }
[data-theme="dark"] .itb-tabs { background: rgba(20, 35, 52, .94); box-shadow: 0 0 0 2px rgba(255, 255, 255, .08), 0 0 0 3.5px #2e4c69, 0 10px 26px rgba(0, 0, 0, .45); }
[data-theme="dark"] .itb-tabs a, [data-theme="dark"] .itb-tabs button { color: #a9bed3; }
[data-theme="dark"] .itb-tabs .on { color: #fff; }
[data-theme="dark"] .itb-scrim { background: rgba(4, 10, 18, .55); }
[data-theme="dark"] .itb-sheet { background: linear-gradient(#1a2c41, #111f30 160px); box-shadow: 0 -8px 30px rgba(0, 0, 0, .5); }
[data-theme="dark"] .itb-sheet .grab, [data-theme="dark"] .itb-sheet .row .sw { background: #2e4c69; }
[data-theme="dark"] .itb-sheet .row .ic { background: linear-gradient(#2a4560, #1d3349); box-shadow: inset 0 0 0 1.5px #34536f; }
[data-theme="dark"] .itb-sheet .row .go { color: #5f7e9c; }
[data-theme="dark"] .itb-sheet .dnc { color: #ff7a70; }
[data-theme="dark"] .itb-acct .av { background: linear-gradient(#22394f, #16273a); box-shadow: inset 0 0 0 1.5px #2e4c69; }
@media (min-width: 900px) { [data-theme="dark"] .itb-tabs { background: none; box-shadow: none; } [data-theme="dark"] .itb-tabs a, [data-theme="dark"] .itb-tabs button { color: var(--itb-wii-ink); } }
[data-theme="dark"] .itb-sheet .sheethead { background: #1a2c41; box-shadow: 0 1px 0 rgba(0, 0, 0, .3); }
/* 10-11 sleep (chrome.js setSleep): window not focused/hovered or tab hidden = CSS animations hold still */
.itb-asleep *, .itb-asleep *::before, .itb-asleep *::after { animation-play-state: paused !important; }
