/* ── Games Tree — extra styles on top of GameLayout.css ──────────────── */

/* Centered grid for rows with fewer than 4 cards */
.gt-grid-center {
    justify-content: center;
}

/* ── Tier section headers ─────────────────────────────────────────────── */
.hd-silver {
    background: #f1f5f9;
    border-color: #cbd5e1;
}
.hd-silver .cat-hd-icon { background: #475569; }
.hd-silver .cat-hd-icon svg { color: #fff; stroke: #fff; }
.hd-silver .cat-hd-name  { color: #334155; }
.hd-silver .cat-hd-desc  { color: #64748b; }
.hd-silver .cat-hd-pill  { background: #475569; color: #fff; }

.hd-gold {
    background: #fefce8;
    border-color: #fde68a;
}
.hd-gold .cat-hd-icon { background: #b45309; }
.hd-gold .cat-hd-icon svg { color: #fff; stroke: #fff; }
.hd-gold .cat-hd-name  { color: #92400e; }
.hd-gold .cat-hd-desc  { color: #a16207; }
.hd-gold .cat-hd-pill  { background: #b45309; color: #fff; }

.hd-platinum {
    background: #faf5ff;
    border-color: #d8b4fe;
}
.hd-platinum .cat-hd-icon { background: #7c3aed; }
.hd-platinum .cat-hd-icon svg { color: #fff; stroke: #fff; }
.hd-platinum .cat-hd-name  { color: #5b21b6; }
.hd-platinum .cat-hd-desc  { color: #7c3aed99; }
.hd-platinum .cat-hd-pill  { background: #7c3aed; color: #fff; }

/* ── Unlocked badge on previously-locked cards ──────────────────────── */
.gt-unlocked-card {
    position: relative;
    border-color: #86efac !important;
    box-shadow: 0 0 0 2px rgba(34,197,94,0.25) !important;
}
.gt-unlocked-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 10;
    background: #16a34a;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 999px;
    letter-spacing: 0.03em;
}

/* ── Locked cards ────────────────────────────────────────────────────── */
.gt-locked-card {
    cursor: default;
    position: relative;
    overflow: hidden;
}

/* Locked card top areas */
.gt-locked-top {
    height: 145px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.gt-locked-top--silver {
    background: linear-gradient(140deg, #1e293b 0%, #334155 55%, #1e293b 100%);
}
.gt-locked-top--gold {
    background: linear-gradient(140deg, #1c1410 0%, #292110 55%, #1c1410 100%);
}
.gt-locked-top--platinum {
    background: linear-gradient(140deg, #160d26 0%, #2d1b4e 55%, #160d26 100%);
}

/* Animated glow blob behind lock icon */
.gt-lock-glow {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.3s;
    border-radius: inherit;
}
.gt-locked-card:hover .gt-lock-glow { opacity: 1; }

.gt-lock-glow--silver {
    background: radial-gradient(ellipse at 50% 60%, rgba(148,163,184,0.18) 0%, transparent 70%);
}
.gt-lock-glow--gold {
    background: radial-gradient(ellipse at 50% 60%, rgba(251,191,36,0.18) 0%, transparent 70%);
}
.gt-lock-glow--platinum {
    background: radial-gradient(ellipse at 50% 60%, rgba(168,85,247,0.22) 0%, transparent 70%);
}

/* Lock SVG scale effect on hover */
.gt-lock-svg {
    width: 72px;
    height: 72px;
    position: relative;
    z-index: 2;
    transition: transform 0.35s cubic-bezier(.34,1.56,.64,1);
    filter: drop-shadow(0 0 8px rgba(0,0,0,0.4));
}
.gt-locked-card:hover .gt-lock-svg {
    transform: scale(1.15);
}

/* Default locked card — subtle */
.gt-locked-card:not(.gt-eligible) {
    opacity: 0.72;
}
.gt-locked-card:not(.gt-eligible):hover {
    opacity: 0.85;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.1) !important;
}

/* Eligible locked card — full opacity, glowing border, pointer cursor */
.gt-locked-card.gt-eligible {
    opacity: 1;
    cursor: pointer;
}
.gt-locked-card.gt-eligible:hover {
    transform: translateY(-5px);
}
.gt-locked-card.gt-eligible[data-tier="silver"] {
    border-color: #94a3b8 !important;
    box-shadow: 0 0 0 2px rgba(148,163,184,0.3), 0 8px 24px rgba(148,163,184,0.2) !important;
}
.gt-locked-card.gt-eligible[data-tier="gold"] {
    border-color: #fbbf24 !important;
    box-shadow: 0 0 0 2px rgba(251,191,36,0.3), 0 8px 24px rgba(251,191,36,0.2) !important;
}
.gt-locked-card.gt-eligible[data-tier="platinum"] {
    border-color: #a855f7 !important;
    box-shadow: 0 0 0 2px rgba(168,85,247,0.3), 0 8px 24px rgba(168,85,247,0.2) !important;
}

/* Eligible glow upgraded */
.gt-locked-card.gt-eligible .gt-lock-glow { opacity: 1; }

/* Lock SVG color shift for eligible */
.gt-locked-card.gt-eligible[data-tier="silver"] .gt-lock-svg {
    filter: drop-shadow(0 0 12px rgba(148,163,184,0.5));
}
.gt-locked-card.gt-eligible[data-tier="gold"] .gt-lock-svg {
    filter: drop-shadow(0 0 14px rgba(251,191,36,0.55));
}
.gt-locked-card.gt-eligible[data-tier="platinum"] .gt-lock-svg {
    filter: drop-shadow(0 0 14px rgba(168,85,247,0.55));
}

/* Card body for locked */
.gt-locked-name {
    color: #64748b;
    font-size: 0.95rem;
}
.gt-locked-card.gt-eligible .gt-locked-name {
    color: var(--text);
}

.gt-lock-reqs {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 6px;
}
.gt-req {
    font-size: 0.75rem;
    font-weight: 600;
    color: #94a3b8;
    line-height: 1.4;
}
.gt-req strong {
    font-weight: 800;
    color: #64748b;
}
.gt-locked-card.gt-eligible .gt-req { color: #64748b; }
.gt-locked-card.gt-eligible .gt-req strong { color: #1a1d26; }

/* Unlock CTA button (added by JS) */
.gt-unlock-btn {
    width: 100%;
    margin-top: 10px;
    padding: 9px 0;
    border-radius: 10px;
    border: none;
    font-family: 'Heebo', sans-serif;
    font-size: 0.85rem;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
}
.gt-unlock-btn:hover { transform: translateY(-1px); }
.gt-unlock-btn:disabled { opacity: 0.5; cursor: default; transform: none; }
[data-tier="silver"] .gt-unlock-btn {
    background: linear-gradient(135deg, #64748b, #475569);
    color: #fff;
    box-shadow: 0 2px 8px rgba(71,85,105,0.35);
}
[data-tier="gold"] .gt-unlock-btn {
    background: linear-gradient(135deg, #fbbf24, #d97706);
    color: #1a0a00;
    box-shadow: 0 2px 8px rgba(251,191,36,0.4);
}
[data-tier="platinum"] .gt-unlock-btn {
    background: linear-gradient(135deg, #a855f7, #7c3aed);
    color: #fff;
    box-shadow: 0 2px 8px rgba(168,85,247,0.4);
}

/* ── Unlock modal ─────────────────────────────────────────────────────── */
.gt-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
}
.gt-modal-overlay.gt-modal--open {
    opacity: 1;
    pointer-events: all;
}
.gt-modal {
    background: #fff;
    border: 2px solid var(--border);
    border-radius: 20px;
    padding: 2rem 2.5rem;
    max-width: 380px;
    width: 90%;
    text-align: center;
    box-shadow: 0 24px 60px rgba(0,0,0,0.18);
    transform: scale(0.92) translateY(12px);
    transition: transform 0.28s cubic-bezier(.34,1.56,.64,1);
    direction: rtl;
}
.gt-modal-overlay.gt-modal--open .gt-modal { transform: scale(1) translateY(0); }

.gt-modal-tier {
    font-size: 1.6rem;
    margin-bottom: 0.5rem;
}
.gt-modal-title {
    font-size: 1.3rem;
    font-weight: 900;
    color: var(--text);
    margin: 0 0 1rem;
}
.gt-modal-cost {
    background: var(--basis-light);
    border: 1.5px solid var(--basis-border);
    border-radius: 10px;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--basis-dark);
    margin-bottom: 0.5rem;
}
.gt-modal-coins {
    font-size: 0.85rem;
    color: var(--text-mid);
    margin-bottom: 1.5rem;
}
.gt-modal-actions { display: flex; gap: 0.75rem; justify-content: center; }

.gt-btn {
    padding: 0.65rem 1.6rem;
    border-radius: 10px;
    font-family: 'Heebo', sans-serif;
    font-weight: 800;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: transform 0.15s, opacity 0.15s;
}
.gt-btn:hover { transform: translateY(-1px); }
.gt-btn:disabled { opacity: 0.5; cursor: default; transform: none; }
.gt-btn--confirm {
    background: linear-gradient(135deg, var(--basis-dark), var(--basis-mid));
    color: #fff;
    box-shadow: 0 3px 10px rgba(109,40,217,0.35);
}
.gt-btn--cancel {
    background: var(--bg);
    color: var(--text-mid);
    border: 2px solid var(--border);
}

/* ── Toast ────────────────────────────────────────────────────────────── */
.gt-toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: var(--text);
    color: #fff;
    padding: 0.75rem 1.5rem;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 700;
    z-index: 2000;
    transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1), opacity 0.35s;
    opacity: 0;
    white-space: nowrap;
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
    font-family: 'Heebo', sans-serif;
}
.gt-toast.gt-toast--show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}
.gt-toast.gt-toast--success { background: #16a34a; }
.gt-toast.gt-toast--error   { background: #dc2626; }

/* ── Chain layout ─────────────────────────────────────────────────────── */
.gt-chain {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 0;
}

.gt-chain-card {
    flex: 1;
    min-width: 0;
}

/* Short chain (2-card row) — limit width so cards don't stretch too wide */
.gt-chain--short {
    max-width: 640px;
}

.gt-link {
    flex: 0 0 52px;
    display: flex;
    flex-direction: row;
    align-items: center;
    position: relative;
    z-index: 1;
    padding: 0 2px;
}

.gt-link-line {
    flex: 1;
    height: 2px;
    background: var(--border);
    border-radius: 1px;
}

.gt-link-lock {
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    flex-shrink: 0;
    transition: border-color 0.2s, background 0.2s;
}

.gt-link--open .gt-link-line {
    background: #86efac;
}

.gt-link--open .gt-link-lock {
    border-color: #86efac;
    background: #dcfce7;
    color: #16a34a;
    font-size: 0.8rem;
    font-weight: 800;
}

/* ── Mobile ───────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .gt-chain {
        flex-direction: column;
    }
    .gt-link {
        flex: 0 0 36px;
        flex-direction: column;
        align-items: center;
        padding: 2px 0;
    }
    .gt-link-line {
        width: 2px;
        height: auto;
        flex: 1;
    }
    .gt-chain--short {
        max-width: none;
    }
}

@media (max-width: 640px) {
    .gt-modal { padding: 1.5rem 1.25rem; }
}

/* ── Category info ? button ───────────────────────────────────────────── */
.cat-info-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid currentColor;
    background: transparent;
    color: inherit;
    font-size: 1rem;
    font-weight: 900;
    cursor: pointer;
    flex-shrink: 0;
    opacity: 0.55;
    transition: opacity 0.15s, transform 0.15s;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Heebo', sans-serif;
    padding: 0;
}
.cat-info-btn:hover { opacity: 1; transform: scale(1.1); }

/* ── Category info modal ──────────────────────────────────────────────── */
.cat-info-modal {
    position: relative;
    max-width: 420px;
}
.cat-info-close {
    position: absolute;
    top: 12px;
    left: 14px;
    background: none;
    border: none;
    font-size: 1.1rem;
    color: var(--text-mid);
    cursor: pointer;
    padding: 4px 6px;
    line-height: 1;
    border-radius: 6px;
    transition: background 0.15s;
}
.cat-info-close:hover { background: var(--border); color: var(--text); }
.cat-info-icon {
    font-size: 2.8rem;
    margin-bottom: 0.4rem;
    line-height: 1;
}
.cat-info-title {
    font-size: 1.3rem;
    font-weight: 900;
    color: var(--text);
    margin: 0 0 0.75rem;
}
.cat-info-body {
    font-size: 0.95rem;
    line-height: 1.75;
    color: var(--text-mid);
    margin: 0 0 1.25rem;
    text-align: right;
}
.cat-info-dismiss-row {
    margin-bottom: 1.25rem;
}
.cat-info-dismiss-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.88rem;
    color: var(--text-mid);
    cursor: pointer;
    justify-content: flex-end;
    user-select: none;
}
.cat-info-dismiss-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--basis-dark);
    flex-shrink: 0;
}
