/**
 * Concentration Grid — focus-training game. Builds on word-games.css.
 */

.cg-wrap { max-width: 640px; margin: 0 auto; }

.cg-size { display: flex; align-items: center; gap: 8px; }
.cg-size span {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 14px;
    letter-spacing: 2px;
    color: var(--ig-ice, #8FB8DE);
}
.cg-size select {
    font-family: var(--ig-font-ui, 'Inter', sans-serif);
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    background: rgba(143,184,222,.12);
    border: 1px solid rgba(143,184,222,.35);
    border-radius: var(--ig-radius-sm, 4px);
    padding: 10px 12px;
    min-height: 44px;
    cursor: pointer;
}
.cg-size select option { color: var(--ig-text-primary, #1a2332); }
#cgTime, #cgNext { font-variant-numeric: tabular-nums; }
#cgNext { color: #ffffff; }

.cg-grid {
    display: grid;
    gap: 4px;
    border-radius: 14px;
    padding: 12px;
    background: linear-gradient(165deg, #eef4fa 0%, #dde9f3 100%);
    box-shadow: inset 0 2px 14px rgba(10,22,40,.10);
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
}
.cg-intro {
    grid-column: 1 / -1;
    text-align: center;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 22px;
    letter-spacing: 2px;
    color: rgba(49,72,122,.55);
    padding: 60px 10px;
    margin: 0;
}
.cg-cell {
    aspect-ratio: 1;
    min-width: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: #ffffff;
    border: 1px solid #c4d2e2;
    font-family: var(--ig-font-ui, 'Inter', sans-serif);
    font-weight: 700;
    font-size: var(--cg-font, 18px);
    color: var(--ig-navy, #0A1628);
    cursor: pointer;
    font-variant-numeric: tabular-nums;
}
.cg-cell:hover { background: #eef4fb; }
.cg-cell.is-done {
    background: var(--ig-accent-blue, #31487A);
    border-color: var(--ig-accent-blue, #31487A);
    color: rgba(255,255,255,.55);
    cursor: default;
}
.cg-cell.is-shake { animation: cg-shake .25s ease; }
@keyframes cg-shake {
    0%, 100% { transform: translateX(0); }
    30% { transform: translateX(-4px); }
    70% { transform: translateX(4px); }
}
@media (prefers-reduced-motion: reduce) {
    .cg-cell.is-shake { animation: none; }
}

.cg-done {
    grid-column: 1 / -1;
    text-align: center;
    padding: 14px 10px;
}
.cg-done h2 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 36px;
    letter-spacing: 3px;
    color: var(--ig-navy, #0A1628);
    margin: 0 0 4px;
}
.cg-done p { color: #5a6678; font-size: 14px; margin: 0 0 10px; }

/* ---------------- v2: tabs, mode, countdown, Pro ---------------- */

.cg-tabs {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin: 0 auto 16px;
}
.cg-tab {
    font-family: var(--ig-font-ui, 'Inter', sans-serif);
    font-size: 14px;
    font-weight: 600;
    color: rgba(255,255,255,.7);
    background: transparent;
    border: 1px solid rgba(143,184,222,.3);
    border-radius: 999px;
    padding: 10px 18px;
    min-height: 44px;
    cursor: pointer;
}
.cg-tab:hover { color: #fff; }
.cg-tab.is-active { color: var(--ig-navy, #0A1628); background: #fff; border-color: #fff; }
.cg-tab:disabled { opacity: .5; cursor: default; }
.cg-tabs--small { justify-content: flex-start; margin: 0; }
.cg-tabs--small .cg-tab { font-size: 13px; padding: 8px 14px; }

.cg-mode {
    display: inline-flex;
    border: 1px solid rgba(143,184,222,.35);
    border-radius: var(--ig-radius-sm, 4px);
    overflow: hidden;
}
.cg-mode[hidden], .cg-size[hidden] { display: none; }
.cg-mode__btn {
    font-family: var(--ig-font-ui, 'Inter', sans-serif);
    font-size: 13px;
    font-weight: 600;
    color: rgba(255,255,255,.7);
    background: transparent;
    border: 0;
    padding: 10px 14px;
    min-height: 44px;
    cursor: pointer;
}
.cg-mode__btn + .cg-mode__btn { border-left: 1px solid rgba(143,184,222,.35); }
.cg-mode__btn.is-active { color: #fff; background: var(--ig-accent-blue, #31487A); }
.cg-mode__btn:disabled { cursor: default; }

.cg-note {
    font-size: 14px;
    line-height: 1.5;
    color: rgba(255,255,255,.72);
    margin: 0 0 12px;
}

.cg-grid { margin: 0 auto; }
.cg-grid.is-big { gap: 2px; padding: 6px; }
.cg-grid.is-big .cg-cell { border-radius: 4px; }

/* Pro: a found number looks exactly like the rest. */
.cg-grid.is-pro .cg-cell.is-done {
    background: #ffffff;
    border-color: #c4d2e2;
    color: var(--ig-navy, #0A1628);
}

.cg-countdown {
    grid-column: 1 / -1;
    text-align: center;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 72px;
    line-height: 1;
    color: var(--ig-accent-blue, #31487A);
    padding: 70px 10px;
    margin: 0;
}

.cg-done p.cg-done__status { font-weight: 600; color: var(--ig-accent-blue, #31487A); min-height: 1.2em; }
.cg-done__actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.cg-bigtip {
    font-size: 13px;
    color: rgba(255,255,255,.65);
    text-align: center;
    margin: 10px 0 0;
}

/* ---------------- progress + boards panels ---------------- */

.cg-panel {
    max-width: 640px;
    margin: 30px auto 0;
    padding: 18px 20px 20px;
    border: 1px solid rgba(143,184,222,.25);
    border-radius: var(--ig-radius-md, 8px);
    background: rgba(143,184,222,.06);
}
.cg-panel__title {
    font-family: var(--ig-font-heading, 'Inter', sans-serif);
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 12px;
}
.cg-panel__title span { font-size: 14px; font-weight: 500; color: var(--ig-ice, #8FB8DE); margin-left: 6px; }
.cg-panel__sub { font-size: 14px; line-height: 1.5; color: rgba(255,255,255,.7); margin: 10px 0 0; }
.cg-panel__sub a { color: var(--ig-ice, #8FB8DE); }
.cg-empty { font-size: 14px; color: rgba(255,255,255,.6); margin: 0; }

.cg-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.cg-stats:empty { display: none; }
.cg-stat { display: flex; flex-direction: column; gap: 2px; }
.cg-stat__v { font-size: 22px; font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; }
.cg-stat__k { font-size: 12px; color: rgba(255,255,255,.6); }

.cg-chart svg { width: 100%; height: auto; display: block; }
.cg-chart__grid { stroke: rgba(143,184,222,.18); stroke-width: 1; }
.cg-chart__axis { fill: rgba(255,255,255,.55); font-size: 12px; font-family: var(--ig-font-ui, 'Inter', sans-serif); }
.cg-chart__dot { fill: var(--ig-ice, #8FB8DE); }
.cg-chart__best { fill: none; stroke: #C9A654; stroke-width: 2.5; stroke-linejoin: round; }
.cg-chart__key { font-size: 12px; color: rgba(255,255,255,.6); margin: 6px 0 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cg-key { display: inline-block; }
.cg-key--dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ig-ice, #8FB8DE); }
.cg-key--line { width: 16px; height: 3px; background: #C9A654; margin-left: 10px; }

.cg-boards__bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.cg-boards__filters { display: flex; gap: 10px; flex-wrap: wrap; }
.cg-boards__filters[hidden] { display: none; }
.cg-board { margin: 12px 0 0; padding: 0 0 0 26px; }
.cg-board li {
    font-size: 15px;
    color: rgba(255,255,255,.88);
    padding: 6px 0;
    border-bottom: 1px solid rgba(143,184,222,.12);
}
.cg-board li::marker { color: rgba(255,255,255,.5); }
.cg-board li .v { float: right; margin-left: 12px; font-variant-numeric: tabular-nums; font-weight: 600; color: #fff; }
.cg-board .cg-board__empty { list-style: none; margin-left: -26px; color: rgba(255,255,255,.6); border: 0; }

@media (max-width: 700px) {
    .cg-grid { gap: 3px; padding: 8px; }
    .cg-panel { padding: 14px; }
    .cg-stat__v { font-size: 18px; }
}

/* The site-wide reading-stats button sits on the grid's corner cells on a
   phone: hide it while a grid is being played. */
body.cg-playing #ingoal-visitor-widget { display: none; }

.cg-share-text {
    width: 100%;
    max-width: 360px;
    font: 13px/1.4 var(--ig-font-ui, 'Inter', sans-serif);
    padding: 8px;
    border-radius: 6px;
    border: 1px solid #c4d2e2;
}

/* Screen-reader-only live region (countdown, result). */
.cg-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* Visible keyboard focus on every control. */
.cg-tab:focus-visible,
.cg-mode__btn:focus-visible,
.cg-cell:focus-visible,
.cg-page .wg-btn:focus-visible,
.cg-size select:focus-visible,
.cg-boardname input:focus-visible {
    outline: 3px solid #C9A654;
    outline-offset: 2px;
}

.cg-boardname { margin: 14px 0 0; font-size: 14px; color: rgba(255,255,255,.8); }
.cg-boardname p { margin: 0 0 6px; }
.cg-boardname strong { color: #fff; }
.cg-boardname label { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; }
.cg-boardname input { width: 18px; height: 18px; }

/* Challenge banner (someone's time to beat, from a ?vs= link). */
.cg-challenge {
    margin: 0 0 12px;
    padding: 10px 14px;
    border-radius: var(--ig-radius-sm, 4px);
    background: #C9A654;
    color: #1B102F;
    font-size: 15px;
    font-weight: 600;
}
.cg-done p.cg-done__vs { font-weight: 700; color: var(--ig-navy, #0A1628); font-size: 16px; }
.cg-challenge-opts { display: inline-flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.cg-challenge-opts a.wg-btn { text-decoration: none; display: inline-flex; align-items: center; }

/* Idle board: a faded grid with a label over it; scrambles just before the
   real grid drops in (concentration.js idleGrid / scramble). */
.cg-grid { position: relative; }
.cg-grid.is-idle .cg-cell {
    opacity: .3;
    pointer-events: none;
    cursor: default;
    transition: opacity .35s ease;
}
.cg-grid.is-idle.is-waking .cg-cell { opacity: .75; }
.cg-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 10px;
    text-align: center;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 30px;
    letter-spacing: 2px;
    color: var(--ig-navy, #0A1628);
    pointer-events: none;
}
.cg-overlay__label {
    display: inline-block;
    padding: 12px 22px 9px;
    border-radius: 999px;
    background: rgba(255,255,255,.94);
    box-shadow: 0 4px 18px rgba(10,22,40,.18);
}
/* Between runs the pill is the Start button itself */
.cg-overlay__start {
    font: inherit;
    letter-spacing: inherit;
    color: #fff;
    background: var(--ig-navy, #0A1628);
    border: 0;
    cursor: pointer;
    min-height: 48px;
    pointer-events: auto;
}
.cg-overlay__start:hover { background: var(--ig-accent-blue, #31487A); }
.cg-overlay__start:focus-visible { outline: 3px solid var(--ig-accent-blue, #31487A); outline-offset: 3px; }
.cg-overlay__start:disabled { opacity: .55; cursor: default; }
.cg-overlay.is-count { font-size: 80px; color: var(--ig-accent-blue, #31487A); }
.cg-overlay.is-count .cg-overlay__label {
    min-width: 1.6em;
    padding: 16px 28px 8px;
    border-radius: 24px;
}
@media (prefers-reduced-motion: reduce) {
    .cg-grid.is-idle .cg-cell { transition: none; }
}

/* ---------------- Today's grid panel (2026-12-02) ----------------
   Leads the page: today's grid is the thing everyone shares. */

.cg-today {
    max-width: 640px;
    margin: 0 auto 18px;
    padding: 16px 18px;
    border: 1px solid rgba(143,184,222,.28);
    border-left: 4px solid #C9A654;
    border-radius: var(--ig-radius-md, 8px);
    background: rgba(143,184,222,.08);
    color: #fff;
}
.cg-today__title {
    font-family: var(--ig-font-heading, 'Inter', sans-serif);
    font-size: 22px;
    font-weight: 700;
    line-height: 1.2;
    color: #fff;
    margin: 0 0 6px;
}
.cg-today__line { font-size: 16px; line-height: 1.45; color: rgba(255,255,255,.9); margin: 0 0 6px; }
.cg-today__meta { font-size: 14px; line-height: 1.5; color: var(--ig-ice, #8FB8DE); margin: 0; }
.cg-today__meta { display: flex; flex-wrap: wrap; gap: 0 10px; }
.cg-today__meta > span[hidden] { display: none; }
.cg-today__meta b { color: #fff; font-weight: 600; font-variant-numeric: tabular-nums; }
.cg-today__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 4px; }
.cg-note:empty { display: none; }
.cg-today__actions > [hidden] { display: none; }
.cg-today .cg-today__play { background: #C9A654; border-color: #C9A654; color: #1B102F; font-size: 14px; }
.cg-today .cg-today__play:hover { background: #d8b866; }
.cg-today__link {
    font: 600 14px/1.2 var(--ig-font-ui, 'Inter', sans-serif);
    color: var(--ig-ice, #8FB8DE);
    background: none;
    border: 0;
    padding: 0;
    min-height: 44px;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}
.cg-today__link:hover { color: #fff; }
.cg-today__link:disabled { opacity: .5; cursor: default; }
.cg-today__link:focus-visible,
.cg-today .wg-btn:focus-visible,
.cg-install button:focus-visible { outline: 3px solid #C9A654; outline-offset: 2px; }

/* "Sign in" in the panel: only in the installed app (the site header,
   which has its own Sign in, is hidden there). */
.cg-app-signin { display: none; }
.cg-standalone .cg-today__actions > .cg-app-signin:not([hidden]) { display: inline-flex; align-items: center; }

/* Install line (after a run, second visit on). */
.cg-install {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    margin: 12px 0 0;
    padding: 10px 44px 10px 14px;
    border: 1px solid rgba(143,184,222,.3);
    border-radius: var(--ig-radius-sm, 4px);
    font-size: 14px;
    line-height: 1.45;
    color: rgba(255,255,255,.85);
}
.cg-install[hidden], .cg-install > [hidden] { display: none; }
.cg-install > span { flex: 1 1 240px; }
.cg-install__x {
    position: absolute;
    top: 0;
    right: 0;
    width: 44px;
    height: 44px;
    border: 0;
    background: transparent;
    color: rgba(255,255,255,.7);
    font-size: 22px;
    cursor: pointer;
}

@media (max-width: 700px) {
    .cg-today { padding: 14px; }
    .cg-today__title { font-size: 20px; }
}

/* ---------------- Installed web app ----------------
   Opens straight onto the game: no site header, promo bar, footer, title or
   long intro (the website keeps them). .cg-standalone is set in <head>
   (concentration.php) only when the page runs standalone AND was opened from
   the grid's own app: the site's app and Solitaire's are standalone too, and
   must keep the header. */
.cg-standalone body.ingoal-word-game .ig-site-header,
.cg-standalone body.ingoal-word-game .ig-promo-bar,
.cg-standalone body.ingoal-word-game .ig-site-footer,
.cg-standalone body.ingoal-word-game #ingoal-visitor-widget,
.cg-standalone .cg-page .wg-hero,
.cg-standalone .cg-page .wg-about { display: none; }
.cg-standalone .cg-page { padding-top: calc(14px + env(safe-area-inset-top, 0px)); padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px)); }

/* ---------------- Embed (/games/concentration-grid/embed/) ----------------
   Today's grid alone, inside an article's iframe. */
body.cg-embed-body { margin: 0; font-family: var(--ig-font-ui, 'Inter', -apple-system, sans-serif); -webkit-text-size-adjust: 100%; }
.cg-embed-body *, .cg-embed-body *::before, .cg-embed-body *::after { box-sizing: border-box; }
.wg-page.cg-embed { max-width: none; margin: 0; padding: 14px 12px 16px; }
.cg-embed .cg-today { margin-bottom: 12px; }
.cg-embed .cg-done a.wg-btn { text-decoration: none; display: inline-flex; align-items: center; }
.cg-done p.cg-done__compare { font-size: 16px; font-weight: 700; line-height: 1.4; color: var(--ig-navy, #0A1628); margin: 0 auto 10px; max-width: 34ch; }
.cg-done p.cg-done__compare[hidden] { display: none; }
