/* LoyaltySpin storefront — compact, theme-independent, inherits the theme font. */
:root {
	--lp-accent: currentColor;
	--lp-accent-ink: #fff;
	--lp-radius: 8px;
	--lp-btn-radius: 6px;
	--lp-good: #059669;
	--lp-bad: #dc2626;
	/* Tinted from the theme's own text colour, so it suits light and dark designs. */
	--lp-border: rgba(0, 0, 0, .12);
	--lp-border: color-mix(in srgb, currentColor 14%, transparent);
	--lp-surface: rgba(0, 0, 0, .02);
	--lp-surface: color-mix(in srgb, currentColor 3%, transparent);
	--lp-muted: #6b7280;
	--lp-muted: color-mix(in srgb, currentColor 62%, transparent);
	--lp-track: rgba(0, 0, 0, .08);
	--lp-track: color-mix(in srgb, currentColor 10%, transparent);
	--lp-earn-bg: rgba(5, 150, 105, .09);
	--lp-earn-line: rgba(5, 150, 105, .3);
}

.lp-rewards *, .lp-wheel *, .lp-redeem *, .lp-cart-box *, .lp-thanks * { box-sizing: border-box; }
.lp-rewards { font-size: 14px; display: grid; gap: 12px; }
.lp-rewards > * { margin: 0 !important; }
.lp-h { font-size: 15px !important; font-weight: 600 !important; margin: 0 0 8px !important; line-height: 1.3 !important; }
.lp-card { border: 1px solid var(--lp-border); border-radius: var(--lp-radius); padding: 12px 14px; background: var(--lp-surface); color: inherit; }
.lp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.lp-stat { display: flex; flex-direction: column; gap: 3px; }
.lp-stat__label { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--lp-muted); display: flex; align-items: center; gap: 6px; }
.lp-stat__value { font-size: 22px; font-weight: 700; line-height: 1.2; }
.lp-muted { color: var(--lp-muted); font-size: 12px; margin: 0; }
.lp-warn { color: #b45309; font-size: 12px; }
.lp-link { color: inherit; text-decoration: underline; font-weight: 600; }
.lp-list { margin: 0; padding-left: 18px; }
.lp-list li { margin: 2px 0; }
.lp-bar { height: 6px; background: var(--lp-track); border-radius: 3px; overflow: hidden; margin: 6px 0 3px; }
.lp-bar span { display: block; height: 100%; background: var(--lp-accent); border-radius: 3px; transition: width .4s; }
.lp-table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 0; }
.lp-table th, .lp-table td { padding: 6px 8px; border-bottom: 1px solid var(--lp-border); text-align: left; }
.lp-table th { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--lp-muted); font-weight: 600; }
.lp-num { text-align: right !important; font-variant-numeric: tabular-nums; }
.lp-pos { color: var(--lp-good); }
.lp-neg { color: var(--lp-bad); }
.lp-win td { font-weight: 600; }

/* Buttons. "Match my theme" adds the theme's own button classes, so only layout is set here. */
.lp-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; text-decoration: none; text-align: center; white-space: nowrap; }
.lp-btn[disabled] { opacity: .45; cursor: not-allowed; }
.lp-btn--theme { margin: 0; }
.lp-btn--custom {
	font: inherit; font-size: 14px; font-weight: 600; line-height: 1.2;
	padding: 9px 16px; min-height: 38px; border-radius: var(--lp-btn-radius);
	border: 1px solid var(--lp-accent); background: var(--lp-accent); color: var(--lp-accent-ink);
	box-shadow: none; transition: filter .15s, transform .05s;
}
.lp-btn--custom:hover:not([disabled]) { filter: brightness(1.08); color: var(--lp-accent-ink); }
.lp-btn--custom:active { transform: translateY(1px); }
.lp-btn:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.lp-btn--ghost {
	font: inherit; font-size: 13px; font-weight: 600; line-height: 1.2; padding: 8px 12px; min-height: 38px;
	border-radius: var(--lp-btn-radius); border: 1px solid var(--lp-border); background: transparent; color: inherit;
}
.lp-btn--ghost:hover { border-color: currentColor; }

/* (?) help bubble. */
.lp-tip {
	position: relative; display: inline-flex; align-items: center; justify-content: center;
	width: 16px; height: 16px; border-radius: 50%; font-size: 11px; font-weight: 700; line-height: 1;
	background: rgba(0, 0, 0, .08); color: var(--lp-muted); cursor: help; text-transform: none; letter-spacing: 0; flex: none;
}
.lp-tip:focus { outline: 2px solid var(--lp-accent); outline-offset: 1px; }
.lp-tip__bubble {
	position: absolute; z-index: 50; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%);
	width: max-content; max-width: 260px; padding: 8px 10px; border-radius: 6px;
	background: #111827; color: #fff; font-size: 12px; font-weight: 400; line-height: 1.45; text-align: left;
	box-shadow: 0 6px 20px rgba(0, 0, 0, .2); display: none; pointer-events: none;
}
.lp-tip:hover .lp-tip__bubble, .lp-tip:focus .lp-tip__bubble { display: block; }

/* Earn notes. */
.lp-earn-note { font-size: 13px; margin: 6px 0 10px; padding: 6px 10px; border-radius: var(--lp-btn-radius); background: var(--lp-earn-bg); color: inherit; display: inline-flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
.lp-earn-note .lp-muted { color: var(--lp-muted); }
.lp-loop-badge { display: inline-block; font-size: 11px; font-weight: 600; color: inherit; background: var(--lp-earn-bg); padding: 2px 8px; border-radius: 10px; margin: 4px 0; }
.lp-cart-box, .lp-thanks { border: 1px solid var(--lp-earn-line); background: var(--lp-earn-bg); color: inherit; border-radius: var(--lp-radius); padding: 10px 12px; margin: 0 0 12px; font-size: 13px; }
.lp-cart-box[hidden] { display: none; }
.lp-cart-box__list { list-style: none; margin: 0; padding: 0; }
.lp-cart-box__list li { margin: 2px 0; }
.lp-thanks { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.lp-order-coins { font-size: 13px; padding: 8px 10px; border: 1px dashed var(--lp-border); border-radius: var(--lp-btn-radius); }

/* Redeem widget. */
.lp-redeem { border: 1px dashed var(--lp-border); border-radius: var(--lp-radius); padding: 10px 12px; margin: 0 0 12px; font-size: 13px; background: var(--lp-surface); color: inherit; }
.lp-redeem__head { display: flex; flex-wrap: wrap; gap: 4px 10px; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.lp-redeem__row { display: flex; flex-wrap: wrap; gap: 6px; }
.lp-redeem__input { width: 110px; min-height: 38px; font-size: 14px; }
.lp-redeem__applied { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.lp-redeem__msg { margin: 4px 0 0; color: var(--lp-bad); font-size: 12px; }
.lp-redeem__msg:empty { display: none; }
.lp-redeem-row td { padding: 8px 0 !important; }

/* Wheel. */
.lp-wheel { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; scroll-margin-top: 80px; }
.lp-wheel__stage { position: relative; width: 300px; max-width: 100%; aspect-ratio: 1; flex: none; }
.lp-wheel__canvas { width: 100%; height: 100%; display: block; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .18)); }
.lp-wheel__pointer {
	position: absolute; top: -6px; left: 50%; transform: translateX(-50%); z-index: 2;
	width: 0; height: 0; border-left: 13px solid transparent; border-right: 13px solid transparent; border-top: 24px solid #ef4444;
	filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .3));
}
.lp-wheel__hub {
	position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 2;
	width: 26%; aspect-ratio: 1; border-radius: 50%; border: 4px solid #fff !important;
	background: radial-gradient(circle at 35% 30%, #fff 0, #fef3c7 30%, #f59e0b 100%) !important; color: #7c2d12 !important;
	font: 800 14px/1 system-ui, -apple-system, sans-serif !important; letter-spacing: .06em; padding: 0 !important;
	box-shadow: 0 3px 10px rgba(0, 0, 0, .3); cursor: pointer; transition: transform .1s;
}
.lp-wheel__hub:hover:not([disabled]) { transform: translate(-50%, -50%) scale(1.05); }
.lp-wheel__hub[disabled] { cursor: not-allowed; filter: grayscale(.8); opacity: .85; }
.is-spinning .lp-wheel__hub { animation: lp-pulse .6s ease-in-out infinite alternate; }
@keyframes lp-pulse { to { box-shadow: 0 0 0 6px rgba(245, 158, 11, .35); } }
.lp-wheel__side { flex: 1 1 220px; min-width: 0; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.lp-wheel__head { display: flex; align-items: center; gap: 6px; }
.lp-wheel__head .lp-h { margin: 0 !important; }
.lp-wheel__count { margin: 0; font-size: 13px; }
.lp-wheel__left { font-size: 18px; }
.lp-wheel__next { width: 100%; max-width: 320px; }
.lp-wheel__prize { width: 100%; max-width: 360px; display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; align-items: center; padding: 10px 12px; border-radius: var(--lp-radius); border: 1px solid var(--lp-border); background: var(--lp-surface); animation: lp-pop .3s ease-out; }
.lp-wheel__prize[hidden] { display: none; }
.lp-wheel__prize.is-win { border-color: var(--lp-earn-line); background: var(--lp-earn-bg); }
.lp-wheel__prize-img { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; grid-row: span 2; }
.lp-wheel__prize p { margin: 0; grid-column: 1 / -1; }
.lp-wheel__emoji { font-size: 28px; grid-row: span 2; }
.lp-wheel__title { font-size: 15px; }
.lp-wheel__msg { font-size: 12px; color: var(--lp-muted); }
@keyframes lp-pop { from { transform: scale(.95); opacity: 0; } to { transform: none; opacity: 1; } }
.lp-code { grid-column: 1 / -1; margin-top: 6px; display: inline-flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 6px 6px 10px; border: 1px dashed var(--lp-good); border-radius: var(--lp-btn-radius); background: transparent; cursor: pointer; font: inherit; color: inherit; }
.lp-code code { font-size: 14px; font-weight: 700; letter-spacing: .05em; background: none; padding: 0; }
.lp-code span { font-size: 12px; font-weight: 600; color: #fff; background: var(--lp-good); border-radius: 4px; padding: 4px 8px; }
.lp-confetti { position: absolute; inset: -20% -20% -20% -20%; width: 140%; height: 140%; pointer-events: none; z-index: 3; }
.lp-odds { font-size: 12px; width: 100%; max-width: 360px; }
.lp-odds summary { cursor: pointer; text-decoration: underline; }
.lp-odds table { width: 100%; margin: 6px 0; font-size: 12px; border-collapse: collapse; }
.lp-odds td { padding: 3px 4px; border-bottom: 1px solid var(--lp-border); }
.lp-odds td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.lp-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.lp-winners table { width: 100%; font-size: 13px; }
.lp-hash code { font-size: 11px; }

@media (max-width: 600px) {
	.lp-wheel { justify-content: center; }
	.lp-wheel__stage { width: min(300px, 100%); }
}
.lp-block-extra { margin: -6px 0 8px; }

/* Wheel hub logo. */
.lp-wheel__hub.has-logo { background: #fff !important; padding: 0 !important; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.lp-wheel__hub.has-logo img { width: 78%; height: 78%; object-fit: contain; }

/* Popup. */
.lp-popup {
	box-sizing: border-box; width: min(720px, calc(100vw - 24px)); max-width: none; max-height: calc(100vh - 24px); overflow: auto;
	padding: 18px; border: 0; border-radius: calc(var(--lp-radius) + 6px);
	background: var(--wp--preset--color--base, #fff); color: var(--wp--preset--color--contrast, #1f2937);
	box-shadow: 0 24px 64px rgba(0, 0, 0, .35); font-size: 14px;
}
.lp-popup::backdrop { background: rgba(15, 23, 42, .55); backdrop-filter: blur(2px); }
.lp-popup[open] { animation: lp-pop .25s ease-out; }
.lp-popup .lp-card { border: 0; background: transparent; padding: 0; }
.lp-popup__close {
	position: absolute; top: 8px; right: 10px; z-index: 5; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%;
	background: var(--lp-track); color: inherit; font: 400 22px/1 system-ui, sans-serif; cursor: pointer;
}
.lp-popup__close:hover { background: var(--lp-border); }
.lp-teaser { text-align: center; padding: 10px 6px !important; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.lp-teaser p { margin: 0; }
.lp-teaser .lp-bar { width: 100%; max-width: 280px; }
.lp-teaser__icon { font-size: 44px; line-height: 1; }
@media (max-width: 600px) {
	.lp-popup { padding: 14px 12px; }
	.lp-wheel--popup .lp-wheel__stage { width: min(260px, 78vw); }
}
.lp-popup:focus { outline: none; }
.lp-fallback-wrap { margin: 8px 0 12px; }
.lp-mini-earn { margin: 8px 0; padding: 6px 10px; font-size: 13px; border-radius: var(--lp-btn-radius); background: var(--lp-earn-bg); }
/* Coin icon (uploaded image or emoji), sized to the surrounding text. */
.lp-coin-icon { display: inline-block; vertical-align: -0.18em; }
img.lp-coin-icon { width: 1.15em; height: 1.15em; object-fit: contain; margin: 0 .1em 0 0; border-radius: 0; box-shadow: none; }
.lp-stat__value img.lp-coin-icon { width: 1em; height: 1em; }
