/* ==========================================
   CARD ROYALE - MAIN CSS
   Variables, Layout Base, Componentes
   ========================================== */

:root {
    /* Colores */
    --primary: #f48fb1;
    --primary-dark: #ec6f9d;
    --secondary: #b8a4ff;
    --success: #8bd8bd;
    --danger: #ff7f8f;
    --warning: #ffd166;
    
    /* Rarezas */
    --legendary: #f7b955;
    --epic: #c39df6;
    --rare: #82c7f5;
    --common: #c8c3d9;
    
    /* Fondos */
    --app-shell-background:
        radial-gradient(circle at 18% 12%, rgba(255, 229, 240, 0.54), transparent 30%),
        radial-gradient(circle at 82% 18%, rgba(232, 226, 255, 0.5), transparent 30%),
        linear-gradient(135deg, #fffafd 0%, #fff6fa 48%, #f8f6ff 100%);
    --bg-primary: #fff7fb;
    --bg-secondary: rgba(255, 255, 255, 0.78);
    --bg-tertiary: #ffeaf3;
    
    /* Texto */
    --text-primary: #5c4052;
    --text-secondary: #8f6d82;
    --text-muted: #b38fa5;
    
    /* Bordes */
    --border: #f3c8da;
    
    /* Espaciado */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    
    /* Tipografía */
    --font-size-sm: 12px;
    --font-size-md: 14px;
    --font-size-lg: 16px;
    --font-size-xl: 20px;
    --font-size-2xl: 24px;
    --font-size-3xl: 32px;
    
    /* Transiciones */
    --transition-fast: 150ms ease;
    --transition-base: 300ms ease;
    --transition-slow: 500ms ease;
}

.admin-only {
    display: none !important;
}

body.is-creator-user .admin-only {
    display: inline-flex !important;
}

.creator-only {
    display: none !important;
}

body.is-creator-user .creator-only {
    display: block !important;
}

body.is-creator-user .profile-upload-manager-btn.creator-only {
    display: inline-flex !important;
}

/* ==========================================
   RESET Y ESTILOS GLOBALES
   ========================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overscroll-behavior-y: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
        'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
}

body {
    position: relative;
    background: var(--app-shell-background);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    overscroll-behavior-y: none;
    padding-bottom: 0;
    touch-action: manipulation;
}

/* ==========================================
   LAYOUT PRINCIPAL
   ========================================== */

#app {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.section {
    width: 100%;
    max-width: 1200px;
    padding: var(--spacing-xl);
    animation: fadeIn var(--transition-base);
}

#collection-section,
#admin-section {
    padding-bottom: 98px;
}

#collection-section.needs-top-safe,
#profile-section.needs-top-safe,
#admin-section.needs-top-safe {
    padding-top: max(var(--spacing-xl), calc(env(safe-area-inset-top) + 18px));
}

.section-full {
    min-height: 100vh;
    min-height: 100svh;
    height: 100vh;
    height: 100svh;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==========================================
   BOTONES
   ========================================== */

.btn {
    padding: var(--spacing-md) var(--spacing-lg);
    border: 2px solid transparent;
    border-radius: 8px;
    font-size: var(--font-size-md);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-transform: uppercase;
    letter-spacing: 0;
    box-shadow: 0 10px 24px rgba(196, 126, 158, 0.14);
}

.btn:hover {
    transform: translateY(-2px);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, #ff93b6, #bba7ff);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #fb7eaa, #aa95f6);
    box-shadow: 0 14px 28px rgba(236, 111, 157, 0.28);
}

.btn:disabled {
    background: #d9d5dc;
    border-color: rgba(120, 112, 124, 0.24);
    color: #817985;
    cursor: not-allowed;
    opacity: 0.72;
    box-shadow: none;
    transform: none;
}

.btn.is-withdrawable {
    box-shadow: 0 0 0 4px rgba(244, 198, 91, 0.25), 0 14px 30px rgba(236, 111, 157, 0.28);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.55);
    border-color: var(--primary);
    color: var(--primary-dark);
}

.btn-secondary:hover {
    background: #fff;
    color: white;
    color: var(--primary-dark);
}

.btn-small {
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: var(--font-size-sm);
}

#arena-back-btn,
#back-to-dashboard-btn,
#back-to-dashboard-btn-2,
#back-to-dashboard-btn-3,
#admin-back-btn {
    background: linear-gradient(135deg, #ff8fba, #f05d9d);
    border-color: rgba(255, 255, 255, 0.72);
    color: #fff;
    box-shadow: 0 12px 24px rgba(196, 86, 137, 0.18);
}

#arena-back-btn:hover,
#back-to-dashboard-btn:hover,
#back-to-dashboard-btn-2:hover,
#back-to-dashboard-btn-3:hover,
#admin-back-btn:hover {
    background: linear-gradient(135deg, #fb7eaa, #e94d91);
    color: #fff;
}

.btn-large {
    padding: var(--spacing-lg) var(--spacing-xl);
    font-size: var(--font-size-lg);
    width: 100%;
}

/* ==========================================
   LOGIN
   ========================================== */

#login-section {
    width: 100vw;
    max-width: none;
    margin: 0;
    padding: 0;
}

.login-container {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100vw;
    min-height: 100vh;
    padding: 0;
    background:
        linear-gradient(180deg, rgba(255, 246, 251, 0.76), rgba(255, 224, 239, 0.82)),
        url('../assets/images/home-background.png') center / cover no-repeat;
}

.login-container::before {
    content: '';
    position: fixed;
    inset: -12px;
    z-index: 0;
    background: url('../assets/images/home-background.png') center / cover no-repeat;
    filter: blur(10px);
    opacity: 0.34;
    transform: scale(1.03);
    pointer-events: none;
}



@media (min-width: 700px) {
    .login-container {
        background-size: auto 100%;
        background-color: #fff1f7;
    }
}

.login-card {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: none;
    backdrop-filter: none;
}

.logo {
    font-size: clamp(38px, 12vw, 72px);
    font-weight: 900;
    line-height: 1;
    color: #fff;
    text-shadow: 0 6px 22px rgba(92, 64, 82, 0.28);
    background: linear-gradient(135deg, #fff, #ffd7ec 48%, #dcd4ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: #fff;
    background-clip: text;
}

.subtitle {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xl);
    font-size: var(--font-size-lg);
}

.creator-login-btn {
    position: fixed;
    right: 16px;
    bottom: 18px;
    z-index: 2;
    border: 0;
    background: rgba(255, 255, 255, 0.64);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    padding: 8px 12px;
    border-radius: 999px;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(196, 126, 158, 0.12);
    backdrop-filter: blur(10px);
}

#login-telegram-btn {
    min-width: 132px;
    min-height: 42px;
    border: 2px solid rgba(255, 255, 255, 0.92);
    border-radius: 999px;
    padding: 10px 24px;
    background: linear-gradient(135deg, #ff93b6, #bba7ff);
    color: white;
    font-size: 14px;
    font-weight: 900;
    box-shadow: 0 14px 30px rgba(105, 55, 82, 0.18), 0 0 0 4px rgba(255, 255, 255, 0.18);
}

#login-telegram-btn:disabled {
    opacity: 0.82;
    cursor: wait;
}


.login-progress {
    position: fixed;
    left: 50%;
    bottom: max(78px, calc(env(safe-area-inset-bottom) + 56px));
    z-index: 2;
    width: min(68vw, 220px);
    height: 9px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(70, 38, 60, 0.18);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.72), 0 8px 22px rgba(70, 38, 60, 0.18);
    opacity: 0.78;
    transform: translateX(-50%) translateY(0);
    transition: opacity 180ms ease, transform 180ms ease;
    pointer-events: none;
}

.login-container.is-validating .login-progress {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.login-progress-bar {
    width: 0%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.98), rgba(255, 226, 126, 0.96));
    box-shadow: 0 0 16px rgba(255, 241, 176, 0.55);
    transition: width 320ms ease;
}

.telegram-login-widget {
    min-height: 44px;
    display: grid;
    place-items: center;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 800;
}

.telegram-login-hint {
    max-width: 260px;
    margin: -8px auto 0;
    color: rgba(107, 76, 95, 0.78);
    font-size: 12px;
    line-height: 1.35;
    font-weight: 700;
}

/* ==========================================
   DASHBOARD
   ========================================== */

.dashboard-header {
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 8;
    margin: 0;
}

#dashboard-section {
    position: relative;
    width: min(100%, 430px);
    min-height: 100vh;
    padding-top: 58px;
    margin: 0 auto;
}

#dashboard-section .dashboard-header .page-title {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

.dashboard-exit-btn {
    width: 34px;
    height: 34px;
    border: 1px solid rgba(243, 200, 218, 0.95);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.82);
    color: var(--primary-dark);
    font-size: 16px;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 12px 26px rgba(196, 126, 158, 0.14);
    backdrop-filter: blur(10px);
}

.page-title {
    font-size: var(--font-size-3xl);
    font-weight: 700;
}

.featured-packs-label {
    margin: 0;
    padding: 0;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.dashboard-box {
    width: min(100%, 430px);
    margin: 12px auto 10px;
    padding: 14px 10px 12px;
    border: 1px solid rgba(243, 200, 218, 0.86);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 18px 44px rgba(196, 126, 158, 0.13);
    backdrop-filter: blur(12px);
}

.dashboard-featured-packs .dashboard-pack-carousel {
    width: 100%;
    margin-top: 0;
    margin-bottom: -4px;
}

.dashboard-pack-carousel {
    position: relative;
    display: grid;
    grid-template-columns: minmax(280px, 640px);
    align-items: center;
    justify-content: center;
    width: min(100%, 430px);
    min-height: 330px;
    margin: 18px auto 4px;
}

.pack-stage {
    position: relative;
    height: 314px;
    cursor: grab;
    overflow: visible;
    touch-action: pan-y pinch-zoom;
    user-select: none;
}

.pack-stage.dragging {
    cursor: grabbing;
}

.pack-stage.slide-next .pack-card {
    animation: packSlideNext 520ms cubic-bezier(0.2, 0.72, 0.24, 1);
}

.pack-stage.slide-prev .pack-card {
    animation: packSlidePrev 520ms cubic-bezier(0.2, 0.72, 0.24, 1);
}

@keyframes packSlideNext {
    0% { transform: translateX(calc(var(--pack-slide-x, -50%) + 36px)) translateY(var(--pack-slide-y, 0)) scale(0.94); opacity: 0.35; }
    100% { }
}

@keyframes packSlidePrev {
    0% { transform: translateX(calc(var(--pack-slide-x, -50%) - 36px)) translateY(var(--pack-slide-y, 0)) scale(0.94); opacity: 0.35; }
    100% { }
}

.pack-stage::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 24px;
    width: 260px;
    height: 30px;
    transform: translateX(-50%);
    background: radial-gradient(ellipse, rgba(122, 77, 102, 0.2), transparent 68%);
}

.pack-card {
    position: absolute;
    top: 34px;
    left: 50%;
    width: 168px;
    height: 238px;
    padding: 0;
    border: 0;
    border-radius: 14px;
    background: transparent;
    cursor: pointer;
    filter: drop-shadow(0 22px 22px rgba(122, 77, 102, 0.24));
    transition: transform var(--transition-base), opacity var(--transition-base), filter var(--transition-base);
}

.pack-card img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 14px;
    pointer-events: none;
    -webkit-user-drag: none;
    user-select: none;
}

.pack-card-left {
    z-index: 2;
    opacity: 0.78;
    --pack-slide-x: calc(-50% - 82px);
    --pack-slide-y: 42px;
    transform: translateX(calc(-50% - 82px)) translateY(42px) rotate(-7deg) scale(0.86);
}

.pack-card-active {
    z-index: 4;
    opacity: 1;
    --pack-slide-x: -50%;
    --pack-slide-y: -18px;
    transform: translateX(-50%) translateY(-18px) scale(1.25);
    filter: drop-shadow(0 28px 26px rgba(236, 111, 157, 0.32));
}

.pack-card-right {
    z-index: 1;
    opacity: 0.78;
    --pack-slide-x: calc(-50% + 82px);
    --pack-slide-y: 42px;
    transform: translateX(calc(-50% + 82px)) translateY(42px) rotate(7deg) scale(0.86);
}

.circle-control,
.circle-action {
    width: 38px;
    height: 38px;
    border: 1px solid rgba(243, 200, 218, 0.9);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.78);
    color: var(--primary-dark);
    font-size: 20px;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 14px 28px rgba(196, 126, 158, 0.16);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

.circle-control {
    display: none;
}

.circle-control:hover,
.circle-action:hover {
    transform: translateY(-3px);
    background: #fff;
    box-shadow: 0 18px 34px rgba(236, 111, 157, 0.22);
}

.featured-packs-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: -8px auto 0;
}

.featured-open-pack-btn {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(255, 255, 255, 0.78);
    border-radius: 50%;
    color: white;
    background: linear-gradient(135deg, #ff93b6, #bba7ff);
    font-size: 17px;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 12px 24px rgba(236, 111, 157, 0.2);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.featured-open-pack-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 30px rgba(236, 111, 157, 0.28);
}

.metrics-grid {
    position: fixed;
    top: 12px;
    left: 12px;
    right: 12px;
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-bottom: 4px;
    flex-wrap: wrap;
    z-index: 5;
}

.metric-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 6px 10px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 5px;
    transition: all var(--transition-base);
    box-shadow: 0 16px 36px rgba(196, 126, 158, 0.11);
    backdrop-filter: blur(10px);
}

.metric-card:hover {
    border-color: var(--primary);
    box-shadow: 0 18px 42px rgba(236, 111, 157, 0.18);
}

.metric-label {
    color: var(--text-secondary);
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.metric-value {
    font-size: var(--font-size-md);
    font-weight: 700;
    color: var(--primary-dark);
}

.action-buttons {
    display: none;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-lg);
}

.admin-header {
    display: none;
}

.admin-lock,
.admin-builder {
    max-width: 920px;
    margin: 0 auto;
}

.admin-cache-actions {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 40px 0 4px;
    padding-top: 14px;
}

.admin-cache-actions .btn {
    width: auto;
    min-height: 30px;
    padding: 6px 10px;
    font-size: 0.72rem;
    margin: 0;
}

.admin-local-delete-btn {
    background-color: #8e6ad8;
}

.admin-global-reset-btn {
    background-color: #2f2f37;
}

.admin-lock {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

.admin-builder {
    grid-template-columns: minmax(260px, 420px) minmax(260px, 360px);
    gap: var(--spacing-xl);
    align-items: start;
}

.admin-form {
    display: grid;
    gap: var(--spacing-md);
}

.admin-form label {
    display: grid;
    gap: 6px;
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    font-weight: 700;
    text-transform: uppercase;
}

.admin-input {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.82);
    color: var(--text-primary);
    font: inherit;
}

.admin-message {
    min-height: 20px;
    color: var(--primary-dark);
    font-weight: 700;
}

#admin-creator-list {
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
}

.princess-creator-card {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid rgba(244, 143, 177, 0.28);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 10px 24px rgba(90, 54, 82, 0.06);
}

.princess-creator-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.princess-creator-title {
    min-width: 0;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
}

.admin-princess-avatar-link {
    width: 34px;
    height: 34px;
    display: inline-grid;
    place-items: center;
    overflow: hidden;
    border-radius: 50%;
    border: 1px solid rgba(244, 143, 177, 0.45);
    background: #fff2b8;
    color: #6b4600;
    font-size: 0.78rem;
    font-weight: 900;
    text-decoration: none;
    box-shadow: 0 8px 18px rgba(90, 54, 82, 0.08);
}

.admin-princess-avatar-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.admin-princess-avatar-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(216, 79, 136, 0.18);
}

.admin-princess-avatar-link.is-disabled {
    opacity: 0.55;
    pointer-events: none;
}

.princess-creator-head strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.9rem;
}

.princess-creator-head span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #8b7e8d;
    font-size: 0.74rem;
}

.princess-creator-head b {
    display: inline-grid;
    place-items: center;
    min-width: 42px;
    height: 34px;
    border-radius: 999px;
    background: #fff2b8;
    color: #6b4600;
    font-size: 0.82rem;
}

.princess-creator-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}

.princess-creator-metrics span {
    min-width: 0;
    padding: 7px 6px;
    border-radius: 8px;
    background: rgba(255, 235, 244, 0.72);
}

.princess-creator-metrics b,
.princess-creator-metrics small {
    display: block;
    overflow-wrap: anywhere;
}

.princess-creator-metrics b {
    color: var(--primary-dark);
    font-size: 0.78rem;
}

.princess-creator-metrics small {
    color: #8b7e8d;
    font-size: 0.64rem;
}

.admin-princess-withdraw-list {
    display: grid;
    gap: 5px;
    padding: 6px;
    border-radius: 8px;
    background: rgba(255, 242, 184, 0.45);
}

.admin-princess-withdraw-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 6px;
    color: #6b4600;
    font-size: 0.68rem;
    font-weight: 800;
}

.admin-princess-withdraw-row span,
.admin-princess-withdraw-row small {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-princess-withdraw-row small {
    color: #9a7a2d;
    font-size: 0.6rem;
    font-weight: 700;
}

.admin-princess-withdraw-row .btn {
    min-height: 24px;
    padding: 3px 8px;
    font-size: 0.62rem;
}

.admin-preview-wrap {
    display: flex;
    justify-content: center;
}

.admin-card-preview {
    width: min(100%, 320px);
    aspect-ratio: 3 / 4;
}

.admin-card-preview .tcg-card {
    width: 100%;
    height: 100%;
}

.admin-uploader {
    max-width: 980px;
    margin: 0 auto;
    grid-template-columns: minmax(280px, 420px) minmax(260px, 360px);
    gap: var(--spacing-xl);
    align-items: start;
}

.admin-upload-panel,
.admin-preview-panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: var(--spacing-lg);
    box-shadow: 0 22px 58px rgba(196, 126, 158, 0.16);
    backdrop-filter: blur(12px);
}

.admin-dropzone {
    min-height: 108px;
    border: 2px dashed var(--primary);
    border-radius: 10px;
    display: grid;
    place-items: center;
    color: var(--primary-dark);
    font-weight: 800;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.62);
    margin-bottom: var(--spacing-lg);
}

.admin-dropzone.drag-over {
    background: rgba(255, 234, 243, 0.9);
    border-color: var(--primary-dark);
    transform: translateY(-1px);
}

.admin-dropzone input {
    display: none;
}

.admin-meta-grid {
    display: grid;
    gap: 10px;
    margin-bottom: var(--spacing-lg);
}

.admin-meta-grid label {
    display: grid;
    grid-template-columns: 104px 1fr;
    gap: 10px;
    align-items: center;
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    font-weight: 800;
}

.admin-meta-grid label:has(#admin-meta-lot),
.admin-meta-grid label:has(#admin-meta-type) {
    display: none;
}

.admin-meta-grid .admin-input {
    padding: 9px 10px;
}

.admin-upload-preview {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: contain;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.7);
}

.admin-reader {
    max-width: 980px;
    margin: 0 auto;
}

.admin-reader > .admin-upload-panel,
.admin-reader > .admin-preview-panel {
    display: none;
}

.admin-reader-layout {
    display: block;
}

.admin-reader-dropzone {
    min-height: 160px;
    border: 1.5px dashed #d9c8d4;
    border-radius: 12px;
    display: grid;
    place-items: center;
    gap: 6px;
    text-align: center;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.54);
    color: var(--text-primary);
    transition: background var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
}

.admin-reader-dropzone.drag-over,
.admin-reader-dropzone:hover {
    background: rgba(255, 255, 255, 0.78);
    border-color: var(--primary);
}

.admin-reader-folder {
    color: var(--primary-dark);
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
}

.admin-reader-dropzone strong {
    font-size: 15px;
    font-weight: 500;
}

.admin-reader-dropzone small {
    color: var(--text-secondary);
}

.admin-stats-bar {
    display: flex;
    gap: 7px;
    margin-top: 12px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
}

.admin-stats-bar::-webkit-scrollbar {
    display: none;
}

.admin-stat {
    flex: 0 0 auto;
    min-width: 0;
    background: rgba(255, 255, 255, 0.84);
    border: 1px solid #ead8e3;
    border-radius: 8px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 12px 28px rgba(196, 126, 158, 0.11);
}

.admin-stat-wide {
    min-width: 94px;
}

.admin-stat span {
    color: var(--text-secondary);
    font-size: 11px;
    line-height: 1;
    text-transform: none;
}

.admin-stat strong {
    color: #1f1720;
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
}

.admin-filter-bar {
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.admin-filter-bar label {
    color: var(--text-secondary);
    font-size: 12px;
}

.admin-select,
.admin-search {
    width: auto;
    min-width: 150px;
    border: 1px solid #ead8e3;
    border-radius: 8px;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.84);
    color: var(--text-primary);
    font: inherit;
    font-size: 12px;
}

.admin-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    margin-top: 20px;
}

.admin-reader-card {
    display: block;
    padding: 0;
    overflow: hidden;
    border: 1px solid #ead8e3;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.72);
    text-align: left;
    cursor: pointer;
    transition: border-color var(--transition-fast), transform var(--transition-fast);
}

.admin-reader-card:hover,
.admin-reader-card.selected {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.admin-reader-card img {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    display: block;
    background: #eee;
}

.admin-reader-card-meta {
    padding: 8px 10px;
}

.admin-reader-card-meta .name {
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-reader-card-meta .sub {
    min-height: 16px;
    color: var(--text-secondary);
    font-size: 11px;
}

.admin-badge {
    display: inline-block;
    margin-top: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
}

.badge-cute { background: #fbeaf0; color: #72243e; }
.badge-sweet { background: #faeeda; color: #633806; }
.badge-lovely { background: #e6f1fb; color: #0c447c; }
.badge-special { background: #eeedfe; color: #3c3489; }
.badge-specialsoft { background: rgba(255, 181, 216, 0.28); color: #9e235f; }
.badge-limited { background: #fcebeb; color: #791f1f; }
.badge-sublime { background: linear-gradient(135deg, #fff6c9, #f4c65b); color: #5e3b00; }
.badge-legendary { background: rgba(247, 185, 85, 0.22); color: #8a5512; }
.badge-epic { background: rgba(195, 157, 246, 0.22); color: #6640a3; }
.badge-rare { background: rgba(130, 199, 245, 0.22); color: #245f8a; }
.badge-common { background: #f0f0f0; color: #666; }

.admin-detail-panel {
    display: flex;
    gap: 18px;
    align-items: flex-start;
    margin-top: 16px;
    padding: 18px;
    border: 1px solid #ead8e3;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.72);
}

.admin-detail-panel img {
    width: 130px;
    border-radius: 8px;
    border: 1px solid #ead8e3;
}

.admin-detail-data {
    flex: 1;
    min-width: 220px;
}

.admin-detail-data h3 {
    margin-bottom: 10px;
    font-size: 16px;
}

.admin-card-guided-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 8px;
    margin: 10px 0 14px;
    padding: 10px;
    border: 1px solid rgba(234, 216, 227, 0.72);
    border-radius: 8px;
    background: rgba(255, 247, 251, 0.74);
}

.admin-card-guided-fields label {
    display: grid;
    gap: 5px;
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 900;
}

.admin-card-guided-fields .admin-select {
    width: 100%;
    min-width: 0;
}

.admin-special-check {
    grid-column: 1 / -1;
    display: flex !important;
    grid-template-columns: none !important;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    padding: 8px 10px;
    border: 1px solid rgba(244, 143, 177, 0.36);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.72);
    color: var(--text-primary);
}

.admin-special-check input {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

.admin-detail-row {
    display: flex;
    gap: 10px;
    padding: 7px 0;
    border-bottom: 1px solid rgba(234, 216, 227, 0.7);
}

.admin-detail-row span {
    min-width: 80px;
    color: var(--text-secondary);
    font-size: 12px;
}

.admin-detail-row strong {
    color: var(--text-primary);
    font-size: 13px;
}

.admin-empty {
    padding: 36px 12px;
    text-align: center;
    color: var(--text-secondary);
}

.profile-shell {
    width: min(100%, 540px);
    margin: 0 auto;
    padding: 18px 14px 98px;
    display: grid;
    gap: 14px;
}

.profile-card,
.profile-referral-card,
.profile-favorites-card,
.profile-creator-shop-card,
.profile-public-card,
.profile-creator-commission-card {
    border: 1px solid rgba(234, 216, 227, 0.86);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 0 18px 44px rgba(196, 126, 158, 0.16);
}

.profile-card {
    display: grid;
    grid-template-columns: 86px 1fr;
    gap: 14px;
    align-items: center;
    padding: 14px;
}

.profile-photo {
    width: 86px;
    height: 86px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #ffd45c;
    background: #fff4da;
    box-shadow: 0 10px 24px rgba(199, 121, 18, 0.22);
}

.profile-main {
    min-width: 0;
    display: grid;
    justify-items: start;
    gap: 3px;
}

.profile-role {
    display: inline-flex;
    width: fit-content;
    min-height: 22px;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(255, 213, 92, 0.25);
    color: #8a5200;
    font-size: 0.7rem;
    font-weight: 900;
    text-transform: uppercase;
}

.profile-name {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.35rem;
    line-height: 1.1;
    overflow-wrap: anywhere;
}

.profile-username {
    display: none;
}

#creator-public-section .profile-username {
    display: none;
}

.creator-favorite-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(244, 143, 177, 0.58);
    border-radius: 50%;
    background: rgba(255, 238, 247, 0.86);
    color: #c45486;
    font: inherit;
    font-size: 18px;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
}

.creator-favorite-btn.is-active {
    border-color: rgba(160, 150, 158, 0.55);
    background: rgba(245, 244, 246, 0.94);
    color: #9b929a;
    box-shadow: none;
}

.profile-mini-stats {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 7px;
}

.profile-mini-stats div {
    min-width: 0;
    padding: 8px 6px;
    border-radius: 8px;
    background: rgba(255, 247, 251, 0.92);
    text-align: center;
}

.profile-mini-stats span {
    display: block;
    color: #271821;
    font-size: 1rem;
    font-weight: 900;
}

.profile-mini-stats small {
    display: block;
    margin-top: 2px;
    color: var(--text-secondary);
    font-size: 0.67rem;
}

.profile-referral-card,
.profile-favorites-card,
.profile-creator-shop-card,
.profile-public-card,
.profile-creator-commission-card {
    padding: 14px;
}

.profile-upload-manager-btn {
    justify-self: start;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 16px;
    border: 0;
    border-radius: 8px;
    background: linear-gradient(135deg, #ff7ab8, #f05296);
    color: #fff;
    box-shadow: 0 10px 22px rgba(217, 68, 137, 0.24);
    font-size: 0.86rem;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
}

.profile-upload-manager-btn:hover,
.profile-upload-manager-btn:focus-visible {
    background: linear-gradient(135deg, #ff8fc4, #d93f86);
    outline: none;
}

.profile-favorites-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
    gap: 8px;
}

.profile-favorite-creator {
    min-width: 0;
    min-height: 46px;
    padding: 6px 8px;
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(244, 143, 177, 0.34);
    border-radius: 999px;
    background: rgba(255, 247, 251, 0.78);
    color: #6b4560;
    font: inherit;
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
}

.profile-favorite-creator img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.profile-favorite-creator span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.creator-public-instagram {
    display: inline-flex;
    width: fit-content;
    margin-top: 6px;
    color: #b94f87;
    font-size: 12px;
    font-weight: 900;
    text-decoration: none;
}

.creator-profile-instagram {
    margin-top: 2px;
    color: #e86fa4;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.15;
    text-decoration: none;
}

.creator-public-instagram:hover {
    text-decoration: underline;
}

.profile-widget-editor {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(234, 216, 227, 0.82);
}

.profile-widget-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 10px;
}

.profile-widget-header-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.profile-widget-edit-btn {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(244, 143, 177, 0.42);
    border-radius: 999px;
    background: #fff;
    color: #9b3d6d;
    font-size: 20px;
    font-weight: 900;
    line-height: 1;
}

.profile-widget-edit-btn.is-active {
    background: rgba(244, 143, 177, 0.16);
    box-shadow: 0 0 0 3px rgba(244, 143, 177, 0.13);
}

.profile-widget-editor-card {
    position: relative;
    min-width: 0;
    padding: 12px 10px 10px 28px;
    border: 1px solid rgba(244, 143, 177, 0.32);
    border-radius: 8px;
    background: rgba(255, 247, 251, 0.88);
    cursor: default;
    touch-action: pan-y;
    user-select: none;
    transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.profile-widget-grid.is-editing .profile-widget-editor-card {
    cursor: grab;
    touch-action: none;
    border-color: rgba(185, 79, 135, 0.46);
}

.profile-widget-editor-card.is-dragging {
    opacity: 0.55;
    transform: scale(0.98);
    box-shadow: 0 12px 26px rgba(196, 126, 158, 0.22);
}

.profile-widget-drag-dot {
    position: absolute;
    left: 10px;
    top: 13px;
    width: 8px;
    height: 28px;
    border-radius: 999px;
    background: radial-gradient(circle, #b94f87 1.5px, transparent 2px) 0 0 / 8px 8px;
    opacity: 0.34;
}

.profile-widget-grid.is-editing .profile-widget-drag-dot {
    opacity: 0.9;
}

.profile-widget-editor-card strong {
    display: block;
    margin-bottom: 3px;
    color: #56314b;
    font-size: 13px;
    font-weight: 900;
}

.profile-widget-editor-card small {
    color: #9b7f91;
    font-size: 11px;
    font-weight: 800;
}

.creator-widget-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.creator-public-edit-controls {
    justify-content: flex-end;
}

.creator-public-edit-controls[hidden] {
    display: none !important;
}

.creator-widget {
    position: relative;
    min-width: 0;
    padding: 14px;
    border: 1px solid rgba(234, 216, 227, 0.86);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 18px 44px rgba(196, 126, 158, 0.13);
    transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.creator-widget-grid.is-editing .creator-widget {
    cursor: grab;
    touch-action: none;
    border-color: rgba(185, 79, 135, 0.5);
}

.creator-widget.is-dragging {
    opacity: 0.58;
    transform: scale(0.98);
    box-shadow: 0 18px 38px rgba(185, 79, 135, 0.24);
}

.creator-widget-grid.is-editing .creator-widget.is-hidden-widget {
    opacity: 0.42;
    filter: grayscale(0.35);
}

.creator-widget-drag-dot {
    position: absolute;
    right: 10px;
    top: 10px;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: rgba(255, 247, 251, 0.94);
    border: 1px solid rgba(244, 143, 177, 0.4);
}

.creator-widget-drag-dot::before {
    content: '';
    position: absolute;
    inset: 7px 9px;
    background: radial-gradient(circle, #b94f87 1.5px, transparent 2px) 0 0 / 8px 8px;
}

.creator-widget.widget-large {
    grid-column: 1 / -1;
}

.creator-widget.widget-medium {
    grid-column: span 1;
}

.creator-widget.widget-small {
    min-height: 112px;
}

.creator-widget h2 {
    margin: 8px 0 8px;
    color: #56314b;
    font-size: 18px;
    line-height: 1.1;
    overflow-wrap: anywhere;
}

.creator-profile-name-link {
    display: inline-flex;
    width: fit-content;
    border: 0;
    padding: 0;
    background: transparent;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.creator-profile-name-link:hover {
    color: #b94f87;
}

.creator-widget-profile {
    position: relative;
    display: grid;
    grid-template-columns: 86px 1fr;
    gap: 14px;
    align-items: center;
}

.creator-widget-cheapest-pack {
    display: grid;
    align-content: start;
    gap: 10px;
}

.creator-cheapest-pack {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    width: 100%;
    border: 0;
    padding: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    font: inherit;
    cursor: pointer;
}

.creator-cheapest-pack img {
    width: 68px;
    height: 96px;
    object-fit: contain;
    filter: drop-shadow(0 10px 18px rgba(196, 126, 158, 0.18));
}

.creator-cheapest-pack h2 {
    margin: 0 0 8px;
    font-size: 15px;
}

.creator-cheapest-price {
    width: fit-content;
    min-height: 24px;
    padding: 4px 9px;
    display: inline-flex;
    align-items: center;
    border: 1px solid rgba(255, 221, 236, 0.9);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: #7a4c00;
    font-size: 11px;
    font-weight: 900;
    box-shadow: 0 8px 16px rgba(196, 126, 158, 0.14);
}

.creator-widget-stats {
    grid-template-columns: repeat(2, 1fr);
    margin-top: 10px;
}

.creator-widget-pack-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 10px 0;
}

.creator-widget-pack-list span {
    max-width: 100%;
    padding: 5px 8px;
    border-radius: 999px;
    background: rgba(244, 143, 177, 0.14);
    color: #6b4560;
    font-size: 11px;
    font-weight: 900;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.creator-public-config {
    padding: 12px;
    border: 1px solid rgba(234, 216, 227, 0.86);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.82);
}

.creator-public-config[hidden] {
    display: none !important;
}

.creator-config-row {
    display: grid;
    gap: 6px;
}

.creator-config-row label {
    color: #6b4560;
    font-size: 12px;
    font-weight: 900;
}

.creator-config-row select {
    width: 100%;
    min-height: 36px;
    border: 1px solid rgba(234, 216, 227, 0.95);
    border-radius: 8px;
    background: #fff;
    color: #56314b;
    font-weight: 800;
}

.creator-config-toggles {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.creator-config-toggles label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 9px;
    border-radius: 999px;
    background: rgba(244, 143, 177, 0.12);
    color: #6b4560;
    font-size: 12px;
    font-weight: 900;
}

.creator-showcase-packs {
    display: grid;
    gap: 8px;
    margin: 10px 0 12px;
}

.creator-showcase-pack {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    width: 100%;
    border: 0;
    padding: 7px;
    border-radius: 8px;
    background: rgba(255, 247, 251, 0.9);
    color: inherit;
    text-align: left;
    font: inherit;
    cursor: pointer;
}

.creator-cheapest-pack:hover,
.creator-showcase-pack:hover {
    filter: brightness(1.02);
}

.creator-showcase-pack img {
    width: 46px;
    height: 60px;
    object-fit: contain;
}

.creator-showcase-pack strong,
.creator-showcase-pack small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.creator-showcase-pack strong {
    color: #56314b;
    font-size: 13px;
    font-weight: 900;
}

.creator-showcase-pack small {
    color: #9b7f91;
    font-size: 11px;
    font-weight: 800;
}

.creator-showcase-pack span {
    min-width: 34px;
    padding: 5px 7px;
    border-radius: 999px;
    background: rgba(255, 213, 92, 0.24);
    color: #8a5200;
    text-align: center;
    font-size: 12px;
    font-weight: 900;
}

.profile-tier-progress {
    height: 9px;
    margin-top: 12px;
    border-radius: 999px;
    background: rgba(234, 216, 227, 0.72);
    overflow: hidden;
}

.profile-tier-bar {
    width: 0%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #f48fb1, #ffd45c);
    transition: width 240ms ease;
}

.profile-tier-bar.is-boosted {
    background: linear-gradient(90deg, #ffb22e, #ffe08a);
    box-shadow: 0 0 12px rgba(255, 178, 46, 0.42);
}

.profile-withdraw-btn {
    display: inline-flex;
    margin-top: 8px;
}

.profile-withdraw-min-note {
    margin: 7px 0 0;
    color: #9b7f91;
    font-size: 0.64rem;
    font-weight: 800;
    line-height: 1.35;
}

#profile-withdraw-stars-btn.profile-withdraw-btn:disabled {
    background: #d8d2da !important;
    background-image: none !important;
    border-color: rgba(120, 112, 124, 0.24) !important;
    color: #8c8490 !important;
    cursor: not-allowed !important;
    opacity: 1;
    pointer-events: none;
    box-shadow: none !important;
    transform: none !important;
}

.withdraw-stars-modal {
    position: fixed;
    inset: 0;
    z-index: 21000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(54, 38, 52, 0.34);
}

.withdraw-stars-dialog {
    width: min(360px, 100%);
    display: grid;
    gap: 10px;
    padding: 16px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 24px 60px rgba(50, 28, 44, 0.24);
}

.withdraw-stars-head,
.withdraw-stars-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.withdraw-stars-head span {
    color: #f0629a;
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
}

.withdraw-stars-close {
    border: 0;
    background: transparent;
    color: #7f6e80;
    cursor: pointer;
    font-weight: 900;
}

.withdraw-stars-dialog strong {
    color: var(--primary-dark);
}

.withdraw-stars-dialog small {
    color: #8b7e8d;
}

.profile-referral-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.profile-referral-head h2 {
    margin: 5px 0 0;
    color: var(--text-primary);
    font-size: 1.08rem;
}

.profile-referral-head strong {
    flex: 0 0 auto;
    padding: 7px 10px;
    border-radius: 999px;
    background: linear-gradient(135deg, #ffd45c, #f39a2f);
    color: #3d2500;
    font-size: 0.82rem;
    box-shadow: 0 8px 18px rgba(207, 130, 28, 0.2);
}

.profile-referral-row {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) auto auto;
    gap: 8px;
    align-items: center;
    margin-top: 8px;
}

.profile-referral-row + .profile-referral-row {
    grid-template-columns: 52px minmax(0, 1fr);
}

.profile-referral-row label {
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 800;
}

.profile-referral-input {
    min-width: 0;
    width: 100%;
    height: 36px;
    border: 1px solid rgba(234, 216, 227, 0.96);
    border-radius: 8px;
    padding: 0 10px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-primary);
    font-size: 0.82rem;
}

.profile-referral-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.profile-referral-stats span {
    padding: 6px 9px;
    border-radius: 999px;
    background: rgba(244, 143, 177, 0.14);
    color: var(--text-secondary);
    font-size: 0.76rem;
}

.profile-referral-stats b {
    color: var(--text-primary);
}

.profile-referral-details {
    margin-top: 10px;
}

.profile-referral-details summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 38px;
    padding: 0 12px;
    border: 1px solid rgba(234, 216, 227, 0.86);
    border-radius: 8px;
    background: rgba(255, 247, 251, 0.78);
    color: var(--text-primary);
    font-size: 0.82rem;
    font-weight: 900;
    cursor: pointer;
    list-style: none;
}

.profile-referral-details summary::-webkit-details-marker {
    display: none;
}

.profile-referral-details summary::after {
    content: "+";
    display: inline-grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(244, 143, 177, 0.18);
    color: var(--primary-dark);
    font-size: 1rem;
    line-height: 1;
}

.profile-referral-details[open] summary::after {
    content: "-";
}

.profile-invited-list,
.profile-commission-list {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.profile-invited-item,
.profile-commission-item {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) minmax(118px, auto);
    align-items: center;
    gap: 8px;
    padding: 8px;
    border: 1px solid rgba(234, 216, 227, 0.78);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.7);
}

.profile-invited-item img,
.profile-commission-item img {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    background: #fff4da;
}

.profile-invited-item strong,
.profile-invited-item small,
.profile-commission-item strong,
.profile-commission-item small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-invited-item strong,
.profile-commission-item strong {
    color: var(--text-primary);
    font-size: 0.82rem;
}

.profile-invited-item small,
.profile-commission-item small {
    color: var(--text-secondary);
    font-size: 0.68rem;
}

.profile-invited-metrics,
.profile-commission-metrics {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 5px;
    min-width: 0;
}

.profile-invited-metrics span,
.profile-commission-metrics span,
.profile-commission-metrics b {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 7px;
    border-radius: 999px;
    background: rgba(255, 213, 92, 0.2);
    color: #6f4300;
    font-size: 0.68rem;
    font-weight: 900;
    white-space: nowrap;
}

.profile-commission-title {
    margin-top: 4px;
    color: var(--text-primary);
    font-size: 0.82rem;
    font-weight: 900;
}

.profile-commission-main {
    min-width: 0;
}

.profile-commission-metrics b {
    background: linear-gradient(135deg, #ffd45c, #f39a2f);
    color: #3d2500;
}

.profile-invited-empty {
    padding: 12px;
    border-radius: 8px;
    background: rgba(255, 247, 251, 0.8);
    color: var(--text-secondary);
    text-align: center;
    font-size: 0.8rem;
}

.profile-referral-message {
    min-height: 18px;
    margin: 12px 0 0;
    color: var(--primary-dark);
    font-size: 0.72rem;
    font-weight: 700;
}

.profile-reset-note {
    margin: 7px 0 0;
    color: #9b929f;
    font-size: 0.62rem;
    line-height: 1.35;
    font-weight: 600;
    letter-spacing: 0;
}

/* ==========================================
   GACHA
   ========================================== */

.gacha-header {
    min-height: 0;
    margin: 0;
}

.gacha-header .page-title {
    display: none;
}

#back-to-dashboard-btn {
    display: none !important;
}

.gacha-skip-inline-btn {
    align-self: center;
    margin-top: 8px;
    visibility: hidden;
    background: linear-gradient(135deg, #ff8fba, #f05d9d);
    border-color: rgba(255, 255, 255, 0.75);
    color: #fff;
    box-shadow: 0 12px 24px rgba(196, 86, 137, 0.18);
}

.gacha-skip-inline-btn:hover {
    background: linear-gradient(135deg, #fb7eaa, #e94d91);
    color: #fff;
}

.mobile-bottom-nav {
    position: fixed;
    left: 50%;
    bottom: calc(10px + env(safe-area-inset-bottom));
    z-index: 30;
    width: min(calc(100% - 24px), 430px);
    height: 62px;
    transform: translateX(-50%);
    display: none;
    grid-template-columns: repeat(5, 1fr);
    align-items: center;
    gap: 5px;
    padding: 7px 8px;
    border: 1px solid rgba(243, 200, 218, 0.86);
    border-radius: 22px;
    background: rgba(255, 252, 254, 0.92);
    box-shadow: 0 18px 44px rgba(196, 126, 158, 0.2);
    backdrop-filter: blur(14px);
}

body.is-app-view:not(.is-login-view) .mobile-bottom-nav {
    display: grid;
}

body:not(.is-app-view) .dashboard-exit-btn {
    display: none;
}

.mobile-bottom-nav button {
    display: grid;
    place-items: center;
    height: 48px;
    border: 0;
    border-radius: 16px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 21px;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
}

.nav-home-icon,
.nav-shop-icon,
.nav-card-icon,
.nav-discover-icon,
.nav-profile-icon,
.nav-admin-icon {
    display: block;
    width: 26px;
    height: 26px;
    background-color: transparent;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    filter: drop-shadow(0 5px 8px rgba(183, 99, 139, 0.18));
}

.nav-home-icon {
    background-image: url('../assets/images/menu/home-menu-v2.webp');
}

.nav-card-icon {
    background-image: url('../assets/images/menu/cards-menu-v2.webp');
}

.nav-discover-icon {
    background-image: url('../assets/images/menu/explora-menu-v2.webp');
}

.nav-shop-icon {
    background-image: url('../assets/images/menu/tienda-menu-v2.webp');
}

.nav-profile-icon {
    background-image: url('../assets/images/menu/profile-menu-v2.webp');
}

.nav-admin-icon {
    -webkit-mask-image: url('../assets/icons/admin.png');
    mask-image: url('../assets/icons/admin.png');
}

.mobile-bottom-nav button:hover,
.mobile-bottom-nav button:focus-visible {
    background: var(--bg-tertiary);
    color: var(--primary-dark);
    outline: none;
}

body.is-login-view .mobile-bottom-nav,
#login-section ~ .mobile-bottom-nav {
    display: none;
}

.discover-shell {
    width: min(100%, 560px);
    margin: 0 auto;
    padding: 18px 10px 98px;
    display: grid;
    gap: 14px;
    overflow: visible;
}

#discover-section {
    overflow: visible;
}

.discover-header {
    padding: 0 4px;
}

#discover-section .discover-header {
    min-height: 0;
}

.discover-feed {
    display: grid;
    gap: 12px;
    overflow: visible;
}

.discover-card {
    display: grid;
    gap: 10px;
    touch-action: pan-y;
    transition: transform 180ms ease, opacity 180ms ease;
}

.discover-card.is-dragging {
    transition: none;
}

.discover-card-image-btn {
    width: 100%;
    min-height: min(72vh, 760px);
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
    overflow: visible;
    box-shadow: none;
}

.discover-card-image-btn img {
    width: 100%;
    height: min(72vh, 760px);
    display: block;
    object-fit: contain;
    filter: drop-shadow(0 18px 28px rgba(92, 64, 82, 0.18));
}

.discover-creator-row {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid rgba(234, 216, 227, 0.86);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-primary);
    text-align: left;
    cursor: pointer;
}

.discover-creator-main {
    min-width: 0;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
}

.discover-creator-main img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    background: #fff4da;
}

.discover-creator-row strong,
.discover-creator-row small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.discover-action-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.discover-vote-btn,
.discover-star-btn,
.discover-heart-count,
.creator-favorite-btn,
.creator-like-btn {
    border: 0;
    border-radius: 8px;
    background: rgba(255, 247, 251, 0.94);
    color: #b65b86;
    font-weight: 900;
    cursor: pointer;
}

.discover-vote-btn {
    min-height: 42px;
    font-size: 24px;
}

.discover-like-btn,
.discover-heart-count.is-active,
.creator-like-btn.is-active {
    background: rgba(255, 232, 244, 0.96);
    color: #e63886;
}

.discover-dislike-btn {
    color: #8b8190;
}

.discover-star-btn,
.discover-heart-count {
    min-width: 38px;
    min-height: 38px;
    padding: 0 10px;
}

.discover-star-btn.is-active,
.creator-favorite-btn.is-active {
    background: rgba(255, 245, 205, 0.98);
    color: #d89400;
}

.creator-profile-actions {
    display: inline-flex;
    gap: 8px;
    margin-top: 8px;
}

.creator-profile-actions .creator-favorite-btn {
    position: static;
    top: auto;
    right: auto;
}

.creator-favorite-btn,
.creator-like-btn {
    width: 36px;
    height: 36px;
    font-size: 18px;
}

.creator-heart-meter {
    display: inline-flex;
    width: fit-content;
    margin-top: 6px;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(255, 232, 244, 0.9);
    color: #c5427d;
    font-size: 12px;
    font-weight: 900;
}

.discover-creator-row strong {
    font-size: 14px;
    font-weight: 900;
}

.discover-creator-row small {
    margin-top: 2px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 800;
}

.discover-creator-setup[hidden] {
    display: none !important;
}

.discover-setup-card {
    padding: 14px;
    border: 1px solid rgba(234, 216, 227, 0.86);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 18px 44px rgba(196, 126, 158, 0.12);
}

.discover-setup-card h2 {
    margin: 4px 0 0;
    color: var(--text-primary);
    font-size: 17px;
    line-height: 1.15;
}

.discover-setup-compact {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
}

.discover-select-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 12px 0;
}

.discover-select-card {
    min-width: 0;
    display: grid;
    gap: 6px;
    padding: 7px;
    border: 1px solid rgba(234, 216, 227, 0.86);
    border-radius: 8px;
    background: rgba(255, 247, 251, 0.82);
    cursor: pointer;
}

.discover-select-card:has(input:checked) {
    border-color: #f05f9e;
    background: rgba(255, 234, 247, 0.96);
    box-shadow: 0 12px 26px rgba(240, 95, 158, 0.18);
}

.discover-select-card input {
    justify-self: end;
}

.discover-select-image {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: contain;
}

.discover-select-card span {
    min-width: 0;
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 900;
    line-height: 1.15;
    text-align: center;
    overflow-wrap: anywhere;
}

.discover-presentation-sheet {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: grid;
    align-items: end;
}

.discover-presentation-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(80, 45, 68, 0.26);
}

.discover-presentation-panel {
    position: relative;
    height: min(80vh, 720px);
    padding: 16px;
    border-radius: 22px 22px 0 0;
    border: 1px solid rgba(244, 172, 206, 0.72);
    background: rgba(255, 250, 253, 0.98);
    box-shadow: 0 -22px 54px rgba(159, 90, 126, 0.2);
    overflow: hidden;
}

.discover-presentation-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.discover-presentation-head h2 {
    margin: 3px 0 0;
    font-size: 18px;
    color: var(--text-primary);
}

.discover-presentation-close {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(244, 172, 206, 0.78);
    border-radius: 999px;
    background: #fff;
    color: var(--accent-pink);
    font-size: 24px;
    font-weight: 900;
    line-height: 1;
}

.discover-select-grid-sheet {
    height: calc(100% - 74px);
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    padding: 2px 2px 22px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.discover-select-grid-sheet .discover-select-card {
    border-radius: 10px;
    text-align: center;
}

.discover-empty {
    min-height: 62vh;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 14px;
    padding: 24px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.88);
    text-align: center;
}

.discover-empty p {
    margin: 0;
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 900;
}

.discover-liked-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 80;
    min-height: 80vh;
    padding: 14px;
    border-radius: 18px 18px 0 0;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 -18px 46px rgba(89, 53, 75, 0.24);
}

.discover-liked-sheet[hidden] {
    display: none !important;
}

.discover-liked-panel {
    max-width: 560px;
    margin: 0 auto;
    display: grid;
    gap: 12px;
}

.discover-liked-panel h2 {
    margin: 0;
    font-size: 18px;
}

.discover-liked-close {
    justify-self: end;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 232, 244, 0.95);
    color: #c5427d;
    font-size: 22px;
    font-weight: 900;
}

.discover-liked-grid {
    max-height: calc(80vh - 92px);
    overflow: auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.discover-liked-card {
    min-width: 0;
    display: grid;
    gap: 6px;
    padding: 8px;
    border: 1px solid rgba(234, 216, 227, 0.86);
    border-radius: 8px;
    background: rgba(255, 247, 251, 0.86);
    color: var(--text-primary);
    font-weight: 900;
}

.discover-liked-card img {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: contain;
}

@media (max-width: 560px) {
    .discover-shell {
        padding: max(68px, calc(env(safe-area-inset-top, 0px) + 42px)) 8px 94px;
        gap: 8px;
    }

    #discover-section .discover-header {
        padding: 0 6px;
    }

    #discover-section .discover-header .shop-kicker {
        font-size: 12px;
    }

    .discover-card,
    .discover-feed {
        gap: 8px;
    }

    .discover-card-image-btn,
    .discover-card-image-btn img {
        height: min(55vh, 500px);
        min-height: 0;
    }

    .discover-action-row {
        gap: 8px;
    }

    .discover-vote-btn {
        min-height: 38px;
        font-size: 22px;
    }

    .discover-creator-row {
        padding: 7px 9px;
    }

    .discover-creator-main {
        grid-template-columns: 40px minmax(0, 1fr);
    }

    .discover-creator-main img {
        width: 40px;
        height: 40px;
    }

    .discover-select-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .discover-select-grid-sheet {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.gacha-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    min-height: calc(100svh - 84px);
    padding: max(6px, env(safe-area-inset-top)) var(--spacing-lg) calc(92px + env(safe-area-inset-bottom));
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
}

.envelope-wrapper,
.card-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-md);
}

.envelope-wrapper {
    --gacha-envelope-w: min(calc(100vw - 104px), 222px, 34svh);
    --gacha-envelope-h: calc(var(--gacha-envelope-w) * 1.4167);
    position: static;
    width: 100%;
    min-height: 0;
    padding-top: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
    touch-action: manipulation;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: clamp(210px, 34svh, 340px);
    z-index: 0;
    pointer-events: none;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 420' preserveAspectRatio='none'%3E%3Cpath fill='%23ffd8e9' fill-opacity='0.74' d='M0 0H1440V210C1308 244 1190 229 1078 194C938 150 838 171 716 219C579 273 458 253 331 205C209 159 103 174 0 235V0Z'/%3E%3C/svg%3E") top center / 100% 100% no-repeat;
}

.envelope-wrapper .envelope-3d-perspective {
    position: relative;
    top: auto;
    left: auto;
    margin-left: 0;
    margin-top: clamp(-28px, -4svh, -10px);
    margin-bottom: clamp(8px, 1.4svh, 14px);
    z-index: 2;
}

.hint-text {
    color: var(--text-secondary);
    font-size: var(--font-size-md);
    text-align: center;
}

.hint-open-text {
    margin: -2px 0 0;
    color: #b85a83;
    font-size: 13px;
    font-weight: 900;
}

.hint-open-button {
    min-width: 112px;
    min-height: 38px;
    margin: 0;
    padding: 9px 22px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, #ff8fba, #f05d9d);
    color: #fff;
    font: inherit;
    font-size: 13px;
    font-weight: 900;
    line-height: 1;
    box-shadow: 0 14px 28px rgba(196, 86, 137, 0.2);
    cursor: pointer;
}

.hint-open-button:active {
    transform: translateY(1px);
}

.gacha-actions {
    width: 100%;
    max-width: 400px;
}

.gacha-pack-info {
    width: min(100%, 390px);
    margin-top: 6px;
    padding: 0;
    display: grid;
    justify-items: center;
    gap: 5px;
}

.gacha-pack-info[hidden] {
    display: none !important;
}

.gacha-info-creator {
    max-width: 100%;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 3px 10px 3px 4px;
    border: 1px solid rgba(243, 200, 218, 0.86);
    border-radius: 999px;
    background: rgba(255, 236, 247, 0.96);
    color: #c45486;
    font-size: 11px;
    font-weight: 900;
    box-shadow: 0 10px 22px rgba(196, 126, 158, 0.08);
    cursor: pointer;
    overflow: hidden;
}

.gacha-info-creator img {
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    border-radius: 50%;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.82);
}

.gacha-info-creator span {
    min-width: 0;
    display: block;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}

.gacha-info-creator:active {
    transform: translateY(1px);
}

.gacha-info-cost {
    display: flex;
    grid-template-columns: auto auto;
    align-items: center;
    justify-content: center;
    gap: 5px;
    opacity: 0.76;
}

.gacha-info-price,
.gacha-info-cards {
    min-height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 7px;
    border-radius: 999px;
    background: rgba(255, 247, 251, 0.68);
    color: #6f4d63;
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
    box-shadow: 0 10px 22px rgba(196, 126, 158, 0.1);
}

.gacha-info-price {
}

.gacha-info-cards {
    min-width: 54px;
}

.gacha-info-price .coin-mini {
    width: 12px;
    height: 12px;
    margin-right: 3px;
}

.gacha-info-panel {
    width: min(100%, 330px);
    display: grid;
    justify-items: center;
    padding: 11px 14px;
    border: 1px solid rgba(255, 214, 232, 0.76);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.72);
    box-shadow: 0 14px 34px rgba(196, 126, 158, 0.08);
    backdrop-filter: blur(6px);
}

.gacha-info-panel[hidden] {
    display: none !important;
}

.gacha-info-description {
    max-width: 100%;
    margin: 0;
    color: #8f6d82;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.45;
    text-align: center;
    opacity: 0.82;
}

.gacha-info-description span {
    display: inline;
}

.gacha-info-description strong {
    color: #a35d80;
    font-weight: 900;
}

.gacha-bottom-actions {
    position: fixed;
    left: 50%;
    bottom: var(--gacha-bottom-actions-bottom, 72px);
    z-index: 31;
    width: min(100%, 330px);
    display: grid;
    grid-template-columns: minmax(78px, 1fr) 42px minmax(78px, 1fr);
    align-items: center;
    gap: 8px;
    transform: translateX(-50%);
    pointer-events: auto;
    visibility: visible;
}

#gacha-section {
    overflow: visible;
}

#gacha-section .envelope-wrapper {
    gap: clamp(6px, 1.1svh, 10px);
}

.gacha-bottom-btn {
    min-width: 0;
    height: 32px;
    border: 1px solid rgba(244, 143, 177, 0.34);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.78);
    color: #b44d7a;
    font: inherit;
    font-size: 10px;
    font-weight: 900;
    box-shadow: 0 12px 26px rgba(196, 126, 158, 0.12);
    backdrop-filter: blur(10px);
    cursor: pointer;
    pointer-events: auto;
}

.gacha-bottom-info {
    justify-self: start;
    padding: 0 11px;
}

.gacha-bottom-shop {
    justify-self: end;
    padding: 0 11px;
}

.gacha-bottom-back {
    width: 42px;
    height: 42px;
    display: inline-grid;
    place-items: center;
    border-color: rgba(244, 143, 177, 0.6);
    background: linear-gradient(135deg, #ff8fba, #f05d9d);
    color: #fff;
    font-size: 18px;
    box-shadow: 0 14px 28px rgba(196, 86, 137, 0.2);
}

.gacha-bottom-btn.is-active {
    background: rgba(255, 236, 247, 0.94);
    color: #8f335f;
    border-color: rgba(244, 143, 177, 0.62);
}

.gacha-bottom-btn[hidden] {
    display: none !important;
}

/* ==========================================
   COLECCIÓN
   ========================================== */

.collection-header {
    display: none;
}

.rarity-filter {
    display: flex;
    gap: var(--spacing-md);
    margin-top: max(10px, env(safe-area-inset-top));
    margin-bottom: var(--spacing-xl);
    flex-wrap: wrap;
}

.collection-owned-toggle {
    min-height: 42px;
    padding: 0 14px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 1px solid rgba(244, 143, 177, 0.36);
    border-radius: 999px;
    background: rgba(255, 247, 251, 0.78);
    color: #6b4560;
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

.collection-owned-toggle input {
    accent-color: #f48fb1;
}

@media (max-width: 520px) {
    .collection-owned-toggle {
        flex: 0 0 auto;
        min-height: 34px;
        padding: 0 11px;
        font-size: 11px;
    }

    .collection-card-row {
        grid-template-columns: repeat(auto-fill, minmax(46px, 1fr));
        gap: 7px;
    }
}

.collection-season-progress {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: -12px 0 18px;
}

.season-progress-pill {
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid #ead8e3;
    border-radius: 8px;
    padding: 7px 10px;
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 800;
}

.filter-btn {
    padding: var(--spacing-sm) var(--spacing-md);
    border: 2px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-weight: 600;
}

.filter-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.filter-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.collection-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.collection-model-section {
    display: grid;
    gap: 10px;
}

.collection-model-section > h2 {
    margin: 0;
    color: #4f3347;
    font-size: 18px;
    font-weight: 900;
}

.collection-set-list {
    display: grid;
    gap: 12px;
}

.collection-set-section {
    padding: 10px;
    border: 1px solid rgba(244, 143, 177, 0.28);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.54);
}

.collection-set-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.collection-set-header h3 {
    margin: 0;
    color: #6b4560;
    font-size: 13px;
    font-weight: 900;
}

.collection-set-header span {
    color: #9b778d;
    font-size: 11px;
    font-weight: 800;
}

.collection-card-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(54px, 1fr));
    gap: 8px;
}

/* ==========================================
   RESPONSIVE
   ========================================== */

@media (max-width: 768px) {
    .section {
        padding: var(--spacing-lg);
    }

    #collection-section.needs-top-safe,
    #profile-section.needs-top-safe,
    #admin-section.needs-top-safe {
        padding-top: max(var(--spacing-lg), calc(env(safe-area-inset-top) + 22px));
    }
    
    .page-title {
        font-size: var(--font-size-2xl);
    }

    .dashboard-pack-carousel {
        grid-template-columns: minmax(220px, 1fr);
        min-height: 260px;
        gap: var(--spacing-sm);
        margin-top: 18px;
    }

    .pack-stage {
        height: 250px;
    }

    .pack-card {
        width: 122px;
        height: 174px;
    }

    .pack-card-left {
        transform: translateX(calc(-50% - 64px)) translateY(34px) rotate(-7deg) scale(0.82);
    }

    .pack-card-right {
        transform: translateX(calc(-50% + 64px)) translateY(34px) rotate(7deg) scale(0.82);
    }

    .circle-control,
    .circle-action {
        width: 42px;
        height: 42px;
    }
    
    .metrics-grid {
        grid-template-columns: 1fr;
    }
    
    .login-card {
        padding: var(--spacing-lg);
    }

    .admin-uploader,
    .admin-builder {
        grid-template-columns: 1fr;
    }

    .admin-meta-grid label {
        grid-template-columns: 92px 1fr;
    }

    .admin-detail-panel {
        flex-direction: column;
    }

    .admin-detail-panel img {
        width: min(180px, 100%);
    }
}

@media (max-width: 480px) {
    :root {
        --spacing-xl: 16px;
        --spacing-lg: 12px;
        --font-size-3xl: 24px;
    }
    
    .section {
        padding: var(--spacing-lg);
    }
    
    .btn-large {
        padding: var(--spacing-md) var(--spacing-lg);
    }

    .dashboard-pack-carousel {
        grid-template-columns: minmax(190px, 1fr);
        min-height: 250px;
    }

    .metrics-grid {
        top: 10px;
        left: 8px;
        right: 8px;
    }

    .pack-card-left {
        transform: translateX(calc(-50% - 54px)) translateY(30px) rotate(-7deg) scale(0.8);
    }

    .pack-card-right {
        transform: translateX(calc(-50% + 54px)) translateY(30px) rotate(7deg) scale(0.8);
    }
}

.admin-library {
    margin-top: 26px;
    padding-top: 22px;
    border-top: 1px solid rgba(234, 216, 227, 0.9);
}

.admin-library-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.admin-header-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.admin-cache-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.admin-library-header h2 {
    margin: 2px 0 0;
    color: var(--text-primary);
    font-size: 20px;
    line-height: 1.15;
}

.admin-library-stats {
    margin-top: 0;
}

.admin-library-grid {
    margin-top: 14px;
}

.admin-saved-card .sub {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.admin-saved-card {
    position: relative;
}

.admin-saved-card-preview-btn {
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
}

.admin-card-edit-btn {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
    min-width: 52px;
    height: 28px;
    padding: 0 10px;
    border: 1.5px solid rgba(244, 143, 177, 0.72);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.94);
    color: #f05f9e;
    font-size: 10px;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 10px 22px rgba(196, 126, 158, 0.12);
}

.admin-edit-modal {
    position: fixed;
    inset: 0;
    z-index: 10020;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(40, 24, 36, 0.62);
    backdrop-filter: blur(10px);
}

.admin-edit-dialog {
    width: min(520px, 100%);
    max-height: min(88vh, 720px);
    overflow: auto;
    padding: 18px;
    border: 1px solid rgba(244, 143, 177, 0.36);
    border-radius: 18px;
    background: rgba(255, 250, 253, 0.98);
    box-shadow: 0 26px 70px rgba(96, 42, 72, 0.22);
}

.admin-edit-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.admin-edit-header h2 {
    margin: 0;
    font-size: 18px;
    color: var(--text-primary);
}

.admin-edit-close {
    width: 34px;
    height: 34px;
    border: 1px solid rgba(244, 143, 177, 0.5);
    border-radius: 999px;
    background: #fff;
    color: #bf5f8a;
    font-weight: 900;
    cursor: pointer;
}

.admin-edit-card-image {
    width: min(180px, 44vw);
    aspect-ratio: 2 / 3;
    object-fit: cover;
    display: block;
    margin: 0 auto 14px;
    border-radius: 12px;
    box-shadow: 0 16px 36px rgba(196, 126, 158, 0.18);
}

.admin-edit-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.admin-edit-grid label {
    display: grid;
    gap: 5px;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 800;
}

.admin-saved-card .admin-badge {
    margin-top: 0;
    white-space: nowrap;
}

.card-preview-modal {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(40, 24, 36, 0.62);
    backdrop-filter: blur(10px);
}

.card-preview-image {
    width: min(86vw, 420px);
    max-height: 86vh;
    object-fit: contain;
    border-radius: 14px;
}

.collection-preview-content {
    position: relative;
    transform-style: preserve-3d;
    perspective: 900px;
    cursor: grab;
    transition: transform 170ms ease, opacity 170ms ease;
    will-change: transform, opacity;
    touch-action: none;
}

.collection-preview-content.is-grabbing {
    cursor: grabbing;
    transition: none;
}

body.collection-preview-open {
    overflow: hidden;
    overscroll-behavior: none;
}

.collection-preview-content.slide-left {
    opacity: 0;
    transform: translateX(-54px) rotateY(-8deg);
}

.collection-preview-content.slide-right {
    opacity: 0;
    transform: translateX(54px) rotateY(8deg);
}

.collection-preview-content.enter-left {
    animation: previewEnterLeft 180ms ease-out;
}

.collection-preview-content.enter-right {
    animation: previewEnterRight 180ms ease-out;
}

@keyframes previewEnterLeft {
    from { opacity: 0; transform: translateX(-54px) rotateY(-8deg); }
    to { opacity: 1; transform: translateX(0) rotateY(0); }
}

@keyframes previewEnterRight {
    from { opacity: 0; transform: translateX(54px) rotateY(8deg); }
    to { opacity: 1; transform: translateX(0) rotateY(0); }
}

.full-art-sublime-media {
    border-radius: 12px;
    object-fit: cover;
    background: linear-gradient(145deg, #fff6cf, #e6b84f);
}

.full-art-sublime-preview {
    width: min(86vw, 420px);
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 16px;
    box-shadow: 0 28px 80px rgba(124, 80, 12, 0.42), inset 0 0 0 2px rgba(255, 246, 201, 0.8);
}

.card-preview-close {
    position: fixed;
    top: 18px;
    right: 18px;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.86);
    color: var(--primary-dark);
    font-size: 24px;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
}

@media (max-width: 480px) {
    .admin-library-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .admin-library-header .btn {
        width: 100%;
    }

    .admin-header-actions {
        width: 100%;
    }
}


#shop-section {
    width: min(100%, 980px);
    padding-bottom: 98px;
}

.shop-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.shop-kicker {
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.shop-total-card,
.shop-stat {
    border: 1px solid rgba(243, 200, 218, 0.9);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.76);
    box-shadow: 0 14px 32px rgba(196, 126, 158, 0.12);
}

.shop-total-card {
    min-width: 86px;
    padding: 10px 12px;
    text-align: center;
}

.shop-total-card span,
.shop-stat span {
    display: block;
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
}

.shop-total-card strong {
    color: var(--primary-dark);
    font-size: 24px;
    line-height: 1.1;
}

.shop-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 18px;
}

.shop-stat {
    padding: 9px 10px;
}

.shop-stat strong {
    color: var(--text-primary);
    font-size: 15px;
}

.shop-grid {
    display: grid;
    gap: 18px;
}

.shop-model-section {
    display: grid;
    gap: 10px;
}

.shop-model-section h2 {
    color: var(--text-primary);
    font-size: 18px;
    line-height: 1.2;
}

.shop-set-list {
    display: grid;
    gap: 12px;
}

.shop-set-section {
    padding: 12px;
    border: 1px solid rgba(234, 216, 227, 0.92);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.58);
}

.shop-set-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}

.shop-set-header h3 {
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 900;
    text-transform: uppercase;
}

.shop-set-header span {
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 900;
}

.shop-set-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.shop-card-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(54px, 1fr));
    gap: 8px;
}

.shop-card {
    position: relative;
    width: 100%;
    aspect-ratio: 2 / 3;
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(234, 216, 227, 0.96);
    border-radius: 6px;
    background: #fff;
    cursor: default;
    box-shadow: 0 10px 20px rgba(122, 77, 102, 0.1);
}

.shop-card.is-owned {
    cursor: pointer;
    border-color: rgba(244, 143, 177, 0.8);
}

.shop-card.is-sublime-reward {
    border-color: rgba(220, 170, 54, 0.95);
    background: linear-gradient(145deg, #fffaf0, #fff2bd);
    box-shadow: 0 12px 28px rgba(182, 127, 24, 0.24);
}

.shop-card.is-sublime-reward img {
    filter: sepia(0.2) saturate(1.18) brightness(1.04);
}

.set-reward-btn {
    border: 1px solid rgba(170, 156, 166, 0.45);
    background: #eee9ed;
    color: #88747f;
    border-radius: 8px;
    padding: 6px 9px;
    font-size: 11px;
    font-weight: 900;
    white-space: nowrap;
}

.set-reward-btn.is-claimable {
    border-color: rgba(221, 166, 48, 0.8);
    background: linear-gradient(135deg, #fff7cf, #f2bf4d);
    color: #5f3b00;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(183, 129, 23, 0.2);
}

.set-reward-btn:disabled {
    cursor: default;
    opacity: 0.78;
}

.shop-card img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center top;
}

.shop-card.is-locked img {
    object-fit: cover;
    filter: saturate(0.9) brightness(1.04);
}

.collection-preview-creator {
    position: static;
    z-index: 2;
    max-width: calc(100% - 84px);
    min-height: 30px;
    padding: 4px 10px 4px 5px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 1px solid rgba(255, 201, 225, 0.86);
    border-radius: 999px;
    background: rgba(255, 171, 211, 0.9);
    color: #fff;
    font: inherit;
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: 0 10px 22px rgba(196, 86, 137, 0.18);
    cursor: pointer;
}

.collection-preview-creator:disabled {
    cursor: default;
}

.collection-preview-creator img {
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.86);
}

.collection-preview-creator span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.shop-card span {
    position: absolute;
    left: 4px;
    right: 4px;
    bottom: 4px;
    overflow: hidden;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.86);
    color: var(--text-primary);
    font-size: 8px;
    font-weight: 800;
    line-height: 1.2;
    padding: 3px 2px;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.shop-card.is-locked span {
    color: var(--text-secondary);
}

@media (max-width: 560px) {
    .shop-header {
        align-items: flex-start;
    }

    .shop-summary {
        grid-template-columns: 1fr;
    }

    .shop-card-row {
        grid-template-columns: repeat(auto-fill, minmax(46px, 1fr));
        gap: 7px;
    }
}

.destroy-duplicate-btn {
    position: absolute;
    left: 8px;
    right: 8px;
    bottom: 8px;
    z-index: 4;
    min-height: 28px;
    border: 1px solid rgba(255, 255, 255, 0.88);
    border-radius: 6px;
    background: linear-gradient(135deg, #ff93b6, #bba7ff);
    color: #fff;
    font-size: 11px;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(122, 77, 102, 0.2);
}

.collection-card:has(.destroy-duplicate-btn) .collection-card-rarity-badge {
    bottom: 42px;
}

/* Popularity Arena */
#arena-section {
    width: min(100%, 920px);
    padding-bottom: 104px;
}

.arena-shell {
    width: min(100%, 820px);
    margin: 0 auto;
    display: grid;
    gap: 14px;
}

.arena-header,
.arena-panel-head,
.arena-selection-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.arena-header {
    margin-bottom: 2px;
}

.arena-panel {
    border: 1px solid rgba(243, 200, 218, 0.82);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.74);
    box-shadow: 0 18px 42px rgba(196, 126, 158, 0.12);
    padding: 14px;
}

.arena-intro div {
    display: grid;
    gap: 2px;
}

.arena-intro strong,
.arena-panel-head strong {
    color: #5c4052;
    font-size: 15px;
    font-weight: 900;
}

.arena-intro span,
.arena-field span,
.arena-summary-row small {
    color: #9b7890;
    font-size: 12px;
    font-weight: 700;
}

.arena-intro b,
.arena-selection-status span {
    color: #bf5f8a;
    font-size: 12px;
    font-weight: 900;
}

.arena-field {
    display: grid;
    gap: 6px;
    margin-bottom: 12px;
}

.arena-field .admin-select {
    width: 100%;
}

.arena-home-panel {
    display: grid;
    gap: 10px;
    justify-items: center;
    text-align: center;
}

.arena-home-panel[hidden],
.arena-duels-grid[hidden] {
    display: none;
}

.arena-duels-grid {
    display: grid;
    gap: 14px;
}

.arena-duel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 54px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    padding: 16px;
    border: 1px solid rgba(243, 200, 218, 0.82);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.72);
    box-shadow: 0 16px 36px rgba(196, 126, 158, 0.12);
}

.arena-duel-side {
    min-width: 0;
    min-height: 334px;
    position: relative;
    overflow: visible;
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 9px;
    padding: 12px 10px;
    border: 1px solid rgba(244, 143, 177, 0.26);
    border-radius: 16px;
    background: rgba(255, 247, 251, 0.78);
    color: #5c4052;
    cursor: pointer;
}

.arena-duel-side.is-supported {
    border-color: #f05f9e;
    background: rgba(255, 236, 247, 0.95);
    box-shadow: inset 0 0 0 2px rgba(240, 95, 158, 0.12);
}

.arena-duel-side:disabled {
    opacity: 0.58;
    cursor: not-allowed;
}

.arena-duel-card {
    width: clamp(158px, 20vw, 190px);
    height: clamp(226px, 28vw, 272px);
    object-fit: contain;
    filter: drop-shadow(0 12px 18px rgba(122, 77, 102, 0.16));
}

.arena-duel-side strong {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 15px;
    font-weight: 900;
}

.arena-duel-side small {
    padding: 4px 10px;
    border-radius: 999px;
    background: #fff;
    color: #f05f9e;
    font-size: 10px;
    font-weight: 900;
}

.arena-point-float {
    position: absolute;
    left: 50%;
    bottom: 54px;
    transform: translateX(-50%);
    pointer-events: none;
    z-index: 4;
    padding: 7px 12px;
    border-radius: 999px;
    background: linear-gradient(135deg, #ff8fba, #f05d9d);
    color: #fff;
    font-size: 14px;
    font-weight: 900;
    box-shadow: 0 12px 24px rgba(196, 86, 137, 0.22);
    animation: arenaPointFloat 1.25s ease-out forwards;
}

@keyframes arenaPointFloat {
    0% { opacity: 0; transform: translate(-50%, 10px) scale(0.88); }
    18% { opacity: 1; transform: translate(-50%, 0) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -54px) scale(1.05); }
}

.arena-vs {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 12px 24px rgba(196, 126, 158, 0.16);
}

.arena-vs img {
    width: 38px;
    height: 38px;
    object-fit: contain;
    display: block;
}

.arena-support-panel[hidden],
.arena-card-grid[hidden] {
    display: none;
}

.arena-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
    gap: 12px;
}

.arena-card {
    position: relative;
    display: grid;
    justify-items: center;
    gap: 6px;
    min-height: 184px;
    padding: 10px 8px;
    border: 1px solid rgba(243, 200, 218, 0.82);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.72);
    color: #5c4052;
    cursor: pointer;
    box-shadow: 0 14px 30px rgba(196, 126, 158, 0.1);
}

.arena-card.is-selected {
    border-color: #f05f9e;
    background: rgba(255, 236, 247, 0.92);
    box-shadow: 0 18px 38px rgba(240, 95, 158, 0.2);
}

.arena-card.is-cooldown {
    opacity: 0.5;
    cursor: not-allowed;
}

.arena-card-image {
    width: 76px;
    height: 108px;
    object-fit: contain;
    filter: drop-shadow(0 12px 18px rgba(122, 77, 102, 0.16));
}

.arena-card-score {
    padding: 4px 9px;
    border-radius: 999px;
    background: #fff;
    color: #f05f9e;
    font-size: 11px;
    font-weight: 900;
}

.arena-card small,
.arena-card b {
    font-size: 10px;
    line-height: 1.2;
    text-align: center;
}

.arena-card b {
    color: #9b7890;
}

.arena-ranking-list,
.arena-summary {
    display: grid;
    gap: 8px;
}

.arena-rank-row,
.arena-summary-row {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 12px;
    background: rgba(255, 247, 251, 0.82);
}

.arena-rank-row b {
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(244, 143, 177, 0.18);
    color: #f05f9e;
}

.arena-rank-row span,
.arena-summary-row span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 900;
}

.arena-rank-row strong,
.arena-summary-row b {
    color: #5c4052;
    font-size: 12px;
}

.arena-summary-row {
    grid-template-columns: minmax(0, 1fr) minmax(120px, auto) auto;
}

@media (max-width: 560px) {
    .arena-header {
        align-items: flex-start;
    }

    .arena-shell {
        gap: 10px;
    }

    .arena-card-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
    }

    .arena-duel {
        grid-template-columns: minmax(0, 1fr) 38px minmax(0, 1fr);
        gap: 6px;
        padding: 10px 8px;
    }

    .arena-vs {
        justify-self: center;
        width: 38px;
        height: 38px;
    }

    .arena-vs img {
        width: 28px;
        height: 28px;
    }

    .arena-duel-side {
        min-height: 232px;
        padding: 8px 4px;
    }

    .arena-duel-card {
        width: clamp(104px, 31vw, 128px);
        height: clamp(150px, 44vw, 184px);
    }

    .arena-duel-side strong {
        font-size: 12px;
    }

    .arena-card {
        min-height: 164px;
        padding: 8px 5px;
    }

    .arena-card-image {
        width: 62px;
        height: 92px;
    }

    .arena-summary-row {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .arena-summary-row small {
        grid-column: 1 / -1;
    }
}

.shop-card.can-buy {
    border-color: rgba(139, 216, 189, 0.95);
    box-shadow: 0 10px 24px rgba(65, 150, 120, 0.22);
}

.shop-card.can-buy span {
    background: rgba(226, 255, 244, 0.92);
    color: #24644f;
}

.shop-card.is-locked {
    cursor: pointer;
    border-color: rgba(244, 143, 177, 0.38);
    background: linear-gradient(145deg, #fff7fb, #ffe4f0);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.72);
}

.game-action-modal {
    position: fixed;
    inset: 0;
    z-index: 20050;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(58, 33, 50, 0.54);
    backdrop-filter: blur(10px);
}

.game-action-dialog {
    position: relative;
    width: min(100%, 360px);
    border: 1.5px solid rgba(244, 143, 177, 0.72);
    border-radius: 28px;
    background: rgba(255, 250, 253, 0.78);
    box-shadow: 0 28px 74px rgba(92, 64, 82, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.76);
    padding: 24px 22px 22px;
    text-align: center;
    backdrop-filter: blur(18px) saturate(1.15);
}

.game-action-dialog h2 {
    margin: 0 0 9px;
    color: var(--text-primary);
    font-size: 20px;
    line-height: 1.2;
}

.game-action-dialog p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.45;
}

.game-action-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 18px;
}

.game-action-btn {
    min-width: 112px;
    min-height: 42px;
    border: 1.5px solid rgba(244, 143, 177, 0.86);
    border-radius: 999px;
    padding: 10px 16px;
    font: inherit;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0;
}

.game-action-btn-primary {
    background: rgba(244, 143, 177, 0.86);
    color: white;
    box-shadow: 0 14px 28px rgba(236, 111, 157, 0.22);
}

.game-action-btn-secondary {
    background: rgba(255, 255, 255, 0.54);
    color: var(--primary-dark);
}

.game-action-modal.is-warning .game-action-dialog {
    border-color: #f48fb1;
}

@media (max-width: 420px) {
    .game-action-buttons {
        flex-direction: column-reverse;
    }

    .game-action-btn {
        width: 100%;
    }
}

.game-action-dialog::before {
    content: '';
    position: absolute;
    inset: 10px 14px auto;
    height: 28px;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.58), transparent);
    pointer-events: none;
}

.shop-generation-section {
    gap: 12px;
}

.shop-generation-section > h2 {
    padding: 0 2px 2px;
    color: #4f3347;
    font-size: 19px;
    font-weight: 900;
}

.shop-rarity-list {
    gap: 10px;
}

.shop-rarity-section {
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.5);
}

.shop-rarity-header h3 {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.shop-rarity-header h3::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 12px rgba(244, 143, 177, 0.45);
}

.shop-rarity-section.rarity-limited .shop-rarity-header h3::before,
.shop-rarity-section.rarity-legendary .shop-rarity-header h3::before {
    background: #f7b955;
}

.shop-rarity-section.rarity-special .shop-rarity-header h3::before,
.shop-rarity-section.rarity-epic .shop-rarity-header h3::before {
    background: #b8a4ff;
}

.shop-rarity-section.rarity-sweet .shop-rarity-header h3::before {
    background: #ffd166;
}

.shop-rarity-section.rarity-lovely .shop-rarity-header h3::before,
.shop-rarity-section.rarity-rare .shop-rarity-header h3::before {
    background: #82c7f5;
}

.shop-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
    margin: -2px 0 12px;
}

.shop-toolbar label {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.shop-toolbar .admin-select {
    min-width: 138px;
    border-color: rgba(244, 143, 177, 0.62);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.68);
}

#shop-creator-filter {
    min-width: min(260px, 100%);
}

.shop-set-order-section .shop-rarity-header h3::before {
    background: #f48fb1;
}

/* Compact mobile shop */
@media (max-width: 560px) {
    #shop-section {
        padding-top: 18px;
    }

    .shop-header {
        display: grid;
        grid-template-columns: 1fr auto;
        align-items: start;
        gap: 8px;
        margin-bottom: 8px;
    }

    .shop-kicker {
        font-size: 10px;
    }

    #shop-section .page-title {
        font-size: 22px;
        line-height: 1.05;
    }

    .shop-total-card {
        min-width: 64px;
        padding: 7px 8px;
        border-radius: 8px;
    }

    .shop-total-card span {
        font-size: 8px;
    }

    .shop-total-card strong {
        font-size: 22px;
    }

    .shop-toolbar {
        justify-content: space-between;
        gap: 8px;
        margin: 0 0 8px;
    }

    .shop-toolbar label {
        font-size: 10px;
    }

    .shop-toolbar .admin-select {
        min-width: 136px;
        max-width: 160px;
        padding: 7px 10px;
        font-size: 12px;
    }

    .shop-summary {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
        margin-bottom: 12px;
    }

    .shop-stat {
        min-width: 0;
        padding: 7px 6px;
        border-radius: 8px;
    }

    .shop-stat span {
        font-size: 8px;
        line-height: 1.1;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .shop-stat strong {
        font-size: 13px;
        line-height: 1.15;
    }

    .shop-generation-section > h2 {
        font-size: 17px;
    }
}

.collection-preview-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.collection-preview-actions {
    display: flex;
    justify-content: center;
    gap: 8px;
    width: min(86vw, 420px);
}

.preview-action-btn {
    flex: 1 1 0;
    min-height: 38px;
    border: 1.5px solid rgba(244, 143, 177, 0.88);
    border-radius: 999px;
    padding: 9px 10px;
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
}

.preview-action-primary {
    background: rgba(244, 143, 177, 0.88);
    color: white;
}

.preview-action-secondary {
    background: rgba(255, 255, 255, 0.72);
    color: var(--primary-dark);
}

.collection-preview-note {
    display: block;
    padding: 8px 12px;
    border: 1px solid rgba(244, 143, 177, 0.52);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.58);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 800;
}

.featured-floating-pack {
    position: relative;
    display: grid;
    place-items: center;
    width: min(calc(100% - 78px), 265px);
    aspect-ratio: 168 / 238;
    margin: 0 auto 20px;
    padding: 0;
    border: 0;
    border-radius: 16px;
    background: transparent;
    cursor: pointer;
    filter: drop-shadow(0 24px 26px rgba(236, 111, 157, 0.24));
    animation: featuredPackFloat 3.4s ease-in-out infinite;
    -webkit-animation: featuredPackFloat 3.4s ease-in-out infinite;
    z-index: 4;
}

.featured-floating-pack::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 2;
    border-radius: 16px;
    background: linear-gradient(112deg, transparent 0 36%, rgba(255, 255, 255, 0.28) 46%, transparent 58% 100%);
    opacity: 0.55;
    transform: translateX(-78%);
    animation: packsSoftReflection 3.6s ease-in-out infinite;
    pointer-events: none;
}

.featured-floating-pack.js-pack-levitating {
    animation: none !important;
    -webkit-animation: none !important;
}

.featured-floating-pack img.js-pack-levitating-image {
    will-change: transform;
    transform: translate3d(0, 0, 0);
    -webkit-transform: translate3d(0, 0, 0);
}

.featured-floating-pack::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -20px;
    width: 92%;
    height: 24px;
    transform: translateX(-50%);
    border-radius: 50%;
    background: radial-gradient(ellipse, rgba(122, 77, 102, 0.18), transparent 70%);
    animation: featuredPackShadow 3.4s ease-in-out infinite;
    -webkit-animation: featuredPackShadow 3.4s ease-in-out infinite;
    z-index: 0;
}

.featured-floating-pack img {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    border-radius: 16px;
    pointer-events: none;
    -webkit-user-drag: none;
    user-select: none;
}

@-webkit-keyframes featuredPackFloat {
    0%, 100% { -webkit-transform: translate3d(0, 0, 0); }
    50% { -webkit-transform: translate3d(0, -22px, 0); }
}

@keyframes featuredPackFloat {
    0%, 100% { transform: translate3d(0, 0, 0); }
    50% { transform: translate3d(0, -22px, 0); }
}


@-webkit-keyframes featuredPackShadow {
    0%, 100% { opacity: 0.8; -webkit-transform: translateX(-50%) scale(1); }
    50% { opacity: 0.42; -webkit-transform: translateX(-50%) scale(0.78); }
}

@keyframes featuredPackShadow {
    0%, 100% { opacity: 0.8; transform: translateX(-50%) scale(1); }
    50% { opacity: 0.42; transform: translateX(-50%) scale(0.78); }
}

@media (max-width: 480px) {
    .featured-floating-pack {
        width: min(calc(100% - 82px), 238px);
        margin-top: 0;
        margin-bottom: 16px;
    }
}

.home-pack-actions {
    display: none !important;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: min(calc(100% - 58px), 330px);
    margin: 0 auto 22px;
}

.home-action-btn {
    min-height: 36px;
    border: 1.5px solid rgba(255, 255, 255, 0.82);
    border-radius: 999px;
    padding: 8px 10px;
    color: #fff;
    font: inherit;
    font-size: 11px;
    font-weight: 900;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0;
    box-shadow: 0 10px 22px rgba(122, 77, 102, 0.1);
}

.home-action-open {
    background: rgba(244, 143, 177, 0.88);
}

.home-action-stars {
    background: linear-gradient(135deg, #ffd35a, #f6a53a);
    color: #3a2400;
}

#dashboard-section.is-home-active {
    justify-content: center;
    padding-top: max(46px, calc(env(safe-area-inset-top) + 34px));
    padding-bottom: calc(84px + env(safe-area-inset-bottom));
}

#dashboard-section.is-home-active .featured-floating-pack {
    margin-top: auto;
    margin-bottom: clamp(14px, 2.2svh, 22px);
}

#dashboard-section.is-home-active .home-mini-packs {
    margin-bottom: auto;
}

.metric-card.metric-stars {
    font: inherit;
    cursor: pointer;
}

.arena-floating-btn {
    position: fixed;
    right: max(16px, env(safe-area-inset-right));
    bottom: calc(92px + env(safe-area-inset-bottom));
    z-index: 38;
    width: 50px;
    height: 50px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.86);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 0 16px 34px rgba(91, 64, 82, 0.18);
    cursor: grab;
    touch-action: none;
}

.arena-floating-btn img {
    width: 31px;
    height: 31px;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 2px 4px rgba(92, 64, 82, 0.16));
}

.arena-floating-btn.is-dragging {
    cursor: grabbing;
    transform: scale(1.04);
}

.stars-recharge-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(14, 16, 24, 0.72);
    backdrop-filter: blur(6px);
}

.stars-recharge-dialog {
    width: min(720px, 100%);
    max-height: min(88vh, 760px);
    overflow-y: auto;
    background: linear-gradient(180deg, #ffffff 0%, #f6f8ff 100%);
    color: #1d2130;
    border-radius: 8px;
    padding: 18px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.stars-recharge-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.stars-recharge-header h2 {
    margin: 0;
    font-size: 1.25rem;
}

.stars-recharge-header p {
    margin: 3px 0 0;
    color: #687089;
    font-size: 0.86rem;
}

#stars-recharge-close {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: #f0f1f5;
    color: #1d2130;
    font-weight: 700;
}

.stars-recharge-packages {
    display: grid;
    gap: 10px;
}

.stars-package {
    position: relative;
    display: grid;
    grid-template-columns: 58px minmax(220px, 1fr) minmax(104px, auto);
    align-items: center;
    gap: 16px;
    min-height: 82px;
    padding: 12px 14px;
    border: 1px solid rgba(34, 38, 55, 0.12);
    border-radius: 8px;
    background: #ffffff;
    overflow: hidden;
    box-shadow: 0 10px 24px rgba(32, 43, 74, 0.08);
    transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.stars-package:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 190, 55, 0.55);
    box-shadow: 0 16px 30px rgba(32, 43, 74, 0.13);
}

.stars-package.has-bonus {
    background: linear-gradient(135deg, #fff7dd 0%, #ffffff 48%, #eef6ff 100%);
}

.stars-package-icon {
    width: 50px;
    height: 50px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: transparent;
    box-shadow: 0 8px 18px rgba(242, 156, 36, 0.34);
    animation: coinPulse 1.8s ease-in-out infinite;
}

.coin-icon {
    position: relative;
    border: 0;
    background: transparent url('../assets/images/menu/coin-lateral.webp') center / contain no-repeat;
}

.coin-icon::before {
    display: none;
}

.coin-icon span {
    display: none;
}

.coin-mini {
    width: 18px;
    height: 18px;
    display: inline-block;
    margin-right: 7px;
    border: 0;
    border-radius: 0;
    background: transparent url('../assets/images/menu/coin-lateral.webp') center / contain no-repeat;
    box-shadow: 0 3px 8px rgba(199, 121, 18, 0.25);
    vertical-align: -2px;
}

.stars-package-copy {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.stars-package-copy strong {
    display: flex;
    align-items: center;
    font-size: 1.78rem;
    line-height: 1;
    color: #20263a;
}

.stars-package-copy span {
    color: #5e6577;
}

.stars-package-copy span {
    font-weight: 800;
}

.stars-package-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    min-width: 0;
}

.stars-package-meta small {
    color: #5e6577;
    font-size: 0.78rem;
}

.stars-package-meta em {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 3px 8px;
    border-radius: 999px;
    background: linear-gradient(135deg, #ffce45, #f39a2f);
    color: #3d2500;
    font-size: 0.72rem;
    font-style: normal;
    font-weight: 900;
    white-space: nowrap;
    box-shadow: 0 5px 12px rgba(207, 130, 28, 0.22);
}

.stars-package-actions {
    display: grid;
    gap: 7px;
    min-width: 104px;
    justify-self: end;
}

.stars-package-actions button {
    border: 0;
    border-radius: 7px;
    padding: 9px 12px;
    background: linear-gradient(135deg, #2584ff, #5a4cf0);
    color: #ffffff;
    font-weight: 700;
    cursor: pointer;
}

.stars-recharge-message {
    min-height: 20px;
    margin: 12px 0 0;
    color: #586074;
    font-size: 0.9rem;
}

@media (max-width: 520px) {
    .stars-recharge-modal {
        align-items: flex-end;
        padding: 10px;
    }

    .stars-recharge-dialog {
        width: 100%;
        max-height: 92vh;
        padding: 14px;
    }

    .stars-package {
        grid-template-columns: 44px minmax(0, 1fr) 82px;
        gap: 10px;
        min-height: 76px;
        padding: 11px;
    }

    .stars-package-icon {
        width: 44px;
        height: 44px;
    }

    .stars-package-copy strong {
        font-size: 1.42rem;
    }

    .stars-package-meta {
        gap: 5px;
    }

    .stars-package-meta em {
        min-height: 19px;
        padding: 2px 6px;
        font-size: 0.66rem;
    }

    .stars-package-actions {
        grid-column: auto;
        grid-template-columns: 1fr;
        min-width: 0;
    }

    .stars-package-actions button {
        padding: 8px 7px;
        font-size: 0.78rem;
    }
}

@keyframes coinPulse {
    0%, 100% {
        transform: scale(1) rotate(0deg);
    }
    50% {
        transform: scale(1.08) rotate(4deg);
    }
}

.shop-featured-packs {
    margin-top: 12px;
    margin-bottom: 14px;
}

@media (max-width: 480px) {
    .profile-shell {
        padding-left: 10px;
        padding-right: 10px;
    }

    .profile-card {
        grid-template-columns: 70px 1fr;
        gap: 11px;
        padding: 12px;
    }

    .profile-photo {
        width: 70px;
        height: 70px;
    }

    .profile-name {
        font-size: 1.12rem;
    }

    .profile-mini-stats {
        gap: 5px;
    }

    .profile-mini-stats div {
        padding: 7px 3px;
    }

    .profile-mini-stats small {
        font-size: 0.58rem;
    }

    .profile-referral-row {
        grid-template-columns: 1fr 1fr;
    }

    .profile-referral-row label {
        grid-column: 1 / -1;
    }

    .profile-referral-input {
        grid-column: 1 / -1;
    }

    .profile-referral-row + .profile-referral-row {
        grid-template-columns: 1fr;
    }

    .profile-invited-item,
    .profile-commission-item {
        grid-template-columns: 32px minmax(0, 1fr);
    }

    .profile-invited-metrics,
    .profile-commission-metrics {
        grid-column: 2;
        justify-content: flex-start;
    }

    .home-pack-actions {
        width: min(calc(100% - 46px), 320px);
        gap: 7px;
        margin-bottom: 18px;
    }

    .home-action-btn {
        min-height: 34px;
        padding: 8px 7px;
        font-size: 10px;
    }
}



#dashboard-section.is-home-active {
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    min-height: 100vh;
    min-height: 100svh;
    padding-top: 154px;
    padding-bottom: 74px;
}

/* Compact icon metrics */
.metrics-grid {
    flex-wrap: nowrap;
    align-items: center;
    gap: 5px;
}

.metric-card {
    min-width: 0;
    padding: 6px 8px;
    gap: 4px;
}

.metric-label {
    display: inline-grid;
    place-items: center;
    width: 24px;
    height: 24px;
    overflow: visible;
    color: var(--text-secondary);
    font-size: 0;
    letter-spacing: 0;
}

.metric-label::before {
    content: '';
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    filter: drop-shadow(0 4px 6px rgba(199, 121, 158, 0.16));
}

.metric-stars .metric-label::before {
    background-image: url('../assets/images/menu/coin-lateral.webp');
}

.metric-cards .metric-label::before {
    background-image: url('../assets/images/menu/cards-lateral.webp');
}

.metric-fragments .metric-label {
    position: relative;
}

.metric-fragments .metric-label::before {
    background-image: url('../assets/images/menu/fragment-lateral.webp');
}

.metric-fragments .metric-label::after {
    display: none;
}

.metric-rank .metric-label::before {
    width: 13px;
    height: 10px;
    border: 1.8px solid currentColor;
    border-top: 0;
    border-radius: 0 0 5px 5px;
    clip-path: polygon(0 22%, 25% 48%, 50% 0, 75% 48%, 100% 22%, 100% 100%, 0 100%);
}

.metric-value {
    font-size: 13px;
    white-space: nowrap;
}

.home-mini-packs {
    width: min(calc(100% - 58px), 330px);
    min-height: 54px;
    margin: -6px auto 10px;
    padding: 7px 8px 10px;
    display: grid;
    grid-template-columns: 78px 1fr;
    align-items: center;
    gap: 10px;
    border: 1px solid rgba(243, 200, 218, 0.86);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 16px 34px rgba(196, 126, 158, 0.11);
    backdrop-filter: blur(12px);
}

.home-mini-pack-stack {
    display: flex;
    align-items: center;
    min-width: 72px;
    padding-left: 10px;
}

.home-mini-pack-stack img {
    width: 34px;
    height: 48px;
    object-fit: contain;
    filter: drop-shadow(0 8px 10px rgba(122, 77, 102, 0.16));
}

.home-mini-pack-stack img + img {
    margin-left: -10px;
}

.home-mini-pack-copy {
    min-width: 0;
    flex: 1;
    display: grid;
    gap: 1px;
}

.home-mini-pack-copy strong {
    color: #8f6d82;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
}

.home-mini-pack-copy small {
    color: #c45486;
    font-size: 10px;
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.home-view-packs-btn {
    min-height: 34px;
    border: 1.5px solid rgba(244, 143, 177, 0.76);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.62);
    color: var(--primary-dark);
    font: inherit;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    cursor: pointer;
}

@media (max-width: 480px) {
    .metrics-grid {
        gap: 4px;
    }

    .metric-card {
        padding: 5px 6px;
    }

    .metric-label {
        width: 13px;
        height: 13px;
    }

    .metric-value {
        font-size: 10px;
    }

    .home-mini-packs {
        width: min(calc(100% - 46px), 320px);
        min-height: 48px;
        margin-bottom: 14px;
        padding: 6px 7px;
    }

    .home-mini-pack-stack img {
        width: 30px;
        height: 42px;
    }

    .home-view-packs-btn {
        min-height: 31px;
        font-size: 10px;
    }

    .home-featured-pack-list {
        width: min(calc(100% - 34px), 330px);
        gap: 8px;
    }

    .home-featured-pack img {
        width: 56px;
        height: 80px;
    }
}


/* Icon-only secondary metrics */
.metric-rank {
    flex: 0 0 30px;
    width: 30px;
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}

.metric-rank .metric-value {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.metric-stars,
.metric-cards,
.metric-fragments {
    flex: 0 1 auto;
}

.metric-stars .metric-value,
.metric-cards .metric-value,
.metric-fragments .metric-value {
    font-size: 0.8rem;
}

@media (max-width: 420px) {
    .metrics-grid {
        top: 50%;
        left: 6px;
        right: auto;
        width: auto;
        max-width: 38px;
        flex-direction: column;
        align-items: stretch;
        transform: translateY(-50%);
        -webkit-transform: translateY(-50%);
        gap: 5px;
        z-index: 12;
    }

    .metric-card {
        min-height: 31px;
        width: 36px;
        min-width: 36px;
        padding: 4px 3px 5px;
        flex-direction: column;
        justify-content: center;
        gap: 1px;
    }

    .metric-stars,
    .metric-cards,
    .metric-fragments {
        padding-left: 3px;
        padding-right: 3px;
    }

    .metric-rank {
        flex-basis: 26px;
        width: 26px;
    }

    .metric-label {
        width: 22px;
        height: 22px;
    }

    .metric-label::before {
        width: 22px;
        height: 22px;
    }

    .metric-stars .metric-label::before {
        width: 22px;
        height: 22px;
    }

    .metric-cards .metric-label::before {
        width: 22px;
        height: 22px;
    }

    .metric-fragments .metric-label::before {
        width: 22px;
        height: 22px;
    }

    .metric-stars .metric-value,
    .metric-cards .metric-value,
    .metric-fragments .metric-value {
        font-size: 11px;
    }
}

/* Packs catalog */
#packs-section {
    width: min(100%, 760px);
    padding-bottom: 98px;
    flex-direction: column;
    min-height: 0;
}

.packs-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.packs-title {
    width: min(100%, 430px);
    margin: 0 auto 12px;
    color: #56314b;
    font-size: 17px;
    font-weight: 900;
    line-height: 1.15;
}

#packs-section.is-creator-pack-view .packs-title {
    display: none;
}

.packs-creator-profile {
    position: relative;
    width: min(100%, 430px);
    margin: 0 auto 14px;
    padding: 10px 54px 10px 12px;
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.packs-creator-profile[hidden] {
    display: none !important;
}

.packs-creator-profile img {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(244, 143, 177, 0.34);
}

.packs-creator-profile img[role="button"],
.packs-creator-copy strong[role="button"] {
    cursor: pointer;
}

.packs-creator-copy {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.packs-creator-copy strong {
    color: #56314b;
    font-size: 15px;
    font-weight: 900;
    line-height: 1.15;
}

.packs-creator-copy small {
    display: none;
}

.creator-favorite-heart {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(244, 143, 177, 0.48);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.82);
    color: #c45486;
    font-size: 17px;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 10px 22px rgba(196, 126, 158, 0.12);
    backdrop-filter: blur(8px);
}

.creator-favorite-heart.is-active {
    border-color: rgba(160, 150, 158, 0.55);
    background: rgba(245, 244, 246, 0.94);
    color: #9b929a;
}

.creator-favorite-heart[hidden] {
    display: none !important;
}

.packs-creator-profile .creator-public-instagram {
    justify-self: start;
    margin-top: 2px;
    color: #e86fa4;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.15;
    text-decoration: none;
    white-space: nowrap;
}

.packs-creator-profile .creator-public-instagram:hover {
    color: #c45486;
}

.packs-featured-packs {
    margin: 8px 0 16px;
}

#packs-section:not(.is-creator-pack-view) .packs-featured-packs {
    margin-top: 0;
    margin-bottom: 10px;
    padding: 10px 14px 8px;
    --featured-shop-pack-w: clamp(104px, 28vw, 132px);
    --featured-shop-pack-h: calc(var(--featured-shop-pack-w) * 1.424);
    --featured-shop-pack-offset: clamp(112px, 31vw, 146px);
}

#packs-section:not(.is-creator-pack-view) .packs-featured-packs .dashboard-pack-carousel {
    min-height: calc(var(--featured-shop-pack-h) + 26px);
    margin: 0 auto;
}

#packs-section:not(.is-creator-pack-view) .packs-featured-packs .pack-stage {
    height: calc(var(--featured-shop-pack-h) + 22px);
    cursor: grab;
}

#packs-section:not(.is-creator-pack-view) .packs-featured-packs .pack-stage::after {
    bottom: 10px;
    width: 300px;
    height: 22px;
    background: radial-gradient(ellipse, rgba(122, 77, 102, 0.14), transparent 70%);
}

#packs-section:not(.is-creator-pack-view) .packs-featured-packs .pack-card {
    top: 8px;
    width: var(--featured-shop-pack-w);
    height: var(--featured-shop-pack-h);
    overflow: hidden;
    border-radius: 14px;
    animation: packsCardBreath 4.8s ease-in-out infinite;
}

#packs-section:not(.is-creator-pack-view) .packs-featured-packs .pack-card::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 2;
    border-radius: inherit;
    background: linear-gradient(112deg, transparent 0 36%, rgba(255, 255, 255, 0.28) 46%, transparent 58% 100%);
    opacity: 0.55;
    transform: translateX(-70%);
    animation: packsSoftReflection 3.6s ease-in-out infinite;
    pointer-events: none;
}

#packs-section:not(.is-creator-pack-view) .packs-featured-packs .pack-card img {
    animation: packsSoftRotate 4.8s ease-in-out infinite;
}

#packs-section:not(.is-creator-pack-view) .packs-featured-packs .pack-card-left {
    opacity: 0.94;
    --pack-slide-x: calc(-50% - var(--featured-shop-pack-offset));
    --pack-slide-y: 8px;
    transform: translateX(calc(-50% - var(--featured-shop-pack-offset))) translateY(8px) rotate(-1.2deg) scale(1);
}

#packs-section:not(.is-creator-pack-view) .packs-featured-packs .pack-card-active {
    --pack-slide-x: -50%;
    --pack-slide-y: 8px;
    transform: translateX(-50%) translateY(8px) rotate(0deg) scale(1);
}

#packs-section:not(.is-creator-pack-view) .packs-featured-packs .pack-card-right {
    opacity: 0.94;
    --pack-slide-x: calc(-50% + var(--featured-shop-pack-offset));
    --pack-slide-y: 8px;
    transform: translateX(calc(-50% + var(--featured-shop-pack-offset))) translateY(8px) rotate(1.2deg) scale(1);
}

#packs-section:not(.is-creator-pack-view) .packs-featured-packs .pack-card:nth-child(2)::before,
#packs-section:not(.is-creator-pack-view) .packs-featured-packs .pack-card:nth-child(2) img {
    animation-delay: -1.2s;
}

#packs-section:not(.is-creator-pack-view) .packs-featured-packs .pack-card:nth-child(3)::before,
#packs-section:not(.is-creator-pack-view) .packs-featured-packs .pack-card:nth-child(3) img {
    animation-delay: -2.1s;
}

#packs-section:not(.is-creator-pack-view) .packs-featured-packs .featured-packs-footer {
    display: none;
}

#packs-section.is-creator-pack-view .packs-featured-packs .pack-card {
    overflow: hidden;
}

#packs-section.is-creator-pack-view .packs-featured-packs .pack-card::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 2;
    border-radius: inherit;
    background: linear-gradient(112deg, transparent 0 36%, rgba(255, 255, 255, 0.28) 46%, transparent 58% 100%);
    opacity: 0.55;
    transform: translateX(-78%);
    animation: packsSoftReflection 3.6s ease-in-out infinite;
    pointer-events: none;
}

#packs-section.is-creator-pack-view .packs-featured-packs .pack-card img {
    animation: packsSoftRotate 4.8s ease-in-out infinite;
}

@keyframes packsSoftRotate {
    0%, 100% { transform: rotate(-0.8deg); }
    50% { transform: rotate(0.8deg); }
}

@keyframes packsSoftReflection {
    0%, 38% { transform: translateX(-78%); opacity: 0; }
    52% { opacity: 0.58; }
    72%, 100% { transform: translateX(78%); opacity: 0; }
}

@keyframes packsCardBreath {
    0%, 100% { filter: drop-shadow(0 18px 20px rgba(122, 77, 102, 0.18)); }
    50% { filter: drop-shadow(0 22px 24px rgba(236, 111, 157, 0.24)); }
}

@media (max-width: 430px) {
    #packs-section:not(.is-creator-pack-view) .packs-featured-packs {
        padding: 12px 12px 8px;
        --featured-shop-pack-w: clamp(96px, 26vw, 108px);
        --featured-shop-pack-offset: clamp(105px, 30vw, 118px);
    }

    .packs-title {
        margin-bottom: 14px;
        padding-left: 4px;
    }
}

.packs-grid,
.packs-model-list {
    display: grid;
    gap: 12px;
    align-content: start;
    align-items: start;
}

#packs-section:not(.is-creator-pack-view) .packs-grid {
    max-height: none;
    overflow: visible;
    align-content: start;
}

#packs-section:not(.is-creator-pack-view) .packs-model-list {
    max-height: none;
    grid-auto-rows: max-content;
    overflow: visible;
    padding-right: 2px;
}

.packs-filter-bar {
    display: flex;
    gap: 7px;
    overflow-x: auto;
    padding: 8px;
    scrollbar-width: none;
}

.packs-filter-bar::-webkit-scrollbar {
    display: none;
}

.packs-filter-bar button {
    flex: 0 0 auto;
    min-height: 30px;
    border: 1px solid rgba(244, 143, 177, 0.38);
    border-radius: 999px;
    padding: 6px 10px;
    background: rgba(255, 247, 251, 0.78);
    color: #9b4d74;
    font: inherit;
    font-size: 10px;
    font-weight: 900;
    cursor: pointer;
}

.packs-filter-bar button.is-active {
    background: linear-gradient(135deg, #ff8fba, #f05d9d);
    color: #fff;
}

.packs-white-panel,
.packs-generation-section {
    width: min(100%, 560px);
    margin-left: auto;
    margin-right: auto;
    padding: 10px 14px 12px;
    border: 1px solid rgba(255, 214, 232, 0.72);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.72);
    box-shadow: 0 18px 42px rgba(196, 126, 158, 0.08);
    backdrop-filter: blur(8px);
}

.packs-highlight-section {
    padding: clamp(12px, 2.8vw, 20px) clamp(12px, 3.8vw, 24px) clamp(18px, 3.8vw, 26px);
}

.packs-highlight-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: end;
    justify-items: center;
    gap: clamp(12px, 4vw, 28px);
}

.packs-generation-section {
    display: grid;
    gap: 8px;
    align-content: start;
}

#packs-section:not(.is-creator-pack-view) {
    height: auto;
    overflow: visible;
    padding-top: clamp(34px, 5svh, 58px);
    padding-bottom: calc(82px + env(safe-area-inset-bottom));
}

@media (max-width: 430px) {
    #packs-section:not(.is-creator-pack-view) {
        padding-top: max(76px, calc(env(safe-area-inset-top) + 54px));
    }
}

#packs-section:not(.is-creator-pack-view) .packs-header {
    display: none;
}

#packs-section:not(.is-creator-pack-view) .packs-generation-section {
    max-height: none;
    overflow: visible;
}

.packs-generation-section > h2 {
    display: none;
}

#packs-section:not(.is-creator-pack-view) .packs-generation-section::before {
    display: none;
    content: '';
}

.packs-model-section {
    height: max-content;
    padding: 7px 0 10px;
    border: 0;
    border-radius: 0;
    border-bottom: 1px solid rgba(244, 143, 177, 0.26);
    background: transparent;
}

.packs-model-section:last-child {
    border-bottom: 0;
    padding-bottom: 4px;
}

.packs-model-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.packs-model-header h3 {
    margin: 0;
    color: #6b4560;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
}

.packs-model-name-link {
    border: 0;
    padding: 0;
    background: transparent;
    color: #6b4560;
    font: inherit;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    cursor: pointer;
}

.home-featured-pack-list {
    width: min(calc(100% - 48px), 360px);
    margin: 0 auto 18px;
    padding: 14px 12px 12px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: end;
    gap: 8px;
    border: 1px solid rgba(255, 214, 232, 0.72);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.72);
    box-shadow: 0 18px 42px rgba(196, 126, 158, 0.08);
    backdrop-filter: blur(8px);
}

.home-featured-pack {
    position: relative;
    min-width: 0;
    display: grid;
    justify-items: center;
    gap: 3px;
    border: 0;
    border-radius: 8px;
    padding: 0;
    background: transparent;
    cursor: pointer;
    overflow: hidden;
}

.home-featured-pack::before {
    content: '';
    position: absolute;
    inset: 0 0 18px;
    z-index: 2;
    border-radius: 8px;
    background: linear-gradient(112deg, transparent 0 36%, rgba(255, 255, 255, 0.28) 46%, transparent 58% 100%);
    opacity: 0.54;
    transform: translateX(-78%);
    animation: packsSoftReflection 3.8s ease-in-out infinite;
    pointer-events: none;
}

.home-featured-pack.is-active {
    filter: drop-shadow(0 0 12px rgba(244, 143, 177, 0.34));
}

.home-featured-pack img {
    position: relative;
    z-index: 1;
    width: 62px;
    height: 88px;
    object-fit: contain;
    filter: drop-shadow(0 9px 12px rgba(122, 77, 102, 0.16));
}

.home-featured-pack small {
    display: inline-flex;
    align-items: center;
    color: #7a4c00;
    font-size: 10px;
    font-weight: 900;
}

.home-featured-pack .coin-mini {
    width: 12px;
    height: 12px;
    margin-right: 3px;
}

.packs-model-name-link:hover {
    color: #b94f87;
}

.packs-model-name {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
}

.packs-model-avatar {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(244, 143, 177, 0.42);
    background: rgba(255, 236, 247, 0.96);
}

.packs-model-actions {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.packs-more-btn {
    min-height: 24px;
    border: 1px solid rgba(244, 143, 177, 0.44);
    border-radius: 999px;
    padding: 4px 9px;
    background: rgba(255, 247, 251, 0.82);
    color: #c45486;
    font: inherit;
    font-size: 10px;
    font-weight: 900;
    cursor: pointer;
}

.packs-creator-name-link {
    border: 0;
    padding: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: 900;
    cursor: pointer;
}

.packs-creator-name-link:hover {
    color: #b94f87;
}

.packs-vitrine-section {
    gap: 0;
}

.packs-vitrine-row {
    grid-template-columns: repeat(3, minmax(86px, 1fr));
}

.packs-model-header span {
    min-width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: rgba(244, 143, 177, 0.16);
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 900;
}

.packs-row {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(88px, 96px);
    gap: 12px;
    justify-items: center;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-inline: contain;
    touch-action: pan-x;
    scroll-snap-type: x proximity;
    padding-bottom: 8px;
    scrollbar-width: none;
}

.packs-row::-webkit-scrollbar {
    display: none;
}

.pack-list-card {
    --pack-thumb-w: 78px;
    --pack-thumb-h: 110px;
    position: relative;
    width: 94px;
    min-height: 118px;
    display: grid;
    justify-items: center;
    align-content: start;
    gap: 6px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    cursor: pointer;
}

.pack-list-card-large {
    width: clamp(92px, 25vw, 148px);
    min-height: clamp(142px, 36vw, 210px);
}

.pack-list-card-large img {
    width: clamp(82px, 22vw, 126px);
    height: clamp(118px, 32vw, 178px);
}

.pack-list-card img {
    width: var(--pack-thumb-w);
    height: var(--pack-thumb-h);
    object-fit: contain;
    filter: drop-shadow(0 8px 14px rgba(236, 111, 157, 0.22));
    cursor: pointer;
}

#packs-section.is-creator-pack-view .packs-header {
    order: 10;
    justify-content: center;
    margin: 18px 0 0;
}

@media (max-width: 560px) {
    #packs-section.is-creator-pack-view {
        padding-top: max(104px, calc(env(safe-area-inset-top) + 78px));
        padding-left: 14px;
        padding-right: 14px;
    }

    #packs-section.is-creator-pack-view .packs-creator-profile {
        width: min(100%, 430px);
        margin-bottom: 18px;
        padding: 0 54px 0 8px;
    }

    #packs-section.is-creator-pack-view .packs-featured-packs {
        margin-top: 8px;
    }
}

#packs-section.is-creator-pack-view #back-to-dashboard-btn-3 {
    border-color: rgba(244, 143, 177, 0.72);
    background: linear-gradient(135deg, #ff8fba, #f05d9d);
    color: #fff;
    box-shadow: 0 12px 24px rgba(196, 86, 137, 0.18);
}

#packs-section.is-creator-pack-view .packs-vitrine-row {
    grid-auto-flow: initial;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    overflow: visible;
    gap: 14px;
    align-items: start;
}

#packs-section.is-creator-pack-view .pack-list-card {
    --pack-thumb-w: 92px;
    --pack-thumb-h: 132px;
    width: 116px;
    min-height: 158px;
}

#packs-section.is-creator-pack-view .pack-list-card img {
    width: var(--pack-thumb-w);
    height: var(--pack-thumb-h);
}

#packs-section.is-creator-pack-view .pack-list-card-large {
    width: clamp(96px, 26vw, 152px);
    min-height: clamp(148px, 38vw, 216px);
}

#packs-section.is-creator-pack-view .pack-list-card-large img {
    width: clamp(86px, 23vw, 130px);
    height: clamp(124px, 33vw, 184px);
}

.pack-price {
    position: absolute;
    top: calc(var(--pack-thumb-h) - 22px);
    left: 50%;
    z-index: 3;
    min-height: 22px;
    padding: 3px 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transform: translateX(-50%);
    border: 1px solid rgba(255, 221, 236, 0.9);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: #7a4c00;
    font-size: 10px;
    font-weight: 900;
    box-shadow: 0 8px 16px rgba(196, 126, 158, 0.14);
    backdrop-filter: blur(6px);
}

#packs-section.packs-featured-compact .packs-featured-packs {
    transform: scale(0.72);
    transform-origin: top center;
    margin-top: -16px;
    margin-bottom: -74px;
    transition: transform 220ms ease, margin 220ms ease;
}

#packs-section .packs-featured-packs {
    transition: transform 220ms ease, margin 220ms ease;
}

.pack-price .coin-mini {
    width: 11px;
    height: 11px;
    margin-right: 3px;
}

.admin-pack-manager {
    margin-top: 18px;
    padding: 16px;
    border: 1px solid rgba(244, 143, 177, 0.34);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.58);
}

.admin-pack-form {
    display: grid;
    gap: 12px;
    margin-top: 12px;
}

.admin-pack-dropzone {
    min-height: 116px;
    display: grid;
    grid-template-columns: 78px 1fr;
    align-items: center;
    gap: 14px;
    padding: 12px;
    border: 2px dashed rgba(244, 143, 177, 0.62);
    border-radius: 16px;
    background: rgba(255, 246, 250, 0.8);
    color: var(--primary-dark);
    font-weight: 900;
    cursor: pointer;
}

.admin-pack-dropzone input {
    display: none;
}

.admin-pack-dropzone img {
    width: 64px;
    height: 90px;
    object-fit: contain;
    filter: drop-shadow(0 8px 14px rgba(236, 111, 157, 0.22));
}

.admin-pack-meta-grid [hidden] {
    display: none !important;
}

.admin-pack-set-filter select {
    width: 100%;
    min-width: 0;
}

.admin-pack-rarity-checks {
    display: flex !important;
    grid-column: 1 / -1;
    flex-wrap: nowrap;
    gap: 6px;
    align-items: center;
    margin: 0;
    padding: 0 !important;
    border: 0 !important;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: thin;
}

.admin-pack-rarity-checks legend {
    width: auto;
    flex: 0 0 auto;
    margin: 0 4px 0 0;
    font-size: 12px;
    font-weight: 800;
    color: #7a4d66;
    white-space: nowrap;
}

.admin-pack-rarity-checks label {
    display: inline-flex !important;
    align-items: center;
    grid-template-columns: none !important;
    gap: 0 !important;
    min-width: auto;
    padding: 0 !important;
    border: 1px solid rgba(243, 200, 218, 0.9);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.68);
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
}

.admin-pack-rarity-checks input {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.admin-pack-rarity-checks span {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 8px 11px;
    border-radius: 999px;
    color: #7a4d66;
    font-weight: 900;
    white-space: nowrap;
    transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.admin-pack-rarity-checks input:checked + span {
    background: linear-gradient(135deg, #f48fb1, #b96a91);
    color: #fff;
    box-shadow: 0 8px 18px rgba(196, 126, 158, 0.26);
    transform: translateY(-1px);
}

.admin-pack-grid {
    margin-top: 12px;
}

.admin-pack-form-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.admin-pack-delete-btn,
.admin-pack-edit-btn,
.admin-card-delete-btn,
.admin-pack-local-delete-btn,
.admin-card-local-delete-btn {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border: 1.5px solid rgba(244, 143, 177, 0.72);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.82);
    color: #f05f9e;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 10px 22px rgba(196, 126, 158, 0.12);
}

.admin-pack-edit-btn {
    width: auto;
    min-width: 58px;
    padding: 0 10px;
    font-size: 10px;
    font-weight: 900;
}

.admin-card-delete-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    width: 30px;
    height: 30px;
    flex-basis: 30px;
    background: rgba(255, 255, 255, 0.92);
}

.admin-card-local-delete-btn {
    position: absolute;
    top: 42px;
    right: 8px;
    z-index: 2;
    width: auto;
    min-width: 42px;
    height: 24px;
    padding: 0 7px;
    flex-basis: auto;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0;
    background: rgba(255, 248, 252, 0.94);
}

.admin-pack-local-delete-btn {
    width: auto;
    min-width: 48px;
    padding: 0 9px;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0;
}

.admin-pack-delete-btn span,
.admin-card-delete-btn span {
    width: 14px;
    height: 15px;
    border: 2px solid currentColor;
    border-top: 0;
    border-radius: 0 0 4px 4px;
    position: relative;
}

.admin-pack-delete-btn span::before,
.admin-card-delete-btn span::before {
    content: '';
    position: absolute;
    left: -3px;
    top: -5px;
    width: 16px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
}

.admin-pack-delete-btn span::after,
.admin-card-delete-btn span::after {
    content: '';
    position: absolute;
    left: 4px;
    top: -8px;
    width: 5px;
    height: 3px;
    border: 2px solid currentColor;
    border-bottom: 0;
    border-radius: 3px 3px 0 0;
}

.admin-pack-delete-btn:hover,
.admin-pack-edit-btn:hover,
.admin-card-edit-btn:hover,
.admin-card-delete-btn:hover,
.admin-pack-local-delete-btn:hover,
.admin-card-local-delete-btn:hover {
    background: rgba(255, 235, 244, 0.95);
    transform: translateY(-1px);
}

@media (max-width: 560px) {
    .admin-edit-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    #packs-section {
        padding-top: 18px;
    }

    .profile-widget-grid,
    .creator-widget-grid {
        grid-template-columns: 1fr;
    }

    .creator-widget.widget-medium,
    .creator-widget.widget-small {
        grid-column: 1 / -1;
    }

    .creator-widget-profile {
        grid-template-columns: 68px 1fr;
    }

    .creator-widget-profile .profile-photo {
        width: 68px;
        height: 68px;
    }

    .packs-creator-profile {
        grid-template-columns: 46px minmax(0, 1fr);
    }

    .packs-creator-profile img {
        width: 46px;
        height: 46px;
    }

    .packs-creator-profile .creator-public-instagram {
        grid-column: auto;
        width: fit-content;
    }

    .packs-header .page-title {
        font-size: 22px;
        line-height: 1.05;
    }

    .pack-list-card {
        width: 94px;
        min-height: 118px;
        padding: 0;
        border-radius: 0;
    }

    .pack-list-card img {
        width: 68px;
        height: 96px;
    }
}

/* Center packs featured trio */
.packs-featured-packs .dashboard-pack-carousel {
    grid-template-columns: minmax(260px, 360px);
    justify-content: center;
    justify-items: center;
    margin-left: auto;
    margin-right: auto;
}

.packs-featured-packs .pack-stage {
    width: min(100%, 360px);
    margin-left: auto;
    margin-right: auto;
}

@media (max-width: 560px) {
    .packs-featured-packs .dashboard-pack-carousel {
        grid-template-columns: minmax(240px, 320px);
    }

    .packs-featured-packs .pack-stage {
        width: min(100%, 320px);
    }
}

/* Center featured packs card */
#packs-section {
    margin-left: auto;
    margin-right: auto;
}

#packs-section .packs-featured-packs {
    width: min(100%, 430px);
    margin-left: auto;
    margin-right: auto;
}

@media (min-width: 720px) {
    #packs-section .packs-featured-packs {
        width: min(100%, 430px);
    }
}

/* Admin tabs */
.admin-tabs {
    display: flex;
    gap: 8px;
    margin: 0 auto 16px;
    padding: 5px;
    width: min(100%, 420px);
    border: 1px solid rgba(244, 143, 177, 0.34);
    border-radius: 999px;
    background: var(--app-shell-background);
    background-attachment: fixed;
}

.admin-tab-btn {
    flex: 1;
    min-height: 38px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #8f6d82;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    cursor: pointer;
}

.admin-tab-btn.is-active {
    background: linear-gradient(135deg, #f58db8, #c78cf3);
    color: #fff;
    box-shadow: 0 10px 22px rgba(236, 111, 157, 0.18);
}

.admin-tab-panel {
    display: none;
}

.admin-tab-panel.is-active {
    display: block;
}

.admin-pack-manager.admin-tab-panel {
    max-width: 980px;
    margin-left: auto;
    margin-right: auto;
}

/* Empty home pack state */
body.has-no-openable-packs #dashboard-section.is-home-active {
    justify-content: center;
}

body.has-no-openable-packs .home-pack-actions {
    grid-template-columns: 1fr;
    justify-items: center;
    margin-top: 0;
}

body.has-no-openable-packs .home-action-stars {
    width: 100%;
    max-width: 190px;
    margin: 0 auto;
}

.home-mini-packs.is-empty {
    grid-template-columns: 1fr auto;
    min-height: 46px;
    margin-top: 14px;
}

.home-mini-packs.is-empty::before {
    content: attr(data-empty-label);
    padding-left: 12px;
    color: #8f6d82;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.home-mini-packs.is-empty .home-view-packs-btn {
    min-width: 128px;
}

/* Respect hidden state for pack UI */
.featured-floating-pack[hidden],
.home-action-btn[hidden],
.home-mini-pack-stack[hidden],
.pack-card[hidden] {
    display: none !important;
}

@media (max-width: 480px) {
    #dashboard-section.is-home-active {
        display: flex !important;
        min-height: 100svh;
        height: 100svh;
        justify-content: center;
        gap: clamp(8px, 1.8svh, 14px);
        padding-top: max(18px, env(safe-area-inset-top));
        padding-bottom: calc(66px + env(safe-area-inset-bottom));
        overflow: hidden;
    }

    #dashboard-section.is-home-active .featured-floating-pack {
        width: min(54vw, 210px, 30svh);
        margin-top: 0;
        margin-bottom: clamp(8px, 1.6svh, 12px);
    }

    #dashboard-section.is-home-active .home-pack-actions {
        width: min(calc(100% - 76px), 300px);
        margin-bottom: clamp(8px, 1.6svh, 12px);
    }

    #dashboard-section.is-home-active .home-mini-packs {
        width: min(calc(100% - 76px), 300px);
        min-height: 44px;
        margin-top: 0;
        margin-bottom: 0;
    }
}

@media (max-width: 380px), (max-height: 720px) {
    #dashboard-section.is-home-active .featured-floating-pack {
        width: min(48vw, 180px, 26svh);
    }

    #dashboard-section.is-home-active .home-action-btn {
        min-height: 31px;
        padding-top: 6px;
        padding-bottom: 6px;
    }

    #dashboard-section.is-home-active .home-mini-packs {
        min-height: 40px;
        padding-top: 5px;
        padding-bottom: 5px;
    }
}

#dashboard-section.is-home-active {
    justify-content: center;
    padding-top: max(46px, calc(env(safe-area-inset-top) + 34px));
    padding-bottom: calc(84px + env(safe-area-inset-bottom));
}

#dashboard-section.is-home-active .featured-floating-pack {
    margin-top: auto;
    margin-bottom: clamp(14px, 2.2svh, 22px);
}

#dashboard-section.is-home-active .home-mini-packs {
    margin-bottom: auto;
}

#dashboard-section.is-home-active .home-pack-actions {
    display: none !important;
}

.packs-highlight-row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.packs-highlight-row .pack-list-card-large {
    width: clamp(72px, 19vw, 128px);
    min-height: clamp(124px, 31vw, 194px);
}

.packs-highlight-row .pack-list-card-large img {
    width: clamp(66px, 17vw, 112px);
    height: clamp(96px, 27vw, 160px);
}

@media (max-width: 420px) {
    .packs-highlight-section {
        padding: 16px 10px;
    }

    .packs-highlight-row {
        gap: 10px;
    }
}

#packs-section:not(.is-creator-pack-view) .pack-list-card {
    --pack-thumb-w: 78px;
    --pack-thumb-h: 110px;
    width: 94px;
    min-height: 118px;
}

#packs-section:not(.is-creator-pack-view) .pack-list-card img {
    width: var(--pack-thumb-w);
    height: var(--pack-thumb-h);
}

.profile-danger-card {
    margin: 14px 0 4px;
    padding: 14px;
    border: 1px solid rgba(240, 95, 158, 0.34);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 0 16px 34px rgba(190, 108, 148, 0.1);
}

.profile-danger-card .btn {
    width: 100%;
    margin-top: 10px;
    color: #fff;
    background: linear-gradient(135deg, #f26ca5, #ef4f93);
    border-color: transparent;
}

.creator-terms-modal {
    position: fixed;
    inset: 0;
    z-index: 1600;
    display: none;
    align-items: center;
    justify-content: center;
    padding: max(14px, env(safe-area-inset-top)) 14px max(14px, env(safe-area-inset-bottom));
    background: rgba(70, 42, 62, 0.34);
}

.creator-terms-dialog {
    width: min(78vw, 320px);
    height: min(38dvh, 320px);
    max-height: calc(100dvh - 42px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto auto;
    gap: 8px;
    padding: 10px;
    border: 1px solid rgba(244, 172, 206, 0.74);
    border-radius: 12px;
    background: rgba(255, 250, 253, 0.98);
    box-shadow: 0 24px 68px rgba(120, 65, 96, 0.24);
}

.creator-terms-head h2 {
    margin: 2px 0 0;
    font-size: 12px;
    color: var(--text-primary);
}

.creator-terms-text {
    height: 100%;
    min-height: 0;
    padding: 8px;
    border: 1px solid rgba(234, 216, 227, 0.82);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.86);
    color: var(--text-secondary);
    font-size: 7.5px;
    line-height: 1.18;
    white-space: pre-wrap;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

#creator-terms-accept-btn {
    width: 100%;
    min-height: 30px;
    font-size: 11px;
}
