/*
 * Public coupon proof: the toast (partials/coupon-feed.blade.php), the homepage strip and
 * the game-card badges (partials/coupon-strip.blade.php). Themed by the same --confirm-*
 * variables as the confirm sheet. --confirm-accent can be a gradient, so it is only ever
 * used as a background.
 */

/* Shared pieces */
.coupon-feed,
.coupon-strip__card {
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: var(--confirm-inner-radius, 12px);
    background: var(--confirm-bg, #fff);
    color: var(--confirm-text, #111827);
    font-family: var(--confirm-font, inherit);
}

.coupon-feed__icon,
.coupon-strip__icon {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--confirm-accent, var(--brand-primary, #2563eb));
    color: var(--confirm-pay-text, #fff);
    font-size: 16px;
}

.coupon-feed__meta,
.coupon-strip__meta {
    display: block;
    font-size: 11px;
    color: var(--confirm-muted, #6b7280);
}

.coupon-feed__line,
.coupon-strip__title,
.coupon-strip__meta {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.coupon-feed__code,
.coupon-strip__code {
    letter-spacing: 0.04em;
}

/* Toast */
.coupon-feed {
    position: fixed;
    left: 16px;
    bottom: 24px;
    z-index: 2147483100;
    max-width: 340px;
    padding: 10px 34px 10px 10px;
    border: 1px solid var(--confirm-line, #d1d5db);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.coupon-feed[hidden] {
    display: none;
}

.coupon-feed.is-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.coupon-feed__text {
    min-width: 0;
    font-size: 13px;
    line-height: 1.4;
}

.coupon-feed__line {
    display: block;
}

.coupon-feed__code {
    font-weight: 700;
}

.coupon-feed__saved {
    font-weight: 700;
    color: var(--confirm-success, #16a34a);
}

.coupon-feed__close {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 26px;
    height: 26px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--confirm-muted, #6b7280);
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
}

/* Phones: above the sticky pay bar, and clear of the chat button on the right. */
@media (max-width: 991.98px) {
    .coupon-feed {
        left: 12px;
        bottom: calc(140px + env(safe-area-inset-bottom, 0px));
        max-width: calc(100% - 100px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .coupon-feed {
        transition: none;
        transform: none;
    }
}

/* Homepage strip, placed above the game grid */
.coupon-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.coupon-strip[hidden] {
    display: none;
}

.coupon-strip__card {
    min-width: 0;
    padding: 10px 12px;
    border: 2px dashed var(--confirm-line, rgba(0, 0, 0, 0.18));
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}

.coupon-strip__text {
    flex: 1;
    min-width: 0;
    line-height: 1.35;
}

.coupon-strip__title {
    display: block;
    font-size: 14px;
    font-weight: 600;
}

.coupon-strip__code {
    font-weight: 800;
}

.coupon-strip__left {
    margin-left: 4px;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--confirm-warning, #b45309);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    vertical-align: middle;
}

.coupon-strip__copy {
    flex-shrink: 0;
    border: 0;
    border-radius: 999px;
    padding: 8px 14px;
    background: var(--confirm-pay-bg, var(--confirm-accent, var(--brand-primary, #2563eb)));
    color: var(--confirm-pay-text, #fff);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.coupon-strip__copy.is-copied {
    background: var(--confirm-success, #16a34a);
}

/* Ticket badge on homepage game cards a coupon is limited to */
.coupon-game-badge-host {
    position: relative;
}

.coupon-game-badge {
    position: absolute;
    left: 6px;
    bottom: 6px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--confirm-accent, var(--brand-primary, #2563eb));
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.6;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
    pointer-events: none;
}
