.dye-swatch{width:72px;height:72px;border-radius:12px;border:1px solid rgba(15,23,36,0.06);box-shadow:inset 0 -6px 18px rgba(0,0,0,0.06);}
.dye-card .name{margin-top:8px}
/* small hex label shown under each dye swatch for debugging */
:root{
	/* Soft red + gray palette */
	--bg: #e77c7c; /* very light neutral gray background */
	--card: #ffffff; /* card surface */
	--primary: #D66A6A; /* soft warm red */
	--primary-dark: #B04B4B; /* deeper muted red */
	--accent: #8A6E6E;  /* muted rosy gray accent */
	--success: #66CC33; /* keep success green for status */
	--muted: #4B4B4B; /* dark gray for text */
	--slot-chosen: #8B2E2E; /* deep red for chosen slots */
	--glass: rgba(255,255,255,0.7);
	--radius: 10px;
}

*{box-sizing:border-box;font-family:system-ui,-apple-system,'Segoe UI',Roboto,Inter,Arial,Helvetica,sans-serif}
body{margin:0;background:var(--bg);color:#0f1724;-webkit-font-smoothing:antialiased}
.app{max-width:1100px;margin:32px auto;padding:22px;background:linear-gradient(180deg,rgba(246,251,249,0.6),rgba(246,251,249,0.95));border-radius:12px;box-shadow:0 10px 30px rgba(2,6,23,0.06);border:1px solid rgba(47,58,54,0.04)}
/* Visual cue for Weapon mode: slight cool tint */
.app.mode-weapon{background:linear-gradient(180deg,rgba(235,244,255,0.6),rgba(235,244,255,0.95));border:1px solid rgba(80,120,160,0.06)}
header{display:flex;align-items:center;justify-content:space-between;gap:12px}
header h1{margin:0;font-size:22px;letter-spacing:-0.2px;margin-bottom:12px}
.top-links{display:flex;gap:8px;align-items:center}
.top-link{font-size:13px;text-decoration:none;padding:8px 12px;border-radius:999px;display:inline-flex;align-items:center;gap:8px;transition:transform .12s ease,box-shadow .12s ease}
.top-link.donate{background:linear-gradient(90deg,var(--primary),var(--primary-dark));color:#fff;border:1px solid rgba(47,58,54,0.06);box-shadow:0 8px 18px rgba(47,58,54,0.06)}
.top-link.donate:hover{transform:translateY(-2px);box-shadow:0 14px 28px rgba(128, 51, 51, 0.08)}
.top-link.email{background:transparent;color:var(--muted);border:1px solid rgba(47,58,54,0.06);backdrop-filter:blur(4px);}
.top-link.email:hover{filter:brightness(.98);transform:translateY(-1px)}
/* SVG icon sizing inside header links */
.top-link svg{width:16px;height:16px;display:inline-block;flex:0 0 16px}
.top-link span{line-height:1}
.config{display:flex;justify-content:space-between;gap:18px;margin-bottom:18px;align-items:start}
.controls{display:flex;gap:12px;align-items:flex-end}
.controls label{display:flex;flex-direction:column;font-size:13px;color:var(--muted)}
.controls select, .controls button, #search-input{padding:9px 12px;border-radius:10px;border:1px solid rgba(15,23,36,0.06);background:var(--card)}
.controls button{background:var(--primary);color:#fff;border:none;cursor:pointer}
.controls button:hover{filter:brightness(.98)}
#selected-summary{width:320px;padding:12px;border-left:1px;background:linear-gradient(180deg,transparent,rgba(255,255,255,0.02))}
#summary-list{min-height:150px;color:#0b1220}
#preset-area{width:320px;padding:12px;border-left:1px;background:linear-gradient(180deg,transparent,rgba(255,255,255,0.02))}
/* Preset UI inside selected summary */
.preset-area{margin-top:10px;border-top:1px;padding-top:10px}
.preset-area label{display:block;font-size:12px;color:var(--muted);margin-bottom:6px}
.preset-area input#preset-name{padding:8px;border-radius:8px;border:1px;margin-bottom:8px}
.preset-actions{display:flex;gap:8px;align-items:center}
.preset-actions button{padding:8px 10px;border-radius:8px;border:none;background:linear-gradient(90deg,var(--primary),var(--primary-dark));color:#fff;cursor:pointer}
.slots{margin-bottom:16px}
#slot-list{display:flex;gap:10px;flex-wrap:wrap;list-style:none;padding:0;margin:8px 0}
#slot-list li{padding:10px 14px;border-radius:10px;border:1px solid rgba(15,23,36,0.06);background:transparent;color:#0b1220;cursor:pointer;transition:all .15s ease}
#slot-list li:hover{transform:translateY(-2px);box-shadow:0 6px 18px rgba(15,23,36,0.04)}
#slot-list li.selected{
	border-style:solid;
	background: linear-gradient(90deg, rgba(214,106,106,0.06), rgba(138,110,110,0.02));
	/* subtle red glow + lift */
	box-shadow: 0 0 18px rgba(214,106,106,0.18), 0 8px 20px rgba(139,46,46,0.12);
	transform: translateY(-2px);
}
/* Make slot items layout-friendly for badges */
#slot-list li{display:inline-flex;align-items:center;gap:8px}

/* Small badge showing count of selected dyes for a category */
.slot-badge{display:inline-flex;align-items:center;justify-content:center;min-width:20px;height:20px;padding:0 6px;border-radius:999px;background:linear-gradient(90deg,var(--primary),var(--primary-dark));color:#fff;font-size:12px;font-weight:600;box-shadow:0 6px 12px rgba(47,58,54,0.06)}
.slot-badge[aria-hidden="true"]{opacity:0.95}
#slot-list li.chosen{background:var(--slot-chosen);color:#fff;border-color:rgba(0,0,0,0.12)}
.skin-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:12px}
.skin-card{display:flex;flex-direction:column;align-items:center;padding:12px;border-radius:12px;border:1px solid rgba(15,23,36,0.04);background:var(--card);transition:transform .15s ease,box-shadow .15s ease}
.skin-card:hover{transform:translateY(-6px);box-shadow:0 18px 40px rgba(2,6,23,0.08)}
.skin-card img{width:72px;height:72px;object-fit:contain}
.skin-card .name{font-size:13px;text-align:center;margin-top:8px;color:#081223}

/* Dye swatch styling */
.dye-swatch{width:72px;height:72px;border-radius:12px;border:1px solid rgba(15,23,36,0.06);box-shadow:inset 0 -6px 18px rgba(0,0,0,0.06);}
.dye-card .name{margin-top:8px}

/* selected skin card: use the slot chosen color (deep red) for strong feedback */
.skin-card.selected{background:var(--slot-chosen);color:#fff;border-color:rgba(0,0,0,0.2);box-shadow:0 10px 30px rgba(139,46,46,0.18);}
.skin-card.selected .name{color:#fff}
.skin-card.selected img{filter:drop-shadow(0 6px 12px rgba(0,0,0,0.25));}
.search-row{margin-bottom:10px}
/* Primary CTA button with subtle gradient and shadow */
#generate-codes{margin-top:8px;padding:10px 12px;background:linear-gradient(90deg,var(--primary),var(--primary-dark));color:white;border:none;border-radius:12px;cursor:pointer;box-shadow:0 8px 20px rgba(47,58,54,0.06);border:1px solid rgba(47,58,54,0.04)}
#generate-codes:hover{transform:translateY(-2px);box-shadow:0 14px 30px rgba(47,58,54,0.08)}

/* small enhancements for other buttons */
.controls button{padding:8px 10px;border-radius:10px;background:linear-gradient(90deg,var(--primary),var(--primary-dark));color:#fff;border:none;box-shadow:0 8px 18px rgba(47,58,54,0.06);cursor:pointer}
.controls button:hover{transform:translateY(-2px);filter:brightness(.98)}
/* mode toggle buttons (Armor / Weapons) */
.mode-btn{padding:6px 10px;border-radius:8px;border:1px solid rgba(15,23,36,0.06);background:transparent;color:var(--muted);cursor:pointer}
.mode-btn[aria-pressed="true"]{background:linear-gradient(90deg,var(--primary),var(--primary-dark));color:#fff;border:none}
footer{margin-top:18px;font-size:12px;color:var(--muted)}

/* progress bar */
.progress{position:relative;height:22px;background:linear-gradient(90deg,rgba(214,106,106,0.06),rgba(138,110,110,0.03));border-radius:12px;overflow:hidden;margin:12px 0}
.progress-bar{position:absolute;left:0;top:0;height:100%;width:0;background:linear-gradient(90deg,var(--primary),var(--accent));transition:width .18s}
.progress-text{position:relative;z-index:2;padding:3px 10px;font-size:12px;color:#fff;text-shadow:0 1px 0 rgba(0,0,0,0.2)}

/* small hint shown beside the progress text while fetching */
.progress-hint{font-size:12px;color:rgba(49, 0, 0, 0.9);opacity:0.95;margin-left:8px;font-style:italic}

/* right-side preview panel */
.preview{width:240px;background:var(--card);border-radius:12px;padding:10px;border:1px solid rgba(15,23,36,0.06);box-shadow:0 18px 40px rgba(2,6,23,0.06);z-index:4;margin-left:12px; margin-top: 12px;}
.preview-inner{display:flex;flex-direction:column;align-items:center;gap:8px}
.preview img{width:200px;height:200px;object-fit:contain;border-radius:8px;background:linear-gradient(180deg,rgba(0,0,0,0.02),rgba(0,0,0,0.01))}
.preview #preview-caption{font-size:13px;text-align:center;color:var(--muted);padding:4px}
.preview a{color:inherit;text-decoration:none}
.preview a:hover{opacity:0.95}

/* small footer under preview to indicate work in progress */
.preview-footer{font-size:12px;color:var(--accent);text-align:center;margin-top:10px;padding-top:8px;border-top:1px solid rgba(15,23,36,0.04);opacity:0.95}

/* subtle patterned background for the page */
body::before{
	content:'';position:fixed;left:0;top:0;right:0;bottom:0;pointer-events:none;background-image:radial-gradient(rgba(15,23,36,0.02) 1px, transparent 1px);background-size:24px 24px;opacity:0.6;mix-blend-mode:overlay}

/* focus states */
button:focus, input:focus, select:focus{outline:3px solid rgba(214,106,106,0.14);outline-offset:2px}

/* mobile friendly tweaks */
@media (max-width:720px){
	.app{margin:12px;padding:14px}
	.selected-summary{display:none}
	.preview{display:none}
	.skin-grid{grid-template-columns:repeat(auto-fill,minmax(120px,1fr))}
}

/* Mobile Codes button and panel - only visible on small screens */
@media (max-width:720px){
	.mobile-codes-btn{position:fixed;left:50%;transform:translateX(-50%);bottom:12px;z-index:1400;padding:10px 18px;border-radius:999px;background:linear-gradient(90deg,var(--primary),var(--primary-dark));color:#fff;border:none;box-shadow:0 12px 36px rgba(2,6,23,0.18);cursor:pointer}
	.mobile-codes-backdrop{position:fixed;left:0;right:0;top:0;bottom:0;background:rgba(0,0,0,0.45);z-index:1300;visibility:hidden;opacity:0;transition:opacity .18s}
	.mobile-codes-panel{position:fixed;left:8px;right:8px;bottom:0;z-index:1401;background:var(--card);border-radius:12px 12px 0 0;padding:12px;max-height:60vh;overflow:auto;transform:translateY(110%);transition:transform .24s ease}
	.mobile-codes-panel[aria-hidden="false"]{transform:translateY(0)}
	.mobile-codes-backdrop[aria-hidden="false"]{visibility:visible;opacity:1}
	.mobile-codes-inner h3{margin:0 0 8px 0}
	.mobile-codes-close{position:absolute;right:12px;top:8px;background:transparent;border:none;font-size:16px}
	.mobile-codes-actions{display:flex;justify-content:flex-end;margin-top:8px}
	.mobile-codes-actions button{padding:8px 10px;border-radius:8px;background:linear-gradient(90deg,var(--primary),var(--primary-dark));color:#fff;border:none}
}

/* Hide mobile controls on desktop */
.mobile-codes-btn, .mobile-codes-panel, .mobile-codes-backdrop{display:none}
@media (max-width:720px){ .mobile-codes-btn, .mobile-codes-panel, .mobile-codes-backdrop{display:block} }

/* Patch Notes modal styles */
.modal-backdrop{position:fixed;left:0;top:0;right:0;bottom:0;background:rgba(0,0,0,0.5);z-index:1400;visibility:hidden;opacity:0;transition:opacity .18s}
.modal-backdrop[aria-hidden="false"]{visibility:visible;opacity:1}
.modal{position:fixed;left:50%;top:10%;transform:translateX(-50%) translateY(-10%);width:min(820px,96%);max-height:78vh;overflow:auto;background:var(--card);border-radius:12px;z-index:1401;box-shadow:0 30px 80px rgba(2,6,23,0.3);padding:12px;visibility:hidden;opacity:0;transition:opacity .18s,transform .18s}
.modal[aria-hidden="false"]{visibility:visible;opacity:1;transform:translateX(-50%) translateY(0)}
.modal-inner{display:flex;flex-direction:column;gap:10px}
.modal-header{display:flex;align-items:center;justify-content:space-between}
.modal-header h3{margin:0;font-size:16px}
.modal-close{background:transparent;border:none;font-size:20px;line-height:1;cursor:pointer}
.patch-notes-content{min-height:180px;padding:12px;border-radius:8px;border:1px solid rgba(15,23,36,0.04);background:linear-gradient(180deg,transparent,rgba(255,255,255,0.02));overflow:auto;white-space:pre-wrap}
.modal-actions{display:flex;gap:8px;justify-content:flex-end}
.modal-actions button{padding:8px 10px;border-radius:8px;border:none;background:linear-gradient(90deg,var(--primary),var(--primary-dark));color:#fff;cursor:pointer}

@media (max-width:720px){
	.modal{left:8px;right:8px;top:auto;bottom:8px;transform:none;max-height:70vh}
}

/* Full Preview slide-in panel (right side) */
.preview-actions{display:flex;justify-content:center;margin-top:8px}
.preview-actions button{padding:8px 12px;border-radius:10px;border:none;background:linear-gradient(90deg,var(--primary),var(--primary-dark));color:#fff;cursor:pointer}
.full-preview-panel{position:fixed;top:0;right:0;bottom:0;width:min(520px,90%);background:var(--card);z-index:1501;box-shadow:0 30px 80px rgba(2,6,23,0.35);padding:14px;overflow:auto;border-left:1px solid rgba(15,23,36,0.06);transform:translateX(100%);transition:transform .28s cubic-bezier(.2,.9,.2,1);visibility:visible}
.full-preview-panel[aria-hidden="false"]{transform:translateX(0)}
.full-preview-inner{display:flex;flex-direction:column;gap:10px}
.full-preview-panel{position:fixed;top:0;right:0;bottom:0;width:min(380px,60%);background:linear-gradient(180deg, rgba(255,255,255,0.72), var(--card));z-index:1501;box-shadow:0 30px 80px rgba(2,6,23,0.18);padding:12px 10px;overflow:auto;border-left:1px solid rgba(15,23,36,0.06);transform:translateX(100%);transition:transform .28s cubic-bezier(.2,.9,.2,1);visibility:visible}
.full-preview-inner{display:flex;flex-direction:column;gap:8px}
.full-preview-header{display:flex;align-items:center;justify-content:space-between}
.full-preview-content{min-height:100px;padding:6px;border-radius:8px;border:1px solid rgba(15,23,36,0.04);background:linear-gradient(180deg,transparent,rgba(255,255,255,0.02));overflow:auto}
.full-preview-grid{display:flex;flex-direction:column;gap:10px;padding:4px}
.full-preview-card{display:flex;flex-direction:column;align-items:flex-start;padding:8px;border-radius:8px;border:1px solid rgba(15,23,36,0.04);background:transparent}
.full-preview-card img{width:100%;max-width:180px;height:auto;object-fit:contain;border-radius:6px;margin:0 auto}
.full-preview-card .swatch{width:100%;max-width:180px;height:90px;border-radius:6px;border:1px solid rgba(15,23,36,0.06);margin:0 auto}
.full-preview-card .caption{font-size:13px;text-align:left;margin-top:6px;color:var(--muted);width:100%; text-align:center}

/* Theme adjustments: slightly tint panel for Weapon mode to match app visual cue */
body .app.mode-weapon ~ .full-preview-panel{
	background: linear-gradient(180deg, rgba(235,244,255,0.78), var(--card));
	border-left-color: rgba(80,120,160,0.08);
	box-shadow: 0 30px 80px rgba(80,120,160,0.10);
}

/* When the app is in default (armor) mode, make the panel subtly warm-tinted */
body .app:not(.mode-weapon) ~ .full-preview-panel{
	background: linear-gradient(180deg, rgba(255,245,245,0.7), var(--card));
	border-left-color: rgba(139,46,46,0.06);
	box-shadow: 0 30px 80px rgba(139,46,46,0.06);
}

@media (max-width:720px){
  .full-preview-panel{width:100%;max-width:100%;right:0}
}
