/* ============================================================
   BeeGlyph — "the hive".

   Warm wax and honey instead of the cold neon cabinet. The comb is real
   wax: outer cells are dark, waxy hexes; the centre cell is a cell already
   full of honey. Every word you find pours honey into the jar; the jar
   fills toward the day's maximum; crossing a rank makes the whole hive
   glow; a pangram sends a bee across the card; finishing fills every cell
   of the comb.

   Scope: body.bg-hive and the game card .bgCard. Site chrome, SEO/FAQ
   cards and the dialogs keep their own styling. Theme contract as the
   other worlds: --hv-* tokens, redeclared for :root[data-theme="light"],
   selectors prefixed with :root so they outrank the site's light rules.
   ============================================================ */

:root body.bg-hive{
  --hv-display: 'Fredoka', 'Outfit', system-ui, sans-serif;

  /* wood + wax */
  --hv-wood-0: #120b04;
  --hv-wood-1: #1c1208;
  --hv-wood-2: #28190a;
  --hv-wood-3: #3a2810;
  --hv-wax:    #4a3416;
  --hv-wax-hi: #6a4b1f;
  --hv-wax-lo: #2f200b;
  --hv-edge-hi: rgba(255,225,160,.10);
  --hv-edge-lo: rgba(0,0,0,.55);

  /* honey */
  --hv-honey:    #ffb52e;
  --hv-honey-hi: #ffe08a;
  --hv-honey-lo: #c77f0c;
  --hv-honey-ink:#2a1a00;
  --hv-glow:     rgba(255,181,46,.45);
  --hv-glow-soft:rgba(255,181,46,.16);
  --hv-line:     rgba(255,181,46,.24);
  --hv-line-soft:rgba(255,181,46,.12);

  /* ink */
  --hv-ink: #fff3d6;
  --hv-dim: #c9b48f;
  --hv-gold-text: #ffcf5a;

  /* states */
  --hv-bad:      #ff6a5a;
  --hv-bad-glow: rgba(255,106,90,.35);
  --hv-stripe:   #1a1206;

  --hv-drop: rgba(0,0,0,.55);
  --hv-glow-scale: 1;
}

:root[data-theme="light"] body.bg-hive{
  --hv-wood-0: #f1e3c4;
  --hv-wood-1: #fbf1d9;
  --hv-wood-2: #fff8e8;
  --hv-wood-3: #ffffff;
  --hv-wax:    #f6e2b0;
  --hv-wax-hi: #fff3d2;
  --hv-wax-lo: #e2c98a;
  --hv-edge-hi: rgba(255,255,255,.9);
  --hv-edge-lo: rgba(80,50,10,.16);

  --hv-honey:    #ffb52e;
  --hv-honey-hi: #ffe08a;
  --hv-honey-lo: #d28a10;
  --hv-honey-ink:#2a1a00;
  --hv-glow:     rgba(255,181,46,.40);
  --hv-glow-soft:rgba(255,181,46,.18);
  --hv-line:     rgba(160,110,20,.30);
  --hv-line-soft:rgba(160,110,20,.14);

  --hv-ink: #2a2418;
  --hv-dim: #6b5a3a;
  --hv-gold-text: #8a5a00;

  --hv-bad:      #c8402e;
  --hv-bad-glow: rgba(200,64,46,.22);
  --hv-stripe:   #2a2418;

  --hv-drop: rgba(80,50,10,.18);
  --hv-glow-scale: .5;
}

/* ------------------------------------------------------------
   The hive box
   ------------------------------------------------------------ */
:root body.bg-hive .card.bgCard{
  position: relative;
  isolation: isolate;
  overflow: visible;
  padding: 16px 16px 16px;
  border-radius: 22px;
  border: 1px solid var(--hv-line);
  color: var(--hv-ink);
  background:
    radial-gradient(90% 50% at 50% 0%, var(--hv-glow-soft), transparent 60%),
    repeating-linear-gradient(90deg, rgba(255,225,160,.025) 0 2px, transparent 2px 9px),
    linear-gradient(180deg, var(--hv-wood-2), var(--hv-wood-1) 45%, var(--hv-wood-0));
  box-shadow:
    inset 0 1px 0 var(--hv-edge-hi),
    inset 0 0 0 1px rgba(0,0,0,.2),
    0 24px 60px var(--hv-drop);
}
/* Faint comb pattern in the wood, and a wax rim. */
:root body.bg-hive .card.bgCard::before{
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 0;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='104' viewBox='0 0 120 104'%3E%3Cg fill='none' stroke='%23FFB52E' stroke-opacity='0.5' stroke-width='2'%3E%3Cpath d='M30 2 L60 18 L60 50 L30 66 L0 50 L0 18 Z'/%3E%3Cpath d='M90 2 L120 18 L120 50 L90 66 L60 50 L60 18 Z'/%3E%3Cpath d='M60 50 L90 66 L90 98 L60 114 L30 98 L30 66 Z'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 120px 104px;
  opacity: .07;
  mix-blend-mode: normal;
  transform: none;
}
:root body.bg-hive .card.bgCard::after{
  content: "";
  position: absolute; inset: 7px;
  border-radius: 16px;
  border: 1px solid var(--hv-line-soft);
  pointer-events: none;
  z-index: 0;
  background: none;
  opacity: 1;
  transform: none;
  mix-blend-mode: normal;
}
:root body.bg-hive .card.bgCard > *{ position: relative; z-index: 1; }
@keyframes hvHiveGlow{
  0%   { box-shadow: inset 0 1px 0 var(--hv-edge-hi), 0 0 0 0 var(--hv-glow), 0 24px 60px var(--hv-drop); }
  40%  { box-shadow: inset 0 1px 0 var(--hv-edge-hi), 0 0 0 12px transparent, 0 0 70px var(--hv-glow), 0 24px 60px var(--hv-drop); }
  100% { box-shadow: inset 0 1px 0 var(--hv-edge-hi), 0 0 0 0 transparent, 0 0 20px var(--hv-glow-soft), 0 24px 60px var(--hv-drop); }
}
:root body.bg-hive .card.bgCard.hvGlow{ animation: hvHiveGlow 1.4s ease-out; }
:root body.bg-hive .card.bgCard.hvComplete{ border-color: var(--hv-honey); box-shadow: inset 0 1px 0 var(--hv-edge-hi), 0 0 40px var(--hv-glow-soft), 0 24px 60px var(--hv-drop); }

/* ------------------------------------------------------------
   Top row: date, score, sound
   ------------------------------------------------------------ */
:root body.bg-hive .bgDate{
  font-family: var(--hv-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .06em;
  color: var(--hv-gold-text);
  opacity: 1;
}
:root body.bg-hive .bgRule{ color: var(--hv-dim); opacity: 1; font-size: 12.5px; }

:root body.bg-hive .bgScoreBox{
  position: relative;
  min-width: 92px;
  padding: 8px 12px 7px;
  border-radius: 14px;
  border: 1px solid var(--hv-line-soft);
  background: linear-gradient(180deg, var(--hv-wood-3), var(--hv-wood-1));
  box-shadow: inset 0 1px 0 var(--hv-edge-hi), inset 0 -2px 0 rgba(0,0,0,.25), 0 6px 14px var(--hv-drop);
  flex-direction: row;
  align-items: center;
  gap: 10px;
}
:root body.bg-hive .bgScoreBox .bgScoreLabel{
  font-family: var(--hv-display);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--hv-dim);
  opacity: 1;
}
:root body.bg-hive .bgScoreBox .bgScoreVal{
  font-family: var(--hv-display);
  font-weight: 700;
  font-size: 26px;
  color: var(--hv-gold-text);
  text-shadow: 0 0 calc(14px * var(--hv-glow-scale)) var(--hv-glow-soft);
}
:root[data-theme="light"] body.bg-hive .bgScoreBox .bgScoreVal{ text-shadow: none; }
:root body.bg-hive .bgScoreBox .nxSound{
  position: static;
  width: 32px; height: 32px; padding: 0;
  border-radius: 50%;
  border: 1px solid var(--hv-line);
  background: var(--hv-wood-0);
  color: var(--hv-gold-text);
  font-size: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  box-shadow: inset 0 1px 0 var(--hv-edge-hi);
  margin: 0;
  order: 3;
}
:root body.bg-hive .bgScoreBox .nxSound[aria-pressed="false"]{ opacity: .6; }
:root body.bg-hive .bgScoreBox > div{ display: flex; flex-direction: column; align-items: flex-end; }

/* ------------------------------------------------------------
   The jar (progress)
   ------------------------------------------------------------ */
:root body.bg-hive .bgProgress{
  margin-top: 10px;
  padding: 10px 12px 9px;
  border-radius: 16px;
  border: 1px solid var(--hv-line-soft);
  background: linear-gradient(180deg, rgba(0,0,0,.14), rgba(0,0,0,.28));
  box-shadow: inset 0 1px 0 rgba(0,0,0,.2), inset 0 -1px 0 var(--hv-edge-hi);
  display: grid;
  grid-template-columns: 44px 1fr;
  grid-template-areas: "jar rank" "jar bar" "jar meta";
  column-gap: 12px;
  align-items: center;
}
:root[data-theme="light"] body.bg-hive .bgProgress{ background: linear-gradient(180deg, rgba(120,80,20,.05), rgba(120,80,20,.09)); }
:root body.bg-hive .bgRankRow{ grid-area: rank; margin-bottom: 6px; }
:root body.bg-hive .bgBar{ grid-area: bar; }
:root body.bg-hive .bgBarMeta{ grid-area: meta; margin-top: 6px; color: var(--hv-dim); opacity: 1; }
:root body.bg-hive .hvJar{ grid-area: jar; width: 44px; height: 56px; align-self: center; filter: drop-shadow(0 4px 8px var(--hv-drop)); }
:root body.bg-hive .hvJar .glass{ fill: rgba(255,240,200,.08); stroke: var(--hv-honey-lo); stroke-width: 1.6; }
:root[data-theme="light"] body.bg-hive .hvJar .glass{ fill: rgba(255,255,255,.7); }
:root body.bg-hive .hvJar .lid{ fill: var(--hv-wax-lo); stroke: var(--hv-honey-lo); stroke-width: 1.2; }
:root body.bg-hive .hvJar .honey{ fill: url(#hvHoneyGrad); transition: transform .5s cubic-bezier(.2,.8,.2,1); transform-origin: 50% 100%; }
:root body.bg-hive .hvJar .shine{ fill: rgba(255,255,255,.35); }

:root body.bg-hive .bgRankRow .mono#rankName{
  font-family: var(--hv-display);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: .04em;
  color: var(--hv-honey-hi);
}
:root[data-theme="light"] body.bg-hive .bgRankRow .mono#rankName{ color: var(--hv-gold-text); }
:root body.bg-hive .bgRankRow .muted.mono{ font-family: var(--hv-display); font-weight: 700; color: var(--hv-dim); font-size: 13px; }
:root body.bg-hive .bgBar{
  height: 12px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.35);
  background: var(--hv-wood-0);
  box-shadow: inset 0 2px 4px rgba(0,0,0,.5), 0 1px 0 var(--hv-edge-hi);
}
:root[data-theme="light"] body.bg-hive .bgBar{ background: #e9d9b3; border-color: rgba(120,80,20,.2); box-shadow: inset 0 2px 4px rgba(80,50,10,.18); }
:root body.bg-hive .bgBarFill{
  background:
    linear-gradient(180deg, rgba(255,255,255,.35), transparent 45%),
    linear-gradient(90deg, var(--hv-honey-lo), var(--hv-honey) 55%, var(--hv-honey-hi));
  box-shadow: 0 0 12px var(--hv-glow);
  transition: width .5s cubic-bezier(.2,.8,.2,1);
}
:root body.bg-hive .bgBarMeta .mono{ color: var(--hv-gold-text); font-weight: 800; }

:root body.bg-hive .bgHint{ color: var(--hv-dim); }
:root body.bg-hive .msg{ color: var(--hv-ink); font-weight: 600; }
:root body.bg-hive .msg:not(:empty)::before{ content: "🍯 "; }

/* ------------------------------------------------------------
   The word (a strip of wax)
   ------------------------------------------------------------ */
:root body.bg-hive .bgWordPill{
  border-radius: 16px;
  padding: 12px 12px 11px;
  border: 1px solid var(--hv-line);
  background: linear-gradient(180deg, var(--hv-wood-0), var(--hv-wood-1));
  box-shadow: inset 0 3px 8px rgba(0,0,0,.45), inset 0 -1px 0 var(--hv-edge-hi);
  min-height: 56px;
  display: flex; align-items: center; justify-content: center;
}
:root[data-theme="light"] body.bg-hive .bgWordPill{ background: linear-gradient(180deg, #fff, var(--hv-wood-2)); box-shadow: inset 0 2px 6px rgba(80,50,10,.14); }
:root body.bg-hive .bgWord{
  font-family: var(--hv-display);
  font-weight: 700;
  font-size: 30px;
  letter-spacing: .12em;
  color: var(--hv-ink);
  text-shadow: 0 1px 0 rgba(0,0,0,.35);
}
:root[data-theme="light"] body.bg-hive .bgWord{ text-shadow: none; }
:root body.bg-hive .bgWord .req,
:root body.bg-hive .bgWord .nxLetter.req{
  color: var(--hv-honey);
  text-shadow: 0 0 calc(14px * var(--hv-glow-scale)) var(--hv-glow);
}
:root[data-theme="light"] body.bg-hive .bgWord .nxLetter.req{ color: var(--hv-gold-text); text-shadow: none; }
@keyframes hvLetterIn{ 0%{ transform: translateY(-14px) scale(.7); opacity: 0 } 60%{ transform: translateY(2px) scale(1.08); opacity: 1 } 100%{ transform: none } }
:root body.bg-hive .bgWord .nxLetter{ display: inline-block; animation: hvLetterIn .22s cubic-bezier(.2,.9,.3,1.3) both; }
@keyframes hvWordBad{ 0%,100%{ transform: none } 20%{ transform: translateX(-8px) rotate(-1.5deg) } 40%{ transform: translateX(8px) rotate(1.5deg) } 60%{ transform: translateX(-5px) } 80%{ transform: translateX(5px) } }
:root body.bg-hive .bgWord.nxBad{ animation: hvWordBad .42s ease; color: var(--hv-bad); }
@keyframes hvWordWin{ 0%{ transform: scale(1) } 35%{ transform: scale(1.12); color: var(--hv-honey-hi) } 100%{ transform: scale(1) } }
:root body.bg-hive .bgWord.nxWin{ animation: hvWordWin .5s cubic-bezier(.2,.9,.3,1.2); }

/* Chain badge: a wax tag. */
:root body.bg-hive .nxCombo{
  align-self: center;
  font-family: var(--hv-display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .06em;
  padding: 5px 12px 4px;
  border-radius: 999px;
  border: 1px solid var(--hv-honey-lo);
  background: linear-gradient(180deg, var(--hv-honey-hi), var(--hv-honey));
  color: var(--hv-honey-ink);
  box-shadow: 0 0 14px var(--hv-glow-soft);
  opacity: 0; transform: translateY(-6px) scale(.9);
  transition: opacity .2s, transform .2s;
  pointer-events: none;
}
:root body.bg-hive .nxCombo.on{ opacity: 1; transform: none; }
:root body.bg-hive .nxCombo .nxComboX{ margin-right: 6px; }

/* ------------------------------------------------------------
   The comb
   ------------------------------------------------------------ */
:root body.bg-hive .bgHoneyWrap{ margin-top: 14px; }
:root body.bg-hive .bgHoney{ gap: 8px; --hex: clamp(68px, 20vw, 96px); }
:root body.bg-hive .bgRow1, :root body.bg-hive .bgRow2, :root body.bg-hive .bgRow3{ gap: 8px; }
:root body.bg-hive .bgRow1{ transform: translateY(8px); }
:root body.bg-hive .bgRow3{ transform: translateY(-8px); }

:root body.bg-hive .bgHex{
  isolation: isolate;
  font-family: var(--hv-display);
  font-weight: 700;
  font-size: 30px;
  letter-spacing: 0;
  color: var(--hv-ink);
  border: 0;
  border-radius: 0;
  clip-path: polygon(25% 3%, 75% 3%, 100% 50%, 75% 97%, 25% 97%, 0% 50%);
  /* the cell wall */
  background: linear-gradient(180deg, var(--hv-wax-hi), var(--hv-wax-lo));
  box-shadow: none;
  text-shadow: 0 1px 0 rgba(0,0,0,.35);
  transition: transform .12s ease, filter .18s ease;
}
:root[data-theme="light"] body.bg-hive .bgHex{ text-shadow: none; background: linear-gradient(180deg, #fff, var(--hv-wax-lo)); }
/* the wax floor of the cell, inset from the wall, behind the letter */
:root body.bg-hive .bgHex::before{
  content: "";
  position: absolute; inset: 7%;
  z-index: -1;
  clip-path: polygon(25% 3%, 75% 3%, 100% 50%, 75% 97%, 25% 97%, 0% 50%);
  background: radial-gradient(70% 60% at 50% 30%, var(--hv-wax-hi), var(--hv-wax) 60%, var(--hv-wax-lo) 100%);
  pointer-events: none;
}
:root body.bg-hive .bgHex:hover{ transform: translateY(-2px); filter: brightness(1.08); }
:root body.bg-hive .bgHex:active,
:root body.bg-hive .bgHex.nxHit{ transform: scale(.94); filter: brightness(1.25); }
@keyframes hvHexHit{ 0%{ transform: scale(.9) } 60%{ transform: scale(1.06) } 100%{ transform: scale(1) } }
:root body.bg-hive .bgHex.nxHit{ animation: hvHexHit .3s cubic-bezier(.2,.9,.3,1.3); }

/* Centre: a cell already full of honey. */
:root body.bg-hive .bgHex.center{
  color: var(--hv-honey-ink);
  background: linear-gradient(180deg, var(--hv-honey-hi), var(--hv-honey-lo));
  text-shadow: 0 1px 0 rgba(255,255,255,.35);
  filter: none;
  animation: hvHoneyBreathe 3.2s ease-in-out infinite;
}
:root body.bg-hive .bgHex.center::before{
  background:
    radial-gradient(60% 45% at 40% 28%, rgba(255,255,255,.55), transparent 60%),
    radial-gradient(80% 70% at 50% 60%, var(--hv-honey-hi), var(--hv-honey) 55%, var(--hv-honey-lo) 100%);
}
:root body.bg-hive .bgHex.center::after{ content: none; }
@keyframes hvHoneyBreathe{ 0%,100%{ filter: brightness(1) } 50%{ filter: brightness(1.12) } }

/* A cell filling with honey (hive complete). */
:root body.bg-hive .bgHex.hvFull{
  color: var(--hv-honey-ink);
  background: linear-gradient(180deg, var(--hv-honey-hi), var(--hv-honey-lo));
  text-shadow: 0 1px 0 rgba(255,255,255,.35);
  animation: hvHexHit .4s cubic-bezier(.2,.9,.3,1.3);
}
:root body.bg-hive .bgHex.hvFull::before{
  background:
    radial-gradient(60% 45% at 40% 28%, rgba(255,255,255,.55), transparent 60%),
    radial-gradient(80% 70% at 50% 60%, var(--hv-honey-hi), var(--hv-honey) 55%, var(--hv-honey-lo) 100%);
}
@keyframes hvDeny{ 0%,100%{ transform: none } 25%{ transform: translateX(-6px) rotate(-1deg) } 50%{ transform: translateX(6px) rotate(1deg) } 75%{ transform: translateX(-3px) } }
:root body.bg-hive .bgHoney.nxDeny{ animation: hvDeny .42s ease; }

/* ------------------------------------------------------------
   Buttons
   ------------------------------------------------------------ */
:root body.bg-hive .bgBtn{
  font-family: var(--hv-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .04em;
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,.35);
  color: var(--hv-ink);
  background: linear-gradient(180deg, var(--hv-wood-3), var(--hv-wood-1) 55%, var(--hv-wood-0));
  box-shadow: inset 0 2px 0 var(--hv-edge-hi), inset 0 -3px 0 var(--hv-edge-lo), 0 4px 10px var(--hv-drop);
  text-shadow: 0 1px 0 rgba(0,0,0,.35);
  transition: transform .08s ease, box-shadow .08s ease, filter .15s;
}
:root[data-theme="light"] body.bg-hive .bgBtn{ text-shadow: none; border-color: rgba(120,80,20,.25); }
:root body.bg-hive .bgBtn:hover{ transform: none; filter: brightness(1.08); box-shadow: inset 0 2px 0 var(--hv-edge-hi), inset 0 -3px 0 var(--hv-edge-lo), 0 4px 10px var(--hv-drop); }
:root body.bg-hive .bgBtn:active,
:root body.bg-hive .bgBtn.hvDown{ transform: translateY(3px); box-shadow: inset 0 2px 4px rgba(0,0,0,.5); }
:root body.bg-hive .bgBtn.ghost{ color: var(--hv-dim); background: linear-gradient(180deg, var(--hv-wood-2), var(--hv-wood-0)); }
:root body.bg-hive .bgBtn.ghost:hover{ color: var(--hv-ink); }
:root body.bg-hive .bgBtn.primary,
:root body.bg-hive .bgBtn.primary:hover{
  color: var(--hv-honey-ink);
  border-color: var(--hv-honey-lo);
  background: linear-gradient(180deg, var(--hv-honey-hi), var(--hv-honey) 55%, #e0951a);
  text-shadow: 0 1px 0 rgba(255,255,255,.3);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45), inset 0 -3px 0 rgba(0,0,0,.2), 0 6px 14px var(--hv-drop);
}
:root body.bg-hive .bgBtn.share,
:root body.bg-hive .bgBtn.share:hover{
  color: var(--hv-gold-text);
  border-color: var(--hv-line);
  background: linear-gradient(180deg, var(--hv-wood-3), var(--hv-wood-1) 55%, var(--hv-wood-0));
}
:root body.bg-hive .bgBtn.compact{ font-size: 14px; }

/* ------------------------------------------------------------
   Panels: found words as wax tags, hints as comb cells
   ------------------------------------------------------------ */
:root body.bg-hive .bgPanel{
  border: 1px solid var(--hv-line-soft);
  background: linear-gradient(180deg, rgba(0,0,0,.12), rgba(0,0,0,.26));
  border-radius: 16px;
}
:root[data-theme="light"] body.bg-hive .bgPanel{ background: linear-gradient(180deg, rgba(120,80,20,.05), rgba(120,80,20,.09)); }
:root body.bg-hive .bgPanelHead .mono{
  font-family: var(--hv-display);
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  font-size: 12px;
  color: var(--hv-gold-text);
}
:root body.bg-hive .bgPanelHead .muted{ color: var(--hv-dim); font-size: 12.5px; }
:root body.bg-hive .bgWordChip{
  font-family: var(--hv-display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .06em;
  padding: 6px 11px 5px;
  border-radius: 10px;
  border: 1px solid var(--hv-line-soft);
  background: linear-gradient(180deg, var(--hv-wax-hi), var(--hv-wax));
  color: var(--hv-ink);
  box-shadow: inset 0 1px 0 var(--hv-edge-hi), 0 2px 6px var(--hv-drop);
}
@keyframes hvChipIn{ 0%{ transform: scale(.6) rotate(-6deg); opacity: 0 } 60%{ transform: scale(1.1) rotate(2deg); opacity: 1 } 100%{ transform: none } }
:root body.bg-hive .bgWordChip.nxNew{
  animation: hvChipIn .4s cubic-bezier(.2,.9,.3,1.3);
  background: linear-gradient(180deg, var(--hv-honey-hi), var(--hv-honey));
  color: var(--hv-honey-ink);
  border-color: var(--hv-honey-lo);
}
:root body.bg-hive .bgHintCard{
  border: 0;
  border-radius: 0;
  padding: 12px 6px 10px;
  clip-path: polygon(25% 3%, 75% 3%, 100% 50%, 75% 97%, 25% 97%, 0% 50%);
  background: radial-gradient(70% 60% at 50% 30%, var(--hv-wax-hi), var(--hv-wax) 60%, var(--hv-wax-lo) 100%);
}
:root body.bg-hive .bgHintN{ font-family: var(--hv-display); font-weight: 700; font-size: 20px; color: var(--hv-gold-text); }
:root[data-theme="light"] body.bg-hive .bgHintN{ color: var(--hv-ink); }
:root body.bg-hive .bgHintK{ color: var(--hv-ink); opacity: 1; font-size: 10px; }

/* ------------------------------------------------------------
   The bee, the banner
   ------------------------------------------------------------ */
:root body.bg-hive .card.bgCard > .hvBee{
  position: absolute;
  left: -70px; top: 30%;
  width: 56px; height: 44px;
  z-index: 5;
  pointer-events: none;
  opacity: 0;
  filter: drop-shadow(0 6px 8px rgba(0,0,0,.35));
}
:root body.bg-hive .hvBee .wing{ fill: rgba(255,255,255,.55); stroke: rgba(255,255,255,.7); stroke-width: .8; transform-origin: 60% 80%; }
:root body.bg-hive .hvBee .body{ fill: var(--hv-honey); stroke: var(--hv-stripe); stroke-width: 1.2; }
:root body.bg-hive .hvBee .stripe{ fill: var(--hv-stripe); }
:root body.bg-hive .hvBee .head{ fill: var(--hv-stripe); }
:root body.bg-hive .hvBee .eye{ fill: #fff; }
@keyframes hvFly{
  0%   { left: -70px; top: 34%; opacity: 0; transform: rotate(-6deg); }
  8%   { opacity: 1; }
  30%  { top: 22%; transform: rotate(4deg); }
  55%  { top: 36%; transform: rotate(-4deg); }
  80%  { top: 24%; transform: rotate(3deg); }
  94%  { opacity: 1; }
  100% { left: calc(100% + 30px); top: 30%; opacity: 0; transform: rotate(-2deg); }
}
@keyframes hvFlap{ 0%,100%{ transform: scaleY(1) } 50%{ transform: scaleY(.25) } }
:root body.bg-hive .card.bgCard > .hvBee.fly{ animation: hvFly 2.1s cubic-bezier(.3,.1,.7,.9) forwards; }
:root body.bg-hive .hvBee.fly .wing{ animation: hvFlap .08s linear infinite; }

/* The little resident bee in the corner of the box. */
:root body.bg-hive .card.bgCard > .hvBeeIdle{
  position: absolute;
  right: 18px; top: -16px;
  width: 34px; height: 27px;
  z-index: 3;
  pointer-events: none;
  animation: hvHover 3.4s ease-in-out infinite;
}
:root body.bg-hive .hvBeeIdle .wing{ fill: rgba(255,255,255,.5); stroke: rgba(255,255,255,.6); stroke-width: .8; transform-origin: 60% 80%; animation: hvFlap .12s linear infinite; }
:root body.bg-hive .hvBeeIdle .body{ fill: var(--hv-honey); stroke: var(--hv-stripe); stroke-width: 1.2; }
:root body.bg-hive .hvBeeIdle .stripe{ fill: var(--hv-stripe); }
:root body.bg-hive .hvBeeIdle .head{ fill: var(--hv-stripe); }
:root body.bg-hive .hvBeeIdle .eye{ fill: #fff; }
@keyframes hvHover{ 0%,100%{ transform: translateY(0) rotate(-3deg) } 50%{ transform: translateY(-5px) rotate(3deg) } }

:root body.bg-hive .nxBanner{
  font-family: var(--hv-display);
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--hv-honey-ink);
  background: linear-gradient(180deg, var(--hv-honey-hi), var(--hv-honey));
  border: 2px solid var(--hv-honey-lo);
  box-shadow: 0 0 40px var(--hv-glow), 0 20px 50px rgba(0,0,0,.4);
  text-shadow: 0 1px 0 rgba(255,255,255,.35);
}

/* Rank banner (the element is in the page; its base rules lived in the
   neon skin). */
:root body.bg-hive .nxBanner{
  position: fixed; left: 50%; top: 34%;
  transform: translate(-50%, 0);
  z-index: 10058;
  pointer-events: none;
  text-align: center;
  font-size: clamp(24px, 7vw, 40px);
  line-height: 1.1;
  padding: 12px 28px 10px;
  border-radius: 18px;
  opacity: 0;
}
@keyframes hvBannerIn{
  0%   { opacity: 0; transform: translate(-50%, 20px) scale(.8); }
  18%  { opacity: 1; transform: translate(-50%, 0) scale(1.06); }
  30%  { transform: translate(-50%, 0) scale(1); }
  80%  { opacity: 1; transform: translate(-50%, 0) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -24px) scale(.96); }
}
:root body.bg-hive .nxBanner.on{ animation: hvBannerIn 1.5s cubic-bezier(.2,.8,.25,1) forwards; }
@media (prefers-reduced-motion: reduce){ :root body.bg-hive .nxBanner.on{ animation-duration: .01ms; } }

/* ------------------------------------------------------------
   Phones
   ------------------------------------------------------------ */
@media (max-width: 520px){
  :root body.bg-hive .card.bgCard{ padding: 12px 12px 12px; border-radius: 18px; }
  :root body.bg-hive .bgHex{ font-size: 26px; }
  :root body.bg-hive .bgWord{ font-size: 26px; }
  :root body.bg-hive .bgScoreBox{ min-width: 0; padding: 6px 10px; gap: 8px; }
  :root body.bg-hive .bgScoreBox .bgScoreVal{ font-size: 22px; }
  :root body.bg-hive .bgProgress{ grid-template-columns: 38px 1fr; column-gap: 10px; }
  :root body.bg-hive .hvJar{ width: 38px; height: 48px; }
  :root body.bg-hive .hvBeeIdle{ right: 12px; top: -14px; width: 28px; height: 22px; }
}

@media (prefers-reduced-motion: reduce){
  :root body.bg-hive .bgHex.center{ animation: none; }
  :root body.bg-hive .hvBeeIdle, :root body.bg-hive .hvBeeIdle .wing{ animation: none; }
  :root body.bg-hive .card.bgCard > .hvBee.fly{ animation: none; opacity: 0; }
  :root body.bg-hive .bgWord .nxLetter,
  :root body.bg-hive .bgWordChip.nxNew,
  :root body.bg-hive .bgHex.nxHit,
  :root body.bg-hive .bgHex.hvFull,
  :root body.bg-hive .card.bgCard.hvGlow{ animation: none; }
}

/* ---------- the post-win dialog, in wood and honey ---------- */
:root body.bg-hive .gvWin{ background: linear-gradient(180deg, var(--hv-wood-2, #28190a), var(--hv-wood-0, #120b04)); color: var(--hv-ink, #fff3d6); border: 1px solid var(--hv-honey-lo); box-shadow: inset 0 1px 0 var(--hv-edge-hi), 0 30px 70px rgba(0,0,0,.5); }
:root body.bg-hive .gvWin h2{ font-family: 'Fredoka', 'Outfit', system-ui, sans-serif; font-weight: 700; font-size: 26px; color: var(--hv-honey-hi); }
:root body.bg-hive .gvWin .gvWinSub, :root body.bg-hive .gvWinNextDesc, :root body.bg-hive .gvWin .gvWinSmall, :root body.bg-hive .gvWin .gvWinX{ color: var(--hv-dim); opacity: 1; }
:root body.bg-hive .gvWinNext, :root body.bg-hive .gvWinRow .gvWinBtn{ background: var(--hv-wood-0, #120b04); border-color: var(--hv-honey-lo); color: var(--hv-ink, #fff3d6); box-shadow: inset 0 1px 0 var(--hv-edge-hi); }
:root body.bg-hive .gvWinNext:hover, :root body.bg-hive .gvWinRow .gvWinBtn:hover{ border-color: var(--hv-honey); filter: none; }
:root body.bg-hive .gvWinNextName{ font-family: 'Fredoka', 'Outfit', system-ui, sans-serif; font-weight: 700; }
:root body.bg-hive .gvWinNextArr{ color: var(--hv-honey-hi); opacity: 1; }
:root body.bg-hive .gvWinRow .gvWinBtn.primary{ background: linear-gradient(180deg, var(--hv-honey-hi), var(--hv-honey)); color: var(--hv-honey-ink, #2a2418); border-color: var(--hv-honey-lo); }
