/* /connectglyph/connectglyph.css */
:root{
  --cg-border: rgba(255,255,255,.12);
  --cg-panel: rgba(255,255,255,.02);

  --cg-sel-outline: rgba(255, 60, 60, .55);

  --cg-y-bg: rgba(255, 200, 0, .16);
  --cg-y-br: rgba(255, 200, 0, .45);

  --cg-g-bg: rgba(0, 255, 140, .16);
  --cg-g-br: rgba(0, 255, 140, .45);

  --cg-b-bg: rgba(120,160,255,.14);
  --cg-b-br: rgba(120,160,255,.34);

  --cg-p-bg: rgba(200,120,255,.14);
  --cg-p-br: rgba(200,120,255,.34);
}

:root[data-theme="light"]{
  --cg-border: rgba(11,15,20,.14);
  --cg-panel: rgba(11,15,20,.02);
  --cg-sel-outline: rgba(200, 20, 20, .45);

  --cg-y-bg: rgba(200, 150, 0, .18);
  --cg-y-br: rgba(200, 150, 0, .44);

  --cg-g-bg: rgba(0, 160, 90, .18);
  --cg-g-br: rgba(0, 160, 90, .44);

  --cg-b-bg: rgba(60,120,255,.12);
  --cg-b-br: rgba(60,120,255,.26);

  --cg-p-bg: rgba(160,80,220,.12);
  --cg-p-br: rgba(160,80,220,.26);
}

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

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

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

.cgMeta{ display:flex; flex-direction:column; gap:2px; }
.cgDate{ font-size: 13px; opacity:.9; }
.cgRule{ font-size: 12px; opacity:.7; }

.cgStatusBox{
  text-align:right;
  display:flex;
  flex-direction:column;
  gap:6px;
  align-items:flex-end;
  min-width: 140px;
}
.cgStatusLine{
  display:flex;
  gap:10px;
  align-items:baseline;
  justify-content:flex-end;
}
#cgSelCount{ font-size: 14px; }
#cgMistakes{ font-size: 14px; }

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

/* solved bars */
.cgSolvedWrap{ margin-top: 4px; }
.cgSolvedStack{
  display:flex;
  flex-direction:column;
  gap:8px;
  margin-bottom: 10px;
}

.cgSolvedBar{
  border: 1px solid var(--cg-border);
  background: var(--cg-panel);
  border-radius: 14px;
  padding: 10px 12px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}

.cgSolvedLeft{
  display:flex;
  flex-direction:column;
  gap:4px;
  min-width: 0;
}
.cgSolvedLabel{
  font-weight: 900;
  letter-spacing:.2px;
}
.cgSolvedItems{
  font-size: 12px;
  opacity: .78;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.cgSolvedBadge{
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--cg-border);
  background: rgba(255,255,255,.02);
}

.cgSolvedBar.y{ background: var(--cg-y-bg); border-color: var(--cg-y-br); }
.cgSolvedBar.g{ background: var(--cg-g-bg); border-color: var(--cg-g-br); }
.cgSolvedBar.b{ background: var(--cg-b-bg); border-color: var(--cg-b-br); }
.cgSolvedBar.p{ background: var(--cg-p-bg); border-color: var(--cg-p-br); }

/* grid */
.cgGrid{
  display:grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 6px;
}
@media (max-width:520px){
  .cgGrid{ gap: 8px; }
}

.cgTile{
  border: 1px solid var(--cg-border);
  background: var(--cg-panel);
  border-radius: 14px;
  padding: 12px 10px;
  min-height: 54px;
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;

  font-weight: 900;
  letter-spacing: .2px;
  font-size: 14px;
  line-height: 1.15;

  cursor:pointer;
  user-select:none;
  transition: transform .05s ease, outline-color .08s ease, background .12s ease;
}

.cgTile:hover{ transform: translateY(-1px); }

.cgTile.sel{
  outline: 3px solid var(--cg-sel-outline);
  outline-offset: 2px;
}

.cgTile.locked{
  opacity: .45;
  cursor: default;
  transform: none;
}

/* actions */
.cgActions{
  margin-top: 12px;
  display:flex;
  gap:10px;
  justify-content:center;
  flex-wrap:wrap;
}
.cgBtn{
  min-width: 112px;
  height: 40px;
  border-radius: 14px;
  font-size: 14px;
  padding: 0 14px;
}
.cgBtn:disabled{
  opacity: .45;
  cursor: not-allowed;
}

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

/* tiny shake on wrong submit */
@keyframes cgShake{
  0%{ transform: translateX(0); }
  25%{ transform: translateX(-6px); }
  50%{ transform: translateX(6px); }
  75%{ transform: translateX(-4px); }
  100%{ transform: translateX(0); }
}
.cgGrid.shake{ animation: cgShake .22s ease; }

/* Help dialog */
:root{
  --cgHelpBorder: rgba(255,255,255,.07);
  --cgHelpBg: rgba(255,255,255,.02);
}
:root[data-theme="light"]{
  --cgHelpBorder: rgba(11,15,20,.12);
  --cgHelpBg: rgba(11,15,20,.02);
}
.cgHelpDlg::backdrop{ background: rgba(0,0,0,.55); }
:root[data-theme="light"] .cgHelpDlg::backdrop{ background: rgba(0,0,0,.35); }

.cgHelp{
  padding: 10px 10px 12px;
  max-width: 560px;
}
.cgHelpScroll{
  max-height: 70vh;
  overflow: auto;
  padding-right: 2px;
}
.cgHelpBox{
  border: 1px solid var(--cgHelpBorder);
  background: var(--cgHelpBg);
  border-radius: 12px;
  padding: 9px 10px;
  margin: 8px 0;
}
.cgHelpKicker{
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  opacity: .78;
  margin-bottom: 6px;
}
.cgHelpList{ margin: 0; padding-left: 18px; }
.cgHelpList li{ margin: 5px 0; }
.cgHelpActions{
  display:flex;
  gap:10px;
  justify-content:flex-end;
  flex-wrap:wrap;
  margin-top: 8px;
}

#helpDlgCG{
  padding: 0;
  border: 0;
  background: transparent;
}
#helpDlgCG:focus{ outline: none; }

/* --- Shared overlay (apply via body class) --- */
body::before{
  content:"";
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 240px;              /* tweak: 200–280 */
  pointer-events: none;
  z-index: 0;                 /* keep it behind */
  background: none;
}



/* default */
.sub{
  font-size: 0.98rem;
  line-height: 1.25;
}

/* mobile tighten */
@media (max-width:520px){
  .sub{
    font-size: 0.90rem;   /* try 0.88–0.92 */
    line-height: 1.18;
  }
}
