/* /memoryglyph/memoryglyph.css */

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

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

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

.mgMeta{ display:flex; flex-direction:column; gap:8px; min-width: 0; }
.mgRight{ display:flex; align-items:center; justify-content:flex-end; }

/* ✅ Mode pills (Kids/Easy/Medium/Hard) stay on ONE line */
.mgMeta .modeSeg{
  display:flex;
  align-items:center;
  gap: 8px;
  flex-wrap: nowrap;
  overflow-x: auto;                 /* scroll instead of wrapping */
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.mgMeta .modeSeg::-webkit-scrollbar{ display:none; }

/* ✅ Stats row stays on ONE line */
.mgStatsRow{
  display:flex;
  align-items:flex-end;
  gap: 10px;
  flex-wrap: nowrap;
  width: 100%;
}

/* Stat tiles */
.mgStat{
  flex: 1 1 0;
  min-width: 0;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.02);
  border-radius: 14px;
  padding: 8px 10px;
}
:root[data-theme="light"] .mgStat{
  border: 1px solid rgba(11,15,20,.12);
  background: rgba(11,15,20,.02);
}

.mgVal{ font-size: 18px; line-height: 1; font-weight: 800; }

/* Slightly tighter on small screens (still 1 line) */
@media (max-width:520px){
  .mgStatsRow{ gap: 8px; }
  .mgStat{ padding: 7px 8px; border-radius: 13px; }
  .mgVal{ font-size: 16px; }
  .mgStat .muted{ font-size: 12px; }
  .mgMeta .modeSeg{ gap: 6px; }
}

/* Haptics pill */
.mgHapticRow{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.02);
  user-select:none;
}
:root[data-theme="light"] .mgHapticRow{
  border: 1px solid rgba(11,15,20,.12);
  background: rgba(11,15,20,.02);
}

.mgHapticRow .muted{
  font-size: 12px;
  line-height: 1;
}

/* ✅ Haptics switch smaller (default) */
.mgSwitch{
  transform: scale(.72);
  transform-origin: right center;
}

/* ✅ Haptics switch MUCH smaller on mobile */
@media (max-width:520px){
  .mgHapticRow{ padding: 5px 7px; border-radius: 13px; }
  .mgSwitch{ transform: scale(.62); }
}

.mgStatus{
  margin: 6px 0 10px;
  font-size: 14px;
  opacity: .92;
}
.msg{ min-height: 20px; }

.mgGridWrap{
  display:flex;
  justify-content:center;
  margin-top: 6px;
}

.mgGrid{
  display:grid;
  gap: 10px;
  width: min(520px, 100%);
}

.mgTile{
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.03);
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  user-select:none;
  min-height: 78px;
  font-size: 30px;
  font-weight: 900;
  line-height: 1;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease, box-shadow 120ms ease;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.04);
}
:root[data-theme="light"] .mgTile{
  border: 1px solid rgba(11,15,20,.14);
  background: rgba(11,15,20,.03);
  box-shadow: inset 0 0 0 2px rgba(11,15,20,.04);
}

.mgTile:active{ transform: scale(.98); }

.mgTile.disabled{
  opacity: .65;
  cursor: default;
}

.mgTile.flash{
  background: rgba(0, 255, 140, .18);
  border-color: rgba(0, 255, 140, .45);
  box-shadow: 0 0 0 4px rgba(0, 255, 140, .10);
}
:root[data-theme="light"] .mgTile.flash{
  background: rgba(0, 160, 90, .18);
  border-color: rgba(0, 160, 90, .40);
  box-shadow: 0 0 0 4px rgba(0, 160, 90, .10);
}

.mgTile.wrong{
  background: rgba(255, 60, 60, .14);
  border-color: rgba(255, 60, 60, .45);
  box-shadow: 0 0 0 4px rgba(255, 60, 60, .10);
}

.mgControls{
  margin-top: 12px;
  display:flex;
  gap:8px;
  justify-content:center;
  flex-wrap:wrap;
}

.mgBtn{
  min-width: 110px;
  height: 40px;
  border-radius: 14px;
  font-size: 15px;
  padding: 0 14px;
}
.mgBtn.ghost{ opacity: .95; }

.mgMiniRow{
  margin-top: 10px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  font-size: 13px;
}

.mgLinkBtn{
  border: 0;
  background: transparent;
  color: inherit;
  text-decoration: underline;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 10px;
}
.mgLinkBtn:hover{ background: rgba(255,255,255,.04); }
:root[data-theme="light"] .mgLinkBtn:hover{ background: rgba(11,15,20,.04); }

/* Help dialog */
.mgHelpDlg{
  padding: 0;
  border: 0;
  background: transparent;
  width: fit-content;
  max-width: calc(100vw - 24px);
  margin: auto;
}
.mgHelpDlg::backdrop{ background: rgba(0,0,0,.55); }
:root[data-theme="light"] .mgHelpDlg::backdrop{ background: rgba(0,0,0,.35); }

.mgHelp{
  padding: 10px 10px 12px;
  max-width: 560px;
}
.mgHelpScroll{
  max-height: 70vh;
  overflow: auto;
  padding-right: 2px;
}
.mgHelpBox{
  border: 1px solid rgba(255,255,255,.07);
  background: rgba(255,255,255,.02);
  border-radius: 12px;
  padding: 9px 10px;
  margin: 8px 0;
}
:root[data-theme="light"] .mgHelpBox{
  border: 1px solid rgba(11,15,20,.12);
  background: rgba(11,15,20,.02);
}
.mgHelpKicker{
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  opacity: .78;
  margin-bottom: 6px;
}
.mgHelpList{
  margin: 0;
  padding-left: 18px;
}
.mgHelpList li{ margin: 5px 0; }

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

/* small screens */
@media (max-width:520px){
  .mgGrid{ gap: 8px; }
  .mgTile{ min-height: 68px; font-size: 28px; border-radius: 14px; }
  .mgBtn{ min-width: 98px; height: 38px; border-radius: 13px; }
}

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

:root{
  --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"]{
  --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);
  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;
}

.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;
  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;
}

.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;
}

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

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

.gvSwitch{ transform: scale(.90); transform-origin: right center; }

@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 */
#menuDlg.gvMenuDlg[open]{
  position: fixed;
  inset: 0;
  margin: auto;
}







.menuBtn{
  position:relative;
  border-radius:12px;
}

@media (prefers-reduced-motion: no-preference){
  .menuBtn.attn::before{
    content:"";
    position:absolute;
    inset:-2px;
    border-radius:inherit;
    padding:2px;
    background: conic-gradient(from 0deg,
      transparent 0 70%,
      var(--accent, #d6b35a) 78%,
      transparent 86% 100%);
    -webkit-mask:
      linear-gradient(#000 0 0) content-box,
      linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
            mask-composite: exclude;
    animation: spin 3.5s linear infinite;
    opacity:.7;
    pointer-events:none;
  }

  @keyframes spin{ to{ transform: rotate(360deg); } }

  /* Stop when user is interacting */
  .menuBtn:hover::before,
  .menuBtn:focus-visible::before{ opacity:0; animation:none; }
}


/* ============================
   MemoryGlyph — status/instructions (centered) + countdown pop
   Add this at the VERY BOTTOM of /memoryglyph/memoryglyph.css
   ============================ */

/* Bigger, clearer status / instructions line */
.mgStatus{
  margin: 6px 0 10px;
  text-align: center;             
  font-size: clamp(18px, 4.2vw, 24px);
  font-weight: 900;
  letter-spacing: .01em;
  opacity: .96;
}

/* Extra emphasis for countdown + key moments */
.mgStatusBig{
  font-size: clamp(22px, 5.2vw, 34px);
  font-weight: 900;
}

/* Countdown pop */
.mgStatusCountdown{ text-align: center; } 

.mgPop{
  animation: mgPopDown 420ms ease-out both;
}

@keyframes mgPopDown{
  0%   { transform: scale(1.35); opacity: .0; }
  35%  { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1.0);  opacity: 1; }
}



