/* Game Changers browser: filterable grid of 53 cards.
   Tokens consumed from /css/base.css. Mobile-first.
   Chrome rules followed: no transforms inside isolation containers,
   defensive [hidden] override below for filter chip groups. */

.gc-app {
    margin: 1.5rem 0 2.5rem;
    padding: 1.25rem;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    isolation: isolate;
}

.gc-app [hidden] { display: none !important; }

/* ── Meta strip ── */
.gc-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}
.gc-meta-count {
    font-weight: 600;
    color: var(--accent);
}
.gc-meta-sep {
    color: var(--text-muted);
}
.gc-meta code {
    background: rgba(212,175,55,0.10);
    padding: 0.05rem 0.4rem;
    border-radius: 4px;
    color: var(--accent);
    font-size: 0.75rem;
}

/* ── Controls ── */
.gc-controls {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.gc-search-wrap { display: block; }
.gc-search-wrap input[type="search"] {
    width: 100%;
    padding: 0.65rem 0.9rem;
    border-radius: 10px;
    border: 1.5px solid rgba(212,175,55,0.30);
    background: var(--card-bg-hi);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
}
.gc-search-wrap input[type="search"]:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-color: var(--accent);
}
.gc-search-wrap input[type="search"]::-webkit-search-cancel-button {
    cursor: pointer;
}

.gc-filter-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
    border: none;
    margin: 0;
    padding: 0;
}
.gc-filter-group legend {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-right: 0.5rem;
    flex: 0 0 auto;
}

.gc-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    border: 1.5px solid rgba(212,175,55,0.25);
    background: rgba(212,175,55,0.06);
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    line-height: 1;
    font-family: inherit;
    min-height: 32px;
}
.gc-chip:hover {
    background: rgba(212,175,55,0.14);
    color: var(--text-primary);
}
.gc-chip:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
.gc-chip.is-active {
    background: var(--accent);
    color: #1a1420;
    border-color: var(--accent);
    font-weight: 600;
}
.gc-chip-count {
    display: inline-block;
    background: rgba(0,0,0,0.18);
    padding: 0.05rem 0.4rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-variant-numeric: tabular-nums;
}
.gc-chip.is-active .gc-chip-count {
    background: rgba(0,0,0,0.20);
    color: #1a1420;
}

/* Color hints — left edge dot only on inactive chips */
.gc-chip-w::before, .gc-chip-u::before, .gc-chip-b::before,
.gc-chip-r::before, .gc-chip-g::before, .gc-chip-m::before,
.gc-chip-c::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,0.20);
    flex: 0 0 auto;
}
.gc-chip-w::before { background: #f5f1d3; }
.gc-chip-u::before { background: #6db4ed; }
.gc-chip-b::before { background: #4a3a52; }
.gc-chip-r::before { background: #ed6f6f; }
.gc-chip-g::before { background: #6dc285; }
.gc-chip-m::before { background: linear-gradient(90deg,#ed6f6f,#6dc285); }
.gc-chip-c::before { background: #b8b0c2; }

.gc-sort-wrap {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.gc-sort-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
#gc-sort {
    padding: 0.4rem 0.75rem;
    border-radius: 8px;
    border: 1.5px solid rgba(212,175,55,0.25);
    background: var(--card-bg-hi);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-family: inherit;
    cursor: pointer;
    min-height: 32px;
}
#gc-sort:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.gc-clear-btn {
    align-self: flex-start;
    padding: 0.4rem 0.9rem;
    border-radius: 8px;
    background: transparent;
    border: 1.5px solid rgba(248,113,113,0.45);
    color: #fca5a5;
    font-size: 0.8125rem;
    cursor: pointer;
    font-family: inherit;
}
.gc-clear-btn:hover { background: rgba(248,113,113,0.12); }

/* ── Result meta ── */
.gc-result-meta {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: rgba(212,175,55,0.06);
    border-radius: 8px;
}
.gc-result-meta span[data-gc-result-count] {
    color: var(--accent);
    font-weight: 600;
}

/* ── Grid ── */
.gc-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    list-style: none;
    padding: 0;
    margin: 0;
}
@media (min-width: 560px) {
    .gc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
}
@media (min-width: 880px) {
    .gc-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1180px) {
    .gc-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.gc-loading,
.gc-empty,
.gc-error {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-secondary);
    background: rgba(212,175,55,0.04);
    border-radius: 10px;
    border: 1px dashed rgba(212,175,55,0.20);
}
.gc-error {
    color: #fca5a5;
    border-color: rgba(248,113,113,0.30);
    background: rgba(248,113,113,0.06);
}
.gc-empty-reset {
    background: transparent;
    border: 1.5px solid var(--accent);
    color: var(--accent);
    padding: 0.3rem 0.75rem;
    border-radius: 6px;
    font-family: inherit;
    cursor: pointer;
    margin-left: 0.5rem;
}
.gc-empty-reset:hover { background: rgba(212,175,55,0.12); }

/* ── Card tile ── */
.gc-card {
    display: flex;
    flex-direction: column;
    background: var(--card-bg-hi);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    overflow: hidden;
    height: 100%;
}
.gc-card-link {
    display: block;
    aspect-ratio: 244 / 340;
    background: rgba(0,0,0,0.30);
    overflow: hidden;
}
.gc-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.gc-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.85rem 0.95rem 1rem;
    flex: 1 1 auto;
}
.gc-card-name {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent);
    line-height: 1.2;
}
.gc-card-meta {
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.3;
}
.gc-card-cost {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    color: var(--text-secondary);
    background: rgba(212,175,55,0.08);
    padding: 0.05rem 0.4rem;
    border-radius: 4px;
    font-size: 0.7rem;
}
.gc-card-type {
    flex: 1 1 auto;
    min-width: 0;
}
.gc-card-tags {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}
.gc-card-tags li {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: rgba(167,139,250,0.14);
    color: #c4b5fd;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    border: 1px solid rgba(167,139,250,0.25);
}
.gc-card-why {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.5;
    flex: 1 1 auto;
}
.gc-card-foot {
    margin: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    padding-top: 0.4rem;
    border-top: 1px solid rgba(212,175,55,0.10);
}
.gc-card-scryfall {
    color: var(--accent-purple);
    font-weight: 500;
    text-decoration: none;
}
.gc-card-scryfall:hover { text-decoration: underline; }
.gc-card-price {
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}
.gc-card-price[data-price-tier="premium"] { color: #fbbf24; }

/* ── No-script fallback ── */
.gc-noscript {
    padding: 0.75rem 1rem;
    background: rgba(248,113,113,0.08);
    border: 1px solid rgba(248,113,113,0.25);
    border-radius: 8px;
    color: #fca5a5;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

/* ── Sources strip ── */
.gc-sources {
    list-style: disc;
    padding-left: 1.5rem;
    margin: 0.75rem 0;
}
.gc-sources li {
    margin-bottom: 0.4rem;
    font-size: 0.875rem;
    line-height: 1.6;
}
.gc-sources code {
    background: rgba(212,175,55,0.10);
    padding: 0.05rem 0.4rem;
    border-radius: 4px;
    color: var(--accent);
    font-size: 0.8em;
}

.gc-timeline-note {
    font-size: 0.8125rem;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 0.5rem;
}

/* ── Visually hidden helper (a11y) ── */
.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ── FAQ accordion (div-based; details/summary forbidden per Chrome compositor rules) ── */
.faq-section { margin: 2rem 0; }
.faq-item { border: 1px solid #2a2a2e; border-radius: 8px; margin-bottom: 0.75rem; overflow: hidden; background: #141418; }
.faq-q { padding: 1rem 1.25rem; cursor: pointer; font-weight: 600; color: #e5e7eb; display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; background: #1a1a1e; user-select: none; }
.faq-q::after { content: '+'; font-size: 1.25rem; color: var(--accent-purple, #a78bfa); flex-shrink: 0; }
.faq-item.open .faq-q::after { content: '\2212'; }
.faq-q:focus-visible { outline: 2px solid var(--accent-purple, #a78bfa); outline-offset: 2px; }
.faq-a { max-height: 0; overflow: hidden; transition: max-height 0.3s ease, padding 0.3s ease; }
.faq-item.open .faq-a { max-height: 800px; padding: 0 1.25rem 1rem; }
.faq-a p { margin: 0.5rem 0; color: #c9c9d0; line-height: 1.6; }
.faq-a a { color: var(--accent-purple, #a78bfa); }
.faq-a a:hover { text-decoration: underline; }
