:root{
  --bg-radius: 18px;
  --bg-radius-sm: 14px;

  --bg-card-br: rgba(255,255,255,.10);
  --bg-card-bg: rgba(255,255,255,.04);
  --bg-card-shadow: 0 18px 55px rgba(0,0,0,.38);

  --bg-btn-br: rgba(255,255,255,.14);
  --bg-btn-bg: rgba(255,255,255,.06);
  --bg-btn-bg2: rgba(255,255,255,.10);

  --bg-press: translateY(1px) scale(.99);

  /* Honey / gold accent */
  --bg-gold: rgba(216,177,90,1);
  --bg-gold2: rgba(255,205,120,1);

  --bg-center-solid: #ffcf5a; /* stronger center hex */
  --bg-center-br: rgba(216,177,90,.46);
  --bg-center-glow: rgba(216,177,90,.35);

  /* Outer hex */
  --bg-hex-bg: rgba(255,255,255,.03);
  --bg-hex-br: rgba(255,255,255,.14);

  /* Progress */
  --bg-bar-bg: rgba(255,255,255,.06);
  --bg-bar-br: rgba(255,255,255,.10);

  /* Text */
  --bg-muted: rgba(255,255,255,.72);
}

:root[data-theme="light"]{
  --bg-card-br: rgba(11,15,20,.12);
  --bg-card-bg: rgba(255,255,255,.86);
  --bg-card-shadow: 0 16px 42px rgba(0,0,0,.14);

  --bg-btn-br: rgba(11,15,20,.12);
  --bg-btn-bg: rgba(255,255,255,.70);
  --bg-btn-bg2: rgba(255,255,255,.92);

  --bg-hex-bg: rgba(255,255,255,.92);
  --bg-hex-br: rgba(11,15,20,.12);

  --bg-bar-bg: rgba(11,15,20,.04);
  --bg-bar-br: rgba(11,15,20,.10);

  --bg-muted: rgba(11,15,20,.68);
}

/* tighter wrapping */
header.wrap { padding-bottom: 8px; }
main.wrap   { padding-top: 8px; }

/* tagline pill */
.sub{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  font-size: .92rem;
  line-height: 1.15;
  padding: .44rem .80rem;
  border-radius: 999px;
  letter-spacing: .01em;
  margin: 10px auto 0;
  max-width: 60ch;
  text-wrap: balance;

  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: 0 12px 26px rgba(0,0,0,.10);
}
:root[data-theme="light"] .sub{
  background: rgba(255,255,255,.70);
  border-color: rgba(11,15,20,.08);
  box-shadow: 0 14px 30px rgba(0,0,0,.08);
}
@media (min-width: 760px){
  .sub{
    white-space: nowrap;
    max-width: none;
  }
}

/* ============================
   GAME CARD
   ============================ */

.card.bgCard{
  position: relative;
  padding: 12px 12px 14px;
  border-radius: var(--bg-radius);
  background: var(--bg-card-bg);
  border: 1px solid var(--bg-card-br);
  box-shadow: var(--bg-card-shadow);
  overflow: hidden;
}

/* soft aura */
.card.bgCard::before{
  content:"";
  position:absolute;
  inset:-2px;
  pointer-events:none;
  background:
    radial-gradient(900px 260px at 18% -10%, rgba(120,160,255,.16), transparent 55%),
    radial-gradient(800px 260px at 90% -10%, rgba(216,177,90,.18), transparent 55%),
    radial-gradient(700px 260px at 50% 115%, rgba(0,255,140,.10), transparent 55%);
  opacity: .9;
}
:root[data-theme="light"] .card.bgCard::before{ opacity: .60; }

/* subtle honeycomb personality overlay */
.card.bgCard::after{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  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='%23D8B15A' stroke-opacity='0.26' 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: .05;
  mix-blend-mode: overlay;
  transform: translateY(10px);
}
:root[data-theme="light"] .card.bgCard::after{
  opacity: .08;
  mix-blend-mode: multiply;
}

@media (max-width:520px){
  .wrap { padding-left: 10px; padding-right: 10px; }
  .card.bgCard { padding: 10px 10px 12px; border-radius: 16px; }
}

.bgTopRow{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:12px;
  margin-bottom: 10px;
  position: relative;
  z-index: 1;
}

.bgMeta{ display:flex; flex-direction:column; gap:4px; }
.bgDate{ font-size: 13px; opacity: .92; }
.bgRule{ font-size: 12px; opacity: .78; }

.bgScoreBox{
  text-align:right;
  display:flex;
  flex-direction:column;
  gap:4px;
  align-items:flex-end;
  min-width: 76px;
  padding: 8px 10px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);
}
:root[data-theme="light"] .bgScoreBox{
  border-color: rgba(11,15,20,.10);
  background: rgba(255,255,255,.70);
}
.bgScoreLabel{ font-size: 12px; opacity: .75; }
.bgScoreVal{ font-size: 20px; line-height: 1; letter-spacing: .02em; }

/* Progress */
.bgProgress{
  position: relative;
  z-index: 1;
  margin-top: 8px;
  padding: 10px 10px 8px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.02);
}
:root[data-theme="light"] .bgProgress{
  border-color: rgba(11,15,20,.10);
  background: rgba(11,15,20,.02);
}
.bgRankRow{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  margin-bottom: 8px;
}
.bgBar{
  height: 12px;
  border-radius: 999px;
  background: var(--bg-bar-bg);
  border: 1px solid var(--bg-bar-br);
  overflow:hidden;
}
.bgBarFill{
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background:
    radial-gradient(200px 80px at 20% 0%, rgba(216,177,90,.55), transparent 60%),
    linear-gradient(90deg, rgba(255,205,120,.92), rgba(0,255,140,.55));
  box-shadow: 0 10px 24px rgba(0,0,0,.12);
  transition: width .35s ease;
}
.bgBarMeta{
  display:flex;
  justify-content:space-between;
  gap:10px;
  margin-top: 8px;
  font-size: 12px;
  opacity: .85;
}

.bgHint{
  position: relative;
  z-index: 1;
  margin-top: 10px;
  margin-bottom: 10px;
  font-size: 13px;
  line-height: 1.25;
}

.msg{
  position: relative;
  z-index: 1;
  min-height: 22px;
  margin: 2px 0 6px;
  font-size: 13px;
  line-height: 1.2;
  opacity: .95;
}

/* Builder (word pill only; buttons moved under honeycomb) */
.bgBuilder{
  position: relative;
  z-index: 1;
  margin-top: 10px;
  display:flex;
  flex-direction:column;
  gap:10px;
}

.bgWordPill{
  border-radius: 16px;
  padding: 12px 12px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}
:root[data-theme="light"] .bgWordPill{
  border-color: rgba(11,15,20,.12);
  background: rgba(255,255,255,.92);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.72);
}
.bgWord{
  display:block;
  font-size: 22px;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-weight: 900;
  text-align:center;
}
.bgWord .req{
  color: rgba(255,205,120,1);
  text-shadow: 0 0 16px rgba(216,177,90,.24);
}
:root[data-theme="light"] .bgWord .req{
  color: rgba(140,95,0,.98);
  text-shadow: 0 0 12px rgba(150,105,0,.14);
}

/* Buttons */
.bgBtn{
  appearance:none;
  border: 1px solid var(--bg-btn-br);
  background: linear-gradient(180deg, var(--bg-btn-bg2), var(--bg-btn-bg));
  color: inherit;

  height: 46px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 850;

  box-shadow:
    0 12px 26px rgba(0,0,0,.16),
    inset 0 1px 0 rgba(255,255,255,.08);

  cursor: pointer;
  transition: transform .12s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease, filter .18s ease;
}
:root[data-theme="light"] .bgBtn{
  box-shadow:
    0 14px 30px rgba(0,0,0,.10),
    inset 0 1px 0 rgba(255,255,255,.85);
}
.bgBtn:hover{
  transform: translateY(-1px);
  box-shadow:
    0 16px 34px rgba(0,0,0,.18),
    inset 0 1px 0 rgba(255,255,255,.10);
  filter: saturate(1.02);
}
:root[data-theme="light"] .bgBtn:hover{
  box-shadow:
    0 18px 38px rgba(0,0,0,.12),
    inset 0 1px 0 rgba(255,255,255,.90);
}
.bgBtn:active{ transform: var(--bg-press); }

.bgBtn.ghost{
  background: rgba(255,255,255,.03);
  box-shadow:
    0 10px 22px rgba(0,0,0,.12),
    inset 0 1px 0 rgba(255,255,255,.05);
}
:root[data-theme="light"] .bgBtn.ghost{
  background: rgba(255,255,255,.78);
  border-color: rgba(11,15,20,.10);
}

.bgBtn.primary{
  border-color: rgba(216,177,90,.55);
  background:
    radial-gradient(700px 220px at 40% 0%, rgba(255,205,120,.42), transparent 60%),
    linear-gradient(180deg, rgba(255,205,120,.98), rgba(216,177,90,.88));
  color: rgba(20,16,10,.96);
  text-shadow: 0 1px 0 rgba(255,255,255,.35);
}
.bgBtn.primary:hover{
  filter: saturate(1.06) contrast(1.02);
}

.bgBtn .btnIcon{ margin-right: 8px; }
.bgBtn.compact{ height: 44px; font-size: 14px; border-radius: 13px; }

/* Honeycomb */
.bgHoneyWrap{
  position: relative;
  z-index: 1;
  margin-top: 12px;
  display:flex;
  flex-direction:column;
  gap: 10px;
  align-items:center;
}

.bgHoney{
  --hex: clamp(64px, 19vw, 92px);
  display:grid;
  grid-template-columns: repeat(3, var(--hex));
  grid-auto-rows: calc(var(--hex) * .84);
  gap: 10px;
  align-items:center;
  justify-items:center;
  padding: 6px 0 2px;
}

.bgRow1{ grid-column: 1 / span 3; display:flex; gap: 10px; justify-content:center; transform: translateY(6px); }
.bgRow2{ grid-column: 1 / span 3; display:flex; gap: 10px; justify-content:center; }
.bgRow3{ grid-column: 1 / span 3; display:flex; gap: 10px; justify-content:center; transform: translateY(-6px); }

.bgHex{
  position: relative;
  width: var(--hex);
  height: calc(var(--hex) * .92);
  border-radius: 18px;
  border: 1px solid var(--bg-hex-br);
  background:
    radial-gradient(220px 90px at 30% 15%, rgba(255,255,255,.10), transparent 62%),
    linear-gradient(180deg, rgba(255,255,255,.08), rgba(0,0,0,0)),
    var(--bg-hex-bg);

  box-shadow:
    0 14px 30px rgba(0,0,0,.18),
    inset 0 1px 0 rgba(255,255,255,.10);
  clip-path: polygon(25% 6%, 75% 6%, 100% 50%, 75% 94%, 25% 94%, 0% 50%);

  display:flex;
  align-items:center;
  justify-content:center;

  font-size: 26px;
  font-weight: 950;
  letter-spacing: .06em;
  text-transform: uppercase;
  user-select:none;

  transition: transform .12s ease, box-shadow .18s ease, border-color .18s ease, filter .18s ease;
}
:root[data-theme="light"] .bgHex{
  box-shadow:
    0 16px 34px rgba(0,0,0,.10),
    inset 0 1px 0 rgba(255,255,255,.92);
}
.bgHex:hover{ transform: translateY(-1px); }
.bgHex:active{ transform: var(--bg-press); }

/* CENTER — always strong yellow */
.bgHex.center{
  border-color: var(--bg-center-br);
  background:
    radial-gradient(260px 120px at 35% 25%, rgba(255,255,255,.40), transparent 58%),
    linear-gradient(180deg, rgba(255,224,140,1), rgba(255,205,120,1)),
    var(--bg-center-solid);
  color: rgba(20,16,10,.96);

  box-shadow:
    0 20px 40px rgba(0,0,0,.20),
    0 0 28px rgba(216,177,90,.22),
    inset 0 0 0 2px rgba(216,177,90,.22);
  filter: saturate(1.08);
}
.bgHex.center::after{
  content:"";
  position:absolute;
  inset: 8%;
  border-radius: 18px;
  clip-path: inherit;
  pointer-events:none;
  background:
    radial-gradient(circle at 35% 25%, rgba(255,255,255,.28), transparent 60%),
    radial-gradient(circle at 70% 70%, rgba(216,177,90,.18), transparent 62%);
  opacity:.95;
}

/* subtle pulse (reduced-motion safe) */
@media (prefers-reduced-motion: no-preference){
  .bgHex.center{
    animation: bgPulse 2.8s ease-in-out infinite;
  }
  @keyframes bgPulse{
    0%,100%{
      box-shadow:
        0 20px 40px rgba(0,0,0,.20),
        0 0 26px rgba(216,177,90,.18),
        inset 0 0 0 2px rgba(216,177,90,.20);
    }
    50%{
      box-shadow:
        0 22px 44px rgba(0,0,0,.22),
        0 0 34px rgba(216,177,90,.30),
        inset 0 0 0 2px rgba(216,177,90,.26);
    }
  }
}

/* ACTIONS (moved under the hive) */
.bgActions{
  position: relative;
  z-index: 1;
  margin-top: 10px;
  width: 100%;
  display:flex;
  flex-direction:column;
  gap: 10px;
  align-items:stretch;
}

.bgActionsPrimary{
  display:flex;
  flex-direction:column; /* mobile: stacked */
  gap: 8px;
}
.bgActionsPrimary .bgBtn{
  width: 100%;
  justify-content:center;
}

.bgActionsSecondary{
  display:grid;
  grid-template-columns: 1fr 1fr; /* mobile: 2x2 */
  gap: 8px;
}

@media (min-width: 760px){
  .bgActionsPrimary{
    flex-direction: row; /* desktop: one line */
  }
  .bgActionsSecondary{
    grid-template-columns: repeat(4, 1fr); /* desktop: one line */
  }
}

/* Share button slightly special */
.bgBtn.share{
  border-color: rgba(216,177,90,.30);
  background:
    radial-gradient(520px 180px at 40% 0%, rgba(216,177,90,.18), transparent 60%),
    linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.05));
}
:root[data-theme="light"] .bgBtn.share{
  background:
    radial-gradient(520px 180px at 40% 0%, rgba(216,177,90,.14), transparent 62%),
    linear-gradient(180deg, rgba(255,255,255,.95), rgba(255,255,255,.78));
}

/* Panels */
.bgPanels{
  position: relative;
  z-index: 1;
  margin-top: 12px;
  display:grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

@media (min-width: 860px){
  .bgPanels{ grid-template-columns: 1fr 1fr; }
}

.bgPanel{
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.02);
  padding: 10px 12px;
}
:root[data-theme="light"] .bgPanel{
  border-color: rgba(11,15,20,.10);
  background: rgba(11,15,20,.02);
}

.bgPanelHead{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap: 10px;
  margin-bottom: 10px;
}

.bgWordGrid{
  display:flex;
  flex-wrap:wrap;
  gap: 8px;
}
.bgWordChip{
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);
  font-size: 13px;
  letter-spacing: .05em;
  text-transform: uppercase;
}
:root[data-theme="light"] .bgWordChip{
  border-color: rgba(11,15,20,.10);
  background: rgba(255,255,255,.82);
}

.bgHintGrid{
  display:grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 8px;
}
@media (max-width:520px){
  .bgHintGrid{ grid-template-columns: repeat(3, minmax(0,1fr)); }
}
.bgHintCard{
  border-radius: 14px;
  padding: 9px 10px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);
  text-align:center;
}
:root[data-theme="light"] .bgHintCard{
  border-color: rgba(11,15,20,.10);
  background: rgba(255,255,255,.82);
}
.bgHintN{ font-size: 18px; font-weight: 950; }
.bgHintK{ font-size: 11px; opacity: .78; letter-spacing: .12em; text-transform: uppercase; }

/* FAQ card */
.bgFaqCard .faqGrid{
  margin-top: 10px;
  display:grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
@media (min-width: 860px){
  .bgFaqCard .faqGrid{ grid-template-columns: 1fr 1fr; }
}
.bgFaqCard details{
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.02);
  padding: 10px 12px;
}
:root[data-theme="light"] .bgFaqCard details{
  border-color: rgba(11,15,20,.10);
  background: rgba(11,15,20,.02);
}
.bgFaqCard summary{
  cursor: pointer;
  font-weight: 850;
  list-style: none;
}
.bgFaqCard summary::-webkit-details-marker{ display:none; }
.bgFaqCard summary::after{
  content:"＋";
  float:right;
  opacity:.8;
}
.bgFaqCard details[open] summary::after{ content:"—"; }
.bgFaqCard .faqA{
  margin-top: 8px;
  opacity: .90;
  line-height: 1.35;
}

/* Dialogs */
.bgHelpDlg,
.bgShareDlg{
  padding: 0;
  border: 0;
  background: transparent;
  width: min(620px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  margin: auto;
}
.bgHelpDlg::backdrop,
.bgShareDlg::backdrop{ background: rgba(0,0,0,.58); }
:root[data-theme="light"] .bgHelpDlg::backdrop,
:root[data-theme="light"] .bgShareDlg::backdrop{ background: rgba(0,0,0,.30); }

.bgHelpDlg .dlg,
.bgShareDlg .dlg{
  margin: 0;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(14,18,24,.86);
  box-shadow: 0 22px 70px rgba(0,0,0,.45);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
}
:root[data-theme="light"] .bgHelpDlg .dlg,
:root[data-theme="light"] .bgShareDlg .dlg{
  background: rgba(255,255,255,.92);
  border-color: rgba(11,15,20,.12);
  box-shadow: 0 18px 52px rgba(0,0,0,.18);
  backdrop-filter: blur(8px) saturate(120%);
  -webkit-backdrop-filter: blur(8px) saturate(120%);
}

.bgHelp{ padding: 12px 12px 14px; }
.bgHelpScroll{ max-height: 70vh; overflow: auto; padding-right: 2px; }
.bgHelpBox{
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);
  border-radius: 14px;
  padding: 10px 12px;
  margin: 10px 0;
}
:root[data-theme="light"] .bgHelpBox{ background: rgba(11,15,20,.03); }

.bgHelpKicker{
  font-size: 12px;
  letter-spacing: .10em;
  text-transform: uppercase;
  opacity: .80;
  margin-bottom: 6px;
}
.bgHelpList{ margin: 0; padding-left: 18px; }
.bgHelpList li{ margin: 6px 0; }
.bgHelpActions{ display:flex; gap:10px; justify-content:flex-end; flex-wrap:wrap; margin-top:10px; }

.bgShare{ padding: 12px 12px 14px; }
.bgShare textarea{
  margin-top: 10px;
  border-radius: 14px;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);
  color: inherit;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}
:root[data-theme="light"] .bgShare textarea{
  border-color: rgba(11,15,20,.12);
  background: rgba(255,255,255,.85);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.75);
}
.bgShareActions{ display:flex; gap:10px; margin-top:12px; justify-content:flex-end; flex-wrap:wrap; }

#helpBGX, #shareNowX{ color: rgba(255,95,95,.95); }
#helpBGX:hover, #shareNowX:hover{ color: rgba(255,125,125,.98); }

/* Reduced motion */
@media (prefers-reduced-motion: reduce){
  .bgBtn, .bgHex, .bgBarFill{ transition: none !important; }
  .bgHex.center{ animation: none !important; }
}
/* =========================================
   HOTFIX: Center hex must be clearly yellow (light mode)
   ========================================= */

:root[data-theme="light"] .bgHex.center{
  /* hard fallback + strong honey gradient */
  background-color: #ffcf3c;
  background:
    radial-gradient(240px 120px at 35% 22%, rgba(255,255,255,.55), transparent 58%),
    radial-gradient(220px 140px at 65% 80%, rgba(216,177,90,.25), transparent 62%),
    linear-gradient(180deg, rgba(255,225,140,1), rgba(255,199,90,1));

  border-color: rgba(216,177,90,.75);

  /* make it “pop” */
  box-shadow:
    0 22px 46px rgba(0,0,0,.16),
    0 0 0 4px rgba(255,205,120,.42),
    0 0 34px rgba(216,177,90,.25),
    inset 0 0 0 2px rgba(216,177,90,.18);

  filter: saturate(1.25) contrast(1.08);
}

:root[data-theme="light"] .bgHex.center::after{
  /* stronger highlight layer */
  opacity: 1;
  background:
    radial-gradient(circle at 35% 25%, rgba(255,255,255,.38), transparent 60%),
    radial-gradient(circle at 70% 75%, rgba(216,177,90,.22), transparent 62%);
}

/* Optional: make the center letter itself a touch “inkier” */
:root[data-theme="light"] .bgHex.center{
  color: rgba(20,16,10,.98);
  text-shadow: 0 1px 0 rgba(255,255,255,.35);
}
/* Mobile: Delete / Clear / Enter on ONE line */
.bgActionsPrimary{
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr; /* Enter slightly wider */
  gap: 8px;
}

/* keep desktop behavior */
@media (min-width: 760px){
  .bgActionsPrimary{
    display: flex;
    flex-direction: row;
  }
}




/* Mobile: Shuffle / Hints / Word list / Share on ONE line */
.bgActionsSecondary{
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

/* Make sure buttons can shrink without forcing wrap */
.bgActionsSecondary .bgBtn{
  min-width: 0;
  padding-left: 10px;
  padding-right: 10px;
  font-size: 14px;
}

/* Desktop can stay as your normal layout */
@media (min-width: 760px){
  .bgActionsSecondary{
    display: flex;
    gap: 10px;
  }
}

