/* ==========================================================================
   Spyral Store — Modern Adaptive Layout
   Designed for Spyral theme (dark + gold #d0a53d)
   ========================================================================== */

/* =========== Tokens =========== */
.spyral-store {
	--sp-bg-0: #07090c;
	--sp-bg-1: #0b1015;
	--sp-bg-2: #11161c;
	--sp-bg-3: #161c23;
	--sp-border: #1c222a;
	--sp-border-strong: #2a313b;
	--sp-text: #d0c8b8;
	--sp-text-muted: #7a8089;
	--sp-text-dim: #4d5560;
	--sp-gold: #d0a53d;
	--sp-gold-soft: #efc149;
	--sp-gold-bright: #ffdd83;
	--sp-radius: 8px;
	--sp-radius-sm: 5px;
	--sp-shadow-sm: 0 2px 8px rgba(0,0,0,.35);
	--sp-shadow-md: 0 4px 18px rgba(0,0,0,.5);
	--sp-shadow-glow: 0 0 14px rgba(208,165,61,.18);

	color: var(--sp-text);
	font-family: calibrib, Calibri, 'Segoe UI', sans-serif;
	text-shadow: 0 1px 1px #000;
	box-sizing: border-box;
}

.spyral-store *,
.spyral-store *::before,
.spyral-store *::after {
	box-sizing: border-box;
}

/* =========== Guest Notice =========== */
.spyral-store-notice {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 16px;
	margin-bottom: 14px;
	background: linear-gradient(180deg, rgba(208,165,61,.12) 0%, rgba(208,165,61,.04) 100%);
	border: 1px solid rgba(208,165,61,.3);
	border-radius: var(--sp-radius);
	color: var(--sp-text);
}
.spyral-store-notice i {
	color: var(--sp-gold);
	font-size: 18px;
	flex-shrink: 0;
}

/* =========== Header (title + balance) =========== */
.spyral-store-header {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 12px;
	padding: 14px 18px;
	margin-bottom: 12px;
	background: linear-gradient(180deg, var(--sp-bg-2) 0%, var(--sp-bg-1) 100%);
	border: 1px solid var(--sp-border);
	border-radius: var(--sp-radius);
	box-shadow: var(--sp-shadow-sm);
}
.spyral-store-header::before {
	content: "";
	position: absolute;
}
.spyral-store-title {
	display: flex;
	align-items: center;
	gap: 12px;
	flex: 1 1 auto;
	min-width: 0;
}
.spyral-store-title i {
	color: var(--sp-gold);
	font-size: 22px;
	filter: drop-shadow(0 0 8px rgba(208,165,61,.35));
}
.spyral-store-title h2 {
	margin: 0;
	font-family: corbelb, Corbel, 'Segoe UI', sans-serif;
	font-size: 18px;
	color: var(--sp-gold-soft);
	text-transform: uppercase;
	letter-spacing: 1px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.spyral-store-balance {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 8px 14px;
	background: rgba(0,0,0,.35);
	border: 1px solid var(--sp-border);
	border-radius: 30px;
}
.spyral-balance-item {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 13px;
}
.spyral-balance-item img {
	width: 16px;
	height: 16px;
}
.spyral-balance-item b {
	color: var(--sp-gold-soft);
	font-weight: 700;
}
.spyral-balance-item small {
	color: var(--sp-text-muted);
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: .5px;
}
.spyral-balance-divider {
	width: 1px;
	height: 18px;
	background: var(--sp-border-strong);
}

/* =========== Toolbar (filters/sort/search) =========== */
.spyral-store-toolbar {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 14px;
	margin-bottom: 14px;
	background: var(--sp-bg-1);
	border: 1px solid var(--sp-border);
	border-radius: var(--sp-radius);
}
.spyral-toolbar-row {
	display: grid;
	gap: 10px;
	grid-template-columns: 1fr 1fr 1.4fr;
}
.spyral-toolbar-row.spyral-toolbar-actions {
	grid-template-columns: 1fr auto;
	align-items: center;
}
.spyral-field {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}
.spyral-field-label {
	font-size: 11px;
	color: var(--sp-text-muted);
	text-transform: uppercase;
	letter-spacing: .5px;
}
.spyral-store-toolbar select,
.spyral-store-toolbar input[type="text"] {
	width: 100%;
	padding: 9px 12px;
	background: var(--sp-bg-0);
	border: 1px solid var(--sp-border-strong);
	border-radius: var(--sp-radius-sm);
	color: var(--sp-text);
	font-family: inherit;
	font-size: 13px;
	box-shadow: inset 0 1px 2px rgba(0,0,0,.4);
	text-shadow: none;
	transition: border-color .25s, box-shadow .25s;
	appearance: none;
	-webkit-appearance: none;
}
.spyral-store-toolbar select {
	background-image: linear-gradient(45deg, transparent 50%, var(--sp-gold) 50%), linear-gradient(135deg, var(--sp-gold) 50%, transparent 50%);
	background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%;
	background-size: 5px 5px, 5px 5px;
	background-repeat: no-repeat;
	padding-right: 28px;
	cursor: pointer;
}
.spyral-store-toolbar select option {
	background: var(--sp-bg-2);
	color: var(--sp-text);
}
.spyral-store-toolbar select:focus,
.spyral-store-toolbar input[type="text"]:focus {
	outline: none;
	border-color: var(--sp-gold);
	box-shadow: 0 0 0 2px rgba(208,165,61,.18), inset 0 1px 2px rgba(0,0,0,.4);
}

/* Toolbar action chips & view toggle */
.spyral-toolbar-group {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}
.spyral-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 7px 12px;
	background: var(--sp-bg-2);
	border: 1px solid var(--sp-border-strong);
	border-radius: 30px;
	color: var(--sp-text-muted);
	font-size: 12px;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
	transition: all .25s;
	user-select: none;
}
.spyral-chip img {
	width: 14px;
	height: 14px;
	opacity: .6;
	transition: opacity .25s;
}
.spyral-chip:hover {
	color: var(--sp-text);
	border-color: var(--sp-gold);
}
.spyral-chip.spyral-chip-active,
.spyral-chip.nice_active {
	background: linear-gradient(180deg, rgba(208,165,61,.2) 0%, rgba(208,165,61,.08) 100%);
	border-color: var(--sp-gold);
	color: var(--sp-gold-soft);
	box-shadow: 0 0 8px rgba(208,165,61,.18);
}
.spyral-chip.spyral-chip-active img,
.spyral-chip.nice_active img {
	opacity: 1;
}

.spyral-view-toggle {
	display: inline-flex;
	background: var(--sp-bg-2);
	border: 1px solid var(--sp-border-strong);
	border-radius: 30px;
	padding: 3px;
	gap: 2px;
}
.spyral-view-toggle a {
	padding: 6px 12px;
	border-radius: 30px;
	color: var(--sp-text-dim);
	font-size: 13px;
	cursor: pointer;
	text-decoration: none;
	transition: all .2s;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}
.spyral-view-toggle a.active,
.spyral-view-toggle a:hover {
	color: var(--sp-gold-soft);
	background: rgba(208,165,61,.15);
}

/* =========== Content layout (items + cart) =========== */
.spyral-store-content {
	display: grid;
	grid-template-columns: 1fr;
	gap: 14px;
	align-items: start;
}
@media (min-width: 769px) {
	/* Desktop/tablet: cart above items, items get full width */
	.spyral-store-content {
		grid-template-columns: 1fr;
	}
	.spyral-cart-wrap {
		order: -1;
	}
}

/* Realms / groups (accordion) */
.spyral-realms {
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.spyral-realm,
.spyral-group {
	background: var(--sp-bg-1);
	border: 1px solid var(--sp-border);
	border-radius: var(--sp-radius);
	overflow: hidden;
}
.spyral-realm-header,
.spyral-group-header {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	padding: 12px 14px;
	background: linear-gradient(180deg, rgba(7,14,18,.95) 0%, rgba(7,14,18,.7) 100%);
	border: 0;
	color: var(--sp-gold);
	font-family: corbelb, Corbel, 'Segoe UI', sans-serif;
	font-size: 14px;
	letter-spacing: .5px;
	text-shadow: 0 1px 1px #000;
	text-align: left;
	cursor: pointer;
	transition: background .25s, color .25s;
}
.spyral-realm-header:hover,
.spyral-group-header:hover {
	color: var(--sp-gold-soft);
	background: linear-gradient(180deg, rgba(208,165,61,.06) 0%, rgba(7,14,18,.7) 100%);
}
.spyral-realm-header > span,
.spyral-group-title {
	flex: 1 1 auto;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.spyral-realm-header > i:first-child {
	color: var(--sp-text-dim);
	font-size: 14px;
}
.spyral-chevron {
	font-size: 11px;
	color: var(--sp-text-dim);
	transition: transform .25s;
}
.spyral-realm-header[aria-expanded="true"] .spyral-chevron,
.spyral-group-header[aria-expanded="true"] .spyral-chevron {
	transform: rotate(180deg);
	color: var(--sp-gold);
}
.spyral-group-header.collapsed .spyral-chevron {
	transform: rotate(0);
}
.spyral-group-count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 26px;
	height: 20px;
	padding: 0 7px;
	background: rgba(208,165,61,.15);
	color: var(--sp-gold);
	font-size: 11px;
	font-weight: 700;
	border-radius: 10px;
	line-height: 1;
}
.spyral-realm-body {
	padding: 12px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}
.spyral-group {
	background: rgba(0,0,0,.25);
}
.spyral-group-body {
	padding: 10px;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

/* =========== Item card (LIST view) =========== */
.spyral-item {
	display: grid;
	grid-template-columns: 56px minmax(0, 1fr) minmax(0, max-content);
	gap: 14px;
	align-items: center;
	padding: 12px;
	min-height: 80px;
	background: linear-gradient(180deg, var(--sp-bg-2) 0%, var(--sp-bg-1) 100%);
	border: 1px solid var(--sp-border);
	border-radius: var(--sp-radius);
	transition: border-color .25s, box-shadow .25s, transform .15s;
}
.spyral-item:hover {
	border-color: var(--sp-border-strong);
	box-shadow: var(--sp-shadow-md), 0 0 0 1px rgba(208,165,61,.05);
}

.spyral-item-icon {
	position: relative;
	width: 56px;
	height: 56px;
	border-radius: var(--sp-radius-sm);
	overflow: hidden;
}
.spyral-item-icon .item_icon {
	width: 56px;
	height: 56px;
	border: 2px solid var(--sp-border-strong);
	border-radius: var(--sp-radius-sm);
	transition: border-color .3s, box-shadow .3s;
	display: block;
	background: #000;
}
.spyral-item-count {
	position: absolute;
	right: 2px;
	bottom: 0;
	color: #fff;
	font-size: 13px;
	font-weight: 700;
	text-shadow: 1px 1px 0 #000, -1px 1px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000;
}

/* Quality borders */
.spyral-item[data-quality="0"] .item_icon { border-color: #9d9d9d; }
.spyral-item[data-quality="1"] .item_icon { border-color: #ffffff; }
.spyral-item[data-quality="2"] .item_icon { border-color: #1eff00; box-shadow: 0 0 6px rgba(30,255,0,.25); }
.spyral-item[data-quality="3"] .item_icon { border-color: #0070dd; box-shadow: 0 0 6px rgba(0,112,221,.25); }
.spyral-item[data-quality="4"] .item_icon { border-color: #a335ee; box-shadow: 0 0 8px rgba(163,53,238,.35); }
.spyral-item[data-quality="5"] .item_icon { border-color: #ff8000; box-shadow: 0 0 9px rgba(255,128,0,.35); }
.spyral-item[data-quality="6"] .item_icon { border-color: #e6cc80; box-shadow: 0 0 8px rgba(230,204,128,.3); }
.spyral-item[data-quality="7"] .item_icon { border-color: #00ccff; box-shadow: 0 0 8px rgba(0,204,255,.3); }

.spyral-item-body {
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 4px;
}
.spyral-item-name {
	font-size: 14px;
	font-weight: 600;
	line-height: 1.25;
	text-decoration: none;
	transition: color .25s;
	word-break: break-word;
}
.spyral-item-name:hover {
	text-decoration: underline;
}
.spyral-item-desc {
	margin: 0;
	font-size: 12px;
	color: var(--sp-text-muted);
	line-height: 1.35;
	overflow: hidden;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.spyral-item-actions {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 6px;
	justify-content: center;
	min-width: 130px;
	max-width: 220px;
}
.spyral-item-actions .spyral-buy-btn {
	flex: 0 0 auto;
	justify-content: center;
}

/* Buy buttons */
.spyral-buy-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 7px 12px;
	background: linear-gradient(180deg, rgba(208,165,61,.18) 0%, rgba(208,165,61,.06) 100%);
	border: 1px solid rgba(208,165,61,.4);
	border-radius: var(--sp-radius-sm);
	color: var(--sp-gold-soft);
	font-size: 13px;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
	transition: all .25s;
	white-space: nowrap;
	box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 1px 2px rgba(0,0,0,.4);
	text-shadow: 0 1px 1px rgba(0,0,0,.7);
}
.spyral-buy-btn img {
	width: 14px;
	height: 14px;
}
.spyral-buy-btn em {
	font-style: normal;
	font-size: 11px;
	color: var(--sp-text-muted);
	text-transform: uppercase;
}
.spyral-buy-btn:hover {
	background: linear-gradient(180deg, rgba(208,165,61,.32) 0%, rgba(208,165,61,.14) 100%);
	border-color: var(--sp-gold);
	color: var(--sp-gold-bright);
	box-shadow: 0 0 12px rgba(208,165,61,.25), inset 0 1px 0 rgba(255,255,255,.08);
	transform: translateY(-1px);
	text-decoration: none;
}
.spyral-buy-btn:active {
	transform: translateY(0);
	box-shadow: inset 0 2px 4px rgba(0,0,0,.5);
}
.spyral-buy-btn.is-disabled,
.spyral-buy-btn.too-expensive {
	opacity: .4;
	filter: grayscale(.5);
	cursor: not-allowed;
	pointer-events: none;
}
.spyral-buy-btn.affordable {
	opacity: 1;
	filter: none;
}

/* Item quality colors for name */
.q0 { color: #9d9d9d; }
.q1 { color: #ffffff; }
.q2 { color: #1eff00; }
.q3 { color: #0070dd; }
.q4 { color: #a335ee; }
.q5 { color: #ff8000; }
.q6 { color: #e6cc80; }
.q7 { color: #00ccff; }

/* =========== Cart (desktop sidebar) =========== */
.spyral-cart-wrap {
	min-width: 0;
	position: relative;
}
.spyral-cart {
	background: linear-gradient(180deg, var(--sp-bg-2) 0%, var(--sp-bg-1) 100%);
	border: 1px solid var(--sp-border);
	border-radius: var(--sp-radius);
	overflow: hidden;
	box-shadow: var(--sp-shadow-sm);
}
@media (min-width: 769px) {
	.spyral-cart {
		position: static;
		top: auto;
		align-self: auto;
	}
}
.spyral-cart-header {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 14px;
	background: linear-gradient(180deg, rgba(7,14,18,.95) 0%, rgba(7,14,18,.6) 100%);
	border-bottom: 1px solid var(--sp-border);
	color: var(--sp-gold);
	font-family: corbelb, Corbel, 'Segoe UI', sans-serif;
}
.spyral-cart-header i {
	font-size: 16px;
}
.spyral-cart-title {
	flex: 1;
	font-size: 14px;
	letter-spacing: .5px;
	text-transform: uppercase;
}
.spyral-cart-counter {
	font-size: 12px;
	color: var(--sp-text-muted);
}
.spyral-cart-counter b {
	color: var(--sp-gold-soft);
	font-weight: 700;
}
.spyral-cart-close {
	display: none;
	background: none;
	border: 0;
	color: var(--sp-text-muted);
	font-size: 16px;
	cursor: pointer;
	padding: 4px 8px;
	border-radius: 4px;
	transition: color .2s, background .2s;
}
.spyral-cart-close:hover {
	color: var(--sp-gold);
	background: rgba(208,165,61,.1);
}

.spyral-cart-body {
	padding: 10px;
	max-height: 50vh;
	overflow-y: auto;
}
.spyral-cart-body::-webkit-scrollbar { width: 6px; }
.spyral-cart-body::-webkit-scrollbar-track { background: rgba(0,0,0,.3); }
.spyral-cart-body::-webkit-scrollbar-thumb { background: var(--sp-border-strong); border-radius: 3px; }

.spyral-cart-empty {
	text-align: center;
	padding: 24px 12px;
	color: var(--sp-text-dim);
}
.spyral-cart-empty i {
	font-size: 28px;
	display: block;
	margin-bottom: 8px;
	opacity: .5;
}
.spyral-cart-empty p {
	margin: 0;
	font-size: 13px;
	font-style: italic;
}

.spyral-cart-items {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

/* Cart item row (override Bootstrap .row injected by Store.Cart.add) */
.spyral-cart #cart_items .store_item.row,
#cart_items .store_item.row {
	display: grid !important;
	grid-template-columns: minmax(0,1fr) auto auto;
	grid-template-areas:
		"name realm delete"
		"price price price";
	row-gap: 4px;
	column-gap: 8px;
	margin: 0 !important;
	padding: 8px 10px !important;
	background: rgba(0,0,0,.25);
	border: 1px solid var(--sp-border);
	border-radius: var(--sp-radius-sm);
	box-shadow: none !important;
}
#cart_items .store_item.row:hover {
	background: rgba(208,165,61,.05);
	border-color: var(--sp-border-strong);
}
.spyral-cart #cart_items .store_item .item_name,
#cart .spyral-cart-body #cart_items .store_item .item_name,
#cart_items .store_item .item_name {
	grid-area: name;
	font-size: 12px !important;
	font-weight: 600;
	line-height: 1.3 !important;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	margin: 0 !important;
	max-width: 100%;
	flex: none !important;
	float: none !important;
}
#cart_items .store_item [id^="cart_item_count_"] {
	grid-area: name;
	justify-self: end;
	color: var(--sp-text-muted);
	font-size: 11px;
}
.spyral-cart #cart_items .store_item .item_realm,
#cart .spyral-cart-body #cart_items .store_item .item_realm,
#cart_items .store_item .item_realm {
	grid-area: realm;
	font-size: 10px !important;
	color: var(--sp-text-dim) !important;
	margin: 0 !important;
	max-width: 100%;
	flex: none !important;
	float: none !important;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
#cart_items .store_item .item_price {
	grid-area: price;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-size: 11px;
	color: var(--sp-text);
	margin: 0 !important;
	max-width: 100%;
	flex: none !important;
}
#cart_items .store_item .item_price img {
	width: 12px;
	height: 12px;
	margin: 0 !important;
}
.spyral-cart #cart_items .store_item .delete_item,
#cart .spyral-cart-body #cart_items .store_item .delete_item,
#cart_items .store_item .delete_item {
	grid-area: delete;
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	width: 24px !important;
	height: 24px !important;
	color: #c66 !important;
	background: rgba(255,82,82,.08) !important;
	border: 1px solid rgba(255,82,82,.18);
	border-radius: 4px;
	opacity: 1 !important;
	position: static !important;
	margin: 0 !important;
	right: auto !important;
	bottom: auto !important;
	font-size: 11px;
	transition: all .2s;
	cursor: pointer;
	flex: none !important;
	max-width: none !important;
	float: none !important;
	overflow: visible !important;
}
#cart_items .store_item .delete_item:hover {
	color: #fff !important;
	background: rgba(255,82,82,.25);
	border-color: rgba(255,82,82,.45);
}
#cart_items .store_item:hover .delete_item {
	width: 24px !important;
	opacity: 1 !important;
}
#cart_items .store_item:hover .item_name,
#cart_items .store_item:hover .item_realm {
	margin-left: 0 !important;
}
#cart_items .clear { display: none; }

.spyral-cart-footer {
	padding: 10px 14px;
	background: rgba(0,0,0,.45);
	border-top: 1px solid var(--sp-border);
}
.spyral-cart-totals {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
}
.spyral-cart-total {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-size: 13px;
	color: var(--sp-text);
}
.spyral-cart-total img {
	width: 14px;
	height: 14px;
}
.spyral-cart-total span {
	color: var(--sp-gold-soft);
	font-weight: 700;
}
.spyral-cart-total small {
	color: var(--sp-text-muted);
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: .5px;
}
.spyral-checkout-btn {
	margin-left: auto;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 9px 16px;
	background: linear-gradient(180deg, var(--sp-gold) 0%, #b88a2e 100%);
	border: 1px solid var(--sp-gold);
	border-radius: var(--sp-radius-sm);
	color: #1a1409 !important;
	font-weight: 700;
	font-size: 13px;
	text-decoration: none;
	text-shadow: 0 1px 0 rgba(255,255,255,.2);
	cursor: pointer;
	transition: all .25s;
	box-shadow: 0 2px 8px rgba(208,165,61,.25), inset 0 1px 0 rgba(255,255,255,.18);
	white-space: nowrap;
	height: auto !important;
	margin-top: 0 !important;
}
.spyral-checkout-btn:hover {
	background: linear-gradient(180deg, var(--sp-gold-bright) 0%, var(--sp-gold) 100%);
	color: #000 !important;
	transform: translateY(-1px);
	box-shadow: 0 4px 14px rgba(208,165,61,.35), inset 0 1px 0 rgba(255,255,255,.3);
	text-decoration: none;
}
.spyral-checkout-btn i {
	font-size: 13px;
}

/* Cart pulse animation */
@keyframes sp-cart-pulse {
	0% { box-shadow: 0 0 0 0 rgba(208,165,61,.55); }
	70% { box-shadow: 0 0 0 12px rgba(208,165,61,0); }
	100% { box-shadow: 0 0 0 0 rgba(208,165,61,0); }
}
.spyral-cart-header.cart-pulse {
	animation: sp-cart-pulse .7s ease-out;
}

/* Hide cart_price by default until items added */
#cart_price[style*="display: none"] {
	display: none !important;
}

/* =========== Mobile Cart FAB & Drawer =========== */
.spyral-cart-fab {
	display: none;
	position: fixed;
	right: 14px;
	bottom: 14px;
	z-index: 950;
	width: 58px;
	height: 58px;
	border-radius: 50%;
	border: 2px solid var(--sp-gold);
	background: radial-gradient(circle at 30% 30%, #2a1f0d, #0b0f13);
	color: var(--sp-gold);
	font-size: 22px;
	cursor: pointer;
	box-shadow: 0 8px 24px rgba(0,0,0,.6), 0 0 0 4px rgba(208,165,61,.08);
	transition: transform .25s, box-shadow .25s;
}
.spyral-cart-fab:hover {
	transform: scale(1.05);
	box-shadow: 0 8px 32px rgba(0,0,0,.7), 0 0 0 6px rgba(208,165,61,.14);
}
.spyral-cart-fab-count {
	position: absolute;
	top: -4px;
	right: -4px;
	min-width: 22px;
	height: 22px;
	padding: 0 6px;
	background: linear-gradient(180deg, #ff5252, #c0392b);
	color: #fff;
	border: 2px solid var(--sp-bg-0);
	border-radius: 11px;
	font-size: 11px;
	font-weight: 700;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
	opacity: 0;
	transform: scale(.5);
	transition: opacity .25s, transform .25s;
}
.spyral-cart-fab-count.is-active {
	opacity: 1;
	transform: scale(1);
}

/* =========== Checkout result cards =========== */
.store-result-card {
	max-width: 520px;
	margin: 30px auto;
	padding: 30px 24px;
	text-align: center;
	background: linear-gradient(180deg, var(--sp-bg-2) 0%, var(--sp-bg-1) 100%);
	border: 1px solid var(--sp-border);
	border-radius: var(--sp-radius);
	box-shadow: var(--sp-shadow-md);
}
.store-result-card .result-icon {
	font-size: 52px;
	margin-bottom: 14px;
	display: block;
}
.store-result-card.success .result-icon { color: #4caf50; }
.store-result-card.error .result-icon { color: #d33; }
.store-result-card h3 {
	color: var(--sp-text);
	font-family: corbelb, Corbel, 'Segoe UI', sans-serif;
	margin-bottom: 12px;
	font-size: 20px;
}
.store-result-card p {
	color: var(--sp-text-muted);
	margin-bottom: 22px;
	line-height: 1.5;
	font-size: 14px;
}
.store-result-card .nice_button,
.store-result-card .spyral-buy-btn {
	display: inline-block;
}

/* =========== Checkout view =========== */
#checkout_info {
	padding: 16px 18px;
	margin-bottom: 16px;
	background: linear-gradient(180deg, rgba(208,165,61,.1) 0%, rgba(7,14,18,.6) 100%);
	border: 1px solid rgba(208,165,61,.25);
	border-radius: var(--sp-radius);
	color: var(--sp-text);
	font-size: 14px;
	line-height: 1.5;
}
#checkout_info img {
	width: 16px;
	height: 16px;
	vertical-align: middle;
}
#checkout_info b {
	color: var(--sp-gold-soft);
}
#checkout_info .d-flex {
	gap: 10px;
	flex-wrap: wrap;
	margin-top: 14px !important;
}
.spyral-checkout-summary {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 6px;
	font-size: 14px;
}
.spyral-checkout-summary img {
	width: 16px;
	height: 16px;
	margin: 0 2px;
}
.spyral-checkout-actions {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	margin-top: 14px;
}
.spyral-checkout-actions > a {
	flex: 1 1 calc(50% - 5px);
	justify-content: center;
}
.spyral-checkout-realm {
	margin-bottom: 14px;
	background: var(--sp-bg-1);
	border: 1px solid var(--sp-border);
	border-radius: var(--sp-radius);
	overflow: hidden;
}
.spyral-checkout-realm-header {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 14px;
	background: linear-gradient(180deg, rgba(7,14,18,.95) 0%, rgba(7,14,18,.6) 100%);
	border-bottom: 1px solid var(--sp-border);
	color: var(--sp-gold);
	font-family: corbelb, Corbel, 'Segoe UI', sans-serif;
	font-size: 14px;
	letter-spacing: .5px;
}
.spyral-checkout-realm-header i {
	color: var(--sp-text-dim);
}
.spyral-checkout-realm-body {
	padding: 12px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}
.spyral-checkout-item {
	display: grid;
	grid-template-columns: 56px minmax(0,1fr) minmax(180px, 220px);
	gap: 14px;
	align-items: center;
	padding: 10px;
	background: rgba(0,0,0,.25);
	border: 1px solid var(--sp-border);
	border-radius: var(--sp-radius-sm);
}
.spyral-checkout-item-body {
	min-width: 0;
}
.spyral-checkout-character {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}
.spyral-checkout-character select {
	width: 100%;
	padding: 8px 10px;
	background: var(--sp-bg-0);
	border: 1px solid var(--sp-border-strong);
	border-radius: var(--sp-radius-sm);
	color: var(--sp-text);
	font-family: inherit;
	font-size: 13px;
	text-shadow: none;
}
.spyral-checkout-character select:focus {
	outline: none;
	border-color: var(--sp-gold);
}
.spyral-no-character {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: #ffb84d;
	font-size: 12px;
}
@media (max-width: 768px) {
	.spyral-checkout-item {
		grid-template-columns: 48px minmax(0,1fr);
		grid-template-areas:
			"icon body"
			"char char";
		gap: 10px;
	}
	.spyral-checkout-item .spyral-item-icon { grid-area: icon; }
	.spyral-checkout-item-body { grid-area: body; }
	.spyral-checkout-character { grid-area: char; }
	.spyral-checkout-actions > a { flex: 1 1 100%; }
}

/* =========== Item Search Autocomplete (admin) =========== */
.item-search-wrapper { position: relative; }
.item-search-results {
	display: none;
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	z-index: 1050;
	max-height: 350px;
	overflow-y: auto;
	background: var(--sp-bg-0);
	border: 1px solid var(--sp-border);
	border-top: none;
	border-radius: 0 0 6px 6px;
	box-shadow: 0 8px 24px rgba(0,0,0,.6);
}
.item-search-row {
	display: flex;
	align-items: center;
	padding: 6px 10px;
	cursor: pointer;
	border-bottom: 1px solid var(--sp-bg-2);
}
.item-search-row:hover { background: var(--sp-bg-2); }
.item-search-row:last-child { border-bottom: none; }
.item-search-icon {
	width: 24px; height: 24px;
	margin-right: 10px;
	border-radius: 3px;
	border: 1px solid var(--sp-border-strong);
	flex-shrink: 0;
}
.item-search-name {
	flex: 1;
	font-size: 13px;
	font-weight: 500;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.item-search-info {
	font-size: 11px;
	color: var(--sp-text-muted);
	margin-left: 12px;
	white-space: nowrap;
	flex-shrink: 0;
}
.item-search-empty {
	padding: 12px;
	text-align: center;
	color: var(--sp-text-muted);
	font-size: 13px;
}

/* =========== GRID VIEW =========== */
.spyral-store-content.store-grid .spyral-group-body {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 10px;
}
.spyral-store-content.store-grid .spyral-realm-body > .spyral-item {
	grid-column: 1 / -1;
}
.spyral-store-content.store-grid .spyral-item {
	grid-template-columns: 1fr;
	grid-template-rows: auto auto auto;
	text-align: center;
	padding: 14px 10px;
	gap: 8px;
}
.spyral-store-content.store-grid .spyral-item-icon {
	margin: 0 auto;
}
.spyral-store-content.store-grid .spyral-item-body {
	align-items: center;
}
.spyral-store-content.store-grid .spyral-item-name {
	font-size: 13px;
	text-align: center;
	word-break: break-word;
}
.spyral-store-content.store-grid .spyral-item-desc {
	font-size: 11px;
	text-align: center;
	-webkit-line-clamp: 2;
}
.spyral-store-content.store-grid .spyral-item-actions {
	flex-direction: row;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	min-width: 0;
	max-width: none;
}
.spyral-store-content.store-grid .spyral-buy-btn {
	font-size: 12px;
	padding: 6px 10px;
	flex: 0 1 auto;
}

/* Backwards-compat selectors used by existing JS */
.store_buttons {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
	justify-content: flex-end;
}

/* =========== ADAPTIVE: tablet =========== */
@media (max-width: 992px) {
	.spyral-toolbar-row {
		grid-template-columns: 1fr 1fr;
	}
	.spyral-field-search {
		grid-column: 1 / -1;
	}
	.spyral-toolbar-row.spyral-toolbar-actions {
		grid-template-columns: 1fr auto;
	}
}

/* =========== ADAPTIVE: mobile =========== */
@media (max-width: 768px) {
	.spyral-store {
		font-size: 13px;
	}

	#wrapper #right article .body:has(.spyral-store) {
		padding: 8px !important;
	}

	.spyral-store-header {
		padding: 10px 12px;
		gap: 8px;
	}
	.spyral-store-title h2 {
		font-size: 15px;
	}
	.spyral-store-balance {
		width: 100%;
		justify-content: center;
		padding: 6px 10px;
	}

	.spyral-store-toolbar {
		padding: 10px;
	}
	.spyral-toolbar-row,
	.spyral-toolbar-row.spyral-toolbar-actions {
		grid-template-columns: 1fr;
	}
	.spyral-field-search {
		grid-column: auto;
	}

	.spyral-toolbar-actions {
		gap: 8px;
	}
	.spyral-toolbar-group {
		justify-content: center;
	}
	.spyral-chip {
		flex: 1 1 auto;
		justify-content: center;
		padding: 8px 14px;
	}
	.spyral-view-toggle {
		justify-self: center;
	}

	/* Item card → vertical stack */
	.spyral-item {
		grid-template-columns: 48px minmax(0,1fr);
		grid-template-areas:
			"icon body"
			"actions actions";
		gap: 10px;
		padding: 10px;
	}
	.spyral-item-icon {
		grid-area: icon;
		width: 48px;
		height: 48px;
	}
	.spyral-item-icon .item_icon {
		width: 48px;
		height: 48px;
	}
	.spyral-item-body {
		grid-area: body;
	}
	.spyral-item-actions {
		grid-area: actions;
		flex-direction: row;
		flex-wrap: wrap;
		align-items: stretch;
		justify-content: stretch;
		gap: 6px;
		padding-top: 8px;
		border-top: 1px solid var(--sp-border);
		min-width: 0;
		max-width: none;
	}
	.spyral-item-actions .spyral-buy-btn,
	.spyral-buy-btn {
		flex: 1 1 calc(50% - 3px);
		justify-content: center;
	}

	.spyral-item-name { font-size: 14px; }
	.spyral-item-desc { font-size: 12px; -webkit-line-clamp: 3; }

	/* Hide desktop cart, show floating button + drawer */
	.spyral-cart {
		position: fixed !important;
		top: auto !important;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 1000;
		max-height: 80vh;
		border-radius: 14px 14px 0 0;
		border-left: 0;
		border-right: 0;
		border-bottom: 0;
		transform: translateY(calc(100% + 24px));
		transition: transform .35s cubic-bezier(.4,0,.2,1);
		box-shadow: 0 -8px 32px rgba(0,0,0,.6);
	}
	.spyral-cart.is-open {
		transform: translateY(0);
	}
	.spyral-cart-close {
		display: inline-flex;
		align-items: center;
		justify-content: center;
	}
	.spyral-cart-body {
		max-height: 50vh;
	}

	.spyral-cart-fab {
		display: inline-flex;
		align-items: center;
		justify-content: center;
	}

	body.spyral-cart-open {
		overflow: hidden;
	}
	body.spyral-cart-open::before {
		content: "";
		position: fixed;
		inset: 0;
		background: rgba(0,0,0,.65);
		z-index: 999;
		animation: sp-fade-in .25s ease-out;
	}
	@keyframes sp-fade-in {
		from { opacity: 0; }
		to { opacity: 1; }
	}

	/* Cart totals on mobile */
	.spyral-cart-totals {
		justify-content: space-between;
	}
	.spyral-checkout-btn {
		flex: 1 1 100%;
		justify-content: center;
		margin-left: 0;
		padding: 10px 16px;
	}

	/* Realm/group headers a bit tighter */
	.spyral-realm-header,
	.spyral-group-header {
		font-size: 13px;
		padding: 10px 12px;
	}

	/* Grid view → 2 cols on mobile */
	.spyral-store-content.store-grid .spyral-group-body {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 8px;
	}
}

@media (max-width: 480px) {
	.spyral-buy-btn {
		flex: 1 1 100%;
	}
	.spyral-store-content.store-grid .spyral-group-body {
		grid-template-columns: 1fr;
	}
	.spyral-cart-fab {
		width: 52px;
		height: 52px;
		right: 10px;
		bottom: 10px;
		font-size: 19px;
	}
}
