:root{
  /* Make feedback strong enough to show in LIGHT mode too */
  --og-green-bg: rgba(0, 255, 140, .18);
  --og-green-br: rgba(0, 255, 140, .50);

  --og-yellow-bg: rgba(255, 200, 0, .18);
  --og-yellow-br: rgba(255, 200, 0, .52);

  --og-bad-bg: rgba(255,255,255,.02);
  --og-bad-br: rgba(255,255,255,.14);

  /* Locked digits */
  --og-locked-bg: rgba(120,160,255,.14);
  --og-locked-br: rgba(120,160,255,.34);
  --og-locked-outline: rgba(120,160,255,.55);

  /* Operators */
  --og-op-bg: rgba(255,255,255,.02);
  --og-op-br: rgba(255,255,255,.22);
  --og-sel-outline: rgba(255, 60, 60, .55);

  /* Target */
  --og-target-bg: rgba(180,255,220,.10);
  --og-target-br: rgba(180,255,220,.24);

  /* Help popup (thin look) */
  --ogHelpBorder: rgba(255,255,255,.07);
  --ogHelpBg: rgba(255,255,255,.02);
}

:root[data-theme="light"]{
  /* STRONGER in light mode so it's clearly visible */
  --og-green-bg: rgba(0, 160, 90, .18);
  --og-green-br: rgba(0, 160, 90, .44);

  --og-yellow-bg: rgba(200, 150, 0, .20);
  --og-yellow-br: rgba(200, 150, 0, .48);

  --og-bad-bg: rgba(11,15,20,.03);
  --og-bad-br: rgba(11,15,20,.14);

  --og-locked-bg: rgba(60,120,255,.12);
  --og-locked-br: rgba(60,120,255,.26);
  --og-locked-outline: rgba(60,120,255,.36);

  --og-op-bg: rgba(11,15,20,.03);
  --og-op-br: rgba(11,15,20,.18);
  --og-sel-outline: rgba(200, 20, 20, .45);

  --og-target-bg: rgba(0,160,90,.10);
  --og-target-br: rgba(0,160,90,.22);

  --ogHelpBorder: rgba(11,15,20,.12);
  --ogHelpBg: rgba(11,15,20,.02);
}

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

.card.ogCard { padding: 10px 10px 12px; }
@media (max-width:520px){
  .wrap { padding-left: 10px; padding-right: 10px; }
  .card.ogCard { padding: 8px 8px 10px; }
}

.ogTopRow{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:10px;
  margin-bottom: 8px;
}

.ogMeta{ display:flex; flex-direction:column; gap:2px; }
.ogDate{ font-size: 13px; opacity: .9; }
.ogRule{ font-size: 12px; opacity: .7; }

.ogTargetBox{
  text-align:right;
  display:flex;
  flex-direction:column;
  gap:3px;
  align-items:flex-end;

  /* was 86px */
  min-width: 70px;
}

.ogTargetVal{
  /* was 20px */
  font-size: 18px;
  line-height: 1;
}

.ogHint{
  margin-top: 6px;
  margin-bottom: 10px;
  font-size: 13px;
  line-height: 1.25;
}

/* center the board */
.ogBoard{
  margin-top: 6px;
  display:flex;
  flex-direction:column;
  gap:10px;
  align-items:center;
}
.ogRow{
  display:flex;
  justify-content:center;
  width: 100%;
}

/* ============================
   TOKENS / STRIP
   ============================ */

/* single-line strip (updated for bigger tokens) */
.tokStrip{
  display:flex;
  align-items:center;
  justify-content:center;
  flex-wrap:nowrap;
  white-space:nowrap;

  gap: clamp(4px, 1.2vw, 8px);
  width: fit-content;
  max-width: 100%;

  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
}

/* Bigger tiles (+15% height) */
.tok{
  width:  clamp(30px, 7.6vw, 52px);
  height: clamp(44px, 10.1vw, 71px);
  border-radius: 14px;

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

  font-size: clamp(17px, 4.8vw, 24px);
  line-height:1;

  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.03);
  user-select:none;
}
:root[data-theme="light"] .tok{
  border: 1px solid rgba(11,15,20,.14);
  background: rgba(11,15,20,.03);
}

/* LOCKED digits + '=' */
.tok.locked{
  background: var(--og-locked-bg);
  border-color: var(--og-locked-br);
  box-shadow: inset 0 0 0 2px var(--og-locked-outline);
  font-weight: 700;
}

/* target tile */
.tok.target{
  width: auto;
  min-width: 72px;
  padding: 0 10px;

  height: clamp(44px, 10.1vw, 71px);
  font-size: clamp(16px, 4.4vw, 22px);

  background: var(--og-target-bg);
  border-color: var(--og-target-br);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.08);
}
:root[data-theme="light"] .tok.target{
  box-shadow: inset 0 0 0 2px rgba(11,15,20,.08);
}

/* operator slots */
button.tok.op{
  cursor:pointer;
  background: var(--og-op-bg);
  border: 1px solid var(--og-op-br);
  padding:0;
  font-weight: 900;
  letter-spacing: .2px;
}
button.tok.op.placeholder{ opacity: .95; }

/* selection ring (red) */
button.tok.op.sel{
  outline: 3px solid var(--og-sel-outline);
  outline-offset: 2px;
}

/* feedback (FORCE visibility) */
.tok.g{ background: var(--og-green-bg) !important; border-color: var(--og-green-br) !important; }
.tok.y{ background: var(--og-yellow-bg) !important; border-color: var(--og-yellow-br) !important; }
.tok.b{ background: var(--og-bad-bg) !important; border-color: var(--og-bad-br) !important; opacity:.92; }

/* Small screens: don’t overdo it (+15% height here too) */
@media (max-width:420px){
  .tok{
    width:  clamp(28px, 8.2vw, 48px);
    height: clamp(41px, 10.8vw, 67px);
    border-radius: 13px;
  }
}

/* Gold “?” placeholder in operator slots */
button.tok.op.placeholder{
  color: rgba(255, 200, 0, .92);
  text-shadow: 0 0 10px rgba(255,200,0,.18);
}
:root[data-theme="light"] button.tok.op.placeholder{
  color: rgba(170, 120, 0, .95);
  text-shadow: 0 0 10px rgba(170,120,0,.14);
}

/* ============================
   KEYPAD
   ============================ */

.opPad{
  margin-top: 12px;
  display:flex;
  gap:8px;
  justify-content:center;
  flex-wrap:wrap;
}
.opBtn{
  min-width: 52px;
  height: 40px;
  border-radius: 14px;
  font-size: 16px;
  padding: 0 12px;
}
#enterBtn, #clearBtn{ min-width: 96px; }

@media (max-width:420px){
  .opPad{ gap:6px; }
  .opBtn{
    min-width: 48px;
    height: 38px;
    border-radius: 13px;
    padding: 0 10px;
    font-size: 15px;
  }
  #enterBtn, #clearBtn{ min-width: 92px; }
}

/* misc row */
.ogMiniRow{
  display:flex;
  justify-content:space-between;
  gap:10px;
  margin-top:10px;
  font-size: 13px;
}

/* ============================
   SEO example cards
   ============================ */

.ogExampleGrid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 8px;
}
@media (max-width:720px){
  .ogExampleGrid{ grid-template-columns: 1fr; }
}
.ogExCard{
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.02);
  border-radius: 14px;
  padding: 10px 12px;
}
:root[data-theme="light"] .ogExCard{
  border: 1px solid rgba(11,15,20,.12);
  background: rgba(11,15,20,.02);
}
.ogExTitle{ font-size: 14px; font-weight: 800; }
.ogExP{ font-size: 13px; line-height: 1.25; }

/* ============================
   Menu: 2 columns (this page only)
   ============================ */

.menuGrid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width:520px){
  .menuGrid{ grid-template-columns: 1fr; }
}
.menuCol{ display:flex; flex-direction:column; gap: 8px; }
.menuSectionTitle{
  opacity: .75;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* ============================
   One-page Help popup (thin)
   - IMPORTANT: the “big white frame” was the <dialog>
   ============================ */

/* OUTER <dialog> — remove default white bg/padding/border */
#ogHelpDlg{
  padding: 0;
  border: 0;
  background: transparent;
}
#ogHelpDlg:focus{ outline: none; }

/* Backdrop */
#ogHelpDlg::backdrop{ background: rgba(0,0,0,.55); }
:root[data-theme="light"] #ogHelpDlg::backdrop{ background: rgba(0,0,0,.35); }

/* Inner panel: make its outline thin (this is the one you actually want) */
#ogHelpDlg .dlg{
  margin: 0;
  border: 1px solid rgba(255,255,255,.06);
  box-shadow: 0 12px 40px rgba(0,0,0,.35);
}
:root[data-theme="light"] #ogHelpDlg .dlg{
  border: 1px solid rgba(11,15,20,.10);
}

/* Your help content wrappers */
.ogHelp{
  padding: 10px 10px 12px;
  max-width: 560px;
}
.ogHelpScroll{
  max-height: 70vh;
  overflow: auto;
  padding-right: 2px;
}
.ogHelpBox{
  border: 1px solid var(--ogHelpBorder);
  background: var(--ogHelpBg);
  border-radius: 12px;
  padding: 9px 10px;
  margin: 8px 0;
}
.ogHelpKicker{
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  opacity: .78;
  margin-bottom: 6px;
}
.ogHelpList{
  margin: 0;
  padding-left: 18px;
}
.ogHelpList li{ margin: 5px 0; }

.ogHelpActions{
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-top: 8px;
}

#helpOGX{ color:#ff4d4d; }
#helpOGX:hover{ color:#ff6b6b; }

@media (max-width:520px){
  .ogTargetBox{
    min-width: 60px; /* was 86px-ish feel; ~30% narrower */
  }
}

@media (max-width:520px){
  .tok.target{
    min-width: 50px;     /* was 72px; ~30% narrower */
    padding: 0 8px;      /* a little tighter */
    /* height stays controlled by your clamp() already */
  }
}


/* Center the help dialog and remove the big empty side area on desktop */
#ogHelpDlg{
  padding: 0;
  border: 0;
  background: transparent;

  /* key bits */
  width: fit-content;
  max-width: calc(100vw - 24px);
  margin: auto;                 /* center */
}

/* ensure the inner panel is centered */
#ogHelpDlg .ogHelp{
  margin: 0 auto;
}














/* ============================
   GLOBAL MENU (Glyphverse) — 2-COL ALWAYS + CRISPER

   ============================ */

:root{
  /* dark */
  --gvMenuBg: rgba(255,255,255,.06);
  --gvMenuBorder: rgba(255,255,255,.10);
  --gvMenuShadow: 0 18px 50px rgba(0,0,0,.45);

  --gvItemBg: rgba(255,255,255,.05);
  --gvItemBgHover: rgba(255,255,255,.08);
  --gvItemBorder: rgba(255,255,255,.10);
}

:root[data-theme="light"]{
  /* light (white glass, crisp) */
  --gvMenuBg: rgba(255,255,255,.92);
  --gvMenuBorder: rgba(11,15,20,.14);
  --gvMenuShadow: 0 16px 40px rgba(0,0,0,.18);

  --gvItemBg: rgba(255,255,255,.78);
  --gvItemBgHover: rgba(255,255,255,.92);
  --gvItemBorder: rgba(11,15,20,.14);
}

.gvMenuDlg{
  border: 0;
  padding: 0;
  background: transparent;
  width: min(760px, 94vw);
  color: inherit;
}

.gvMenuDlg::backdrop{ background: rgba(0,0,0,.55); }
:root[data-theme="light"] .gvMenuDlg::backdrop{ background: rgba(0,0,0,.28); }

.gvMenu{
  background: var(--gvMenuBg);
  border: 1px solid var(--gvMenuBorder);
  border-radius: 16px;
  box-shadow: var(--gvMenuShadow);

  /* IMPORTANT: allow scrolling (mobile cut-off fix) */
  overflow: auto;

  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  max-height: 80vh;
}

:root[data-theme="light"] .gvMenu{
  backdrop-filter: blur(6px) saturate(120%);
  -webkit-backdrop-filter: blur(6px) saturate(120%);
}

.gvMenuTop{
  position: sticky;
  top: 0;
  z-index: 2;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 8px 10px;
  border-bottom: 1px solid var(--gvMenuBorder);
  background: inherit; /* keeps header solid while scrolling */
}

.gvMenuTitle{
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  opacity: .85;
}

.gvMenuX{
  border: 1px solid var(--gvItemBorder);
  background: var(--gvItemBg);
  color: inherit;
  font-size: 18px;
  line-height: 1;
  padding: 8px 10px;
  border-radius: 12px;
  cursor: pointer;
}
.gvMenuX:hover{ background: var(--gvItemBgHover); }

.gvMenuGrid{
  display:grid;
  /* ALWAYS two columns (even on mobile) */
  grid-template-columns: minmax(0,1fr) minmax(0,1fr);
  gap: 10px;
  padding: 10px;
  align-items: start;
}

.gvCol{ min-width: 0; }

.gvCol:first-child{
  padding-right: 8px;
  border-right: 1px solid var(--gvMenuBorder);
}

.gvSection{ margin-bottom: 10px; }
.gvSection:last-child{ margin-bottom: 0; }

.gvSectionTitle{
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  opacity: .70;
  margin: 0 0 8px;
}

.gvWelcome{
  margin-bottom: 10px;
  padding: 8px 10px;
  border: 1px solid var(--gvItemBorder);
  background: var(--gvItemBg);
  border-radius: 14px;
}

.gvWelcomeTitle{
  font-size: 13px;
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 2px;
}
.gvWelcomeSub{
  font-size: 12px;
  line-height: 1.2;
  opacity: .85;
}

/* tight one-line items */
.gvRow,
.gvLink,
.gvGameLink{
  display:flex;
  align-items:center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 14px;
  border: 1px solid var(--gvItemBorder);
  background: var(--gvItemBg);
  text-decoration: none;
  color: inherit;
  min-height: 38px;
}

.gvRow{ justify-content: space-between; }
.gvRowLeft{ display:flex; align-items:center; gap:10px; min-width:0; }

.gvLink:hover,
.gvGameLink:hover{ background: var(--gvItemBgHover); }

.gvIcon{
  width: 18px;
  display:inline-flex;
  justify-content:center;
  opacity: .95;
  flex: 0 0 auto;
}

.gvText{
  font-size: 13px;
  line-height: 1.05;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

/* Game grids: 2 columns on desktop, 1 within the right column by default.
   (We keep 1 so the right column doesn't get too cramped on mobile.)
   If you want 2 inside the right column on desktop, see media rule below. */
.gvGameGrid{
  display:grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

@media (min-width:900px){
  .gvGameGrid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}



/* Active highlight */
.gvActive{
  outline: 2px solid rgba(255,255,255,.18);
  outline-offset: 0;
}
:root[data-theme="light"] .gvActive{
  outline-color: rgba(11,15,20,.18);
}

/* Slightly smaller switch in menu */
.gvSwitch{ transform: scale(.90); transform-origin: right center; }

/* Mobile tightening (still 2 cols) */
@media (max-width:520px){
  .gvMenuDlg{ width: 98vw; }
  .gvMenu{ max-height: 88vh; border-radius: 14px; }

  .gvMenuGrid{ gap: 8px; padding: 8px; }
  .gvCol:first-child{ padding-right: 6px; }

  .gvSectionTitle{ font-size: 10px; margin: 0 0 6px; letter-spacing: .18em; }

  .gvWelcome{ padding: 8px 8px; border-radius: 12px; }
  .gvWelcomeTitle{ font-size: 12px; }
  .gvWelcomeSub{ font-size: 11px; }

  .gvRow, .gvLink, .gvGameLink{
    padding: 8px 8px;
    border-radius: 12px;
    min-height: 34px;
    gap: 8px;
  }

  .gvText{ font-size: 12px; }
  .gvIcon{ width: 16px; }
  .gvSwitch{ transform: scale(.85); }
}


/* Center the dialog on desktop (override any left-aligned dialog styles) */
#menuDlg.gvMenuDlg[open]{
  position: fixed;
  inset: 0;      /* top/right/bottom/left = 0 */
  margin: auto;  /* centers it */
}









/* Premium tagline pill */
.sub{
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-size: .92rem;        /* stays small */
  line-height: 1.15;
  padding: .35rem .6rem;
  border-radius: 999px;
  letter-spacing: .01em;
  background: rgba(0,0,0,.04);
  border: 1px solid rgba(0,0,0,.06);
  max-width: 42ch;          /* controls wrapping nicely */
  text-wrap: balance;       /* modern browsers: nicer wraps */
}

/* Dark mode */
:root[data-theme="dark"] .sub{
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.10);
}

/* Mobile: slightly tighter */
@media (max-width:520px){
  .sub{ font-size: .86rem; max-width: 34ch; }
}


.sub{
  margin: 8px auto 0;   /* auto centers */
}


/* Remove popup tutorial border completely */
#ogHelpDlg{
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
}

#ogHelpDlg .ogHelpBox{
  border: 0 !important;
}






#ogHelpDlg .ogHelpBox{
  border: 0 !important;
  background: transparent !important;
}


/* Kill the default <dialog> white sheet + padding (desktop) */
#helpDlgOG,
#ogHelpDlg{
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;

  /* stop it behaving like a huge white panel */
  width: fit-content;
  max-width: calc(100vw - 24px);
  margin: auto !important;
}

/* Make sure the inner panel isn't adding extra outer margin */
#helpDlgOG .ogHelp,
#ogHelpDlg .ogHelp{
  margin: 0 !important;
}


