/* ============================================================
   Completion Cards — Page-specific styles.
   Loaded last, after theme.css and components.css.
   One section per page; each page's responsive rules stay
   next to its section.
   ============================================================ */

html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem rgba(var(--cc-primary-rgb), 0.3), 0 0 0 0.25rem rgba(var(--cc-primary-rgb), 0.15);
}

html {
  position: relative;
  min-height: 100%;
}

.beta-ribbon {
  position: sticky;
  top: 0;
  z-index: 1050;
  width: 100%;
  padding: 0.5rem 1rem;
  text-align: center;
  font-weight: 600;
  font-size: 0.95rem;
  color: #000;
  background-color: #ffc107;
  border-bottom: 2px solid #e0a800;
}

/* ============================================================
   Home page
   ============================================================ */

/* Card back image in the "A trophy you can hold" section */
.cc-home-trophy-img {
    max-width: 240px;
    border-radius: var(--cc-radius-md);
    box-shadow: 0 8px 40px rgba(var(--cc-primary-rgb), 0.15);
}

/* ============================================================
   Selection page
   ============================================================ */

/* Ensure the page wrapper is tall enough for sticky to work */
.cc-page-selection {
    min-height: calc(100vh - 160px);
    display: flex;
    flex-direction: column;
}

.cc-page-selection #gameFormPanel {
    flex: 1;
}

/* Card art preview */
.cc-preview-card {
    position: relative;
    width: 100%;
    max-width: 280px;
    margin: 0 auto;
    aspect-ratio: 1472 / 2060;
    overflow: hidden;
    border-radius: var(--cc-radius-md);
    background: #060a14;
}

.cc-preview-art {
    position: absolute;
    left: 4.62%;
    top: 9.47%;
    width: 90.76%;
    height: 78.64%;
    object-fit: cover;
}

.cc-preview-frame {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.cc-preview-hint {
    text-align: center;
    color: var(--cc-text-muted);
    font-size: 0.85rem;
    margin: 1rem 0 0;
}

/* ============================================================
   Cart page
   ============================================================ */

.cc-page-cart {
    padding-bottom: 4rem;
}

/* Price breakdown rows */
.cc-price-breakdown {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.cc-price-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 0.9rem;
}

.cc-price-label {
    color: var(--cc-text-muted);
}

.cc-price-value {
    font-family: var(--cc-font-mono);
    font-size: 0.875rem;
    color: var(--cc-text);
}

.cc-price-row.--discount .cc-price-label,
.cc-price-row.--discount .cc-price-value {
    color: var(--cc-success);
}

.cc-price-row.--total {
    border-top: 1px solid var(--cc-border);
    padding-top: 0.625rem;
    margin-top: 0.25rem;
}

.cc-price-row.--total .cc-price-label {
    color: var(--cc-text);
    font-weight: 600;
}

.cc-price-row.--total .cc-price-value {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--cc-text);
}

/* Applied coupon row — each is a small card */
.cc-coupon-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    background-color: var(--cc-surface-elevated);
    border: 1px solid var(--cc-border);
    border-radius: 6px;
    margin-bottom: 0.5rem;
}

.cc-coupon-item.--founder {
    align-items: flex-start;
}

.cc-coupon-item:last-child {
    margin-bottom: 0;
}

.cc-coupon-item-body {
    flex: 1;
    min-width: 0;
}

.cc-coupon-line {
    font-size: 0.875rem;
    line-height: 1.4;
}

.cc-coupon-code {
    font-family: var(--cc-font-mono);
    font-weight: 600;
    color: var(--cc-primary);
}

.cc-coupon-desc {
    color: var(--cc-text);
    font-weight: 500;
}

/* Forfeit warning (overrides the Bootstrap alert inside the coupon panel) */
.cc-forfeit-warning {
    background-color: rgba(var(--cc-warning-rgb), 0.08);
    border: 1px solid rgba(var(--cc-warning-rgb), 0.35);
    border-radius: var(--cc-radius-sm);
    padding: 0.5rem 0.75rem;
    font-size: 0.82rem;
    color: var(--cc-warning);
    margin-bottom: 0.75rem;
    line-height: 1.45;
}

/* Coupon input row */
.cc-coupon-form {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.875rem;
}

.cc-coupon-form .cc-input {
    flex: 1;
    min-width: 0;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* The typed text is uppercased, but the placeholder should read normally */
.cc-coupon-form .cc-input::placeholder {
    text-transform: none;
    letter-spacing: normal;
}

/* Cart game list (reuses cc-game visuals without interactive behaviour) */
.cc-cart-game-list .cc-game {
    border-radius: 0;
    margin-bottom: 0;
    border: none;
    border-bottom: 1px solid var(--cc-border);
    cursor: default;
}

.cc-cart-game-list .cc-game:last-child {
    border-bottom: none;
}

.cc-cart-game-list .cc-game:hover {
    border-color: transparent;
    box-shadow: none;
}

.cc-cart-game-list .cc-game-content {
    padding-left: 150px;
}

@media (max-width: 768px) {
    .cc-cart-game-list .cc-game-content {
        padding-left: 115px;
    }
}

@media (max-width: 480px) {
    .cc-cart-game-list .cc-game-content {
        padding-left: 85px;
    }
}

/* ============================================================
   Authenticity page
   ============================================================ */

.cc-page-authenticity {
    padding-bottom: 4rem;
    max-width: 900px;
    margin: 0 auto;
}

.cc-auth-search {
    display: flex;
    gap: 0.5rem;
    max-width: 500px;
    margin: 0 auto 2rem;
}

.cc-auth-search .cc-input {
    flex: 1;
    font-family: var(--cc-font-mono);
    letter-spacing: 0.03em;
}

.cc-auth-error {
    text-align: center;
    color: var(--cc-danger);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* Panel recipe comes from cc-card --shadow in the markup */
.cc-auth-result {
    display: flex;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.cc-auth-card-img {
    flex-shrink: 0;
}

/* Hover effect comes from cc-img-lift in the markup */
.cc-auth-card-img img {
    width: 320px;
    border-radius: var(--cc-radius-md);
    border: 1px solid var(--cc-border);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}

.cc-auth-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.cc-auth-game-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    color: var(--cc-text);
}

.cc-auth-serial {
    font-family: var(--cc-font-mono);
    font-size: 0.85rem;
    color: var(--cc-text-dim);
    margin: 0;
    letter-spacing: 0.03em;
}

.cc-auth-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.cc-auth-player {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.cc-auth-player.--sm {
    gap: 0.5rem;
}

.cc-auth-avatar {
    width: 48px;
    height: 48px;
    border-radius: var(--cc-radius-full);
    border: 2px solid var(--cc-border);
    flex-shrink: 0;
}

.cc-auth-avatar.--sm {
    width: 32px;
    height: 32px;
}

.cc-auth-player-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--cc-text);
}

.cc-auth-player.--sm .cc-auth-player-name {
    font-size: 0.85rem;
    font-weight: 500;
}

.cc-auth-profile-link {
    font-size: 0.8rem;
    color: var(--cc-primary);
    text-decoration: none;
    transition: color 150ms ease;
}

.cc-auth-profile-link:hover {
    text-decoration: underline;
}

.cc-auth-profile-link.--sm {
    font-size: 0.75rem;
}

.cc-auth-ordered-by {
    padding-top: 0.5rem;
    border-top: 1px solid var(--cc-border);
}

.cc-auth-ordered-by-label {
    display: block;
    font-size: 0.75rem;
    color: var(--cc-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.35rem;
}

.cc-auth-dates {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.85rem;
    color: var(--cc-text-muted);
    padding-top: 0.5rem;
    border-top: 1px solid var(--cc-border);
}

.cc-auth-date-label {
    display: inline-block;
    width: 60px;
    color: var(--cc-text-dim);
    font-size: 0.8rem;
}

@media (max-width: 768px) {
    .cc-auth-result {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .cc-auth-card-img img {
        width: 100%;
        max-width: 300px;
    }

    .cc-auth-info {
        align-items: center;
    }

    .cc-auth-player {
        justify-content: center;
    }

    .cc-auth-ordered-by {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .cc-auth-dates {
        align-items: center;
        width: 100%;
    }

    .cc-auth-search {
        flex-direction: column;
    }
}

/* ============================================================
   Stripe callback page
   (page wrapper .cc-page-callback is shared with the login
   page and lives in components.css)
   ============================================================ */

.cc-callback-icon {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.cc-callback-icon.--success {
    background: rgba(var(--cc-success-rgb), 0.1);
    color: var(--cc-success);
    box-shadow: 0 0 20px rgba(var(--cc-success-rgb), 0.2);
}

.cc-callback-icon.--danger {
    background: rgba(var(--cc-danger-rgb), 0.1);
    color: var(--cc-danger);
    box-shadow: 0 0 20px rgba(var(--cc-danger-rgb), 0.2);
}

.cc-callback-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.cc-callback-detail {
    color: var(--cc-text-muted);
    font-size: 1rem;
    margin-bottom: 1.5rem;
    max-width: 360px;
    line-height: 1.5;
}

/* ============================================================
   Contact page
   ============================================================ */

.cc-page-contact {
    max-width: 560px;
    margin: 0 auto;
    padding: 2rem 1rem 4rem;
}

.cc-page-contact .cc-page-subtitle a {
    color: var(--cc-primary);
    text-decoration: none;
}

.cc-page-contact .cc-page-subtitle a:hover {
    text-decoration: underline;
}

/* Panel recipe comes from cc-card --lg in the markup */
.cc-contact-panel form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.cc-contact-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.cc-contact-field label {
    font-size: 0.875rem;
    color: var(--cc-text-muted);
}

.cc-contact-textarea {
    resize: vertical;
    min-height: 120px;
    font-family: inherit;
}

.cc-contact-error {
    color: var(--cc-danger);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.cc-contact-success {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    text-align: center;
    padding: 3rem 1rem;
    color: var(--cc-success);
}

.cc-contact-success p {
    color: var(--cc-text-muted);
    font-size: 1rem;
}

/* ============================================================
   Gift pages (landing, friend, code)
   ============================================================ */

.cc-page-gift {
    max-width: 860px;
    margin: 0 auto;
    padding: 2rem 1rem 4rem;
}

.cc-gift-hero {
    display: flex;
    align-items: center;
    gap: 3.5rem;
    padding: 2rem 0 3.5rem;
}

/* Two copies of the card art fanned like a hand of cards */
.cc-gift-hero-cards {
    position: relative;
    flex-shrink: 0;
    width: 240px;
    height: 300px;
}

/* Each card holds one of two poses : "back" (left tilt, behind) or "front" (right tilt, on top).
   On mouseleave, JS shuffles them in two phases : the front card is pulled out of the stack
   (inline transform), then --swapped is toggled so the poses trade — the depth swap happens
   while the pulled card is clear of the stack, and it slides back in underneath. */
.cc-gift-hero-card {
    position: absolute;
    top: 0;
    left: 0;
    max-height: 280px;
    width: auto;
    border-radius: var(--cc-radius-md);
    box-shadow: 0 12px 60px rgba(var(--cc-primary-rgb), 0.25);
    transition: transform 300ms ease;
}

/* Back pose */
.cc-gift-hero-card.--left,
.--swapped .cc-gift-hero-card.--right {
    transform: rotate(-8deg) translateY(10px);
    z-index: 1;
}

/* Front pose */
.cc-gift-hero-card.--right,
.--swapped .cc-gift-hero-card.--left {
    transform: translateX(50px) rotate(7deg);
    z-index: 2;
}

/* On hover of the card stack the fan spreads slightly */
.cc-gift-hero-cards:hover .cc-gift-hero-card.--left,
.cc-gift-hero-cards.--swapped:hover .cc-gift-hero-card.--right {
    transform: rotate(-11deg) translateY(10px) translateX(-8px);
}

.cc-gift-hero-cards:hover .cc-gift-hero-card.--right,
.cc-gift-hero-cards.--swapped:hover .cc-gift-hero-card.--left {
    transform: translateX(58px) rotate(10deg);
}

.cc-gift-hero-text h1 {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.cc-gift-hero-sub {
    font-size: 1.05rem;
    color: var(--cc-text);
    line-height: 1.6;
    max-width: 480px;
    margin: 0 0 1rem;
}

.cc-gift-hero-note {
    font-size: 0.9rem;
    color: var(--cc-text-muted);
    line-height: 1.6;
    max-width: 480px;
    margin: 0;
}

.cc-gift-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

/* Panel recipe comes from cc-card in the markup */
.cc-gift-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    text-align: center;
    padding: 2.5rem 2rem;
    text-decoration: none;
}

.cc-gift-option-icon {
    color: var(--cc-primary);
    line-height: 1;
}

.cc-gift-option-desc {
    font-size: 1rem;
    color: var(--cc-text);
    line-height: 1.5;
    margin: 0 0 0.5rem;
}

@media (max-width: 768px) {
    .cc-gift-hero {
        flex-direction: column;
        gap: 2rem;
        text-align: center;
        padding-bottom: 2.5rem;
    }

    .cc-gift-hero-text h1 {
        font-size: 1.9rem;
    }

    .cc-gift-options {
        grid-template-columns: 1fr;
    }
}

/* --- Gift friend page --- */
.cc-page-gift-friend {
    max-width: 720px;
    margin: 0 auto;
    padding: 2rem 1rem 4rem;
}

.cc-gift-friend-steps {
    margin-bottom: 3rem;
}

.cc-gift-friend-picker .cc-section-title {
    margin-bottom: 1.5rem;
}

/* Also used on the gift code page */
.cc-gift-friend-error-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

/* cc-card in the markup, padding removed so friend rows span edge to edge */
.cc-friend-list {
    padding: 0;
    overflow: hidden;
}

.cc-friend {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--cc-border);
    cursor: pointer;
    transition: background-color 150ms ease;
}

.cc-friend:last-child {
    border-bottom: none;
}

.cc-friend:hover {
    background: var(--cc-surface-elevated);
}

.cc-friend.--disabled {
    opacity: 0.5;
    cursor: default;
}

.cc-friend.--disabled:hover {
    background: none;
}

.cc-friend-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--cc-radius-full);
    flex-shrink: 0;
}

.cc-friend-name {
    flex: 1;
    min-width: 0;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cc-friend-action {
    color: var(--cc-primary);
    font-size: 0.875rem;
    white-space: nowrap;
}

.cc-friend-hint {
    color: var(--cc-text-muted);
    font-size: 0.8rem;
    white-space: nowrap;
}

/* ============================================================
   Profile page
   ============================================================ */

.cc-page-profile {
    padding-bottom: 4rem;
    max-width: 900px;
    margin: 0 auto;
}

.cc-profile-header {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.cc-profile-avatar {
    width: 56px;
    height: 56px;
    border-radius: var(--cc-radius-full);
    border: 2px solid var(--cc-border);
    flex-shrink: 0;
}

.cc-profile-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.cc-profile-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--cc-text);
    cursor: pointer;
}

.cc-profile-checkbox input[type="checkbox"] {
    accent-color: var(--cc-primary);
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* --- Order list --- */
.cc-order-list {
    display: flex;
    flex-direction: column;
}

.cc-order {
    border-bottom: 1px solid var(--cc-border);
}

.cc-order:last-child {
    border-bottom: none;
}

.cc-order-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1rem;
    transition: background-color 150ms ease;
}

.cc-order-summary.--clickable {
    cursor: pointer;
}

.cc-order-summary.--clickable:hover {
    background-color: rgba(var(--cc-primary-rgb), 0.04);
}

.cc-order-main {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.cc-order-id {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--cc-text);
}

.cc-order-date {
    font-size: 0.85rem;
    color: var(--cc-text-muted);
}

.cc-order-cards {
    font-size: 0.85rem;
    color: var(--cc-text-muted);
}

.cc-order-amount {
    font-family: var(--cc-font-mono);
    font-size: 0.85rem;
    color: var(--cc-text);
}

.cc-order-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.cc-order-status {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: var(--cc-radius-full);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.cc-order-status.--unpaid {
    background: rgba(var(--cc-warning-rgb), 0.15);
    color: var(--cc-warning);
}

.cc-order-status.--paid {
    background: rgba(var(--cc-success-rgb), 0.15);
    color: var(--cc-success);
}

.cc-order-status.--cancelled {
    background: rgba(var(--cc-danger-rgb), 0.1);
    color: var(--cc-danger);
}

.cc-order-status.--shipped {
    background: rgba(var(--cc-primary-rgb), 0.15);
    color: var(--cc-primary);
}

.cc-order-status.--received {
    background: rgba(var(--cc-success-rgb), 0.15);
    color: var(--cc-success);
}

.cc-order-status.--refunded {
    background: rgba(168, 85, 247, 0.15);
    color: #A855F7;
}

.cc-order-chevron {
    color: var(--cc-text-muted);
    font-size: 0.85rem;
    transition: transform 150ms ease;
}

.cc-order.--expanded .cc-order-chevron {
    transform: rotate(90deg);
}

/* Gift orders — rainbow left border */
.cc-order.--gift {
    border-left: 3px solid transparent;
    border-image: linear-gradient(180deg, #FF6B6B, #FBBF24, #22C55E, #3BA7FF, #A855F7) 1;
    background: linear-gradient(90deg, rgba(255, 107, 107, 0.07), rgba(251, 191, 36, 0.07), rgba(34, 197, 94, 0.07), rgba(59, 167, 255, 0.07), rgba(168, 85, 247, 0.07));
}

.cc-order-status.--gift {
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.2), rgba(167, 85, 247, 0.2));
    color: #C084FC;
}

/* Cancelled and refunded orders are dimmed */
.cc-order.--cancelled .cc-order-summary,
.cc-order.--refunded .cc-order-summary {
    opacity: 0.5;
}

/* Actions and detail hidden by default */
.cc-order-actions,
.cc-order-detail {
    display: none;
}

.cc-order.--expanded .cc-order-actions,
.cc-order.--expanded .cc-order-detail {
    display: flex;
}

.cc-order-actions {
    padding: 0 1rem 0.75rem;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.cc-order-detail {
    flex-direction: column;
    gap: 0.75rem;
    padding: 0 1rem 1rem;
    border-top: 1px solid var(--cc-border);
    margin: 0 1rem;
    padding-top: 0.75rem;
}

.cc-order-detail-section {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.85rem;
    color: var(--cc-text-muted);
}

.cc-order-detail-label {
    font-size: 0.75rem;
    color: var(--cc-text-dim);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
    margin-bottom: 0.1rem;
}

.cc-order-card-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cc-order-card-game {
    color: var(--cc-text);
    font-size: 0.85rem;
}

.cc-order-card-link {
    color: var(--cc-primary);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 150ms ease;
}

.cc-order-card-link:hover {
    text-decoration: underline;
}

.cc-order-card-printed {
    font-size: 0.8rem;
    color: var(--cc-text-dim);
    font-style: italic;
}

.cc-order-coupon-row {
    font-size: 0.85rem;
}

@media (max-width: 768px) {
    .cc-order-main {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
}

/* ============================================================
   Error page
   ============================================================ */

/* Center the empty state vertically so the page never looks blank */
.cc-page-error {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
}

.cc-page-error h1 {
    font-size: var(--cc-text-2xl);
    margin: 0;
}

.cc-error-actions {
    display: flex;
    gap: var(--cc-space-md);
    margin-top: var(--cc-space-md);
}

/* Fine print reference for support requests */
.cc-error-request-id {
    margin-top: var(--cc-space-lg);
    font-size: var(--cc-text-xs);
    color: var(--cc-text-dim);
}

.cc-error-request-id code {
    font-family: var(--cc-font-mono);
    color: var(--cc-text-dim);
}

/* ============================================================
   404 page
   ============================================================ */

.cc-notfound-code {
    font-family: var(--cc-font-mono);
    font-size: 5rem;
    font-weight: 700;
    color: var(--cc-primary);
    line-height: 1;
    text-shadow: var(--cc-glow);
    margin-bottom: var(--cc-space-sm);
}
