/* Concentration. Loaded only on the concentration page.
   Every rule is scoped under #concentrationApp, so nothing leaks into the site. */

#concentrationApp { max-width: 100%; }
#concentrationApp .gkc-card { overflow: hidden; }
#concentrationApp .gkc-card .card-header { background: #0f5132; color: #fff; }
#concentrationApp .gkc-card .card-header .gkc-sub { color: #d1e7dd !important; }
#concentrationApp .card-body { background: #146c43 radial-gradient(ellipse at 50% 30%, #1d8a57 0%, #146c43 60%, #0f5132 100%); color: #fff; }
#concentrationApp .card-body .text-body-secondary { color: #d1e7dd !important; }
#concentrationApp .card-body .btn-outline-primary { --bs-btn-color: #fff; --bs-btn-border-color: #fff; --bs-btn-hover-bg: #fff; --bs-btn-hover-color: #0f5132; --bs-btn-hover-border-color: #fff; --bs-btn-active-bg: #fff; --bs-btn-active-color: #0f5132; --bs-btn-active-border-color: #fff; }
#concentrationApp .card-body .btn-outline-primary .text-body-secondary { color: inherit !important; opacity: .8; }
#concentrationApp .card-body .btn-primary { --bs-btn-bg: #fff; --bs-btn-color: #0f5132; --bs-btn-border-color: #fff; --bs-btn-hover-bg: #d1e7dd; --bs-btn-hover-color: #0f5132; --bs-btn-hover-border-color: #d1e7dd; }
#concentrationApp .card-body .btn-link { color: #fff; }
#concentrationApp .btn { min-height: 44px; }
#concentrationApp .btn:focus-visible { outline: 3px solid #ffc107; outline-offset: 2px; }

#concentrationApp .gkc-levels { max-width: 420px; }
#concentrationApp .gkc-choices { max-width: 420px; }
#concentrationApp .gkc-choice { padding: 12px; }
#concentrationApp .gkc-choice-img { width: 100%; max-width: 120px; height: auto; border-radius: 8px; }
#concentrationApp .gkc-preview { width: 120px; height: auto; border-radius: 8px; box-shadow: 0 6px 18px rgba(0, 0, 0, .35); }

/* The table: a grid with a fixed column count per level, so the whole table
   fits the content column without sideways scroll. */
#concentrationApp .gkc-table {
    --gkc-cols: var(--gkc-cols-xs, 4);
    display: grid;
    grid-template-columns: repeat(var(--gkc-cols), minmax(0, 1fr));
    gap: 8px;
    max-width: calc(var(--gkc-cols) * 150px);
    margin: 0 auto;
}
@media (min-width: 768px) {
    #concentrationApp .gkc-table { --gkc-cols: var(--gkc-cols-md, 8); gap: 12px; }
}
#concentrationApp .gkc-cell {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 7 / 10;
    padding: 0;
    border: 0;
    background: none;
    perspective: 800px;
    cursor: pointer;
    border-radius: 8px;
}
#concentrationApp .gkc-cell:focus-visible { outline: 3px solid #ffc107; outline-offset: 2px; }
#concentrationApp .gkc-inner {
    position: absolute;
    inset: 0;
    transform-style: preserve-3d;
    transition: transform .35s ease;
}
#concentrationApp .gkc-cell.is-up .gkc-inner { transform: rotateY(180deg); }
#concentrationApp .gkc-face {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 3px 8px rgba(0, 0, 0, .35);
}
#concentrationApp .gkc-back { background: transparent; }
#concentrationApp .gkc-front { transform: rotateY(180deg); }
#concentrationApp .gkc-cell.is-matched { cursor: default; }
#concentrationApp .gkc-cell.is-matched .gkc-front { box-shadow: 0 0 0 3px #ffc107, 0 3px 8px rgba(0, 0, 0, .35); }
#concentrationApp .gkc-cell.is-miss .gkc-front { box-shadow: 0 0 0 3px #dc3545, 0 3px 8px rgba(0, 0, 0, .35); }
#concentrationApp .gkc-cell:not(.is-up):hover .gkc-inner { transform: translateY(-3px); }

@media (prefers-reduced-motion: reduce) {
    #concentrationApp .gkc-inner { transition: none; }
}

/* The site sets p { margin: 15px }. Inside the game, Bootstrap spacing classes own the gaps. */
#concentrationApp p { margin-left: 0; margin-right: 0; margin-top: 0; }
