:root {
    --bgg-primary: #445138;
    --bgg-accent:  #d19a5a;
    --bgg-text:    #383837;
    --bgg-bg:      #f8f6f4;
    --bgg-border:  #d8d2cb;
    --bgg-error:   #b6432f;
    --bgg-success: #2f7a3f;
}

.bgg-purchase--closed {
    text-align: center;
}
.bgg-closed-msg {
    font-size: 1.15rem;
    line-height: 1.5;
    color: var(--bgg-text);
    padding: 1rem 0;
}
.bgg-closed-msg p { margin: 0 0 0.6rem 0; }
.bgg-closed-msg p:last-child { margin-bottom: 0; }

.bgg-purchase, .bgg-status {
    max-width: 640px;
    margin: 2rem auto;
    padding: 1.5rem;
    background: var(--bgg-bg);
    color: var(--bgg-text);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    font-family: inherit;
}

.bgg-purchase__title,
.bgg-status__title {
    color: var(--bgg-primary);
    margin: 0 0 0.5rem 0;
    font-size: 1.6rem;
}

.bgg-purchase__intro {
    margin: 0 0 1rem 0;
    color: var(--bgg-text);
}

.bgg-field {
    display: flex;
    flex-direction: column;
    margin-bottom: 1rem;
}
.bgg-field label {
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--bgg-primary);
}
.bgg-field input,
.bgg-field textarea {
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--bgg-border);
    border-radius: 4px;
    background: #fff;
    color: var(--bgg-text);
    font: inherit;
}
.bgg-field input:focus,
.bgg-field textarea:focus {
    outline: 2px solid var(--bgg-accent);
    outline-offset: 1px;
}
.bgg-field small {
    color: #666;
    margin-top: 0.25rem;
}

.bgg-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

/* === Plain (Plugin-Standard) === */
.bgg-purchase--style-plain .bgg-preset {
    padding: 0.4rem 0.8rem;
    border: 1px solid var(--bgg-border);
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
    color: var(--bgg-text);
    font: inherit;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.bgg-purchase--style-plain .bgg-preset:hover {
    border-color: var(--bgg-accent);
}
.bgg-purchase--style-plain .bgg-preset.is-active {
    background: var(--bgg-primary);
    color: #fff;
    border-color: var(--bgg-primary);
}

/* === YOOtheme/UIkit Pill-Look (auch für non-YOOtheme Themes als Fallback) === */
.bgg-purchase--style-yootheme .bgg-preset {
    padding: 0 18px;
    line-height: 38px;
    height: 38px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 500px;
    border: 1px solid #c0cbc5;
    background: rgba(255,255,255,0.55);
    color: var(--bgg-primary);
    cursor: pointer;
    text-transform: none;
    letter-spacing: 0;
    transition: color 0.5s cubic-bezier(.165,.85,.45,1),
                background-color 0.5s cubic-bezier(.165,.85,.45,1),
                border-color 0.5s cubic-bezier(.165,.85,.45,1),
                box-shadow 0.5s cubic-bezier(.165,.85,.45,1);
    -webkit-backdrop-filter: blur(9px);
    backdrop-filter: blur(9px);
}
.bgg-purchase--style-yootheme .bgg-preset:hover,
.bgg-purchase--style-yootheme .bgg-preset:focus {
    background: rgba(235,232,229,0.55);
    border-color: #a4b4ab;
    outline: none;
}
.bgg-purchase--style-yootheme .bgg-preset.is-active {
    background: var(--bgg-primary);
    border-color: var(--bgg-primary);
    color: #fff;
}
/* Wenn ein YOOtheme-Theme aktiv ist und uk-button bereits styled,
   greift dessen CSS — wir lassen Theme-Styles vorrang. */
body.theme-yootheme .bgg-purchase--style-yootheme .bgg-preset.uk-button {
    /* Theme-CSS gewinnt durch höhere Specificity bei uk-button-* */
}
.bgg-purchase--style-yootheme .bgg-preset.uk-button.is-active {
    background: var(--bgg-primary) !important;
    border-color: var(--bgg-primary) !important;
    color: #fff !important;
}

.bgg-paypal-button {
    margin-top: 1rem;
    min-height: 50px;
}

.bgg-status[data-bgg-status]:not(:empty) {
    padding: 0.5rem;
    margin-top: 0.5rem;
    border-radius: 4px;
}
.bgg-status.is-error {
    background: #fdecea;
    color: var(--bgg-error);
}
.bgg-status.is-info {
    background: #f5efe6;
    color: var(--bgg-text);
}

.bgg-success {
    text-align: center;
}

.bgg-error {
    color: var(--bgg-error);
    background: #fdecea;
    padding: 0.75rem 1rem;
    border-radius: 4px;
}

/* Status page */
.bgg-card {
    background: #fff;
    border-radius: 8px;
    border: 2px solid var(--bgg-primary);
    padding: 1.25rem;
    margin: 1rem 0;
}
.bgg-card.bgg-state--expired { border-color: var(--bgg-error); }
.bgg-card.bgg-state--redeemed { border-color: #888; }

.bgg-card__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--bgg-border);
}
.bgg-card__row:last-child { border-bottom: none; }

.bgg-state-pill {
    display: inline-block;
    background: var(--bgg-primary);
    color: #fff;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
}
.bgg-state--expired .bgg-state-pill { background: var(--bgg-error); }
.bgg-state--redeemed .bgg-state-pill { background: #888; }

.bgg-amount {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--bgg-primary);
}
.bgg-label {
    color: #666;
    font-size: 0.9rem;
}
.bgg-code {
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.bgg-actions {
    text-align: center;
    margin-top: 1rem;
}
.bgg-actions__hint {
    color: #666;
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

.bgg-btn {
    display: inline-block;
    padding: 0.7rem 1.5rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    font: inherit;
}
.bgg-btn--primary {
    background: var(--bgg-primary);
    color: #fff;
}
.bgg-btn--primary:hover {
    background: #34402b;
}
