/* ============================================================
   Completion Cards — Reusable Component Classes (cc- prefix)
   Loaded after theme.css, before site.css.
   Only classes used on 2+ pages live here — single-page styles
   (including .cc-page-* wrappers) belong in site.css.
   ============================================================ */

/* --- Buttons --- */
.cc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: var(--cc-radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: background-color 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
    text-decoration: none;
    line-height: 1.4;
}

.cc-btn.--primary {
    background-color: var(--cc-primary);
    color: #fff;
    border-color: var(--cc-primary);
}

.cc-btn.--primary:hover {
    background-color: var(--cc-primary-hover);
    box-shadow: var(--cc-glow-strong);
}

.cc-btn.--outline {
    background: transparent;
    color: var(--cc-primary);
    border-color: var(--cc-primary);
}

.cc-btn.--outline:hover {
    background-color: var(--cc-primary);
    color: #fff;
    box-shadow: var(--cc-glow);
}

.cc-btn.--ghost {
    background: transparent;
    color: var(--cc-primary);
    border: none;
    padding: 0.25rem 0.5rem;
}

.cc-btn.--ghost:hover {
    text-decoration: underline;
}

.cc-btn.--sm {
    padding: 0.3rem 0.75rem;
    font-size: 0.8rem;
}

.cc-btn.--lg {
    padding: 0.75rem 2rem;
    font-size: 1rem;
    font-weight: 600;
}

.cc-btn.--danger {
    background-color: transparent;
    color: var(--cc-danger);
    border-color: var(--cc-danger);
}

.cc-btn.--danger:hover {
    background-color: var(--cc-danger);
    color: #fff;
    box-shadow: 0 0 12px rgba(var(--cc-danger-rgb), 0.4);
}

.cc-btn.--disabled,
.cc-btn:disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* --- Inputs --- */
.cc-input,
.cc-select {
    background-color: var(--cc-surface-elevated);
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-radius-sm);
    color: var(--cc-text);
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    height: 36px;
    transition: border-color 150ms ease, box-shadow 150ms ease;
    width: 100%;
}

.cc-input:focus,
.cc-select:focus {
    outline: none;
    border-color: var(--cc-primary);
    box-shadow: 0 0 0 2px rgba(var(--cc-primary-rgb), 0.2);
}

.cc-input::placeholder {
    color: var(--cc-text-muted);
}

/* --- Cards / Panels --- */
/* Base panel recipe, previously duplicated across feature tiles, contact,
   privacy, login, gift and authenticity panels. Page classes only add
   their layout specifics on top. */
.cc-card {
    background: var(--cc-surface);
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-radius-md);
    padding: 1.5rem;
}

.cc-card.--lg {
    padding: 2rem;
}

.cc-card.--shadow {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

/* --- Modal --- */
.cc-modal-wrap {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.cc-modal {
    background: var(--cc-surface);
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-radius-lg);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
    max-width: 480px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.cc-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--cc-border);
    gap: 1rem;
}

.cc-modal-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cc-modal-close {
    background: none;
    border: none;
    color: var(--cc-text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    flex-shrink: 0;
    transition: color 150ms ease;
}

.cc-modal-close:hover {
    color: var(--cc-text);
}

.cc-modal-body {
    padding: 1.25rem;
}

.cc-modal-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--cc-border);
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

/* --- Badges (card rarity / special editions) --- */
.cc-badge {
    font-family: var(--cc-font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.75rem;
    border-radius: var(--cc-radius-full);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.cc-badge.--gold {
    background: linear-gradient(135deg, #AA853E, #F5E54A);
    color: #1a1a1a;
}

.cc-badge.--silver {
    background: linear-gradient(135deg, #7A8A9E, #C0CDD9);
    color: #1a1a1a;
}

.cc-badge.--founder {
    background: linear-gradient(135deg, #2563EB, #60A5FA);
    color: #fff;
}

/* --- Image hover lift (home gallery, authenticity card) --- */
.cc-img-lift {
    transition: transform 150ms ease, box-shadow 150ms ease;
}

.cc-img-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(var(--cc-primary-rgb), 0.2);
}

/* --- Field label (block label above an input: cart shipping, profile email) --- */
.cc-field-label {
    display: block;
    font-size: 0.85rem;
    color: var(--cc-text-muted);
    margin-bottom: 0.35rem;
}

/* --- Count hint (mono counter in panel headers: cart card count, profile order count) --- */
.cc-count-hint {
    font-family: var(--cc-font-mono);
    font-size: 0.8rem;
    color: var(--cc-text-muted);
}

/* --- Page header --- */
.cc-page-header {
    margin-bottom: 1.5rem;
    padding-top: 1.5rem;
}

.cc-page-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
}

.cc-page-header .cc-page-subtitle {
    color: var(--cc-text-muted);
    font-size: 0.9rem;
    margin: 0.25rem 0 0 0;
}

/* --- Game list item (selection + cart) --- */
.cc-game {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 72px;
    border-radius: var(--cc-radius-md);
    overflow: hidden;
    background-color: var(--cc-surface);
    border: 1px solid var(--cc-border);
    cursor: pointer;
    transition: border-color 150ms ease, box-shadow 150ms ease;
    margin-bottom: 0.5rem;
}

.cc-game:hover {
    border-color: var(--cc-primary);
}

.cc-game.--selected {
    border-color: var(--cc-primary);
    box-shadow: var(--cc-glow);
}

/* Background image with bleed effect */
.cc-game-bg {
    position: absolute;
    left: 0;
    top: 0;
    width: 200px;
    height: 100%;
    background-size: cover;
    background-position: center;
    mask-image: linear-gradient(to right, rgba(0,0,0,0.7) 40%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, rgba(0,0,0,0.7) 40%, transparent 100%);
    pointer-events: none;
}

/* Content sits on top of the bleed */
.cc-game-content {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.75rem 1rem;
    padding-left: 155px;
    min-height: 72px;
    z-index: 1;
}

.cc-game-info {
    flex: 1;
    min-width: 0;
}

.cc-game-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--cc-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cc-game-meta {
    font-size: 0.8rem;
    color: var(--cc-text-muted);
    margin-top: 0.15rem;
}

.cc-game-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: 1rem;
    flex-shrink: 0;
}

.cc-game-toggle {
    width: 22px;
    height: 22px;
    border-radius: var(--cc-radius-sm);
    border: 2px solid var(--cc-border);
    background: var(--cc-surface-elevated);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 150ms ease, background-color 150ms ease;
    flex-shrink: 0;
}

.cc-game.--selected .cc-game-toggle {
    border-color: var(--cc-primary);
    background-color: var(--cc-primary);
}

.cc-game-toggle-check {
    display: none;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
}

.cc-game.--selected .cc-game-toggle-check {
    display: block;
}

.cc-game-preview-link {
    font-size: 0.8rem;
    color: var(--cc-text-muted);
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: color 150ms ease;
}

.cc-game-preview-link:hover {
    color: var(--cc-primary);
}

/* --- Sticky bar (selection total + cart proceed) --- */
.cc-sticky-bar {
    position: sticky;
    bottom: 0;
    z-index: 100;
    background-color: var(--cc-surface-elevated);
    border-top: 1px solid var(--cc-border);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
    padding: 0.75rem 0;
    margin-top: 1.5rem;
    /* Break out of .container to span full viewport width */
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    padding-left: calc(50vw - 50%);
    padding-right: calc(50vw - 50%);
}

.cc-sticky-bar-content {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.cc-sticky-bar-price {
    font-family: var(--cc-font-mono);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--cc-text);
}

.cc-sticky-bar-hint {
    font-size: 0.8rem;
    color: var(--cc-secondary);
}

/* --- Spinner --- */
.cc-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--cc-border);
    border-top-color: var(--cc-primary);
    border-radius: 50%;
    animation: cc-spin 0.6s linear infinite;
}

.cc-spinner.--lg {
    width: 36px;
    height: 36px;
    border-width: 3px;
}

@keyframes cc-spin {
    to { transform: rotate(360deg); }
}

/* --- Loading panel --- */
.cc-loading-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    text-align: center;
    gap: 1rem;
}

.cc-loading-panel p {
    margin: 0;
    color: var(--cc-text-muted);
}

.cc-loading-panel .cc-loading-title {
    color: var(--cc-text);
    font-size: 1.1rem;
    font-weight: 500;
}

/* --- Progress bar --- */
.cc-progress {
    width: 100%;
    max-width: 300px;
    height: 6px;
    background: var(--cc-surface-elevated);
    border-radius: 3px;
    overflow: hidden;
}

.cc-progress-bar {
    height: 100%;
    background: var(--cc-primary);
    border-radius: 3px;
    transition: width 250ms ease;
}

/* --- Empty state --- */
.cc-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    text-align: center;
    gap: 0.75rem;
}

.cc-empty-state-icon {
    font-size: 2.5rem;
    opacity: 0.5;
}

.cc-empty-state-message {
    color: var(--cc-text-muted);
    font-size: 0.95rem;
    max-width: 400px;
}

/* --- Search/sort toolbar --- */
.cc-toolbar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    align-items: flex-end;
}

.cc-toolbar-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    justify-content: flex-end;
}

.cc-toolbar-field .cc-btn {
    height: 36px;
}

.cc-toolbar-field label {
    font-size: 0.8rem;
    color: var(--cc-text-muted);
    font-weight: 500;
}

.cc-toolbar-field.--grow {
    flex: 1;
    min-width: 200px;
}

/* --- Game list / sticky bar responsive --- */
@media (max-width: 768px) {
    .cc-game-bg {
        width: 120px;
    }

    .cc-game-content {
        padding-left: 100px;
    }

    .cc-sticky-bar-content {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .cc-game-bg {
        width: 80px;
    }

    .cc-game-content {
        padding-left: 70px;
    }
}

/* --- Gift mode banner (selection + cart) --- */
.cc-gift-mode-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
    background: var(--cc-surface);
    border: 1px solid var(--cc-primary);
    border-radius: var(--cc-radius-md);
}

.cc-gift-mode-text {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.cc-gift-mode-label {
    padding: 0.15rem 0.6rem;
    border-radius: var(--cc-radius-full);
    background: var(--cc-primary);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

/* --- Centered narrow pages (login + Stripe callback) --- */
/* The two pages share the exact same centered column layout,
   so they are defined together instead of duplicated. */
.cc-page-login,
.cc-page-callback {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 55vh;
    max-width: 480px;
    margin: 0 auto;
    padding: 2rem 1rem 4rem;
    text-align: center;
}

/* --- Steam login panel (login page + gift friend page) --- */
.cc-page-login-header {
    margin-bottom: 2rem;
}

/* Panel recipe comes from cc-card --lg --shadow in the markup */
.cc-page-login-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    width: 100%;
}

.cc-login-btn--page img {
    height: 42px;
    width: auto;
    transition: opacity 150ms ease, box-shadow 150ms ease;
}

.cc-login-btn--page:hover img {
    opacity: 1;
    box-shadow: 0 8px 24px rgba(var(--cc-primary-rgb), 0.2);
}

.cc-page-login-note {
    margin: 0;
    font-size: 0.8rem;
    color: var(--cc-text-muted);
    line-height: 1.5;
    max-width: 320px;
}

/* --- Prose pages (privacy + terms) --- */
.cc-page-privacy {
    max-width: 720px;
    margin: 0 auto;
    padding: 2rem 1rem 4rem;
}

/* Panel recipe comes from cc-card --lg in the markup */
.cc-privacy-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.cc-privacy-list li {
    position: relative;
    padding-left: 1.25rem;
    color: var(--cc-text-muted);
    line-height: 1.7;
    font-size: 0.925rem;
}

.cc-privacy-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.6em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--cc-primary);
}

.cc-privacy-content h2 {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--cc-text);
    margin-top: 1.75rem;
    margin-bottom: 0.5rem;
}

.cc-privacy-content h2:first-child {
    margin-top: 0;
}

.cc-privacy-content p {
    color: var(--cc-text-muted);
    line-height: 1.7;
    font-size: 0.925rem;
    margin-bottom: 0.5rem;
}

.cc-privacy-content a,
.cc-privacy-list a {
    color: var(--cc-primary);
    text-decoration: none;
    transition: opacity 150ms ease;
}

.cc-privacy-content a:hover,
.cc-privacy-list a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* --- Home page hero (home + construction) --- */
/* Breaks out of Bootstrap .container to span full viewport width */
.cc-hero {
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #101426;
    border-bottom: 1px solid var(--cc-border);
}

/* Inner content constrained and centered */
.cc-hero-inner {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4rem;
    padding: 3rem 2rem;
}

.cc-hero-image {
    flex-shrink: 0;
}

.cc-hero-image img {
    max-height: 380px;
    width: auto;
    border-radius: var(--cc-radius-md);
    box-shadow: 0 12px 60px rgba(var(--cc-primary-rgb), 0.25);
}

.cc-hero-text {
    flex: 1;
    min-width: 0;
}

.cc-hero-headline {
    font-size: 2.75rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--cc-text);
}

.cc-hero-sub {
    font-size: 1.1rem;
    color: var(--cc-text-muted);
    margin-bottom: 2rem;
    max-width: 480px;
    line-height: 1.6;
}

/* --- Home sections (home + construction + gift friend) --- */
.cc-section {
    padding: 4rem 0;
    border-top: 1px solid var(--cc-border);
}

.cc-section-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.cc-section-lead {
    color: var(--cc-text-muted);
    font-size: 1rem;
    margin-bottom: 2.5rem;
    max-width: 540px;
    line-height: 1.6;
}

/* --- Feature tiles (home + construction) --- */
/* Each tile is a plain cc-card in the markup */
.cc-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 1.25rem;
}

.cc-feature-icon {
    font-size: 1.75rem;
    margin-bottom: 0.75rem;
    line-height: 1;
}

.cc-feature-title {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.4rem;
    color: var(--cc-text);
}

.cc-feature-desc {
    font-size: 0.85rem;
    color: var(--cc-text-muted);
    margin: 0;
    line-height: 1.5;
}

/* --- How it works steps (home + construction + gift friend) --- */
.cc-steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.cc-step {
    text-align: center;
}

.cc-step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--cc-primary);
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.cc-step-title {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.4rem;
}

.cc-step-desc {
    font-size: 0.875rem;
    color: var(--cc-text-muted);
    margin: 0;
    line-height: 1.5;
}

/* --- Bottom CTA block (home + construction) --- */
.cc-cta-block {
    padding: 4rem 0 5rem;
    border-top: 1px solid var(--cc-border);
    text-align: center;
}

.cc-cta-block h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.cc-cta-block p {
    color: var(--cc-text-muted);
    margin-bottom: 1.75rem;
}

/* --- Card gallery (home; kept with the home group) --- */
.cc-gallery {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

/* Hover effect comes from cc-img-lift in the markup */
.cc-gallery img {
    width: 100%;
    border-radius: var(--cc-radius-md);
    border: 1px solid var(--cc-border);
}

/* --- Home responsive --- */
@media (max-width: 992px) {
    .cc-hero-inner {
        gap: 2.5rem;
    }

    .cc-hero-image img {
        max-height: 320px;
    }

    .cc-hero-headline {
        font-size: 2.25rem;
    }
}

@media (max-width: 768px) {
    .cc-hero {
        min-height: auto;
        padding: 2rem 0;
    }

    .cc-hero-inner {
        flex-direction: column;
        text-align: center;
        padding: 2rem 1.5rem;
        gap: 2rem;
    }

    .cc-hero-image img {
        max-height: 240px;
    }

    .cc-hero-headline {
        font-size: 1.75rem;
    }

    .cc-hero-sub {
        max-width: 100%;
    }

    .cc-steps {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .cc-gallery {
        grid-template-columns: repeat(2, 1fr);
    }
}
