/* =====================================================================
   Bubble-Shooter.org theme — shared by the game (bs.css = theme.css + game styles) and the site.
   Owner: game engineer (part B). Variable names (--bs-*) and the classes below are a stable contract.

   Look: "bright lagoon". Site light by default with a dark theme; the game shell is a deep lagoon blue in both
   themes, the playfield has its own selectable themes (drawn on the canvas).

   Theme switching (attribute on <html>; the game's Settings toggle sets it at runtime):
     data-theme="dark" | "light"   absent = follow prefers-color-scheme   (localStorage bs_theme)
   Pre-paint (site <head>, avoids a flash of the wrong theme):
     <script>try{var t=localStorage.getItem('bs_theme');if(t)document.documentElement.dataset.theme=t}catch(e){}</script>

   Fonts (self-hosted, SIL OFL; URLs relative to this file, keep fonts/ next to bs.css / theme.css = /game/fonts/):
     --bs-font     Geologica (variable 100–900): latin, latin-ext, cyrillic, cyrillic-ext, greek
     --bs-display  Fredoka (variable 300–700, latin + latin-ext): logo, score digits, short Latin labels.
                   For headings in other scripts the stack falls back to Geologica automatically.
     ja, ko, zh: system stacks (rules at the end).

   Static art for site illustrations (same colours as the game):
     <i class="bs-mb bs-c1"></i>          bubble; bs-c1 … bs-c6 = yellow red turquoise purple blue green
                                          size via --bs-mb (default 28px); add bs-mb--sym for the colour-blind symbol
     <i class="bs-mb bs-p-bomb"></i>      special bubble: bs-p-bomb | bs-p-rainbow | bs-p-fire | bs-p-bolt | bs-p-stone
     /game/art/*.svg                      bubble-<colour>.svg, bubble-<colour>-sym.svg, special-<type>.svg (64×64)
   ===================================================================== */

@font-face { font-family: 'Geologica'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(fonts/geologica-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Geologica'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(fonts/geologica-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Geologica'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(fonts/geologica-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Geologica'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(fonts/geologica-cyrillic-ext.woff2) format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: 'Geologica'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(fonts/geologica-greek.woff2) format('woff2');
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF; }
@font-face { font-family: 'Fredoka'; font-style: normal; font-weight: 300 700; font-display: swap;
  src: url(fonts/fredoka-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Fredoka'; font-style: normal; font-weight: 300 700; font-display: swap;
  src: url(fonts/fredoka-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  color-scheme: light;
  --bs-font: 'Geologica', system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans', sans-serif;
  --bs-display: 'Fredoka', 'Geologica', system-ui, sans-serif;

  /* brand */
  --bs-lagoon: #14c6d0;
  --bs-aqua: #5ff0e4;
  --bs-coral: #ff6b5e;
  --bs-sun: #ffcf3f;
  --bs-violet: #9a6bff;
  --bs-deep: #062c47;
  --bs-deep-2: #0b3d5e;
  --bs-deep-3: #125279;

  --bs-radius-sm: 10px;
  --bs-radius: 16px;
  --bs-radius-lg: 24px;

  /* site surfaces (light) */
  --bs-ink: #0d2338;
  --bs-soft: #4b6278;
  --bs-line: rgba(13, 35, 56, .12);
  --bs-bg: #f2f9fc;
  --bs-bg-image: radial-gradient(1100px 520px at 50% -220px, #d4f4f6 0%, rgba(212, 244, 246, 0) 70%), linear-gradient(180deg, #f6fcfe 0%, #ecf5f9 100%);
  --bs-card: #ffffff;
  --bs-card-2: #e9f5f8;
  --bs-link: #0a6fb8;
  --bs-accent: #d8463a;           /* coral, darkened for text contrast on light */
  --bs-accent-2: #0a8f98;         /* lagoon, darkened */
  --bs-on-accent: #ffffff;
  --bs-btn: #ffffff;
  --bs-btn-ink: #0f2a40;
  --bs-btn-border: rgba(13, 35, 56, .14);
  --bs-focus: 0 0 0 3px rgba(20, 198, 208, .65);
  --bs-shadow: 0 10px 30px rgba(6, 44, 71, .12);
  --bs-shadow-lg: 0 30px 80px rgba(2, 16, 30, .45);
  --bs-danger: #cc2f3f;
  --bs-ok: #14895a;
  --sb-thumb: rgba(10, 143, 152, .55);
  --sb-thumb-hover: rgba(10, 143, 152, .8);
  --sb-track: transparent;

  /* game shell (same in both themes) */
  --bs-shell: #062c47;
  --bs-shell-edge: #1a5a80;
  --bs-hud-ink: #effcff;
  --bs-hud-soft: #9cc6da;
  --bs-hud-btn: rgba(255, 255, 255, .08);
  --bs-hud-btn-hover: rgba(255, 255, 255, .17);
  --bs-panel: #0a3150;
  --bs-panel-2: #104269;
  --bs-panel-line: rgba(255, 255, 255, .11);
  --bs-panel-ink: #effcff;
  --bs-panel-soft: #a7cadb;
  --bs-overlay: rgba(2, 18, 32, .62);

  /* bubble colours: main / light / dark (order = game colour ids 0…5) */
  --bs-c1: #ffcc2e; --bs-c1l: #fff3b0; --bs-c1d: #d48a00;   /* yellow */
  --bs-c2: #ff4b55; --bs-c2l: #ffb3b3; --bs-c2d: #b8162b;   /* red */
  --bs-c3: #1fdcc8; --bs-c3l: #b5fff4; --bs-c3d: #07928f;   /* turquoise */
  --bs-c4: #a463ff; --bs-c4l: #e1c9ff; --bs-c4d: #6224c4;   /* purple */
  --bs-c5: #3a86ff; --bs-c5l: #b8d6ff; --bs-c5d: #1446b8;   /* blue */
  --bs-c6: #4fd85a; --bs-c6l: #c6ffbf; --bs-c6d: #158a2c;   /* green */

  /* special bubbles */
  --bs-p-bomb: #2b3446; --bs-p-rainbow: #ffffff; --bs-p-fire: #ff7a1a; --bs-p-bolt: #ffe14d; --bs-p-stone: #8c97a8;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bs-ink: #eaf8ff;
  --bs-soft: #a5c3d4;
  --bs-line: rgba(255, 255, 255, .1);
  --bs-bg: #04192b;
  --bs-bg-image: radial-gradient(1100px 520px at 50% -220px, #0d4566 0%, rgba(13, 69, 102, 0) 70%), linear-gradient(180deg, #051e33 0%, #031322 100%);
  --bs-card: #0a2a43;
  --bs-card-2: #0e3552;
  --bs-link: #6fd9ff;
  --bs-accent: #ff7d70;
  --bs-accent-2: #3fe3e0;
  --bs-btn: #0e3552;
  --bs-btn-ink: #e3f6ff;
  --bs-btn-border: rgba(255, 255, 255, .13);
  --bs-shadow: 0 12px 34px rgba(0, 0, 0, .5);
  --bs-danger: #ff7b86;
  --bs-ok: #52d99a;
  --sb-thumb: rgba(255, 255, 255, .28);
  --sb-thumb-hover: rgba(255, 255, 255, .45);
}
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) {
    color-scheme: dark;
    --bs-ink: #eaf8ff;
    --bs-soft: #a5c3d4;
    --bs-line: rgba(255, 255, 255, .1);
    --bs-bg: #04192b;
    --bs-bg-image: radial-gradient(1100px 520px at 50% -220px, #0d4566 0%, rgba(13, 69, 102, 0) 70%), linear-gradient(180deg, #051e33 0%, #031322 100%);
    --bs-card: #0a2a43;
    --bs-card-2: #0e3552;
    --bs-link: #6fd9ff;
    --bs-accent: #ff7d70;
    --bs-accent-2: #3fe3e0;
    --bs-btn: #0e3552;
    --bs-btn-ink: #e3f6ff;
    --bs-btn-border: rgba(255, 255, 255, .13);
    --bs-shadow: 0 12px 34px rgba(0, 0, 0, .5);
    --bs-danger: #ff7b86;
    --bs-ok: #52d99a;
    --sb-thumb: rgba(255, 255, 255, .28);
    --sb-thumb-hover: rgba(255, 255, 255, .45);
  }
}

/* ---- static art for site illustrations ---- */
.bs-c1 { --c: var(--bs-c1); --cl: var(--bs-c1l); --cd: var(--bs-c1d); }
.bs-c2 { --c: var(--bs-c2); --cl: var(--bs-c2l); --cd: var(--bs-c2d); }
.bs-c3 { --c: var(--bs-c3); --cl: var(--bs-c3l); --cd: var(--bs-c3d); }
.bs-c4 { --c: var(--bs-c4); --cl: var(--bs-c4l); --cd: var(--bs-c4d); }
.bs-c5 { --c: var(--bs-c5); --cl: var(--bs-c5l); --cd: var(--bs-c5d); }
.bs-c6 { --c: var(--bs-c6); --cl: var(--bs-c6l); --cd: var(--bs-c6d); }
.bs-p-bomb { --c: #3a4560; --cl: #8a97b8; --cd: #121826; }
.bs-p-fire { --c: #ff7a1a; --cl: #ffd29a; --cd: #b83a00; }
.bs-p-bolt { --c: #ffd83a; --cl: #fff6c2; --cd: #c08a00; }
.bs-p-stone { --c: #8c97a8; --cl: #d5dbe4; --cd: #4c5566; }
.bs-p-rainbow { --c: #fff; --cl: #fff; --cd: #9aa; }
.bs-mb {
  --w: var(--bs-mb, 28px);
  position: relative; display: inline-block; box-sizing: border-box; width: var(--w); height: var(--w); vertical-align: middle;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #fff 0 9%, var(--cl) 16%, var(--c) 52%, var(--cd) 100%);
  box-shadow: inset 0 calc(var(--w) * -.06) calc(var(--w) * .12) rgba(0, 0, 0, .25), 0 calc(var(--w) * .04) calc(var(--w) * .1) rgba(0, 0, 0, .18);
}
.bs-mb.bs-p-rainbow { background: radial-gradient(circle at 34% 30%, #fff 0 10%, rgba(255, 255, 255, 0) 30%), conic-gradient(#ff4b55, #ffcc2e, #4fd85a, #1fdcc8, #3a86ff, #a463ff, #ff4b55); }
.bs-mb.bs-p-bomb::after, .bs-mb.bs-p-fire::after, .bs-mb.bs-p-bolt::after, .bs-mb.bs-p-stone::after, .bs-mb--sym::after {
  content: ''; position: absolute; inset: 22%; background: rgba(255, 255, 255, .92);
  -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat;
}
.bs-mb.bs-p-bolt::after { background: rgba(80, 50, 0, .85); }
.bs-mb.bs-p-bomb { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='14' r='7'/%3E%3Cpath d='M15 8l3-3M18 3v2M21 5h-2' stroke='%23000' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); }
.bs-mb.bs-p-fire { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2c1 4 6 6 6 12a6 6 0 0 1-12 0c0-3 2-5 3-6 0 2 1 3 2 3 0-3-1-6 1-9z'/%3E%3C/svg%3E"); }
.bs-mb.bs-p-bolt { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M13 2L4 14h7l-1 8 9-12h-7z'/%3E%3C/svg%3E"); }
.bs-mb.bs-p-stone { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 5h14v14H5z' fill='none' stroke='%23000' stroke-width='3'/%3E%3C/svg%3E"); }
.bs-mb--sym.bs-c1 { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2l2.9 6.6 7.1.6-5.4 4.7 1.6 7.1L12 17.3 5.8 21l1.6-7.1L2 9.2l7.1-.6z'/%3E%3C/svg%3E"); }
.bs-mb--sym.bs-c2 { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 3l10 18H2z'/%3E%3C/svg%3E"); }
.bs-mb--sym.bs-c3 { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 1l11 11-11 11L1 12z'/%3E%3C/svg%3E"); }
.bs-mb--sym.bs-c4 { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 2h6v7h7v6h-7v7H9v-7H2V9h7z'/%3E%3C/svg%3E"); }
.bs-mb--sym.bs-c5 { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 3h18v18H3z'/%3E%3C/svg%3E"); }
.bs-mb--sym.bs-c6 { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm0 5a5 5 0 1 1 0 10 5 5 0 0 1 0-10z'/%3E%3C/svg%3E"); }

/* system fonts where Geologica has no glyphs */
:lang(zh), :lang(zh-Hans) { --bs-font: system-ui, -apple-system, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', sans-serif; --bs-display: 'Fredoka', system-ui, 'PingFang SC', 'Microsoft YaHei', sans-serif; }
:lang(ja) { --bs-font: system-ui, -apple-system, 'Segoe UI', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Yu Gothic UI', Meiryo, 'Noto Sans JP', sans-serif; --bs-display: 'Fredoka', system-ui, 'Hiragino Sans', 'Yu Gothic UI', Meiryo, sans-serif; }
:lang(ko) { --bs-font: system-ui, -apple-system, 'Segoe UI', 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans KR', sans-serif; --bs-display: 'Fredoka', system-ui, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif; }
