/* ── BB Giveaways Widget ─────────────────────────────────────── */

.bbg-widget {
    max-width: 100%;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Scoped reset — neutralise theme margin/padding on all widget children */
.bbg-widget * {
    box-sizing: border-box;
}
.bbg-widget h1, .bbg-widget h2, .bbg-widget h3,
.bbg-widget h4, .bbg-widget h5, .bbg-widget h6,
.bbg-widget p, .bbg-widget ul, .bbg-widget ol,
.bbg-widget li, .bbg-widget table {
    margin: 0;
    padding: 0;
}
/* Prevent themes from inflating our inline SVG icons to 100% width */
.bbg-widget svg {
    max-width: none;
    max-height: none;
    display: inline-block;
}

/* Notices */
.bbg-notice {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}
.bbg-notice-error {
    background: #fff0f0;
    border: 1px solid #f5c6c6;
    color: #c0392b;
}

/* Connect prompt */
.bbg-connect-prompt {
    padding: 32px 24px;
    text-align: center;
    border: 1px solid #e1e8ed;
    border-radius: 12px;
    background: #fff;
}
.bbg-connect-intro {
    font-size: 15px;
    color: #555;
    margin: 0 0 20px;
}

/* X sign-in button */
.bbg-btn-x {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #000;
    color: #fff;
    border: none;
    border-radius: 9999px;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s;
}
.bbg-btn-x:hover {
    background: #333;
    color: #fff;
    text-decoration: none;
}
.bbg-x-icon {
    width: 18px;
    height: 18px;
    fill: currentColor;
    flex-shrink: 0;
}

/* Connected state */
.bbg-connected {
    border: 1px solid #e1e8ed;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

/* Header row */
.bbg-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
}
.bbg-avatar-wrap {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.bbg-avatar-wrap .bbg-x-icon {
    width: 20px;
    height: 20px;
    fill: #fff;
}
.bbg-user-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0;
    line-height: 1.3;
}
.bbg-display-name {
    font-size: 15px;
    font-weight: 600;
    color: #000;
    line-height: 1.1;
}
.bbg-username {
    font-size: 13px;
    color: #657786;
    line-height: 1.1;
}
.bbg-disconnect {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid #ccc;
    border-radius: 9999px;
    padding: 6px 14px;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    color: #555;
    transition: border-color 0.15s, color 0.15s;
}
.bbg-disconnect:hover {
    border-color: #e0245e;
    color: #e0245e;
}

/* Points card */
.bbg-points-card {
    padding: 24px 20px 20px;
    border-bottom: 1px solid #f0f0f0;
    text-align: center;
}
.bbg-points-total {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
    margin-bottom: 6px;
}
.bbg-points-num {
    font-size: 48px;
    font-weight: 700;
    color: #000;
    line-height: 1;
}
.bbg-points-label {
    font-size: 18px;
    font-weight: 500;
    color: #657786;
}
.bbg-points-source {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: #888;
}
.bbg-source-icon {
    width: 13px;
    height: 13px;
    fill: #888;
}

/* Daily breakdown / Ticket Log */
.bbg-breakdown {
    padding: 16px 20px 20px;
}
.bbg-ticket-log-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    padding: 0;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #888;
    cursor: pointer;
    margin: 0 0 12px;
    line-height: 1;
}
.bbg-ticket-log-toggle:hover {
    color: #555;
}
.bbg-toggle-arrow {
    font-size: 10px;
    transition: transform 0.15s;
}
.bbg-ticket-log-body {
    margin-top: 4px;
}
.bbg-breakdown-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.bbg-breakdown-table th {
    text-align: left;
    color: #999;
    font-weight: 500;
    padding: 4px 8px 8px 0;
    border-bottom: 1px solid #f0f0f0;
}
.bbg-breakdown-table td {
    padding: 8px 8px 8px 0;
    border-bottom: 1px solid #f8f8f8;
    color: #333;
}
.bbg-td-points {
    font-weight: 600;
    color: #1a7a1a;
}
.bbg-no-entries {
    font-size: 14px;
    color: #888;
    text-align: center;
    padding: 16px 20px 24px;
    margin: 0;
}

/* Login gate buttons */
.bbg-login-buttons {
    display: flex;
    flex-direction: row;
    gap: 12px;
    align-items: stretch;
    justify-content: center;
    flex-wrap: nowrap;
}
.bbg-btn-icon {
    width: 16px;
    height: 16px;
    fill: currentColor;
    flex-shrink: 0;
    vertical-align: middle;
    position: relative;
    top: -1px;
}
.bbg-btn-login {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: 1 1 0;
    min-width: 0;
    background: #e84393;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    line-height: 1;
    transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 2px 8px rgba(232, 67, 147, 0.3);
}
.bbg-btn-login:hover {
    background: #d63384;
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(232, 67, 147, 0.4);
}
.bbg-btn-email {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: 1 1 0;
    min-width: 0;
    background: #3498db;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    line-height: 1;
    transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}
.bbg-btn-email:hover {
    background: #2980b9;
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4);
}

/* Email form (hidden by default, revealed via JS) */
.bbg-email-form {
    margin-top: 16px;
}
.bbg-email-form-inner {
    display: flex;
    gap: 8px;
    max-width: 400px;
    margin: 0 auto;
}
.bbg-email-input {
    flex: 1;
    padding: 12px 14px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.15s;
}
.bbg-email-input:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
}
.bbg-btn-email-submit {
    background: #3498db;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
}
.bbg-btn-email-submit:hover {
    background: #2980b9;
}
.bbg-btn-email-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Identity card — shown when user is identified */
.bbg-identity-card {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 14px 20px;
    border: 1px solid #e1e8ed;
    border-radius: 12px;
    background: #fff;
    margin-bottom: 12px;
}
.bbg-identity-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
}
.bbg-identity-details {
    display: flex;
    flex-direction: column;
    gap: 0;
    line-height: 1.3;
    min-width: 0;
    flex: 1;
}
.bbg-identity-name {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.bbg-identity-email {
    font-size: 13px;
    color: #657786;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.bbg-identity-stats {
    display: flex;
    border-top: 1px solid #f0f0f0;
    margin-top: 10px;
    padding-top: 10px;
    gap: 0;
}
.bbg-id-stat {
    flex: 1;
    text-align: center;
    padding: 0 8px;
}
.bbg-id-stat:first-child {
    padding-left: 0;
}
.bbg-id-stat:last-child {
    padding-right: 0;
}
.bbg-id-stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #111;
    line-height: 1.1;
}
.bbg-id-stat-label {
    display: block;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #999;
    margin-top: 1px;
}

.bbg-identity-action {
    background: none;
    border: 1px solid #ccc;
    border-radius: 9999px;
    padding: 5px 14px;
    font-size: 13px;
    cursor: pointer;
    color: #555;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    transition: border-color 0.15s, color 0.15s;
}
.bbg-identity-action:hover {
    border-color: #e0245e;
    color: #e0245e;
    text-decoration: none;
}

/* ── Contest Cards ───────────────────────────────────────────── */

.bbg-contests {
    margin-top: 20px;
}
.bbg-widget .bbg-contests-title {
    font-size: 16px;
    font-weight: 700;
    color: #333;
    margin: 0 0 12px;
    text-align: center;
}

.bbg-contests-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

@media (max-width: 540px) {
    .bbg-contests-grid {
        grid-template-columns: 1fr;
    }
}

.bbg-contest-card {
    border: 1px solid #e1e8ed;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.15s, transform 0.15s;
}
.bbg-contest-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

/* Locked overlay */
.bbg-contest-locked {
    opacity: 0.75;
}
.bbg-contest-image {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #f0f0f0;
}
.bbg-contest-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.bbg-contest-lock-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
}

.bbg-contest-body {
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 2px;
}
.bbg-contest-name {
    font-size: 20px;
    font-weight: 700;
    color: #111;
    margin: 0;
    line-height: 1.2;
}

/* Meta lines */
.bbg-contest-meta {
    font-size: 13px;
    color: #666;
    margin: 0;
}
.bbg-contest-trigger {
    font-weight: 600;
    color: #e67e22;
}

/* Prizes */
.bbg-contest-prizes {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin: 0;
}
.bbg-prize-item {
    display: flex;
    flex-direction: column;
    gap: 0;
    line-height: 1.2;
}
.bbg-prize-winners {
    font-size: 12px;
    color: #999;
    font-weight: 500;
    line-height: 1.2;
}
.bbg-prize-name {
    font-size: 15px;
    font-weight: 700;
    color: #222;
    line-height: 1.2;
}
.bbg-prize-sponsor {
    font-size: 12px;
    color: #aaa;
    font-style: italic;
    line-height: 1.2;
}

/* Winners */
.bbg-contest-winners {
    margin: 0;
    padding: 8px 12px;
    background: #fffbe6;
    border-radius: 8px;
    border: 1px solid #f5e6a3;
    font-size: 14px;
}
.bbg-contest-winners ul {
    margin: 4px 0 0 18px;
    padding: 0;
}
.bbg-contest-winners li {
    font-weight: 600;
    color: #333;
}

/* Entry area */
.bbg-contest-entry {
    padding-top: 6px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.bbg-btn-enter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: #27ae60;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s, transform 0.15s;
}
.bbg-btn-enter:hover {
    background: #219a52;
    transform: translateY(-1px);
}
.bbg-btn-enter:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.bbg-entered-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #eafaf1;
    color: #27ae60;
    border: 1px solid #a3d9b1;
    border-radius: 9999px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
}

/* Boost controls */
.bbg-ticket-boost {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.bbg-boost-hidden {
    display: none;
}
.bbg-boost-controls {
    display: inline-flex;
    gap: 6px;
    align-items: center;
}
.bbg-boost-meta {
    width: 100%;
    font-size: 11px;
    color: #aaa;
    margin-top: 2px;
}
.bbg-boost-input {
    width: 60px;
    padding: 6px 8px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    text-align: center;
}
.bbg-btn-boost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #8e44ad;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    line-height: 1;
    transition: background 0.15s;
}
.bbg-btn-boost:hover {
    background: #7d3c98;
}
.bbg-btn-boost:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.bbg-tickets-spent {
    font-size: 12px;
    color: #888;
    white-space: nowrap;
}

.bbg-entry-login-hint {
    font-size: 13px;
    color: #888;
    margin: 0;
    font-style: italic;
}

/* Stats row */
.bbg-contest-stats {
    display: flex;
    border: 1px solid #e1e8ed;
    border-radius: 8px;
    overflow: hidden;
    margin: 0;
}
.bbg-stat {
    flex: 1;
    text-align: center;
    padding: 5px 4px;
    border-right: 1px solid #e1e8ed;
}
.bbg-stat:last-child {
    border-right: none;
}
.bbg-stat-num {
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: #111;
    line-height: 1.1;
}
.bbg-stat-label {
    display: block;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #999;
    margin-top: 1px;
    line-height: 1.1;
}
.bbg-stat-urgent .bbg-stat-num {
    color: #e67e22;
}
.bbg-stat-urgent .bbg-stat-label {
    color: #e67e22;
}
.bbg-stat-ended .bbg-stat-num {
    color: #aaa;
}

/* Boost availability hint */
.bbg-boost-avail {
    display: block;
    font-size: 11px;
    color: #aaa;
    font-weight: 400;
}

/* Ended card */
.bbg-contest-ended .bbg-contest-entry {
    opacity: 0.7;
}
