/**
 * Supa Rewards — front-end launcher + panel widget (Smile-style).
 * Colours come from CSS variables set inline by the plugin (Appearance tab).
 */

.sv-rw {
	--svw-launcher: #f2ad44;
	--svw-launcher-ic: #1a1a1a;
	--svw-header: #f2ad44;
	--svw-header-tx: #1a1a1a;
	--svw-accent: #f2ad44;
	--svw-accent-tx: #1a1a1a;
	position: fixed;
	bottom: 20px;
	z-index: 99990;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 14px;
	line-height: 1.45;
	color: #1f2937;
}
.sv-rw.is-right { right: 20px; }
.sv-rw.is-left  { left: 20px; }

/* Launcher */
.sv-rw-launcher {
	width: 62px;
	height: 62px;
	border: none;
	border-radius: 50%;
	background: var(--svw-launcher);
	color: var(--svw-launcher-ic);
	cursor: pointer;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
	margin-left: auto;
}
.sv-rw-launcher:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28); }
.sv-rw-launcher svg { color: var(--svw-launcher-ic); }
.sv-rw-launcher-emoji { font-size: 27px; line-height: 1; }

/* Panel — constant size regardless of which screen is showing */
.sv-rw-panel {
	position: absolute;
	bottom: 76px;
	width: 350px;
	max-width: calc(100vw - 32px);
	height: 560px;
	max-height: calc(100vh - 104px);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	background: #fff;
	border-radius: 18px;
	box-shadow: 0 20px 52px rgba(0, 0, 0, 0.30);
	opacity: 0;
	transform: translateY(12px) scale(0.98);
	transition: opacity 0.16s ease, transform 0.16s ease;
	pointer-events: none;
}
.sv-rw.is-right .sv-rw-panel { right: 0; }
.sv-rw.is-left  .sv-rw-panel { left: 0; }
.sv-rw.is-open .sv-rw-panel {
	opacity: 1;
	transform: translateY(0) scale(1);
	pointer-events: auto;
}

/* Header (subtle gradient over the theme colour) */
.sv-rw-header {
	position: relative;
	flex: 0 0 auto;
	background:
		linear-gradient(135deg, rgba(255, 255, 255, 0.16), rgba(0, 0, 0, 0.06)),
		var(--svw-header);
	color: var(--svw-header-tx);
	padding: 24px 22px 30px;
	transition: padding 0.18s ease;
}
.sv-rw-header-eyebrow { font-size: 13px; opacity: 0.82; font-weight: 600; }
.sv-rw-header-title { font-size: 40px; font-weight: 800; margin-top: 2px; letter-spacing: -0.02em; line-height: 1.05; }
.sv-rw.is-guest .sv-rw-header-title { font-size: 27px; letter-spacing: -0.01em; line-height: 1.12; }
.sv-rw-header-compact { font-size: 17px; font-weight: 800; }

.sv-rw-close,
.sv-rw-back {
	position: absolute;
	top: 14px;
	width: 30px;
	height: 30px;
	border: none;
	background: transparent;
	color: inherit;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	opacity: 0.85;
	padding: 0;
}
.sv-rw-close { right: 14px; }
.sv-rw-back  { left: 12px; display: none; }
.sv-rw-close:hover,
.sv-rw-back:hover { opacity: 1; }

/* Sub-screen: compact header, show back arrow, swap titles */
.sv-rw-sub-only { display: none; }
.sv-rw:not([data-screen="main"]) .sv-rw-header { padding: 15px 22px 15px 44px; }
.sv-rw:not([data-screen="main"]) .sv-rw-back { display: block; top: 11px; }
.sv-rw:not([data-screen="main"]) .sv-rw-main-only { display: none; }
.sv-rw:not([data-screen="main"]) .sv-rw-sub-only { display: block; }

/* Body / screens */
.sv-rw-body {
	flex: 1 1 auto;
	overflow-y: auto;
	padding: 14px;
	background: #f4f5f7;
}
.sv-rw-screen { display: flex; flex-direction: column; gap: 12px; }
.sv-rw-screen[hidden] { display: none; }
.sv-rw-screen-title { margin: 2px 2px 0; font-size: 17px; font-weight: 700; }

.sv-rw-card {
	background: #fff;
	border: 1px solid #eceef1;
	border-radius: 14px;
	padding: 16px;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}
.sv-rw-join { text-align: center; }
.sv-rw-card-title { font-weight: 700; margin-bottom: 6px; text-align: center; font-size: 15px; }
.sv-rw-card-label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: #9ca3af; font-weight: 700; margin-bottom: 2px; }
.sv-rw-muted { color: #6b7280; font-size: 13px; margin: 0 0 12px; text-align: center; }
.sv-rw-left { text-align: left; }
.sv-rw-rows { padding: 6px 16px; }
.sv-rw-rows-flush { padding: 6px 0 0; }
.sv-rw-ready { text-align: center; font-weight: 600; padding: 6px 0 10px; }

/* Rows (nav / info / redeem) */
.sv-rw-row {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	text-align: left;
	background: transparent;
	border: none;
	border-top: 1px solid #eee;
	padding: 13px 2px;
	cursor: pointer;
	color: inherit;
	font: inherit;
}
.sv-rw-rows > .sv-rw-row:first-child,
.sv-rw-rows-flush > .sv-rw-row:first-child { border-top: none; }
.sv-rw-row-flush { border-top: none; padding-top: 2px; }
.sv-rw-row.is-static { cursor: default; }
.sv-rw-row-ic { flex: 0 0 auto; width: 26px; display: flex; align-items: center; justify-content: center; color: #52606d; }
.sv-rw-ico { width: 22px; height: 22px; display: block; }
.sv-rw-row-main { flex: 1 1 auto; min-width: 0; }
.sv-rw-row-main strong { display: block; font-weight: 600; font-size: 14px; }
.sv-rw-row-main small { display: block; color: #6b7280; font-size: 12.5px; margin-top: 1px; }
.sv-rw-row-chev { color: #9ca3af; font-size: 20px; flex: 0 0 auto; }
.sv-rw-row-trailing { flex: 0 0 auto; display: flex; align-items: center; }
.sv-rw-nav:hover { background: #fafafa; }

/* Progress ring */
.sv-rw-ring circle:last-child { transition: stroke-dashoffset 0.4s ease; }

/* Redeem pill on a row */
.sv-rw-pill {
	font-size: 12px;
	font-weight: 700;
	color: var(--svw-accent-tx);
	background: var(--svw-accent);
	border-radius: 999px;
	padding: 6px 14px;
	flex: 0 0 auto;
}
.sv-rw-redeem.is-disabled { opacity: 0.55; cursor: not-allowed; }
.sv-rw-redeem.is-disabled .sv-rw-pill { background: #e5e7eb; color: #6b7280; }
.sv-rw-redeem-msg { min-height: 1.1em; font-size: 13px; margin: 4px 4px 0; color: #15803d; text-align: center; }

/* Buttons */
.sv-rw-btn {
	display: inline-block;
	background: var(--svw-accent);
	color: var(--svw-accent-tx);
	border: none;
	border-radius: 999px;
	padding: 12px 22px;
	font-weight: 700;
	font-size: 14px;
	cursor: pointer;
	text-decoration: none;
	text-align: center;
}
.sv-rw-btn:hover { filter: brightness(0.96); }
.sv-rw-block { display: block; width: 100%; box-sizing: border-box; }
.sv-rw-signin { font-size: 13px; margin: 12px 0 0; color: #6b7280; }
.sv-rw-signin a { color: #b5761a; font-weight: 600; }
.sv-rw-note { text-align: center; color: #6b7280; font-size: 13px; }

/* Referral share */
.sv-rw-refrow { display: flex; gap: 6px; align-items: stretch; }
.sv-rw-reflink { flex: 1 1 auto; min-width: 0; padding: 10px; font-family: monospace; font-size: 11px; border: 1px solid #ddd; border-radius: 9px; background: #f9fafb; }
.sv-rw-iconbtn { flex: 0 0 auto; width: 42px; border: 1px solid #ddd; border-radius: 9px; background: #fff; cursor: pointer; font-size: 16px; }
.sv-rw-iconbtn:hover { background: #f3f4f6; }
.sv-rw-share { display: flex; gap: 8px; margin-top: 10px; }
.sv-rw-share-btn {
	flex: 1 1 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	padding: 9px 4px;
	border: 1px solid #eceef1;
	border-radius: 10px;
	text-decoration: none;
	color: #374151;
	background: #fff;
}
.sv-rw-share-btn span { font-size: 17px; font-weight: 700; }
.sv-rw-share-btn small { font-size: 11px; }
.sv-rw-share-btn:hover { background: #fafafa; }

/* Activity */
.sv-rw-tabs { display: flex; gap: 8px; }
.sv-rw-tab {
	flex: 1 1 0;
	padding: 9px;
	border: 1px solid #e5e7eb;
	border-radius: 999px;
	background: #fff;
	cursor: pointer;
	font-weight: 600;
	font-size: 13px;
	color: #374151;
}
.sv-rw-tab.is-active { background: var(--svw-accent); color: var(--svw-accent-tx); border-color: transparent; }
.sv-rw-tabpane[hidden] { display: none; }
.sv-rw-actrow { display: flex; align-items: center; gap: 10px; padding: 11px 2px; border-top: 1px solid #eee; }
.sv-rw-rows > .sv-rw-actrow:first-child { border-top: none; }
.sv-rw-actrow-main { flex: 1 1 auto; min-width: 0; }
.sv-rw-actrow-main strong { display: block; font-weight: 600; font-size: 13.5px; }
.sv-rw-actrow-main small { display: block; color: #9ca3af; font-size: 12px; }
.sv-rw-actrow-pts { font-weight: 700; font-variant-numeric: tabular-nums; flex: 0 0 auto; }
.sv-rw-actrow-pts.is-pos { color: #15803d; }
.sv-rw-actrow-pts.is-neg { color: #b91c1c; }
.sv-rw-status { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: #eef2ff; color: #4338ca; }
.sv-rw-status.is-rewarded { background: #ecfdf3; color: #15803d; }
.sv-rw-status.is-blocked { background: #fef2f2; color: #b91c1c; }

@media (max-width: 480px) {
	.sv-rw-panel { width: calc(100vw - 32px); }
}
