:root {
    --bg-color: #0b0f19;
    --panel-color: #151d30;
    --accent-color: #4caf50;
    --accent-hover: #45a049;
    --card-color: #222b45;
    --text-muted: #8f9bb3;
    --text-light: #ffffff;
    --modal-overlay: rgba(5, 7, 13, 0.85);
}

/* Digital Pattern Counter Styles */
.digital-counter {
    font-family: 'Orbitron', monospace;
    background: #060913;
    color: #ffd700; /* glowing gold */
    padding: 2px 10px;
    border-radius: 6px;
    border: 1.5px solid #ffb74d;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.8), 0 0 10px rgba(255, 183, 77, 0.4);
    font-size: 15px;
    display: inline-block;
    vertical-align: middle;
    margin-left: 8px;
    letter-spacing: 1px;
    line-height: 1.2;
}

/* Gold Shimmer Tab Styles for Masterpieces */
#tab-masterpieces {
    background: linear-gradient(135deg, #ffd700 0%, #b8860b 50%, #ffd700 100%);
    background-size: 200% auto;
    color: #0b0f19 !important;
    font-weight: bold;
    border: 1px solid #d4af37;
    animation: goldShimmer 3s linear infinite;
    text-shadow: 0 0 2px rgba(255,255,255,0.4);
    box-shadow: 0 0 10px rgba(212,175,55,0.3);
}

#tab-masterpieces.active {
    background: linear-gradient(135deg, #ffffff 0%, #ffd700 50%, #ffffff 100%);
    background-size: 200% auto;
    animation: goldShimmer 1.5s linear infinite;
    box-shadow: 0 0 15px rgba(255,215,0,0.6);
}

@keyframes goldShimmer {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Whimsical Empty State Save Checklist Layout */
.empty-saves-container {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 10px 40px 10px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.empty-saves-text {
    font-family: 'Kristen ITC', 'Comic Neue', 'Chalkboard SE', 'Comic Sans MS', sans-serif;
    font-size: 19px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.85); /* chalky white */
    margin-bottom: 25px;
    background: none;
    padding: 0;
    border: none;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.6), 0 0 6px rgba(255, 255, 255, 0.25);
    transform: rotate(-1.5deg);
    filter: url(#chalk-filter); /* applies the fuzzy sketch filter */
}

/* Modal Internal Tabs Styles */
.modal-tabs {
    display: flex;
    justify-content: space-around;
    gap: 8px;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 12px;
}

.modal-tab-btn {
    flex: 1;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.modal-tab-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.modal-tab-btn.active {
    background: #ffb74d;
    border-color: #ffb74d;
    color: #0b0f19;
}

/* User Account Fields */
.account-form-group {
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: left;
}

.account-form-group label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.account-input {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 14px;
    outline: none;
}

.account-input:focus {
    border-color: #ffb74d;
    background: rgba(0, 0, 0, 0.3);
}

/* Emoji Avatar Picker */
.avatar-picker-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
    margin-top: 5px;
}

.avatar-option {
    font-size: 24px;
    padding: 6px;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.15s ease;
    text-align: center;
    background: rgba(255, 255, 255, 0.03);
}

.avatar-option:hover {
    background: rgba(255, 255, 255, 0.08);
}

.avatar-option.selected {
    border-color: #ffb74d;
    background: rgba(255, 183, 77, 0.15);
}

/* Friends and Checklist Item Lists */
.friend-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    margin-bottom: 8px;
}

.friend-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.friend-avatar {
    font-size: 28px;
}

.friend-name {
    font-weight: 600;
    color: #fff;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.friend-level {
    font-size: 10px;
    color: #ffb74d;
    text-transform: uppercase;
    font-weight: bold;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}

.status-online { background: #4caf50; }
.status-offline { background: #9e9e9e; }

/* Checklist Categories */
.checklist-category-header {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #ffb74d;
    margin: 15px 0 8px 0;
    text-align: left;
    font-weight: bold;
    border-bottom: 1px solid rgba(255, 183, 77, 0.15);
    padding-bottom: 4px;
}

.checklist-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.01);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 13px;
}

.checklist-item:last-child {
    border-bottom: none;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-light);
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow: hidden;
    overscroll-behavior-y: contain;
}

.app-view {
    display: none;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    position: absolute;
    top: 0;
    left: 0;
    background-color: var(--bg-color);
}

.app-view.active {
    display: flex;
    flex-direction: column;
}

.btn-capsule {
    background: linear-gradient(135deg, var(--accent-color) 0%, #2e7d32 100%);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 30px;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: center;
}

.btn-capsule:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.6);
}

.btn-secondary-capsule {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 10px 22px;
    border-radius: 30px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-secondary-capsule:hover {
    background: rgba(255, 255, 255, 0.2);
}

#splash-view {
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    position: absolute;
    top: 0;
    left: 0;
    overflow: hidden;
    background: radial-gradient(circle at 50% 42%, #182342 0%, #0b1020 55%, #060913 100%);
    user-select: none;
}

#splash-view:not(.active) {
    display: none !important;
}

#splash-gem-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    cursor: pointer;
    touch-action: none;
}

.splash-vignette {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
    background:
        radial-gradient(circle at 50% 44%, transparent 32%, rgba(5, 8, 17, 0.72) 85%, rgba(4, 6, 12, 0.92) 100%),
        linear-gradient(180deg, rgba(6, 9, 19, 0.55) 0%, transparent 18%, transparent 72%, rgba(6, 9, 19, 0.88) 100%);
}

.splash-hero-container {
    position: relative;
    z-index: 3;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 28px 20px 32px 20px;
    box-sizing: border-box;
    pointer-events: none;
}

.splash-tagline-pill {
    pointer-events: auto;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 7px 18px;
    border-radius: 999px;
    background: rgba(15, 22, 42, 0.72);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 215, 0, 0.28);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.12);
    color: #ffd700;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 2.5px;
    text-transform: uppercase;
}

.tagline-sparkle {
    color: #ce93d8;
    font-size: 12px;
    animation: pulse 2.2s infinite ease-in-out;
}

.splash-gem-stage {
    flex: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding-bottom: 14px;
    pointer-events: none;
}

.splash-hint-badge {
    padding: 5px 14px;
    border-radius: 999px;
    background: rgba(11, 15, 25, 0.68);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.65);
    font-size: 11.5px;
    letter-spacing: 0.4px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.splash-cta-cluster {
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: 380px;
}

.btn-splash-primary {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 15px 28px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: linear-gradient(135deg, #ab47bc 0%, #7b1fa2 45%, #4a148c 100%);
    color: #ffffff;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow:
        0 10px 30px rgba(171, 71, 188, 0.48),
        0 0 0 1px rgba(206, 147, 216, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.35);
    transition: transform 0.22s cubic-bezier(0.2, 0.9, 0.3, 1), box-shadow 0.22s ease, filter 0.22s ease;
}

.btn-splash-primary:hover {
    transform: translateY(-2px) scale(1.015);
    filter: brightness(1.1);
    box-shadow:
        0 14px 36px rgba(171, 71, 188, 0.68),
        0 0 20px rgba(255, 215, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.btn-splash-primary:active {
    transform: translateY(0) scale(0.985);
}

.btn-splash-gem-icon {
    font-size: 18px;
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.6));
}

.btn-splash-resume {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 20px;
    border-radius: 999px;
    background: rgba(46, 125, 50, 0.24);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(102, 187, 106, 0.45);
    color: #e8f5e9;
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 0.4px;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
    transition: all 0.2s ease;
}

.btn-splash-resume:hover {
    background: rgba(46, 125, 50, 0.4);
    border-color: #81c784;
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(67, 160, 71, 0.35);
}

.resume-pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #69f0ae;
    box-shadow: 0 0 10px #69f0ae;
    flex-shrink: 0;
}

.splash-utility-dock {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    width: 100%;
}

.splash-dock-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 11px 12px;
    border-radius: 16px;
    background: rgba(21, 29, 48, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: rgba(255, 255, 255, 0.9);
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transition: all 0.2s ease;
}

.splash-dock-btn:hover {
    background: rgba(34, 46, 74, 0.9);
    border-color: rgba(255, 183, 77, 0.45);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.45);
}

.dock-icon {
    font-size: 14px;
}

.hub-utility-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.06);
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.hub-utility-btn:hover {
    background: rgba(171, 71, 188, 0.28);
    border-color: #ce93d8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(171, 71, 188, 0.35);
}

.modal-container {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--modal-overlay);
    z-index: 100;
    align-items: center;
    justify-content: center;
}

.modal-container.active {
    display: flex;
}

.modal-card {
    background: var(--panel-color);
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 90%;
    max-width: 400px;
    padding: 30px;
    box-sizing: border-box;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
}

.modal-card h3 {
    margin: 0 0 25px 0;
    text-align: center;
    letter-spacing: 1px;
    font-size: 22px;
    color: white;
}

.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.setting-info h4 {
    margin: 0 0 4px 0;
    font-size: 16px;
    font-weight: 600;
}

.setting-info p {
    margin: 0;
    font-size: 12px;
    color: var(--text-muted);
}

.switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #3e4c6d;
    transition: .3s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: var(--accent-color);
}

input:checked+.slider:before {
    transform: translateX(24px);
}

.in-progress-shelf {
    max-width: 1000px;
    margin: 0 auto 30px auto;
    background: linear-gradient(135deg, #161f33 0%, #0f1524 100%);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 24px;
    padding: 20px;
    box-sizing: border-box;
}

.in-progress-shelf h3 {
    margin: 0 0 15px 0;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #ffb74d;
    display: flex;
    align-items: center;
    gap: 8px;
}

.in-progress-scroller {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-top: 6px;
    margin-top: -6px;
    padding-bottom: 5px;
}

.in-progress-scroller::-webkit-scrollbar {
    height: 6px;
}

.in-progress-scroller::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.in-progress-card {
    background: var(--panel-color);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    min-width: 180px;
    max-width: 180px;
    height: 240px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.in-progress-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-color);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* Special styling for the Most Recent active save tile */
.in-progress-card.special-recent-card {
    border: 1.5px solid #ffb74d !important;
    background: linear-gradient(145deg, #1d1b28 0%, #0d0f19 100%) !important;
    box-shadow: 0 0 20px rgba(255, 183, 77, 0.25);
    position: relative;
}
.in-progress-card.special-recent-card:hover {
    border-color: #ffd54f !important;
    box-shadow: 0 0 25px rgba(255, 183, 77, 0.45), 0 8px 24px rgba(0, 0, 0, 0.5);
    transform: translateY(-6px) scale(1.02);
}
.in-progress-card.special-recent-card::after {
    content: '';
    position: absolute;
    top: -2px; left: -2px; right: -2px; bottom: -2px;
    background: linear-gradient(135deg, #ffb74d, #ff5722, #ffb74d);
    border-radius: 18px;
    z-index: -1;
    opacity: 0.3;
    filter: blur(4px);
    pointer-events: none;
}


.in-progress-thumb {
    position: relative;
    width: 100%;
    height: 180px;
    flex-shrink: 0;
    background: transparent;
}

.in-progress-thumb canvas {
    position: absolute;
    top: 16px;
    bottom: 16px;
    left: 16px;
    right: 16px;
    width: calc(100% - 32px);
    height: calc(100% - 32px);
    object-fit: contain;
    image-rendering: pixelated;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.4));
}

.in-progress-meta {
    background: var(--panel-color);
    width: 100%;
    height: 60px;
    /* Exactly 25% */
    padding: 0 14px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-sizing: border-box;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.in-progress-name {
    font-size: 13px;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.in-progress-grid {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.progress-bar-bg {
    width: 100%;
    height: 5px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #4caf50, #81c784);
    border-radius: 4px;
    width: 0%;
}

.progress-percent-lbl {
    font-size: 10px;
    font-family: monospace;
    font-weight: bold;
    color: var(--accent-color);
    margin-top: 4px;
    text-align: right;
}

.btn-delete-resume {
    font-size: 16px;
    opacity: 0.4;
    cursor: pointer;
    transition: opacity 0.15s, transform 0.15s;
    z-index: 5;
    padding: 2px;
}

.btn-delete-resume:hover {
    opacity: 1.0;
    color: #ff5252;
    transform: scale(1.12);
}

.view-header {
    height: 70px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: var(--panel-color);
    position: relative;
    box-sizing: border-box;
}

.header-left, .header-right {
    flex: 0 0 85px;
    display: flex;
    align-items: center;
}

.header-left {
    justify-content: flex-start;
}

.header-right {
    justify-content: flex-end;
}

.header-title {
    flex: 1;
    margin: 0;
    font-size: 19px;
    font-weight: 800;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 0 10px rgba(224, 64, 251, 0.25), 0 0 2px rgba(255, 255, 255, 0.8);
    background: linear-gradient(90deg, #ffffff, #f1d3ff, #ffffff);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    color: #ffffff;
}

.header-icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    box-sizing: border-box;
}

.header-icon-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.35);
    transform: scale(1.04);
}

.header-icon-btn:active {
    transform: scale(0.96);
    background: rgba(255, 255, 255, 0.2);
}

.scroll-content {
    flex: 1;
    overflow-y: auto;
    padding: 25px;
    box-sizing: border-box;
}

.theme-hub-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    max-width: 1000px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .theme-hub-grid {
        grid-template-columns: repeat(1, 1fr);
    }
}

.theme-hub-card {
    background: var(--panel-color);
    border-radius: 24px;
    border: 2px solid rgba(255, 255, 255, 0.05);
    padding: 44px 20px 24px 20px;
    text-align: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s, border-color 0.2s;
}

.theme-hub-card:hover {
    transform: scale(1.02);
    border-color: var(--accent-color);
}

.theme-emoji {
    font-size: 45px;
    margin-bottom: 10px;
    display: block;
}

.theme-title {
    font-size: 16px;
    font-weight: bold;
    text-transform: capitalize;
}

.wide-span {
    grid-column: 1 / -1;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.wide-span .theme-emoji {
    margin-bottom: 0;
    font-size: 38px;
}

.special-masterpiece-card {
    background: linear-gradient(135deg, #2c1654 0%, #11092c 100%);
    border: 2px solid #e0aa3e;
    box-shadow: 0 0 20px rgba(224, 170, 62, 0.15);
}

.special-masterpiece-card:hover {
    border-color: #fff1ad;
    box-shadow: 0 0 30px rgba(224, 170, 62, 0.35);
}

.easy-tier-card {
    background: linear-gradient(135deg, #1b3d2b 0%, #0d1f14 100%);
    border: 2px solid #a5d6a7;
    box-shadow: 0 0 20px rgba(165, 214, 167, 0.15);
}

.easy-tier-card:hover {
    border-color: #c8e6c9;
    box-shadow: 0 0 30px rgba(165, 214, 167, 0.35);
}

.shimmer-fx-layer {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: inherit;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.shimmer-fx-layer::before {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 241, 173, 0.18), transparent);
    transform: skewX(-25deg);
    animation: shine 6s infinite ease-in-out;
}

.thumbnails-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    max-width: 900px;
    margin: 0 auto;
}

@media (max-width: 600px) {
    .thumbnails-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ==========================================================================
   MODERN ARTWORK GALLERY & PATTERN CARDS
   ========================================================================== */

.thumbnails-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    max-width: 1100px;
    margin: 0 auto;
    padding-bottom: 30px;
}

@media (max-width: 600px) {
    .thumbnails-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

.gallery-pattern-card {
    background: linear-gradient(145deg, rgba(26, 32, 54, 0.9) 0%, rgba(16, 20, 36, 0.95) 100%);
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    position: relative;
    user-select: none;
    transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
}

.gallery-pattern-card:hover {
    transform: translateY(-5px) scale(1.02);
    border-color: rgba(186, 104, 200, 0.6);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(171, 71, 188, 0.25);
}

.gallery-pattern-card:active {
    transform: scale(0.97);
}

.pattern-card-img-wrap {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    position: relative;
    background: radial-gradient(circle, rgba(38, 48, 76, 0.5) 0%, rgba(12, 15, 26, 0.9) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.pattern-card-img-wrap img {
    width: 82%;
    height: 82%;
    object-fit: contain;
    image-rendering: pixelated;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.45));
}

.gallery-pattern-card:hover .pattern-card-img-wrap img {
    transform: scale(1.1);
}

.pattern-card-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 10px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 12px;
    backdrop-filter: blur(10px);
    letter-spacing: 0.4px;
    text-transform: uppercase;
    z-index: 2;
}

.badge-in-progress {
    background: rgba(46, 125, 50, 0.9);
    color: #e8f5e9;
    border: 1px solid rgba(129, 199, 132, 0.5);
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.4);
}

.badge-completed {
    background: rgba(245, 127, 23, 0.9);
    color: #fffde7;
    border: 1px solid rgba(255, 213, 79, 0.6);
    box-shadow: 0 2px 8px rgba(255, 179, 0, 0.4);
}

.badge-sizes {
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.pattern-card-info {
    padding: 12px 14px 14px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: rgba(0, 0, 0, 0.2);
}

.pattern-card-title {
    font-weight: 700;
    font-size: 13.5px;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0.3px;
}

.pattern-card-meta {
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Backwards compatibility for existing markup */
.thumbnail-card {
    display: none;
}

/* ==========================================================================
   PATTERN LAUNCH & CANVAS SIZE MODAL
   ========================================================================== */

.pattern-launch-card {
    max-width: 520px;
    width: 92%;
    padding: 24px;
    background: linear-gradient(150deg, #1b2034 0%, #111524 100%);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 30px rgba(171, 71, 188, 0.2);
    border-radius: 24px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 18px;
    max-height: 90vh;
    overflow-y: auto;
}

.launch-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 14px;
}

.launch-modal-title-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.launch-pack-badge {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #ba68c8;
}

.launch-title {
    margin: 0;
    font-size: 20px;
    font-weight: 800;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.launch-close-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s, transform 0.15s;
    padding: 0;
}

.launch-close-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    transform: scale(1.08);
}

.launch-modal-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.launch-preview-wrapper {
    width: 100%;
    height: 180px;
    background: radial-gradient(circle, rgba(42, 52, 82, 0.6) 0%, rgba(12, 15, 25, 0.95) 100%);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.launch-preview-wrapper img {
    height: 85%;
    max-width: 85%;
    object-fit: contain;
    image-rendering: pixelated;
    filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.6));
}

.launch-preview-badge {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(11, 15, 25, 0.85);
    color: rgba(255, 255, 255, 0.8);
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(8px);
}

.launch-size-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.launch-section-label {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.launch-sizes-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.launch-size-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1.5px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.18s ease;
    user-select: none;
}

.launch-size-option:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.22);
}

.launch-size-option.selected {
    background: linear-gradient(135deg, rgba(171, 71, 188, 0.2) 0%, rgba(33, 150, 243, 0.15) 100%);
    border-color: #ba68c8;
    box-shadow: 0 0 16px rgba(186, 104, 200, 0.25);
}

.size-opt-radio {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.launch-size-option.selected .size-opt-radio {
    border-color: #ba68c8;
}

.size-opt-radio-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ba68c8;
    transform: scale(0);
    transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.launch-size-option.selected .size-opt-radio-dot {
    transform: scale(1);
}

.size-opt-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.size-opt-title-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.size-opt-emoji {
    font-size: 16px;
}

.size-opt-name {
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
}

.size-opt-dim {
    font-size: 12px;
    color: var(--text-muted);
    font-family: monospace;
}

.size-status-pill {
    margin-left: auto;
    font-size: 10.5px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.status-in-progress {
    background: rgba(46, 125, 50, 0.4);
    color: #a5d6a7;
    border: 1px solid rgba(76, 175, 80, 0.4);
}

.status-completed {
    background: rgba(245, 127, 23, 0.4);
    color: #ffe082;
    border: 1px solid rgba(255, 179, 0, 0.4);
}

.size-opt-stats {
    font-size: 11.5px;
    color: rgba(255, 255, 255, 0.65);
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.size-stat-gems {
    color: #ffb74d;
    font-weight: 600;
}

.size-stat-time {
    color: #80deea;
    font-weight: 600;
}

.size-stat-desc {
    color: rgba(255, 255, 255, 0.5);
}

.size-opt-progress-wrap {
    margin-top: 5px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.size-opt-progress-track {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.size-opt-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #43a047, #66bb6a);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.size-opt-progress-text {
    font-size: 10.5px;
    color: #a5d6a7;
    font-weight: 600;
}

.launch-modal-footer {
    padding-top: 6px;
}

.launch-action-btn {
    width: 100%;
    font-size: 15px;
    font-weight: 800;
    padding: 14px 20px;
    border-radius: 30px;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    letter-spacing: 0.5px;
}

.launch-action-btn:hover {
    transform: scale(1.02);
}

.launch-action-btn:active {
    transform: scale(0.98);
}

.card-top-badges {
    position: absolute;
    top: 14px;
    left: 0;
    right: 0;
    padding: 0 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-sizing: border-box;
    z-index: 5;
}

.card-count-badge {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.8);
    font-size: 10px;
    font-weight: 700;
    padding: 4px 9px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    line-height: 1;
    display: inline-flex;
    align-items: center;
}

.pack-size-subtitle {
    margin-top: 8px;
    font-size: 11.5px;
    color: var(--text-muted);
    font-weight: 600;
}

#workspace-holder {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
    touch-action: none;
}

#game-canvas {
    z-index: 1;
}

#text-overlay-canvas {
    z-index: 2;
    pointer-events: none;
}

#blueprint-overlay-canvas {
    z-index: 0;
    pointer-events: none;
}

.sidebar {
    background: var(--panel-color);
    display: flex;
    box-sizing: border-box;
    z-index: 10;
}

.palette-scroll {
    display: flex;
    gap: 8px;
    width: 100%;
    height: 100%;
}

.color-option {
    display: flex;
    border-radius: 12px;
    cursor: pointer;
    background: var(--card-color);
    border: 2px solid transparent;
    align-items: center;
    box-sizing: border-box;
    justify-content: center;
    flex-shrink: 0;
}

.color-option.selected {
    border-color: var(--accent-color);
    background: #363636;
}

.color-option.completed {
    opacity: 0.15;
    background: #1a1a1a;
    cursor: default;
}

.color-badge {
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    color: #fff;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.8);
}

.color-counter {
    font-size: 11px;
    font-family: monospace;
    color: #aaa;
    background: #111;
    border-radius: 6px;
    text-align: center;
    font-weight: bold;
}

.meta-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    background: #080b12;
    padding: 10px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 20;
}

.header-timer-box {
    font-family: monospace;
    background: #0b0f19;
    padding: 5px 14px;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 14px;
    font-weight: bold;
    color: #ffb74d;
    letter-spacing: 0.5px;
}

#security-override-container {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 50;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 20px;
}

@keyframes shine {
    0% {
        left: -100%;
    }

    15% {
        left: 150%;
    }

    100% {
        left: 150%;
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.04);
    }

    100% {
        transform: scale(1);
    }
}

@media (orientation: portrait) {
    #game-interface {
        flex-direction: column;
    }

    .sidebar {
        width: 100vw;
        height: 110px;
        border-top: 2px solid #2d2d2d;
        padding: 12px;
        display: flex;
        flex-direction: row;
        gap: 10px;
        align-items: center;
    }

    .palette-scroll {
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
        padding-bottom: 4px;
    }

    .color-option {
        flex-direction: column;
        width: 62px;
        height: 84px;
        padding: 8px 4px;
        gap: 8px;
    }

    .color-badge {
        width: 44px;
        height: 40px;
    }

    .color-counter {
        width: 52px;
        padding: 2px 0;
    }
}

@media (orientation: landscape) {
    #game-interface {
        flex-direction: row;
    }

    .sidebar {
        width: 160px;
        height: 100%;
        border-left: 2px solid #2d2d2d;
        padding: 15px 12px;
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .palette-scroll {
        flex-direction: column;
        overflow-y: auto;
        overflow-x: hidden;
    }

    .color-option {
        flex-direction: row;
        width: 100%;
        height: 48px;
        padding: 6px 10px;
        justify-content: space-between;
        gap: 10px;
    }

    .color-badge {
        width: 32px;
        height: 32px;
    }

    .color-counter {
        padding: 4px 8px;
    }
}

#game-canvas,
#text-overlay-canvas,
#blueprint-overlay-canvas {
    image-rendering: auto;
    will-change: transform;
}

.color-option.selected-ripper {
    border-color: #ffb74d !important;
    background: rgba(255, 183, 77, 0.15) !important;
}

@keyframes error-pulse {
    0% {
        background-color: rgba(255, 82, 82, 0.6);
    }

    100% {
        background-color: #f1f1f1;
    }
}

.btn-secondary-capsule.glow-alert-active {
    border-color: #ffb74d !important;
    animation: seam-ripper-glow-pulse 1.8s infinite ease-in-out;
}

@keyframes seam-ripper-glow-pulse {
    0% {
        box-shadow: 0 0 4px rgba(255, 183, 77, 0.2);
        background: rgba(255, 183, 77, 0.05);
    }

    50% {
        box-shadow: 0 0 16px rgba(255, 183, 77, 0.6);
        background: rgba(255, 183, 77, 0.22);
    }

    100% {
        box-shadow: 0 0 4px rgba(255, 183, 77, 0.2);
        background: rgba(255, 183, 77, 0.05);
    }
}

/* ==========================================================================
   FEATURE 6: LUXURY REPLAY THEATER VIEW & EXHIBITION FRAMES
   ========================================================================== */

/* Hide In-Game HUDs while in Replay Theater Mode */
#game-view.replay-theater-mode .game-studio-header,
#game-view.replay-theater-mode .active-color-bar-container,
#game-view.replay-theater-mode #palette-ribbon-dock,
#game-view.replay-theater-mode #floating-toolbox,
#game-view.replay-theater-mode .sidebar,
#game-view.replay-theater-mode #palette-drawer-overlay,
#game-view.replay-theater-mode #peek-intro-edge-glow {
    display: none !important;
}

/* Dedicated Replay Theater Full-Screen Overlay */
.replay-theater-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
}

/* Museum Gallery Spotlight & Deep Vignette */
.replay-theater-spotlight {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 46%, rgba(20, 27, 45, 0.42) 0%, rgba(8, 11, 20, 0.88) 60%, rgba(4, 6, 12, 0.98) 100%);
    pointer-events: none;
    z-index: 10;
}

/* --------------------------------------------------------------------------
   EXHIBITION GALLERY PRESENTATION FRAMES (Anchored around mosaic canvas)
   -------------------------------------------------------------------------- */
.replay-frame-box {
    position: absolute;
    left: 0;
    top: 0;
    pointer-events: none;
    transform-origin: 0 0;
    box-sizing: border-box;
    will-change: transform, width, height;
    z-index: 25;
    overflow: hidden; /* Cleanly bounds the shimmer sweep to the artwork dimensions */
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

/* 1. Velvet Spotlight (Modern Floating Museum Shadow-Box) */
.replay-frame-box.frame-velvet {
    border: 2px solid rgba(255, 215, 0, 0.45);
    border-radius: 4px;
    box-shadow: 
        0 0 0 14px #121622,
        0 0 0 16px rgba(255, 255, 255, 0.12),
        0 25px 80px rgba(0, 0, 0, 0.95);
}

/* 2. Ornate Gilded Gold Baroque Frame */
.replay-frame-box.frame-gold {
    border: 2px solid #5a3c10;
    border-radius: 4px;
    box-shadow: 
        0 0 0 6px #eed182,
        0 0 0 14px #c89d3c,
        0 0 0 18px #8a6518,
        0 0 0 20px #5a3c10,
        0 0 35px rgba(200, 157, 60, 0.3),
        0 30px 90px rgba(0, 0, 0, 0.95);
}

.replay-frame-box.frame-gold .frame-corner {
    position: absolute;
    width: 22px;
    height: 22px;
    border: 3px solid #eed182;
    background: radial-gradient(circle, #ffe699 0%, #b8860b 80%);
    box-shadow: 0 0 8px rgba(0,0,0,0.8);
    display: block;
}
.replay-frame-box.frame-gold .corner-tl { top: -11px; left: -11px; border-radius: 50% 0 0 0; }
.replay-frame-box.frame-gold .corner-tr { top: -11px; right: -11px; border-radius: 0 50% 0 0; }
.replay-frame-box.frame-gold .corner-bl { bottom: -11px; left: -11px; border-radius: 0 0 0 50%; }
.replay-frame-box.frame-gold .corner-br { bottom: -11px; right: -11px; border-radius: 0 0 50% 0; }

/* 3. Artisan Rustic Oak Frame with Linen Matting */
.replay-frame-box.frame-oak {
    border: 1px solid #4a2e18;
    border-radius: 4px;
    box-shadow: 
        0 0 0 10px #f4eee1,
        0 0 0 12px rgba(90, 56, 30, 0.4),
        0 0 0 26px #5a381e,
        0 0 0 28px #3e2410,
        0 25px 80px rgba(0, 0, 0, 0.95);
}

/* 4. Diamond Crystal Bevel Frame (Crystal-Clear Artwork with Glowing Prism Border) */
.replay-frame-box.frame-crystal {
    border: 2px solid rgba(255, 255, 255, 0.85);
    border-radius: 8px;
    box-shadow: 
        0 0 0 12px rgba(147, 197, 253, 0.38),
        0 0 0 15px rgba(255, 255, 255, 0.65),
        0 0 35px rgba(147, 197, 253, 0.45),
        0 25px 80px rgba(0, 0, 0, 0.95);
}

/* Floating Music Attribution Credit Badge (Anchored Above Super Player Dock) */
.replay-music-credit-pill {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 8px;
    z-index: 1020;
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 12px;
    background: rgba(11, 15, 25, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
    max-width: min(380px, calc(100vw - 44px));
    box-sizing: border-box;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.replay-music-credit-pill.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
}

.replay-music-credit-pill.faded {
    opacity: 0.35;
}

.replay-music-credit-pill:hover,
.replay-music-credit-pill:focus-within {
    opacity: 1 !important;
}

.music-pill-icon {
    font-size: 16px;
    animation: musicPulse 2s ease-in-out infinite alternate;
    flex-shrink: 0;
}

@keyframes musicPulse {
    0% { transform: scale(1) rotate(0deg); }
    100% { transform: scale(1.15) rotate(6deg); }
}

.music-pill-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
    overflow: hidden;
    min-width: 0;
}

.music-pill-title {
    font-size: 11px;
    font-weight: 700;
    color: #ffd54f;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.music-pill-license {
    font-size: 10px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.music-pill-close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 50%;
    margin-left: auto;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease, transform 0.2s ease;
}

.music-pill-close-btn:hover {
    color: #fff;
    transform: scale(1.15);
}

/* --------------------------------------------------------------------------
   TOP THEATER BAR
   -------------------------------------------------------------------------- */
.replay-theater-top-bar {
    position: relative;
    z-index: 1010;
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 14px 18px 0 18px;
    padding: 10px 18px;
    background: rgba(11, 15, 25, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.65);
    flex-wrap: wrap;
}

.replay-title-cluster {
    display: flex;
    align-items: center;
    gap: 10px;
}

.replay-badge-collection {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 700;
    color: #ffb74d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.replay-title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 240px;
}

.replay-density-pill {
    background: rgba(56, 189, 248, 0.15);
    border: 1px solid rgba(56, 189, 248, 0.35);
    color: #38bdf8;
    font-size: 11px;
    font-weight: bold;
    padding: 2px 8px;
    border-radius: 10px;
    font-family: monospace;
}

/* Frame Selector Pills */
.replay-frame-selector-group {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 0, 0, 0.35);
    padding: 4px 8px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.frame-selector-label {
    font-size: 10px;
    font-weight: 800;
    color: var(--text-muted);
    letter-spacing: 0.8px;
    margin-right: 2px;
}

.replay-frame-pill {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    border-radius: 12px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
}

.replay-frame-pill:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    transform: translateY(-1px);
}

.replay-frame-pill.active {
    background: linear-gradient(135deg, rgba(255, 183, 77, 0.25) 0%, rgba(255, 152, 0, 0.35) 100%);
    border-color: #ffb74d;
    color: #fff;
    box-shadow: 0 0 12px rgba(255, 183, 77, 0.3);
}

.pill-swatch {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    display: inline-block;
}
.swatch-velvet { background: #141824; border: 1px solid #ffd700; }
.swatch-gold { background: linear-gradient(135deg, #ffd700, #b8860b); border: 1px solid #ffe680; }
.swatch-oak { background: #5a381e; border: 1px solid #f4eee1; }
.swatch-crystal { background: linear-gradient(135deg, #93c5fd, #e0e7ff); border: 1px solid #fff; }

/* Top Actions (Audio & Close) */
.replay-top-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.replay-sound-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    border-radius: 14px;
    padding: 5px 12px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
}

.replay-sound-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.replay-sound-btn.active {
    background: rgba(76, 175, 80, 0.22);
    border-color: #4caf50;
    color: #a5d6a7;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.25);
}

.replay-sound-btn.muted {
    opacity: 0.55;
    border-color: rgba(255, 255, 255, 0.08);
}

.replay-close-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.replay-close-btn:hover {
    background: rgba(244, 67, 54, 0.35);
    border-color: #f44336;
    transform: scale(1.08);
}

/* --------------------------------------------------------------------------
   BOTTOM SUPER PLAYER DOCK
   -------------------------------------------------------------------------- */
.replay-player-dock {
    position: relative;
    z-index: 1010;
    pointer-events: auto;
    margin: 0 18px 16px 18px;
    padding: 14px 20px;
    background: rgba(11, 15, 25, 0.88);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 24px;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.75);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Scrubber Row */
.replay-scrubber-row {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
}

.replay-dots-pill {
    font-size: 12px;
    font-weight: 700;
    color: #ffd54f;
    font-family: monospace;
    white-space: nowrap;
    min-width: 130px;
}

.replay-time-pill {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    font-family: monospace;
    white-space: nowrap;
    text-align: right;
    min-width: 85px;
}

.replay-slider-container {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    height: 20px;
}

.replay-slider-track {
    position: absolute;
    left: 0;
    right: 0;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    overflow: hidden;
    pointer-events: none;
}

.replay-slider-fill {
    height: 100%;
    background: linear-gradient(90deg, #38bdf8 0%, #a855f7 50%, #ec4899 100%);
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.5);
    width: 0%;
    transition: width 0.05s linear;
}

.replay-slider-input {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 5;
}

/* Controls Row */
.replay-controls-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.replay-controls-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.replay-control-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.replay-control-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    transform: scale(1.08);
}

.replay-play-pause-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: 1.5px solid #34d399;
    color: #fff;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 18px rgba(16, 185, 129, 0.45);
    transition: all 0.2s ease;
    padding: 0;
}

.replay-play-pause-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 24px rgba(16, 185, 129, 0.6);
}

.replay-play-pause-btn.paused {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-color: #60a5fa;
    box-shadow: 0 4px 18px rgba(59, 130, 246, 0.45);
}

/* Speed Pills */
.replay-speed-group {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(0, 0, 0, 0.35);
    padding: 3px 8px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.speed-label {
    font-size: 10px;
    font-weight: 800;
    color: var(--text-muted);
    letter-spacing: 0.8px;
    margin-right: 2px;
}

.replay-speed-pill {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.replay-speed-pill:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.replay-speed-pill.active {
    background: #38bdf8;
    color: #0b1120;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}

/* Right Action Buttons (Wallpaper, Shimmer, Stats, Hub) */
.replay-controls-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.replay-action-pill {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    border-radius: 18px;
    padding: 7px 14px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.replay-action-pill:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.replay-action-pill.finale-btn {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.25) 0%, rgba(168, 85, 247, 0.35) 100%);
    border-color: #ec4899;
    color: #fbcfe8;
}
.replay-action-pill.finale-btn:hover {
    box-shadow: 0 4px 18px rgba(236, 72, 153, 0.45);
}

.replay-action-pill.wallpaper-btn {
    background: linear-gradient(135deg, rgba(255, 183, 77, 0.2) 0%, rgba(255, 152, 0, 0.35) 100%);
    border-color: #ffb74d;
    color: #ffe0b2;
}
.replay-action-pill.wallpaper-btn:hover {
    box-shadow: 0 4px 18px rgba(255, 183, 77, 0.45);
}

.replay-action-pill.hub-btn {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.replay-action-pill.journey-btn {
    background: linear-gradient(90deg, #d500f9, #7b1fa2);
    border-color: #e040fb;
    color: #fff;
    box-shadow: 0 4px 15px rgba(224, 64, 251, 0.4);
}

/* Shimmer Specular Light Sweep Animation */
@keyframes replayGlitterSweep {
    0% { transform: translate(-100%, -100%) rotate(45deg); opacity: 0; }
    20% { opacity: 0.85; }
    80% { opacity: 0.85; }
    100% { transform: translate(150%, 150%) rotate(45deg); opacity: 0; }
}

.replay-shimmer-sweep-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 200%;
    height: 200%;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.15) 45%, rgba(255, 255, 255, 0.6) 50%, rgba(255, 255, 255, 0.15) 55%, transparent 100%);
    pointer-events: none;
    z-index: 60;
    animation: replayGlitterSweep 1.8s ease-in-out;
}

/* Responsive Adjustments for Tablet and Mobile Displays */
@media (max-width: 900px) {
    .replay-theater-top-bar {
        margin: 10px 12px 0 12px;
        padding: 8px 14px;
        gap: 10px;
    }
    .replay-title {
        max-width: 180px;
        font-size: 15px;
    }
    .replay-player-dock {
        margin: 0 12px 12px 12px;
        padding: 12px 16px;
        gap: 10px;
    }
}

@media (max-width: 768px) {
    .replay-theater-top-bar {
        margin: 8px 10px 0 10px;
        padding: 8px 12px;
        gap: 8px;
        justify-content: space-between;
    }
    .replay-badge-collection {
        font-size: 10px;
        padding: 2px 7px;
    }
    .replay-title {
        max-width: 140px;
        font-size: 14px;
    }
    .frame-selector-label {
        display: none;
    }
    .replay-frame-pill {
        padding: 4px 8px;
        font-size: 11px;
    }
    .replay-sound-btn .sound-label {
        display: none;
    }
    .replay-sound-btn {
        padding: 5px 8px;
        border-radius: 12px;
    }
    .replay-player-dock {
        margin: 0 10px 10px 10px;
        padding: 10px 12px;
        gap: 8px;
    }
    .replay-scrubber-row {
        gap: 8px;
    }
    .replay-dots-pill {
        min-width: unset;
        font-size: 11px;
    }
    .replay-time-pill {
        min-width: unset;
        font-size: 11px;
    }
    .replay-controls-row {
        gap: 8px;
        justify-content: space-between;
    }
    .speed-label {
        display: none;
    }
    .replay-speed-pill {
        padding: 3px 6px;
        font-size: 10px;
    }
    .replay-action-pill .action-label {
        display: none;
    }
    .replay-action-pill {
        padding: 0;
        min-width: 36px;
        height: 36px;
        justify-content: center;
        font-size: 14px;
        border-radius: 12px;
    }
    .replay-control-btn {
        width: 34px;
        height: 34px;
    }
    .replay-play-pause-btn {
        width: 38px;
        height: 38px;
    }
}

@media (max-width: 520px) {
    .replay-theater-top-bar {
        margin: 6px 8px 0 8px;
        padding: 8px 10px;
        gap: 6px;
        flex-wrap: wrap;
        justify-content: space-between;
    }
    .replay-title-cluster {
        gap: 6px;
    }
    .replay-badge-collection {
        display: none;
    }
    .replay-title {
        max-width: 160px;
        font-size: 13px;
    }
    .replay-top-actions {
        gap: 6px;
    }
    .replay-frame-selector-group {
        order: 3;
        width: 100%;
        justify-content: center;
        margin-top: 2px;
        padding: 3px 6px;
        gap: 4px;
    }
    .replay-frame-pill {
        padding: 3px 7px;
        font-size: 10px;
        gap: 4px;
    }
    .replay-player-dock {
        margin: 0 8px 8px 8px;
        padding: 8px 10px;
        gap: 8px;
    }
    .replay-scrubber-row {
        gap: 6px;
    }
    .replay-dots-pill {
        font-size: 10px;
    }
    .replay-time-pill {
        font-size: 10px;
    }
    .replay-controls-row {
        flex-wrap: wrap;
        gap: 6px;
        justify-content: space-between;
    }
    .replay-controls-left {
        gap: 4px;
    }
    .replay-control-btn {
        width: 30px;
        height: 30px;
        font-size: 11px;
    }
    .replay-play-pause-btn {
        width: 34px;
        height: 34px;
        font-size: 13px;
    }
    .replay-controls-right {
        gap: 4px;
    }
    .replay-action-pill {
        min-width: 30px;
        height: 30px;
        font-size: 13px;
    }
    .replay-speed-group {
        order: 4;
        width: 100%;
        justify-content: space-around;
        margin-top: 2px;
        padding: 2px 4px;
    }
    .replay-speed-pill {
        padding: 2px 5px;
        font-size: 10px;
    }
    .replay-music-credit-pill {
        left: 0;
        bottom: calc(100% + 6px);
        max-width: calc(100vw - 20px);
        padding: 5px 8px;
        gap: 6px;
    }
    .music-pill-title {
        font-size: 10px;
    }
    .music-pill-license {
        font-size: 8.5px;
    }
}

/* Floating HUD Container */
.floating-hud {
    position: absolute;
    bottom: 30px;
    background: rgba(11, 15, 25, 0.75);
    padding: 12px 24px;
    border-radius: 40px;
    border: 1px solid rgba(76, 175, 80, 0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
    transition: opacity 0.3s ease, transform 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: fit-content;
    max-width: 90%;
    z-index: 250;
    pointer-events: auto;
}

.floating-hud.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px);
}

.hud-section {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
    transition: opacity 0.3s ease, max-height 0.3s ease;
}

.hud-section.hidden-section {
    opacity: 0;
    pointer-events: none;
    max-height: 0;
    overflow: hidden;
    margin: 0;
}

.floating-hud button {
    background: rgba(255, 255, 255, 0.08);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px 18px;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.floating-hud button:hover {
    background: var(--accent-color);
    border-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.floating-hud button.primary-action {
    background: linear-gradient(135deg, var(--accent-color) 0%, #2e7d32 100%);
    border-color: transparent;
}

.floating-hud button.primary-action:hover {
    box-shadow: 0 6px 15px rgba(76, 175, 80, 0.5);
}

.active-brush {
    background: var(--accent-color) !important;
    color: #111522 !important;
    font-weight: bold;
}

#mixing-canvas {
    position: static !important;
    width: 256px !important;
    height: 256px !important;
    display: block;
    margin: 0 auto;
}

/* ==========================================================================
   DYNAMIC SPATIAL HUB & GEM TABLE STYLES
   ========================================================================== */

#gem-table-viewport {
    position: relative;
    width: 100%;
    height: calc(100vh - 70px);
    overflow: hidden;
    background: radial-gradient(circle at center, #111625 0%, #070a12 100%);
    user-select: none;
    -webkit-user-select: none;
}

#gem-table-board {
    position: absolute;
    width: 2400px;
    height: auto;
    background-image: radial-gradient(#222c4d 1.5px, transparent 1.5px);
    background-size: 24px 24px;
    cursor: grab;
    transform-style: preserve-3d;
    will-change: transform;
    padding: 600px 300px;
    box-sizing: border-box;
}

#gem-table-board:active {
    cursor: grabbing;
}

.theme-hub-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
}

/* Tier Quick (Emerald Green) */
.theme-hub-card.tier-quick {
    background: linear-gradient(145deg, #0d1e15 0%, #060e0a 100%);
    border: 1.5px solid rgba(76, 175, 80, 0.35);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
}

.theme-hub-card.tier-quick:hover {
    border-color: #4caf50;
    box-shadow: 0 15px 35px rgba(76, 175, 80, 0.25);
}

/* Tier Advanced (Sapphire Blue) */
.theme-hub-card.tier-advanced {
    background: linear-gradient(145deg, #101c36 0%, #080f1e 100%);
    border: 1.5px solid rgba(33, 150, 243, 0.35);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
}

.theme-hub-card.tier-advanced:hover {
    border-color: #2196f3;
    box-shadow: 0 15px 35px rgba(33, 150, 243, 0.25);
}

/* Tier Masterpiece (Amber Gold) */
.theme-hub-card.tier-masterpiece {
    background: linear-gradient(145deg, #361f0a 0%, #170d04 100%);
    border: 1.5px solid #ffb74d;
    box-shadow: 0 12px 30px rgba(255, 183, 77, 0.15);
}

.theme-hub-card.tier-masterpiece:hover {
    border-color: #ffe082;
    box-shadow: 0 18px 45px rgba(255, 183, 77, 0.35);
}

/* Common Card elements */
.theme-hub-card {
    position: relative;
    border-radius: 20px;
    padding: 38px 30px 26px 30px;
    /* adjusted top padding to fit badges */
    text-align: center;
    cursor: pointer;
    overflow: visible;
    transform-style: preserve-3d;
    transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateZ(0);
    transition: border-color 0.25s, box-shadow 0.25s, transform 0.1s ease-out;
}

.theme-hub-card * {
    transform: translateZ(25px);
}

/* Badging system styles */
.card-tier-badge {
    position: static;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 4px 9px;
    border-radius: 12px;
    line-height: 1;
    display: inline-block;
}

.tier-quick .card-tier-badge {
    background: rgba(76, 175, 80, 0.15);
    color: #81c784;
    border: 0.5px solid rgba(76, 175, 80, 0.3);
}

.tier-advanced .card-tier-badge {
    background: rgba(33, 150, 243, 0.15);
    color: #64b5f6;
    border: 0.5px solid rgba(33, 150, 243, 0.3);
}

.tier-masterpiece .card-tier-badge {
    background: rgba(255, 183, 77, 0.15);
    color: #ffb74d;
    border: 0.5px solid rgba(255, 183, 77, 0.3);
}

.card-grid-size-dimension {
    position: absolute;
    top: 10px;
    right: 14px;
    transform: translateZ(15px);
    pointer-events: none;
}

.dimension-container {
    position: relative;
    display: inline-block;
    padding-left: 9px;
    padding-bottom: 9px;
}

.dimension-box {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 30px;
    padding: 0 4px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(0, 0, 0, 0.35);
    font-family: monospace;
    font-size: 9px;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.75);
    border-radius: 4px;
    box-sizing: border-box;
}

.dimension-arrow-left {
    position: absolute;
    left: 2px;
    top: 0;
    bottom: 9px;
    width: 4px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    font-size: 5px;
    line-height: 1;
}

.dimension-arrow-left::before {
    content: '▲';
}

.dimension-arrow-left::after {
    content: '▼';
}

.dimension-arrow-left-line {
    flex: 1;
    width: 1px;
    margin: 1px 0;
}

.dimension-arrow-bottom {
    position: absolute;
    bottom: 2px;
    left: 9px;
    right: 0;
    height: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 5px;
    line-height: 1;
}

.dimension-arrow-bottom::before {
    content: '◀';
}

.dimension-arrow-bottom::after {
    content: '▶';
}

.dimension-arrow-bottom-line {
    flex: 1;
    height: 1px;
    margin: 0 1px;
}

/* Tier Specific Dimension Themes */
.tier-quick .dimension-box {
    border-color: rgba(76, 175, 80, 0.45);
    color: #81c784;
}

.tier-quick .dimension-arrow-left,
.tier-quick .dimension-arrow-bottom {
    color: rgba(76, 175, 80, 0.65);
}

.tier-quick .dimension-arrow-left-line,
.tier-quick .dimension-arrow-bottom-line {
    background: rgba(76, 175, 80, 0.35);
}

.tier-advanced .dimension-box {
    border-color: rgba(33, 150, 243, 0.45);
    color: #64b5f6;
}

.tier-advanced .dimension-arrow-left,
.tier-advanced .dimension-arrow-bottom {
    color: rgba(33, 150, 243, 0.65);
}

.tier-advanced .dimension-arrow-left-line,
.tier-advanced .dimension-arrow-bottom-line {
    background: rgba(33, 150, 243, 0.35);
}

.tier-masterpiece .dimension-box {
    border-color: rgba(255, 183, 77, 0.55);
    color: #ffb74d;
}

.tier-masterpiece .dimension-arrow-left,
.tier-masterpiece .dimension-arrow-bottom {
    color: rgba(255, 183, 77, 0.75);
}

.tier-masterpiece .dimension-arrow-left-line,
.tier-masterpiece .dimension-arrow-bottom-line {
    background: rgba(255, 183, 77, 0.35);
}

/* Shiny hover overlay effect */
.theme-hub-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 20px;
    background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, 0.08) 0%, transparent 60%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.theme-hub-card:hover::after {
    opacity: 1;
}

/* In progress shelf inside the spatial map */
#in-progress-container {
    margin-bottom: 50px;
    width: 100%;
}

/* ==========================================================================
   MOBILE & RESPONSIVE ADAPTATIONS
   ========================================================================== */

@media (max-width: 768px) {

    /* Scale down the spatial board size on mobile so dragging/panning is fast and easy */
    #gem-table-board {
        width: 1200px;
        height: auto;
        padding: 400px 100px;
        background-size: 16px 16px;
    }

    /* Stack cards in a single column layout that is easily reachable on phone screens */
    .theme-hub-grid {
        grid-template-columns: repeat(1, 1fr);
        gap: 20px;
        max-width: 290px;
        margin: 0 auto;
    }

    .theme-hub-card {
        padding: 16px 20px;
        border-radius: 16px;
    }

    .theme-emoji {
        font-size: 32px;
        margin-bottom: 6px;
    }

    .theme-title {
        font-size: 13px !important;
    }

    .wide-span {
        flex-direction: column;
        gap: 8px;
        padding: 16px 20px;
    }

    /* Keep game footer controls (Shop, progress) on a single row on mobile screens */
    .meta-panel {
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 10px 16px !important;
        background: #0b0f19;
    }

    /* Keep settings modal responsive */
    .modal-card {
        width: 94%;
        max-width: 350px;
        padding: 20px;
    }

    /* Adjust blueprint thumbnails layout */
    .thumbnails-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 10px;
    }
}

/* ==========================================================================
   SPECIAL EVENTS & STORY CAMPAIGN STYLES
   ========================================================================== */

/* Specials Announcement Ticker Banner */
.specials-ticker-banner {
    position: absolute;
    top: 70px;
    left: 0;
    right: 0;
    height: 36px;
    background: linear-gradient(90deg, #1f083d 0%, #3e0c70 50%, #1f083d 100%);
    border-bottom: 2px solid #e040fb;
    box-shadow: 0 4px 15px rgba(224, 64, 251, 0.25);
    z-index: 99;
    overflow: hidden;
    display: flex;
    align-items: center;
    cursor: pointer;
    font-family: 'Segoe UI', sans-serif;
}

.ticker-content {
    display: flex;
    white-space: nowrap;
    animation: marquee-scroll 24s linear infinite;
}

.ticker-content span {
    font-size: 11px;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 0 6px rgba(255, 255, 255, 0.8), 0 0 12px #e040fb;
    padding-right: 60px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

@keyframes marquee-scroll {
    0% {
        transform: translate3d(0, 0, 0);
    }

    100% {
        transform: translate3d(-50%, 0, 0);
    }
}

#gem-table-viewport {
    position: relative;
    width: 100%;
    height: calc(100vh - 106px);
    margin-top: 36px;
    /* Offset for specials ticker */
    overflow: hidden;
    background: #090d16;
}

/* Campaign/Journey Map Dashboard layout */
.journey-dashboard-container {
    display: flex;
    gap: 30px;
    padding: 30px;
    max-width: 1200px;
    margin: 0 auto;
    box-sizing: border-box;
}

/* Left Speech Portrait panel */
.journey-rowan-panel {
    flex: 0 0 320px;
    background: rgba(24, 34, 60, 0.45);
    border: 1px solid rgba(224, 64, 251, 0.2);
    border-radius: 20px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    height: fit-content;
}

.rowan-portrait-box {
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(224, 64, 251, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    overflow: visible;
}

.rowan-portrait-box img {
    height: 110%;
    object-fit: contain;
    filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.5));
}

.rowan-speech-bubble {
    position: relative;
    background: #0b0f19;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 16px 20px;
    color: var(--text-color);
    font-size: 13px;
    line-height: 1.5;
    text-align: left;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
}

.rowan-speech-bubble::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 14px;
    height: 14px;
    background: #0b0f19;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Right Progression panel */
.journey-map-panel {
    flex: 1;
    background: rgba(24, 34, 60, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.journey-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 16px;
    margin-bottom: 20px;
}

.journey-campaign-name {
    font-size: 18px;
    font-weight: bold;
    color: #e040fb;
    text-shadow: 0 0 10px rgba(224, 64, 251, 0.3);
}

.journey-badge {
    background: rgba(224, 64, 251, 0.15);
    color: #e040fb;
    border: 1px solid rgba(224, 64, 251, 0.3);
    padding: 4px 12px;
    font-size: 11px;
    font-weight: 800;
    border-radius: 12px;
    font-family: monospace;
}

.journey-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

/* Campaign Grid Node */
.journey-node {
    position: relative;
    background: linear-gradient(145deg, #18223c 0%, #101627 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 12px;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.journey-node:hover:not(.locked) {
    transform: translateY(-2px);
    border-color: #e040fb;
    box-shadow: 0 6px 18px rgba(224, 64, 251, 0.25);
}

.journey-node.locked {
    cursor: not-allowed;
    border-color: rgba(255, 255, 255, 0.02) !important;
}

.journey-node.locked .journey-node-thumb {
    filter: grayscale(1) brightness(0.3);
}

.journey-node.locked::after {
    content: '🔒';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 20px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.journey-node-thumb {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 8px;
    object-fit: cover;
    margin-bottom: 8px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
    background: #090d16;
    filter: grayscale(100%);
    transition: filter 0.3s ease;
}

.journey-node-title {
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-color);
}

/* Completed Overlay */
.journey-node.completed {
    border-color: rgba(76, 175, 80, 0.4);
}

.journey-node.completed .journey-node-thumb {
    filter: none;
}

.journey-node.completed::before {
    content: '✅';
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 14px;
    z-index: 2;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.journey-node-view-btn {
    margin-top: 6px;
    width: 100%;
    padding: 4px;
    font-size: 9px;
    background: rgba(76, 175, 80, 0.15);
    border: 1.5px solid #4caf50;
    color: #81c784;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: background 0.2s, color 0.2s;
}

.journey-node-view-btn:hover {
    background: #4caf50;
    color: #fff;
}

.journey-upcoming-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
}

/* Narrative Dialogue Modal Card */
.journey-modal-card {
    background: linear-gradient(145deg, #1c152d 0%, #0d091a 100%);
    border: 1.5px solid #ab47bc;
    border-radius: 24px;
    width: 90%;
    max-width: 480px;
    padding: 24px;
    display: flex;
    gap: 20px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6), 0 0 30px rgba(171, 71, 188, 0.2);
    box-sizing: border-box;
    align-items: center;
    animation: zoom-fade 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.journey-modal-rowan-box {
    flex: 0 0 120px;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

.journey-modal-rowan-box img {
    height: 120%;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
}

.journey-modal-bubble {
    flex: 1;
    display: flex;
    flex-direction: column;
    text-align: left;
}

.journey-modal-title {
    font-size: 11px;
    font-weight: 800;
    color: #e040fb;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
}

#journey-modal-speech-text {
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-color);
}

/* Image Viewer Modal Styles */
.image-viewer-card {
    background: #0b0f19;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
    padding: 16px;
    box-sizing: border-box;
}

.image-viewer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.image-viewer-header h3 {
    margin: 0;
    font-size: 16px;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.image-viewer-body {
    width: 100%;
    aspect-ratio: 1;
    background: #05070c;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 4px 8px rgba(0, 0, 0, 0.6);
}

.image-viewer-body img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Animation helpers */
@keyframes zoom-fade {
    from {
        opacity: 0;
        transform: scale(0.92);
    }

    to {
        opacity: 1;
        transform: scale(1.00);
    }
}

/* Responsive Campaign View */
@media (max-width: 768px) {
    .specials-ticker-banner {
        top: 70px;
    }

    .journey-dashboard-container {
        flex-direction: column;
        padding: 16px;
        gap: 20px;
    }

    .journey-rowan-panel {
        flex: 1;
        width: 100%;
        box-sizing: border-box;
    }

    .journey-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .journey-modal-card {
        flex-direction: column;
        padding: 20px;
        gap: 12px;
    }

    .journey-modal-rowan-box {
        height: 100px;
        flex: 0 0 100px;
    }

    .journey-modal-rowan-box img {
        height: 100%;
    }
}

/* Replay continue button hover styles */
.continue-journey-hud-btn:hover {
    transform: translateY(-1px) scale(1.02);
    box-shadow: 0 6px 20px rgba(224, 64, 251, 0.6) !important;
    filter: brightness(1.15);
}

/* ==========================================================================
   VERTICAL DASHBOARD SYSTEM STYLES
   ========================================================================== */

.dashboard-scroll-content {
    position: absolute;
    top: 106px;
    /* 70px header + 36px specials ticker */
    left: 0;
    right: 0;
    bottom: 0;
    overflow-y: auto;
    background: #090d16;
    padding: 0 24px 50px 24px;
    scroll-behavior: smooth;
    box-sizing: border-box;
}

.dashboard-section {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    box-sizing: border-box;
}

.dashboard-section-title {
    font-size: 14px;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.15);
    margin: 0 0 12px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Featured Horizontal Swiper */
.featured-swiper {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding: 4px 4px 16px 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(224, 64, 251, 0.2) transparent;
}

.featured-card {
    position: relative;
    flex: 0 0 250px;
    background: linear-gradient(135deg, rgba(28, 38, 68, 0.4) 0%, rgba(14, 20, 36, 0.6) 100%);
    border: 1px solid rgba(224, 64, 251, 0.15);
    border-radius: 16px;
    padding: 20px;
    text-align: left;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.featured-card:hover {
    transform: translateY(-3px);
    border-color: #e040fb;
    box-shadow: 0 12px 30px rgba(224, 64, 251, 0.25);
}

.featured-card-badge {
    position: absolute;
    top: 14px;
    right: 14px;
    font-size: 8px;
    font-weight: 900;
    padding: 3px 8px;
    border-radius: 8px;
    background: #e040fb;
    color: #0b0f19;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.featured-card-emoji {
    font-size: 32px;
    margin-bottom: 12px;
}

.featured-card-title {
    font-size: 15px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 4px;
}

.featured-card-subtitle {
    font-size: 12px;
    color: var(--text-muted);
}

/* Glassmorphic Tabs Bar */
.difficulty-tabs {
    display: flex;
    gap: 6px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 4px;
    border-radius: 30px;
    margin-bottom: 24px;
    overflow-x: auto;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.tab-button {
    flex: 1;
    text-align: center;
    padding: 10px 18px;
    border-radius: 25px;
    color: var(--text-muted);
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
    border: 1px solid transparent;
}

.tab-button:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.03);
}

.tab-button.active {
    background: rgba(224, 64, 251, 0.12);
    color: #e040fb;
    border: 1.5px solid rgba(224, 64, 251, 0.35);
    text-shadow: 0 0 8px rgba(224, 64, 251, 0.5);
    box-shadow: inset 0 2px 4px rgba(224, 64, 251, 0.1);
}

/* Dashboard Tab Content Grid overrides */
.theme-hub-grid.dashboard-grid {
    grid-template-columns: repeat(3, 1fr);
    margin: 0;
    max-width: 100%;
}
.theme-hub-grid.dashboard-grid.in-progress-active {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    justify-content: center;
    justify-items: center;
    gap: 25px;
}

/* Daily Discoveries Grid */
.discoveries-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
}

.discovery-card {
    background: linear-gradient(135deg, rgba(30, 41, 75, 0.2) 0%, rgba(16, 23, 44, 0.4) 100%);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 14px;
    padding: 12px;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.discovery-card:hover {
    transform: translateY(-2px);
    border-color: #e040fb;
    box-shadow: 0 6px 18px rgba(224, 64, 251, 0.25);
}

.discovery-thumb {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 8px;
    background: #05080f;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
    filter: grayscale(100%);
    transition: filter 0.3s ease;
}

.discovery-card:hover .discovery-thumb {
    filter: none;
}

.discovery-title {
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.discovery-size-tag {
    font-size: 9px;
    color: var(--text-muted);
    margin-top: 3px;
    font-weight: 600;
}

/* Premium Footer */
.hub-footer {
    margin-top: 60px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding: 24px 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Mobile Responsiveness for dashboard */
@media (max-width: 768px) {
    .dashboard-scroll-content {
        padding: 0 16px 40px 16px;
    }

    .theme-hub-grid.dashboard-grid {
        grid-template-columns: repeat(1, 1fr) !important;
        gap: 16px;
    }

    .discoveries-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

/* ==========================================================================
   PERK SYSTEM & SHOP STYLES
   ========================================================================== */

.perk-btn.active {
    background: #2e7d32 !important;
    border-color: #a5d6a7 !important;
    color: #fff !important;
    box-shadow: 0 0 12px rgba(165, 214, 167, 0.4);
    animation: active-glow-pulse 1.5s infinite alternate;
}

.perk-shop-item {
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.perk-shop-item:hover {
    transform: translateY(-2px);
    border-color: rgba(171, 71, 188, 0.3) !important;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes active-glow-pulse {
    0% {
        box-shadow: 0 0 4px rgba(165, 214, 167, 0.3);
    }

    100% {
        box-shadow: 0 0 14px rgba(165, 214, 167, 0.7);
    }
}

/* ==========================================================================
   JOURNEY WORLD MAP OVERLAY STYLES
   ========================================================================== */

.journey-world-map-container {
    width: 100%;
    margin-top: 15px;
}

.map-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 1/1;
    background: #0d1222;
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
    overflow: hidden;
}

/* Connection Path SVG */
.map-connections-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

.map-connection-line {
    stroke-dasharray: 6, 6;
    stroke-linecap: round;
    animation: dash-flow 2s linear infinite;
}

@keyframes dash-flow {
    to {
        stroke-dashoffset: -20;
    }
}

/* Map Nodes */
.journey-map-node {
    position: absolute;
    transform: translate(-50%, -50%);
    width: var(--node-size, 22px);
    height: var(--node-size, 22px);
    border-radius: 50%;
    cursor: pointer;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease-out;
    /* Smooth hover but zero position lag during zoom/pan */
    /* 3D Glass/Gem reflections */
    box-shadow:
        0 4px 10px rgba(0, 0, 0, 0.5),
        inset -3px -3px 7px rgba(0, 0, 0, 0.4),
        inset 3px 3px 7px rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.journey-map-node::before {
    content: '';
    width: calc(var(--node-size, 22px) * 0.23);
    height: calc(var(--node-size, 22px) * 0.23);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.8);
    position: absolute;
    top: calc(var(--node-size, 22px) * 0.14);
    left: calc(var(--node-size, 22px) * 0.14);
}

/* Node States */
/* Locked: Greyed out dark hematite bead */
.journey-map-node.locked {
    background: radial-gradient(circle at 35% 35%, #888 0%, #444 60%, #222 100%);
    box-shadow:
        0 4px 8px rgba(0, 0, 0, 0.6),
        inset -2px -2px 6px rgba(0, 0, 0, 0.6),
        inset 2px 2px 6px rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.15);
    cursor: not-allowed;
}

.journey-map-node.locked::before {
    background: rgba(255, 255, 255, 0.4);
    content: '';
}

/* Completed: Shiny tinted white pearl/diamond gem */
.journey-map-node.completed {
    background: radial-gradient(circle at 35% 35%, #ffffff 0%, #f0f0f5 40%, #c8c8d8 75%, #a0a0b5 100%);
    box-shadow:
        0 4px 10px rgba(0, 0, 0, 0.4),
        inset -3px -3px 6px rgba(0, 0, 0, 0.2),
        inset 3px 3px 6px rgba(255, 255, 255, 0.8);
    border-color: rgba(255, 255, 255, 0.6);
}

.journey-map-node.completed::before {
    background: rgba(255, 255, 255, 0.9);
}

/* Active: Pulsing vibrant emerald green gem */
.journey-map-node.active {
    background: radial-gradient(circle at 35% 35%, #a8ffb2 0%, #4caf50 50%, #1b5e20 100%);
    box-shadow:
        0 4px 12px rgba(76, 175, 80, 0.5),
        inset -3px -3px 6px rgba(0, 0, 0, 0.3),
        inset 3px 3px 6px rgba(255, 255, 255, 0.7);
    border-color: rgba(255, 255, 255, 0.7);
    animation: active-gem-pulse 1.8s infinite;
}

.journey-map-node.active::before {
    background: rgba(255, 255, 255, 0.95);
}

/* Shrunk tooltip hide */
.journey-map-node.shrunk-tooltip-hide:hover .journey-map-node-tooltip {
    display: none !important;
}

@keyframes active-gem-pulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
        box-shadow: 0 4px 12px rgba(76, 175, 80, 0.5), 0 0 0 0 rgba(76, 175, 80, 0.7);
    }

    70% {
        transform: translate(-50%, -50%) scale(1.15);
        box-shadow: 0 6px 16px rgba(76, 175, 80, 0.3), 0 0 0 10px rgba(76, 175, 80, 0);
    }

    100% {
        transform: translate(-50%, -50%) scale(1);
        box-shadow: 0 4px 12px rgba(76, 175, 80, 0.5), 0 0 0 0 rgba(76, 175, 80, 0);
    }
}

.journey-map-node:hover {
    z-index: 99 !important;
    /* Bring hovered node and its tooltip to the very top */
}

.journey-map-node:not(.locked):hover {
    transform: translate(-50%, -50%) scale(1.15);
}

/* Tooltip */
.journey-map-node-tooltip {
    position: absolute;
    bottom: 36px;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: #0b0f19;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 6px 12px;
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    z-index: 100;
}

.journey-map-node:hover .journey-map-node-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.journey-map-node-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #0b0f19;
}

#header-pattern-title {
    font-weight: 800;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 0 10px rgba(224, 64, 251, 0.25), 0 0 1px rgba(255, 255, 255, 0.8);
    background: linear-gradient(90deg, #ffffff, #f1d3ff, #ffffff);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    color: #ffffff;
    display: inline-block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 280px;
}

/* Luxury Studio Top Bar in #game-view */
.game-studio-header {
    height: 64px;
    padding: 0 16px;
    background: rgba(14, 19, 34, 0.96);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
    gap: 12px;
}

.game-header-left {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.game-header-right {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.game-header-center {
    flex: 1;
    min-width: 0;
    max-width: 440px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.game-title-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    max-width: 100%;
}

.game-size-pill {
    font-size: 10px;
    font-weight: 700;
    color: #ce93d8;
    background: rgba(171, 71, 188, 0.16);
    border: 1px solid rgba(206, 147, 216, 0.35);
    padding: 1px 7px;
    border-radius: 999px;
    letter-spacing: 0.4px;
    white-space: nowrap;
}

.game-top-progress-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    max-width: 340px;
}

.game-top-progress-track {
    flex: 1;
    height: 7px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.6);
}

.game-top-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #7b1fa2 0%, #ab47bc 45%, #69f0ae 100%);
    border-radius: 999px;
    box-shadow: 0 0 10px rgba(105, 240, 174, 0.45);
    transition: width 0.2s cubic-bezier(0.2, 0.9, 0.3, 1);
}

.game-top-progress-pct {
    font-family: 'Orbitron', monospace;
    font-size: 11.5px;
    font-weight: 800;
    color: #69f0ae;
    min-width: 34px;
    text-align: right;
}

.game-top-gems-count {
    font-family: monospace;
    font-size: 10.5px;
    color: var(--text-muted);
    white-space: nowrap;
}

.view-header,
.game-studio-header {
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

@media (max-width: 640px) {
    .game-top-gems-count {
        display: none;
    }
    #header-pattern-title {
        font-size: 12px;
        max-width: 100%;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .game-studio-header {
        padding: 0 8px;
        gap: 6px;
        height: 58px;
    }
    .game-header-left,
    .game-header-right {
        gap: 4px;
    }
    .game-studio-header .header-icon-btn {
        width: 30px;
        height: 30px;
        padding: 0;
    }
    .game-studio-header .header-shards-pill,
    .game-studio-header .header-timer-box,
    .game-studio-header .header-streak-pill {
        padding: 3px 6px;
        font-size: 10.5px;
    }
    #hub-view .view-header {
        padding: 0 10px;
        gap: 6px;
    }
    #hub-view .header-left,
    #hub-view .header-right {
        flex: 0 0 auto;
        gap: 5px;
    }
}

@media (max-width: 500px) {
    #game-daily-streak-pill,
    .game-size-pill,
    #level-stopwatch-lbl {
        display: none;
    }
    .game-top-progress-row {
        gap: 5px;
    }
    .game-top-progress-pct {
        font-size: 10.5px;
        min-width: 28px;
    }
}

/* Hide old sidebar palette list completely to free up 100% of workspace */
.sidebar {
    display: none !important;
}

/* Bar container that centers the entire color control group */
.active-color-bar-container {
    position: absolute;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    max-width: calc(100vw - 12px);
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.68));
}

/* Floating Color Complete Celebration Toast */
.color-complete-toast {
    position: absolute;
    bottom: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%) translateY(10px) scale(0.9);
    background: linear-gradient(135deg, rgba(25, 35, 60, 0.96), rgba(15, 22, 40, 0.96));
    border: 1.5px solid #ffd54f;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55), 0 0 16px rgba(255, 213, 79, 0.35);
    color: #ffd54f;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.6px;
    padding: 6px 16px;
    border-radius: 999px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.2);
    z-index: 120;
}

.color-complete-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
}

/* Base style for crescent buttons */
.crescent-btn {
    width: 42px;
    height: 48px;
    background: rgba(18, 25, 44, 0.92);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-sizing: border-box;
    transition: transform 0.2s, background 0.2s, border-color 0.2s, box-shadow 0.2s;
    user-select: none;
    -webkit-user-select: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.crescent-btn:hover {
    background: rgba(36, 49, 81, 0.95);
    border-color: #ffb74d;
    box-shadow: 0 4px 15px rgba(255, 183, 77, 0.4);
}

.crescent-btn:active {
    transform: scale(0.92);
}

/* Specific curved shapes and margins (static and semi-attached) */
.crescent-btn.double-left {
    border-top-left-radius: 22px;
    border-bottom-left-radius: 22px;
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
    z-index: 10;
    margin-right: 4px;
}

.crescent-btn.single-left {
    border-radius: 8px;
    z-index: 11;
    margin-right: 8px;
}

.crescent-btn.single-right {
    border-radius: 8px;
    z-index: 11;
    margin-left: 8px;
}

.crescent-btn.double-right {
    border-top-right-radius: 22px;
    border-bottom-right-radius: 22px;
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
    z-index: 10;
    margin-left: 4px;
}

/* Floating Active Color Widget */
.active-color-widget-container {
    width: 226px;
    box-sizing: border-box;
    background: rgba(11, 16, 30, 0.94);
    border: 1.5px solid rgba(255, 255, 255, 0.18);
    border-radius: 20px;
    padding: 8px 14px 8px 10px;
    display: flex;
    align-items: center;
    gap: 11px;
    cursor: pointer;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    z-index: 12;
    transition: transform 0.2s, background 0.2s, border-color 0.2s, box-shadow 0.2s;
    user-select: none;
    -webkit-user-select: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.active-color-widget-container:hover {
    transform: translateY(-2px) scale(1.02);
    background: rgba(21, 29, 48, 0.96);
    border-color: #ffb74d;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 14px rgba(255, 183, 77, 0.28);
}
.active-color-widget-container:active {
    transform: scale(0.98);
}

/* 3D Faceted Square Crystal Gem Swatch */
.active-color-widget-gem {
    width: 40px;
    height: 40px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
    flex-shrink: 0;
    position: relative;
    box-sizing: border-box;
    border-style: solid;
    border-width: 5px;
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.55),
        inset 0 1px 2px rgba(255, 255, 255, 0.45);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.65);
}

.active-color-widget-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
    min-width: 0;
}

@media (max-width: 520px) {
    .active-color-bar-container {
        bottom: 12px;
        width: calc(100vw - 12px);
        max-width: 390px;
    }
    .crescent-btn {
        width: 34px;
        height: 44px;
        flex-shrink: 0;
        font-size: 11px;
    }
    .crescent-btn.double-left {
        border-top-left-radius: 18px;
        border-bottom-left-radius: 18px;
        margin-right: 2px;
    }
    .crescent-btn.single-left {
        margin-right: 4px;
    }
    .crescent-btn.single-right {
        margin-left: 4px;
    }
    .crescent-btn.double-right {
        border-top-right-radius: 18px;
        border-bottom-right-radius: 18px;
        margin-left: 2px;
    }
    .active-color-widget-container {
        width: auto;
        min-width: 0;
        flex: 1 1 auto;
        border-radius: 16px;
        padding: 6px 10px 6px 8px;
        gap: 8px;
    }
    .active-color-widget-gem {
        width: 34px;
        height: 34px;
        border-width: 4px;
        font-size: 12px;
    }
}
.active-color-title-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}
.active-color-widget-name {
    font-size: 13px;
    font-weight: 800;
    color: #fff;
    letter-spacing: 0.3px;
}
.active-color-widget-pct {
    font-size: 10.5px;
    font-weight: 700;
    color: #ffb74d;
    font-family: monospace;
}
.active-color-widget-remaining {
    font-size: 10.5px;
    color: var(--text-muted);
    font-weight: 600;
}
.active-color-mini-track {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    overflow: hidden;
    margin-top: 1px;
}
.active-color-mini-fill {
    height: 100%;
    background: linear-gradient(90deg, #ffb74d, #69f0ae);
    border-radius: 999px;
    transition: width 0.2s ease;
}
.active-color-widget-arrow {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.55);
    margin-left: 2px;
}

/* Palette Drawer Bottom Popup sheet */
.palette-drawer-overlay {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 7, 13, 0.65);
    z-index: 1050;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    transition: opacity 0.3s ease;
}
.palette-drawer-overlay.active {
    display: block;
}
.palette-drawer-card {
    position: absolute;
    bottom: -100%;
    left: 0;
    width: 100%;
    max-height: 74%;
    background: linear-gradient(180deg, #172038 0%, #0f1526 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.18);
    border-top-left-radius: 28px;
    border-top-right-radius: 28px;
    box-shadow: 0 -15px 45px rgba(0, 0, 0, 0.65);
    padding: 20px 24px 24px 24px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    transition: bottom 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.palette-drawer-overlay.active .palette-drawer-card {
    bottom: 0;
}
.palette-drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 10px;
    position: relative;
    z-index: 2;
}
.palette-drawer-close-btn {
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
    border-radius: 50% !important;
    width: 34px !important;
    height: 34px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #ffffff !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    flex-shrink: 0 !important;
}
.palette-drawer-close-btn:hover {
    background: rgba(239, 68, 68, 0.25) !important;
    border-color: #ef4444 !important;
    color: #fecaca !important;
    transform: scale(1.08) !important;
}
.palette-drawer-title-group {
    display: flex;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
}
.palette-drawer-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 0.6px;
    background: linear-gradient(45deg, #ffd54f, #e1bee7, #ab47bc);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.palette-drawer-summary {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    padding: 3px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Sort & Filter Controls in Palette Drawer */
.palette-drawer-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.palette-sort-pills {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.palette-filter-pill {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.78);
    font-size: 11.5px;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.18s ease;
}
.palette-filter-pill:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}
.palette-filter-pill.active {
    background: linear-gradient(135deg, #ab47bc, #7b1fa2);
    border-color: #ce93d8;
    color: #fff;
    box-shadow: 0 3px 10px rgba(171, 71, 188, 0.35);
}
.palette-hide-done-pill.active {
    background: rgba(76, 175, 80, 0.22);
    border-color: #69f0ae;
    color: #69f0ae;
    box-shadow: 0 3px 10px rgba(105, 240, 174, 0.25);
}

.palette-drawer-grid {
    flex: 1;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
    gap: 10px;
    padding-bottom: 20px;
    align-content: start;
}

.gem-tray-slot {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 9px 6px 7px 6px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1.5px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
    transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
    user-select: none;
    box-sizing: border-box;
    min-height: 78px;
}
.gem-tray-slot:hover:not(.completed) {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.24);
}
.gem-tray-slot.selected {
    background: rgba(171, 71, 188, 0.16);
    border-color: #ffd54f;
    box-shadow: 0 0 14px rgba(255, 213, 79, 0.3), inset 0 0 8px rgba(255, 213, 79, 0.12);
}
.gem-tray-slot.completed {
    opacity: 0.32;
    background: rgba(0, 0, 0, 0.25);
    cursor: default;
}
.gem-tray-swatch {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border-style: solid;
    border-width: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 12px;
    box-sizing: border-box;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.45), inset 0 1px 1px rgba(255, 255, 255, 0.4);
}
.gem-tray-remaining {
    font-family: monospace;
    font-size: 10.5px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.88);
    margin-top: 5px;
}
.gem-tray-bar-track {
    width: 88%;
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 99px;
    overflow: hidden;
    margin-top: 4px;
}
.gem-tray-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #ffb74d, #69f0ae);
    border-radius: 99px;
}

/* Floating Collapsible Crystal Tool Dock */
.floating-toolbox {
    position: absolute;
    top: var(--toolbox-y, 130px);
    z-index: 1000;
    display: flex;
    align-items: center;
    background: rgba(11, 15, 25, 0.90);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 16px;
    padding: 8px 6px;
    box-shadow:
        0 12px 32px rgba(0, 0, 0, 0.65),
        inset 0 1px 0 rgba(255, 255, 255, 0.10);
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.2s, box-shadow 0.2s;
}

/* Position Snapping Styles */
.floating-toolbox.left-sided {
    left: 0;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-left: none;
}
.floating-toolbox.right-sided {
    right: 0;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: none;
    flex-direction: row-reverse;
}

/* Collapsed Slide-Off States */
.floating-toolbox.left-sided.collapsed {
    transform: translateX(-100%);
}
.floating-toolbox.right-sided.collapsed {
    transform: translateX(100%);
}

/* Handle Tab */
.toolbox-handle {
    width: 20px;
    height: 56px;
    background: rgba(19, 27, 46, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.16);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.38);
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    gap: 2px;
    transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.toolbox-handle:hover {
    background: rgba(30, 41, 69, 0.98);
    border-color: rgba(56, 189, 248, 0.4);
}
.floating-toolbox.left-sided .toolbox-handle {
    right: -20px;
    border-top-right-radius: 10px;
    border-bottom-right-radius: 10px;
    border-left: none;
}
.floating-toolbox.right-sided .toolbox-handle {
    left: -20px;
    border-top-left-radius: 10px;
    border-bottom-left-radius: 10px;
    border-right: none;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.38);
}

.toolbox-handle:active {
    cursor: grabbing;
}
.toolbox-handle .handle-dots {
    color: rgba(255, 255, 255, 0.42);
    font-size: 13px;
    line-height: 1;
    font-weight: bold;
}
.toolbox-handle .handle-arrow {
    color: #ffb74d;
    font-size: 9px;
    line-height: 1;
    font-weight: bold;
    transition: transform 0.3s ease;
}

/* Smart Alert Dot on Handle (pulses when a locked mistake occurs while collapsed) */
.handle-alert-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #ef4444;
    box-shadow: 0 0 8px #ef4444;
    display: none;
    margin-bottom: 2px;
}
.floating-toolbox.has-mistake-alert .handle-alert-dot {
    display: block;
    animation: pulse 1s infinite;
}
.floating-toolbox.has-mistake-alert.collapsed .toolbox-handle {
    border-color: rgba(239, 68, 68, 0.75);
    box-shadow: 0 0 14px rgba(239, 68, 68, 0.45);
}

/* Flip arrows when collapsed/expanded */
.floating-toolbox.left-sided.collapsed .handle-arrow {
    transform: rotate(0deg);
}
.floating-toolbox.left-sided:not(.collapsed) .handle-arrow {
    transform: rotate(180deg);
}
.floating-toolbox.right-sided.collapsed .handle-arrow {
    transform: rotate(180deg);
}
.floating-toolbox.right-sided:not(.collapsed) .handle-arrow {
    transform: rotate(0deg);
}

/* Slim Vertical Crystal Dock Layout */
.toolbox-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    width: 56px;
    min-width: 56px;
}

.toolbox-group-divider {
    width: 36px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.22), transparent);
    margin: 1px 0;
}

/* Compact Tile Button Styles */
.toolbox-btn {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.055) 0%, rgba(255, 255, 255, 0.02) 100%);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 12px;
    padding: 6px 3px 5px 3px;
    color: #fff;
    font-family: inherit;
    font-size: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    cursor: pointer;
    transition: background 0.18s, border-color 0.18s, transform 0.1s, box-shadow 0.18s;
    text-align: center;
    width: 54px;
    min-height: 48px;
    position: relative;
}
.toolbox-btn:hover {
    background: rgba(255, 255, 255, 0.10);
    border-color: rgba(255, 255, 255, 0.26);
    transform: translateY(-1px);
}
.toolbox-btn:active {
    transform: scale(0.95);
}
.toolbox-btn .btn-icon {
    font-size: 17px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.45));
}
.toolbox-btn .btn-label {
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.2px;
    color: rgba(241, 245, 249, 0.9);
    line-height: 1.05;
    white-space: nowrap;
}

/* Floating Corner Pill Badges */
.toolbox-btn .btn-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 17px;
    height: 15px;
    padding: 0 4px;
    border-radius: 999px;
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 0.3px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
    pointer-events: none;
    z-index: 2;
    transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}
.toolbox-btn .btn-badge.status-off {
    background: rgba(15, 23, 42, 0.94);
    color: rgba(148, 163, 184, 0.82);
    border: 1px solid rgba(255, 255, 255, 0.15);
}
.toolbox-btn .btn-badge.status-on {
    background: linear-gradient(135deg, #38bdf8, #0284c7);
    color: #ffffff;
    border: 1px solid rgba(224, 242, 254, 0.85);
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.65);
}
.toolbox-btn .btn-badge.status-auto {
    background: linear-gradient(135deg, #c084fc, #38bdf8);
    color: #0b0f19;
    border: 1px solid rgba(255, 255, 255, 0.85);
    box-shadow: 0 0 8px rgba(192, 132, 252, 0.6);
}
.toolbox-btn .btn-badge.perk-has-count {
    background: linear-gradient(135deg, #fbbf24, #d97706);
    color: #0b0f19;
    border: 1px solid rgba(254, 243, 199, 0.9);
    font-size: 9px;
}
.toolbox-btn .btn-badge.perk-empty-plus {
    background: rgba(56, 189, 248, 0.18);
    color: #7dd3fc;
    border: 1px solid rgba(56, 189, 248, 0.45);
    font-size: 10px;
}
.toolbox-btn .btn-badge.status-alert {
    background: linear-gradient(135deg, #ef4444, #b91c1c);
    color: #ffffff;
    border: 1px solid #fecaca;
}

/* Smooth Draining Countdown Bar inside 10x10 Big Brush Button */
.big-brush-progress-track {
    position: absolute;
    left: 5px;
    right: 5px;
    bottom: 2px;
    height: 3px;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.12);
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}
#btn-big-brush.active-perk .big-brush-progress-track {
    opacity: 1;
}
.big-brush-progress-fill {
    width: 100%;
    height: 100%;
    border-radius: 99px;
    background: linear-gradient(90deg, #34d399, #a7f3d0);
    box-shadow: 0 0 6px rgba(52, 211, 153, 0.8);
    transition: width 0.08s linear;
}

/* Active State Styles for tools */
#btn-clue-overlay.active-perk {
    background: rgba(56, 189, 248, 0.22) !important;
    border-color: #38bdf8 !important;
    color: #e0f2fe !important;
    box-shadow: 0 0 14px rgba(56, 189, 248, 0.35);
}
#btn-seam-ripper.active-perk {
    background: rgba(255, 183, 77, 0.20) !important;
    border-color: #ffb74d !important;
    box-shadow: 0 0 12px rgba(255, 183, 77, 0.35);
}
#btn-seam-ripper.active-perk .btn-badge {
    background: linear-gradient(135deg, #fbbf24, #ea580c);
    color: #0b0f19;
    border-color: #fef3c7;
}
#btn-big-brush.active-perk {
    background: rgba(52, 211, 153, 0.20) !important;
    border-color: #34d399 !important;
    box-shadow: 0 0 14px rgba(52, 211, 153, 0.4);
}
#btn-big-brush.active-perk .btn-badge {
    background: linear-gradient(135deg, #34d399, #059669);
    color: #052e16;
    border-color: #a7f3d0;
}
#btn-admin-brush.active-perk {
    background: rgba(255, 82, 82, 0.20) !important;
    border-color: #ff5252 !important;
    box-shadow: 0 0 12px rgba(255, 82, 82, 0.35);
}
#btn-super-show-me.active-perk {
    background: rgba(255, 235, 59, 0.20) !important;
    border-color: #fbc02d !important;
    box-shadow: 0 0 12px rgba(253, 216, 53, 0.35);
}
#btn-sparkle-visor.active-perk {
    background: rgba(192, 132, 252, 0.22) !important;
    border-color: #c084fc !important;
    box-shadow: 0 0 14px rgba(192, 132, 252, 0.45);
}
#btn-cluster-splash.active-perk {
    background: rgba(244, 63, 94, 0.28) !important;
    border-color: #f43f5e !important;
    box-shadow: 0 0 16px rgba(244, 63, 94, 0.65) !important;
    animation: splashAimPulse 1.2s ease-in-out infinite alternate;
}

@keyframes splashAimPulse {
    0% { transform: scale(1); box-shadow: 0 0 10px rgba(244, 63, 94, 0.4); }
    100% { transform: scale(1.06); box-shadow: 0 0 20px rgba(244, 63, 94, 0.85); }
}

#viewport-frame.viewport-splash-targeting,
#viewport-frame.viewport-splash-targeting canvas {
    cursor: crosshair !important;
}

/* Developer-Only Toolbox Section */
.dev-toolbox-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    margin-top: 2px;
    padding-top: 7px;
    border-top: 1px dashed rgba(255, 82, 82, 0.32);
    width: 100%;
}
.dev-toolbox-divider {
    display: flex;
    align-items: center;
    justify-content: center;
}
.dev-toolbox-divider span {
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 1px;
    color: #ff8a80;
    background: rgba(255, 82, 82, 0.14);
    border: 1px solid rgba(255, 82, 82, 0.28);
    padding: 1px 6px;
    border-radius: 999px;
}

/* Subtle Crystal Edge Flash / Glow for PEEK! Mode & Pattern Load Intro */
.peek-intro-edge-glow {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 25;
    opacity: 0;
    box-shadow:
        inset 0 0 42px rgba(56, 189, 248, 0.38),
        inset 0 0 14px rgba(224, 64, 251, 0.25);
    border: 1.5px solid rgba(56, 189, 248, 0.45);
    box-sizing: border-box;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 12px;
    will-change: opacity;
}
.peek-edge-pill {
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: 1.2px;
    color: #e0f2fe;
    background: linear-gradient(135deg, rgba(14, 116, 144, 0.88), rgba(88, 28, 135, 0.88));
    border: 1px solid rgba(125, 211, 252, 0.55);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45), 0 0 12px rgba(56, 189, 248, 0.35);
    padding: 4px 14px;
    border-radius: 999px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

/* Unlocked & Locked Avatar Grid Styles */
.profile-avatar-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 1;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.02);
}

.profile-avatar-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.profile-avatar-item:hover {
    transform: scale(1.08);
    background: rgba(255, 255, 255, 0.06);
}

.profile-avatar-item.active-avatar {
    border-color: #ffb74d;
    box-shadow: 0 0 10px rgba(255, 183, 77, 0.4);
}

.profile-avatar-item.locked-avatar {
    filter: grayscale(1) brightness(0.4);
    cursor: not-allowed;
}

.profile-avatar-item.locked-avatar::after {
    content: "🔒";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 16px;
    z-index: 2;
}

.profile-avatar-item .level-lock-badge {
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.85);
    color: #ffb74d;
    font-size: 8px;
    padding: 1px 4px;
    border-radius: 4px;
    font-weight: bold;
    white-space: nowrap;
    z-index: 3;
}

/* Compare card styling */
}
.leader-stat-cell {
    position: relative;
    border-color: #ffb74d !important;
    background: rgba(255, 183, 77, 0.08) !important;
    box-shadow: inset 0 0 8px rgba(255, 183, 77, 0.15);
}

.leader-stat-cell::after {
    content: "⭐";
    position: absolute;
    top: -4px;
    right: -4px;
    font-size: 10px;
}

/* ==========================================================================
   DYNAMIC ASYMMETRIC FLOATING CATEGORIES LAYOUT
   ========================================================================== */

/* ==========================================================================
   CONCEPT 1 WITH OPTION B: ART COLLECTIONS & BLUEPRINT EXPLORER
   ========================================================================== */

/* Section headers */
.dashboard-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.section-tag-badge {
    background: rgba(255, 183, 77, 0.12);
    border: 1px solid rgba(255, 183, 77, 0.25);
    color: #ffb74d;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    letter-spacing: 0.3px;
}

/* Option B Category Cards Grid */
#gallery-categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    width: 100%;
    box-sizing: border-box;
    margin-top: 10px;
}

.gallery-category-card.option-b {
    position: relative;
    aspect-ratio: 16 / 10;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    background-size: cover;
    background-position: center;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    transition: transform 0.28s cubic-bezier(0.25, 0.8, 0.25, 1),
                box-shadow 0.28s cubic-bezier(0.25, 0.8, 0.25, 1),
                border-color 0.28s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-sizing: border-box;
}

.gallery-category-card.option-b:hover {
    transform: translateY(-4px) scale(1.015);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.65);
    border-color: rgba(255, 183, 77, 0.45);
}

.gallery-category-card.option-b:active {
    transform: scale(0.985);
}

.category-gradient-scrim {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(10, 13, 20, 0.95) 0%, rgba(10, 13, 20, 0.6) 45%, rgba(10, 13, 20, 0.1) 80%, rgba(10, 13, 20, 0.02) 100%);
    pointer-events: none;
    transition: background 0.3s ease;
}

.gallery-category-card.option-b:hover .category-gradient-scrim {
    background: linear-gradient(to top, rgba(10, 13, 20, 0.95) 0%, rgba(10, 13, 20, 0.5) 45%, rgba(10, 13, 20, 0.05) 80%, rgba(10, 13, 20, 0) 100%);
}

.category-card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 2;
    pointer-events: none;
}

.category-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.category-emoji {
    font-size: 20px;
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.category-card-title {
    margin: 0;
    font-size: 15px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: 0.3px;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.7);
}

.category-card-meta {
    font-size: 11px;
    font-weight: 600;
    color: #ffb74d;
    letter-spacing: 0.2px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

/* Explore Blueprints Header & Search */
.explore-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.explore-header-row .dashboard-section-desc {
    margin: 3px 0 0 0;
    font-size: 12px;
    color: var(--text-muted);
}

.hub-search-container {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 24px;
    padding: 6px 14px;
    min-width: 220px;
    max-width: 320px;
    flex: 1;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.hub-search-container:focus-within {
    border-color: #ab47bc;
    background: rgba(255, 255, 255, 0.09);
    box-shadow: 0 0 12px rgba(171, 71, 188, 0.3);
}

.hub-search-icon {
    color: rgba(255, 255, 255, 0.5);
    margin-right: 8px;
    flex-shrink: 0;
}

.hub-search-input {
    background: transparent;
    border: none;
    outline: none;
    color: #ffffff;
    font-size: 13px;
    font-family: inherit;
    width: 100%;
}

.hub-search-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.hub-search-clear-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    cursor: pointer;
    padding: 0 4px;
    margin-left: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hub-search-clear-btn:hover {
    color: #fff;
}

/* Hub Filter Pills Bar */
.hub-filter-pills-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding: 6px 2px 14px 2px;
    box-sizing: border-box;
}

.hub-filter-pills-bar::-webkit-scrollbar {
    display: none;
}

.hub-pill {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
    font-weight: 700;
    padding: 7px 15px;
    border-radius: 20px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    user-select: none;
    flex-shrink: 0;
}

.hub-pill:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

.hub-pill.active {
    background: linear-gradient(135deg, #ab47bc 0%, #7b1fa2 100%);
    color: #ffffff;
    border-color: #ce93d8;
    box-shadow: 0 4px 14px rgba(171, 71, 188, 0.4);
}

/* Hub Blueprints Grid */
.hub-blueprints-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 14px;
    width: 100%;
    box-sizing: border-box;
    margin-top: 10px;
}

.hub-blueprint-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.22s cubic-bezier(0.25, 0.8, 0.25, 1),
                border-color 0.22s,
                box-shadow 0.22s;
    display: flex;
    flex-direction: column;
}

.hub-blueprint-card:hover {
    transform: translateY(-4px);
    border-color: rgba(171, 71, 188, 0.5);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
}

.hub-blueprint-card:active {
    transform: scale(0.97);
}

.bp-card-thumb-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    background: rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.bp-card-img {
    width: 82%;
    height: 82%;
    object-fit: contain;
    image-rendering: pixelated;
    transition: transform 0.25s ease;
}

.hub-blueprint-card:hover .bp-card-img {
    transform: scale(1.08);
}

.bp-card-size-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(15, 18, 28, 0.75);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.9);
    font-size: 9.5px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 8px;
    pointer-events: none;
}

.bp-card-info {
    padding: 10px 11px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
}

.bp-card-title {
    font-size: 12.5px;
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* =============================================================================
   CRYSTAL SHARDS WALLET, DAILY STREAK & PERK EMPORIUM STYLES
   ============================================================================= */

/* Header Shards & Streak Badges */
.header-shards-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.18) 0%, rgba(14, 165, 233, 0.08) 100%);
    border: 1px solid rgba(56, 189, 248, 0.35);
    padding: 4px 10px;
    border-radius: 999px;
    cursor: pointer;
    user-select: none;
    transition: transform 0.15s ease, background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
.header-shards-pill:hover {
    background: rgba(56, 189, 248, 0.28);
    border-color: #38bdf8;
    transform: translateY(-1px);
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.4);
}
.header-shards-pill .shard-gem {
    font-size: 13px;
    line-height: 1;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}
.header-shards-pill .shard-text {
    font-size: 12px;
    font-weight: 800;
    color: #e0f2fe;
    font-family: 'Segoe UI', system-ui, sans-serif;
    letter-spacing: 0.3px;
}

.header-streak-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.20) 0%, rgba(234, 88, 12, 0.08) 100%);
    border: 1px solid rgba(249, 115, 22, 0.38);
    padding: 4px 9px;
    border-radius: 999px;
    cursor: pointer;
    user-select: none;
    transition: transform 0.15s ease, background 0.18s ease, border-color 0.18s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
.header-streak-pill:hover {
    background: rgba(249, 115, 22, 0.3);
    border-color: #f97316;
    transform: translateY(-1px);
    box-shadow: 0 0 12px rgba(249, 115, 22, 0.4);
}
.header-streak-pill.streak-completed-today {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.22) 0%, rgba(22, 163, 74, 0.1) 100%);
    border-color: rgba(34, 197, 94, 0.45);
}
.header-streak-pill .streak-flame {
    font-size: 12.5px;
    line-height: 1;
}
.header-streak-pill .streak-text {
    font-size: 11px;
    font-weight: 800;
    color: #ffedd5;
}
.header-streak-pill .streak-sub {
    font-size: 10px;
    color: #fdba74;
    font-family: monospace;
    margin-left: 2px;
}
.header-streak-pill.mini-streak {
    padding: 3px 7px;
}

/* Perk Shop Modal Card & Layout */
.perk-shop-modal-card {
    position: relative;
    max-width: 540px !important;
    width: 92vw;
    border-color: rgba(168, 85, 247, 0.5) !important;
    background: rgba(13, 17, 30, 0.98) !important;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8), 0 0 35px rgba(168, 85, 247, 0.18) !important;
    padding: 18px 20px !important;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
}
.perk-shop-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-right: 36px;
    margin-bottom: 10px;
    padding-bottom: 9px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}
.perk-shop-title {
    margin: 0;
    font-family: 'Cinzel', 'Segoe UI', serif;
    font-size: clamp(15px, 4.2vw, 19px);
    font-weight: 800;
    letter-spacing: 0.4px;
    line-height: 1.2;
    background: linear-gradient(90deg, #f3e8ff 0%, #fde68a 52%, #c4b5fd 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 6px rgba(168, 85, 247, 0.35));
}
.perk-shop-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}
.perk-shop-subtitle {
    margin: 0;
    font-size: 11px;
    color: var(--text-muted);
}
.perk-shop-inline-shards {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 800;
    color: #bae6fd;
    white-space: nowrap;
}
.perk-shop-inline-shards .shard-gem {
    font-size: 13px;
    line-height: 1;
}
.perk-shop-inline-shards .shop-shards-num {
    color: #ffffff;
    font-size: 13px;
}
.perk-shop-inline-shards .shop-shards-sub {
    color: #7dd3fc;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.perk-shop-close-btn {
    position: absolute;
    top: 11px;
    right: 11px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.06);
    color: #e2e8f0;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 6;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease, color 0.15s ease;
}
.perk-shop-close-btn:hover {
    background: rgba(239, 68, 68, 0.24);
    border-color: rgba(248, 113, 113, 0.65);
    color: #ffffff;
    transform: scale(1.06);
}
@media (max-width: 520px) {
    .perk-shop-modal-card {
        padding: 14px 14px 12px 14px !important;
    }
    .perk-shop-daily-banner {
        padding: 7px 10px !important;
        margin-bottom: 8px !important;
    }
}
.perk-shop-balance-pill {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.35);
    border-radius: 14px;
    padding: 6px 14px;
    min-width: 78px;
}
.perk-shop-balance-pill .shard-gem {
    font-size: 16px;
    line-height: 1;
}
.perk-shop-balance-pill .shop-shards-num {
    font-size: 16px;
    font-weight: 900;
    color: #38bdf8;
    line-height: 1.1;
    font-family: 'Segoe UI', system-ui, sans-serif;
}
.perk-shop-balance-pill .shop-shards-sub {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    color: rgba(224, 242, 254, 0.7);
    letter-spacing: 0.6px;
}

/* Daily 1,000 Dots Challenge Banner in Store */
.perk-shop-daily-banner {
    background: linear-gradient(90deg, rgba(249, 115, 22, 0.15) 0%, rgba(234, 88, 12, 0.06) 100%);
    border: 1px solid rgba(249, 115, 22, 0.35);
    border-radius: 12px;
    padding: 10px 14px;
    margin-bottom: 14px;
    cursor: pointer;
    transition: background 0.18s, border-color 0.18s, transform 0.12s;
}
.perk-shop-daily-banner:hover {
    background: rgba(249, 115, 22, 0.22);
    border-color: #f97316;
}
.daily-banner-left {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}
.daily-streak-flame-icon {
    font-size: 22px;
    line-height: 1;
}
.daily-banner-title {
    font-size: 13px;
    font-weight: 800;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}
.streak-reward-tag {
    font-size: 10.5px;
    font-weight: 800;
    background: rgba(56, 189, 248, 0.2);
    border: 1px solid rgba(56, 189, 248, 0.4);
    color: #7dd3fc;
    padding: 1px 7px;
    border-radius: 999px;
}
.daily-banner-sub {
    font-size: 11px;
    color: var(--text-muted);
}
.daily-streak-bar-track {
    width: 100%;
    height: 5px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 99px;
    overflow: hidden;
}
.daily-streak-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #f97316, #fbbf24);
    border-radius: 99px;
    transition: width 0.3s ease;
}

.perk-shop-scroll-wrap {
    position: relative;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
#perk-store-main-view {
    overflow-y: auto;
    padding: 6px 6px 28px 4px;
    flex: 1;
    scrollbar-width: thin;
    scrollbar-color: rgba(168, 85, 247, 0.5) rgba(255, 255, 255, 0.04);
}
#perk-store-main-view::-webkit-scrollbar {
    width: 5px;
}
#perk-store-main-view::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 99px;
}
#perk-store-main-view::-webkit-scrollbar-thumb {
    background: rgba(168, 85, 247, 0.5);
    border-radius: 99px;
}
.perk-shop-scroll-hint {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 58px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 6px;
    background: linear-gradient(to bottom, rgba(13, 17, 30, 0) 0%, rgba(13, 17, 30, 0.96) 72%);
    cursor: pointer;
    z-index: 5;
    transition: opacity 0.22s ease, transform 0.22s ease;
}
.perk-shop-scroll-hint.is-hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(6px);
}
.perk-scroll-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.3px;
    color: #f3e8ff;
    background: rgba(168, 85, 247, 0.26);
    border: 1px solid rgba(192, 132, 252, 0.55);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.55);
    animation: perkScrollBob 1.8s ease-in-out infinite;
}
@keyframes perkScrollBob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(3px); }
}
.perk-store-section-label {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #cbd5e1;
    margin-bottom: 8px;
}

/* Value Bundles Grid */
.perk-bundles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 14px;
}
.perk-bundle-card {
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 12px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    transition: transform 0.15s ease, border-color 0.18s ease, background 0.18s ease;
}
.perk-bundle-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}
.featured-starter-pack {
    background: linear-gradient(135deg, rgba(234, 88, 12, 0.18) 0%, rgba(245, 158, 11, 0.08) 100%) !important;
    border: 1.5px solid rgba(245, 158, 11, 0.6) !important;
    padding: 12px 14px !important;
    margin-top: 4px !important;
    margin-bottom: 14px !important;
    box-shadow: 0 4px 18px rgba(245, 158, 11, 0.25);
}
.featured-starter-pack:hover {
    transform: none !important;
    border-color: rgba(245, 158, 11, 0.9) !important;
    box-shadow: 0 6px 24px rgba(245, 158, 11, 0.4) !important;
}
.featured-starter-pack .bundle-content-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.bundle-badge-ribbon {
    font-size: 9.5px;
    font-weight: 900;
    letter-spacing: 1px;
    color: #fef08a;
    text-transform: uppercase;
    margin-bottom: 4px;
}
.bundle-mini-ribbon {
    position: absolute;
    top: -8px;
    right: 8px;
    background: linear-gradient(135deg, #e11d48, #be123c);
    color: #fff;
    font-size: 8px;
    font-weight: 900;
    letter-spacing: 0.5px;
    padding: 2px 7px;
    border-radius: 999px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}
.featured-best-value {
    border-color: rgba(225, 29, 72, 0.4) !important;
    background: linear-gradient(180deg, rgba(225, 29, 72, 0.08) 0%, rgba(255, 255, 255, 0.03) 100%) !important;
}
.bundle-title {
    margin: 0 0 3px 0;
    font-size: 13px;
    color: #fff;
    font-weight: 800;
}
.bundle-desc {
    margin: 0 0 8px 0;
    font-size: 10px;
    color: var(--text-muted);
    line-height: 1.35;
}
.bundle-buy-btn {
    width: 100%;
    padding: 7px 10px;
    font-size: 11.5px;
    font-weight: 800;
    background: linear-gradient(135deg, #ff9800 0%, #ea580c 100%);
    box-shadow: 0 3px 12px rgba(234, 88, 12, 0.35);
    border: 1px solid #ffedd5;
}

/* Individual Perk Rows */
.perk-items-scrollable-list {
    display: flex;
    flex-direction: column;
    gap: 9px;
}
.perk-shop-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    gap: 12px;
    transition: background 0.18s, border-color 0.18s;
}
.perk-shop-item:hover {
    background: rgba(255, 255, 255, 0.055);
    border-color: rgba(255, 255, 255, 0.16);
}
.perk-shop-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}
.perk-shop-emoji {
    font-size: 20px;
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}
.perk-shop-name {
    margin: 0 0 2px 0;
    font-size: 13px;
    font-weight: 700;
    color: #f1f5f9;
}
.perk-shop-desc {
    margin: 0;
    font-size: 10.5px;
    color: var(--text-muted);
    line-height: 1.3;
    max-width: 250px;
}
.perk-shop-actions {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-shrink: 0;
}
.btn-shard-purchase {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.22) 0%, rgba(14, 165, 233, 0.12) 100%);
    border: 1px solid rgba(56, 189, 248, 0.45);
    color: #e0f2fe;
    font-size: 11px;
    font-weight: 800;
    padding: 6px 12px;
    border-radius: 999px;
    cursor: pointer;
    transition: transform 0.12s, background 0.18s, border-color 0.18s, box-shadow 0.18s;
}
.btn-shard-purchase:hover {
    background: rgba(56, 189, 248, 0.35);
    border-color: #38bdf8;
    transform: translateY(-1px);
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.45);
}
.btn-shard-purchase:active {
    transform: scale(0.96);
}
.btn-ad-free {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #94a3b8;
    font-size: 11px;
    font-weight: 700;
    padding: 6px 10px;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.18s, color 0.18s, border-color 0.18s;
}
.btn-ad-free:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.3);
}
    text-overflow: ellipsis;
}

.bp-card-pack {
    font-size: 10.5px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Load more button */
.btn-hub-load-more {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    padding: 10px 24px;
    border-radius: 24px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-hub-load-more:hover {
    background: rgba(171, 71, 188, 0.25);
    border-color: #ab47bc;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(171, 71, 188, 0.3);
}

/* ==========================================================================
   MOBILE & TABLET RESPONSIVENESS ENHANCEMENTS
   ========================================================================== */
@media (max-width: 900px) {
    #gallery-categories-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 12px;
    }
    .hub-blueprints-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 12px;
    }
}

@media (max-width: 600px) {
    .dashboard-scroll-content {
        padding: 10px 12px 60px 12px !important;
    }

    #gallery-categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .gallery-category-card.option-b {
        aspect-ratio: 16 / 11;
        border-radius: 12px;
    }

    .category-card-content {
        padding: 10px 12px;
    }

    .category-card-title {
        font-size: 13px;
    }

    .category-emoji {
        font-size: 16px;
    }

    .category-card-meta {
        font-size: 9.5px;
    }

    .hub-blueprints-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .bp-card-info {
        padding: 8px;
    }

    .bp-card-title {
        font-size: 11.5px;
    }

    .bp-card-pack {
        font-size: 9.5px;
    }

    .explore-header-row {
        flex-direction: column;
        align-items: stretch;
    }

    .hub-search-container {
        max-width: 100%;
        min-width: 0;
    }

    .in-progress-card {
        width: 210px !important;
    }
}

/* Category header back button navigation */
.category-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffb74d;
    padding: 10px 18px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    margin: 15px auto 25px auto;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.category-back-btn:hover {
    background: rgba(255, 183, 77, 0.1);
    border-color: #ffb74d;
    transform: translateX(-3px);
}

/* Resume/In-Progress Carousel Layout */
.in-progress-carousel-container {
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
    padding: 10px 5px 15px 5px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    box-sizing: border-box;
}

.in-progress-carousel-container::-webkit-scrollbar {
    display: none;
}

.in-progress-carousel-track {
    display: inline-flex;
    gap: 15px;
}

/* ==========================================================================
   COLLECTION HUB 4-TAB GEM NAVIGATION (Desktop Top Bar + Mobile Bottom Dock)
   ========================================================================== */
.hub-gem-nav-bar {
    position: absolute;
    top: 106px;
    left: 0;
    right: 0;
    height: 54px;
    z-index: 25;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0 20px;
    background: rgba(11, 15, 25, 0.92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-sizing: border-box;
}

.hub-gem-tab {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 8px 18px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.72);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.22s cubic-bezier(0.25, 0.8, 0.25, 1);
    white-space: nowrap;
}

.hub-gem-tab:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: rgba(224, 64, 251, 0.35);
    transform: translateY(-1px);
}

.hub-gem-tab.active {
    background: linear-gradient(135deg, #ab47bc 0%, #7b1fa2 100%);
    color: #fff;
    border-color: #ea80fc;
    box-shadow: 0 4px 16px rgba(171, 71, 188, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.hub-tab-icon {
    font-size: 15px;
    line-height: 1;
}

.hub-tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: linear-gradient(135deg, #ffb300, #ff6f00);
    color: #0b0f19;
    font-size: 10px;
    font-weight: 900;
    box-shadow: 0 2px 6px rgba(255, 179, 0, 0.45);
}

/* Desktop/Tablet offset for top gem nav bar */
@media (min-width: 769px) {
    #hub-view .dashboard-scroll-content {
        top: 160px;
    }
}

/* Sticky search + filter pills inside Explore tab */
#explore-blueprints-section .explore-header-row {
    position: sticky;
    top: 0;
    z-index: 12;
    background: rgba(9, 13, 22, 0.94);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 10px 0 8px 0;
    margin-top: -10px;
}

/* Crafting Empty State */
.hub-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 48px 24px;
    margin-top: 12px;
    border-radius: 20px;
    background: linear-gradient(145deg, rgba(28, 38, 68, 0.35), rgba(14, 20, 36, 0.65));
    border: 1px dashed rgba(224, 64, 251, 0.25);
}

.hub-empty-emoji {
    font-size: 46px;
    margin-bottom: 12px;
    filter: drop-shadow(0 0 14px rgba(224, 64, 251, 0.4));
}

.hub-empty-title {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 800;
    color: #fff;
}

.hub-empty-desc {
    margin: 0 0 20px 0;
    max-width: 340px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-muted);
}

.btn-hub-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 999px;
    border: 1px solid #ea80fc;
    background: linear-gradient(135deg, #ab47bc 0%, #7b1fa2 100%);
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(171, 71, 188, 0.45);
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-hub-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 26px rgba(224, 64, 251, 0.55);
}

/* Mobile Frosted-Glass Bottom App Dock */
@media (max-width: 768px) {
    .hub-gem-nav-bar {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        height: calc(64px + env(safe-area-inset-bottom, 0px));
        padding: 6px 10px calc(8px + env(safe-area-inset-bottom, 0px)) 10px;
        gap: 6px;
        justify-content: space-around;
        background: rgba(11, 15, 25, 0.88);
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
        border-bottom: none;
        border-top: 1px solid rgba(255, 255, 255, 0.12);
        box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.55);
        z-index: 90;
    }

    .hub-gem-tab {
        flex: 1;
        flex-direction: column;
        gap: 3px;
        padding: 6px 4px;
        border-radius: 14px;
        border-color: transparent;
        background: transparent;
        font-size: 10.5px;
    }

    .hub-gem-tab.active {
        background: linear-gradient(135deg, rgba(171, 71, 188, 0.32), rgba(123, 31, 162, 0.42));
        border-color: rgba(234, 128, 252, 0.55);
        box-shadow: 0 2px 12px rgba(171, 71, 188, 0.35);
    }

    .hub-tab-icon {
        font-size: 18px;
    }

    .hub-tab-badge {
        position: absolute;
        top: 3px;
        right: 14%;
        min-width: 16px;
        height: 16px;
        font-size: 9px;
    }

    #hub-view .dashboard-scroll-content {
        top: 106px;
        padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px)) !important;
    }

    #hub-view .hub-footer {
        margin-top: 28px;
        padding-bottom: 12px;
    }
}

/* ==========================================================================
   OPTIONAL SCROLLABLE BOTTOM RIBBON COLOR PICKER & SETTINGS TOGGLE
   ========================================================================== */
.palette-ribbon-dock {
    position: absolute;
    bottom: max(12px, env(safe-area-inset-bottom, 12px));
    left: 50%;
    transform: translateX(-50%);
    width: min(94vw, 820px);
    height: 76px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 22px;
    background: rgba(13, 18, 34, 0.90);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    z-index: 100;
    box-sizing: border-box;
}

.palette-ribbon-controls-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-right: 8px;
    border-right: 1px solid rgba(255, 255, 255, 0.12);
    flex-shrink: 0;
}

.ribbon-action-btn {
    width: 30px;
    height: 28px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: background 0.18s, border-color 0.18s, transform 0.15s;
}

.ribbon-action-btn:hover {
    background: rgba(224, 64, 251, 0.22);
    border-color: rgba(224, 64, 251, 0.55);
    color: #fff;
}

.ribbon-action-btn:active {
    transform: scale(0.92);
}

.palette-ribbon-track {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 4px 4px;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: rgba(224, 64, 251, 0.35) transparent;
    -webkit-overflow-scrolling: touch;
}

.palette-ribbon-track::-webkit-scrollbar {
    height: 4px;
}

.palette-ribbon-track::-webkit-scrollbar-thumb {
    background: rgba(224, 64, 251, 0.35);
    border-radius: 999px;
}

.ribbon-gem-slot {
    flex: 0 0 auto;
    width: 50px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 5px 4px;
    border-radius: 14px;
    border: 1.5px solid transparent;
    background: rgba(255, 255, 255, 0.04);
    cursor: pointer;
    transition: transform 0.18s cubic-bezier(0.2, 0.9, 0.3, 1.2), background 0.18s, border-color 0.18s, box-shadow 0.18s, opacity 0.2s;
    user-select: none;
    -webkit-user-select: none;
}

.ribbon-gem-slot:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.ribbon-gem-slot.selected {
    background: linear-gradient(145deg, rgba(171, 71, 188, 0.32), rgba(106, 27, 154, 0.45));
    border-color: #ffd54f;
    box-shadow: 0 0 14px rgba(255, 213, 79, 0.42);
    transform: translateY(-3px) scale(1.06);
}

.ribbon-gem-slot.completed {
    opacity: 0.42;
    cursor: default;
}

.ribbon-gem-slot.completed:hover {
    transform: none;
    background: rgba(255, 255, 255, 0.04);
}

.ribbon-gem-swatch {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2.5px solid rgba(255, 255, 255, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 900;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
    box-sizing: border-box;
}

.ribbon-gem-count {
    font-size: 9.5px;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1;
    white-space: nowrap;
}

.ribbon-gem-bar-track {
    width: 34px;
    height: 3px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    overflow: hidden;
}

.ribbon-gem-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #00e5ff, #ffd54f);
    transition: width 0.2s ease;
}

/* Segmented Toggle in Settings Modal */
.picker-style-segmented {
    display: inline-flex;
    padding: 3px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    gap: 4px;
    flex-shrink: 0;
}

.picker-style-btn {
    padding: 7px 12px;
    border-radius: 9px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.65);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.picker-style-btn.active {
    background: linear-gradient(135deg, #ab47bc 0%, #7b1fa2 100%);
    color: #fff;
    box-shadow: 0 3px 10px rgba(171, 71, 188, 0.45);
}

@media (max-width: 600px) {
    .palette-ribbon-dock {
        width: calc(100vw - 16px);
        height: 70px;
        bottom: max(8px, env(safe-area-inset-bottom, 8px));
        border-radius: 18px;
        padding: 5px 8px;
    }

    .ribbon-gem-slot {
        width: 45px;
    }

    .ribbon-gem-swatch {
        width: 27px;
        height: 27px;
        font-size: 10px;
    }
}
